使用@jiaminghi/data-view实现一个数据大屏

<template>
  <div class="content bg">
    <!-- 全局容器 -->
    <!-- <dv-full-screen-container> -->
    <!-- 第二行 -->
    <div class="module-box" style="align-items: start; margin-top: 10px">
      <!--  -->
      <div style="flex: 0 1 30%">
        <dv-decoration-10 style="height: 5px" />
      </div>
      <div style="flex: 0 1 40%">
        <div class="d-flex">
          <dv-decoration-8 style="height: 50px; flex: 1" />
          <div style="flex: 1" class="tc box-middle">
            <dv-decoration-11 style="height: 50px">智慧工厂数据中心</dv-decoration-11>
          </div>
          <dv-decoration-8 :reverse="true" style="height: 50px; flex: 1" />
        </div>
      </div>
      <div style="flex: 0 1 30%">
        <dv-decoration-10 style="height: 5px; transform: rotateY(180deg)" />
      </div>
    </div>
    <!-- 第二行 -->
    <div class="module-box">
      <!--  -->
      <div style="flex: 0 1 25%">
        <dv-border-box-13 style="width: 100%; height: 200px">
          <div style="box-sizing: border-box">
            <div style="height: 30px; padding: 20px 20px 0 20px">
              <div>设备能耗监测</div>
              <div><dv-decoration-3 style="width: 100px; height: 10px" /></div>
            </div>
            <div style="padding: 10px">
              <Bar style="width: 100%; height: 130px"></Bar>
              <!-- <dv-capsule-chart :config="config_bar" style="width: 100%; height: 140px" /> -->
            </div>
          </div>
        </dv-border-box-13>
        <dv-border-box-1 style="width: 100%; height: 200px">
          <div style="box-sizing: border-box">
            <div style="height: 30px; padding: 20px 20px 0 20px">
              <div>仓库存储量</div>
              <div><dv-decoration-6 style="width: 100px; height: 10px" /></div>
            </div>
            <div style="padding: 0 10px 10px 10px">
              <dv-capsule-chart
                :config="config_capsule"
                style="width: 100%; height: 140px"
              />
            </div>
          </div>
        </dv-border-box-1>
        <dv-border-box-2 style="width: 100%; height: 200px">
          <div style="padding: 10px 15px 10px 15px">
            <div style="line-height: 30px">设备运转负荷率</div>
            <div>
              <dv-water-level-pond
                :config="config_water"
                style="width: 100%; height: 150px"
              />
            </div>
          </div>
        </dv-border-box-2>
      </div>
      <!--  -->
      <div style="flex: 0 1 50%">
        <dv-border-box-12
          style="width: 100%; height: 600px; padding: 10px; box-sizing: border-box"
        >
          <div class="module-box">
            <div style="flex: 0 1 25%">
              <dv-border-box-9 style="width: 100%; height: 90px">
                <div class="tc">
                  <div style="padding-top: 10px">设备管理</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                </div>
              </dv-border-box-9>
            </div>
            <div style="flex: 0 1 25%">
              <dv-border-box-9 style="width: 100%; height: 90px">
                <div class="tc">
                  <div style="padding-top: 10px">生产管理</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                </div>
              </dv-border-box-9>
            </div>
            <div style="flex: 0 1 25%">
              <dv-border-box-9 style="width: 100%; height: 90px">
                <div class="tc">
                  <div style="padding-top: 10px">物流管理</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                </div>
              </dv-border-box-9>
            </div>
            <div style="flex: 0 1 25%">
              <dv-border-box-9 style="width: 100%; height: 90px">
                <div class="tc">
                  <div style="padding-top: 10px">人员管理</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                  <div style="color: #7ec699; font-size: 16px">100%</div>
                </div>
              </dv-border-box-9>
            </div>
          </div>
          <div>
            <div style="line-height: 50px">设备数据统计</div>
            <dv-flyline-chart
              :config="config_flyline"
              style="width: 100%; height: 460px"
            />
          </div>
        </dv-border-box-12>
      </div>
      <!--  -->
      <div style="flex: 0 1 25%">
        <dv-border-box-1 style="width: 100%; height: 300px">
          <div style="box-sizing: border-box">
            <div style="height: 30px; padding: 20px 20px 0 20px">
              <div>销售额时间抽</div>
            </div>
            <div style="padding: 0 10px 10px 10px">
              <dv-conical-column-chart
                :config="config_conical"
                style="width: 100%; height: 240px"
              />
            </div>
          </div>
        </dv-border-box-1>
        <dv-border-box-8 style="width: 100%; height: 300px">
          <div style="box-sizing: border-box; padding: 10px">
            <div style="height: 30px">
              <div>车间设备能耗排行</div>
              <div><dv-decoration-3 style="width: 100px; height: 10px" /></div>
            </div>
            <div>
              <dv-scroll-ranking-board
                :config="config_ranking"
                style="width: 100%; height: 250px"
              />
            </div>
          </div>
        </dv-border-box-8>
      </div>
    </div>
    <!-- 第三行 -->
    <div class="module-box">
      <div style="flex: 0 1 50%">
        <dv-border-box-8 style="width: 100%; height: 200px">
          <div style="box-sizing: border-box; padding: 10px">
            <div style="height: 30px">
              <div>车间产线耗电统计</div>
              <div><dv-decoration-3 style="width: 100px; height: 10px" /></div>
            </div>
            <div>
              <LineChart style="width: 100%; height: 170px"></LineChart>
            </div>
          </div>
        </dv-border-box-8>
      </div>
      <div style="flex: 0 1 25%">
        <dv-border-box-13 style="width: 100%; height: 200px">
          <div style="box-sizing: border-box">
            <div style="height: 30px; padding: 20px 20px 0 20px">
              <div>动态环图</div>
              <div><dv-decoration-3 style="width: 100px; height: 10px" /></div>
            </div>
            <div style="margin-top: -30px">
              <dv-active-ring-chart
                :config="config_ring"
                style="width: 100%; height: 200px"
              />
            </div>
          </div>
        </dv-border-box-13>
      </div>
      <div style="flex: 0 1 25%">
        <dv-border-box-8 style="width: 100%; height: 200px">
          <div style="box-sizing: border-box">
            <div style="height: 30px; padding: 15px 15px 0 15px">
              <div>剩余油量表</div>
              <div><dv-decoration-3 style="width: 100px; height: 10px" /></div>
            </div>
            <div style="margin-top: -30px">
              <dv-charts :option="config_chart" style="width: 100%; height: 200px" />
            </div>
          </div>
        </dv-border-box-8>
      </div>
    </div>
    <!-- </dv-full-screen-container> -->
  </div>
</template>

<script>
import Bar from "@/components/bar.vue";
import LineChart from "@/components/line.vue";
import resize from "@/components/utils/resize";
export default {
  mixins: ["resize"],
  components: {
    Bar,
    LineChart,
  },
  data() {
    return {
      config_chart: {
        series: [
          {
            type: "gauge",
            data: [{ name: "itemA", value: 55 }],
            center: ["50%", "55%"],
            axisLabel: {
              formatter: "{value}%",
              style: {
                fill: "#fff",
              },
            },
            axisTick: {
              style: {
                stroke: "#fff",
              },
            },
            animationCurve: "easeInOutBack",
          },
        ],
      },
      config_ring: {
        data: [
          {
            name: "周口",
            value: 55,
          },
          {
            name: "南阳",
            value: 120,
          },
          {
            name: "西峡",
            value: 78,
          },
          {
            name: "驻马店",
            value: 66,
          },
          {
            name: "新乡",
            value: 80,
          },
        ],
      },
      config_conical: {
        data: [
          {
            name: "周口",
            value: 55,
          },
          {
            name: "南阳",
            value: 120,
          },
          {
            name: "西峡",
            value: 71,
          },
          {
            name: "驻马店",
            value: 66,
          },
          {
            name: "新乡",
            value: 80,
          },
          {
            name: "信阳",
            value: 35,
          },
          {
            name: "漯河",
            value: 15,
          },
        ],
        img: [
          require("../assets/img/1st.png"),
          require("../assets/img/2st.png"),
          require("../assets/img/3st.png"),
          require("../assets/img/4st.png"),
          require("../assets/img/5st.png"),
          require("../assets/img/6st.png"),
          require("../assets/img/7st.png"),
        ],
      },
      config_ranking: {
        data: [
          {
            name: "周口",
            value: 55,
          },
          {
            name: "南阳",
            value: 120,
          },
          {
            name: "西峡",
            value: 78,
          },
          {
            name: "驻马店",
            value: 66,
          },
          {
            name: "新乡",
            value: 80,
          },
          {
            name: "信阳",
            value: 45,
          },
          {
            name: "漯河",
            value: 29,
          },
        ],
      },
      config_flyline: {
        centerPoint: [0.48, 0.35],
        points: [
          {
            position: [0.52, 0.235],
            text: "新乡",
          },
          {
            position: [0.43, 0.29],
            text: "焦作",
          },
          {
            position: [0.59, 0.35],
            text: "开封",
          },
          {
            position: [0.53, 0.47],
            text: "许昌",
          },
          {
            position: [0.45, 0.54],
            text: "平顶山",
          },
          {
            position: [0.36, 0.38],
            text: "洛阳",
          },
          {
            position: [0.62, 0.55],
            text: "周口",
          },
          {
            position: [0.56, 0.56],
            text: "漯河",
          },
          {
            position: [0.37, 0.66],
            text: "南阳",
          },
          {
            position: [0.55, 0.81],
            text: "信阳",
          },
          {
            position: [0.55, 0.67],
            text: "驻马店",
          },
          {
            position: [0.37, 0.29],
            text: "济源",
          },
          {
            position: [0.2, 0.36],
            text: "三门峡",
          },
          {
            position: [0.76, 0.41],
            text: "商丘",
          },
          {
            position: [0.59, 0.18],
            text: "鹤壁",
          },
          {
            position: [0.68, 0.17],
            text: "濮阳",
          },
          {
            position: [0.59, 0.1],
            text: "安阳",
          },
        ],
        bgImgUrl: require("../assets/img/map.jpg"),
        centerPointImg: {
          url: require("../assets/img/mapCenterPoint.png"),
        },
        pointsImg: {
          url: require("../assets/img/mapPoint.png"),
        },
      },
      // 水位图
      config_water: { data: [66, 45], shape: "roundRect" },
      // 柱状图
      config_capsule: {
        data: [
          {
            name: "南阳",
            value: 167,
          },
          {
            name: "周口",
            value: 67,
          },
          {
            name: "漯河",
            value: 123,
          },
          {
            name: "郑州",
            value: 55,
          },
          {
            name: "西峡",
            value: 98,
          },
        ],
      },
    };
  },
};
</script>

效果图:

在这里插入图片描述
在这里插入图片描述

  • 8
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Vue 3 中使用大屏数据可视化库 DataV 的步骤如下: 1. 首先,确保你已经在项目中安装了 Vue 3 及其相应的依赖。可以使用 Vue CLI 或其他工具来初始化项目并生成基础的目录结构和配置文件。 2. 在你的前端项目中,使用 npm 或 yarn 安装 DataV 插件。 可以使用以下命令进行安装: ``` npm install @jiaminghi/data-view ``` 或 ``` yarn add @jiaminghi/data-view ``` 3. 在你的 Vue 组件中引入 DataV 插件并使用它。 在你的组件中,使用 import 语句将 DataV 引入: ``` import DataV from '@jiaminghi/data-view' ``` 然后,在你的模板中使用 DataV 的组件来展示大屏数据可视化: ``` <template> <dataVComponent></dataVComponent> </template> ``` 4. 根据 DataV 的文档和示例,按照你的需求来配置和使用 DataV 的组件和功能。可以参考 DataV 的官方文档和示例代码来了解如何使用不同的组件和功能来展示大屏数据可视化效果。 如果你在使用 TypeScript 进行开发,还需要在 `shims-vue.d.ts` 文件中添加以下声明,以便让 TypeScript 识别 DataV 的模块: ``` declare module '@jiaminghi/data-view' ``` 这样 TypeScript 就能正确地识别并使用 DataV 的模块。 总结: 1. 确保项目中安装了 Vue 3 及其依赖。 2. 使用 npm 或 yarn 安装 DataV 插件。 3. 在 Vue 组件中引入 DataV 插件。 4. 配置和使用 DataV 的组件和功能来展示大屏数据可视化效果。 请根据你的具体需求和项目情况进行相应的配置和使用。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [vue3使用大屏dataV详细教程](https://blog.csdn.net/weixin_51958960/article/details/128873162)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [vue整合SSM项目实战](https://download.csdn.net/download/m0_55755339/88241603)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

你的美,让我痴迷

你的好,我会永远记住你的。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值