|
@@ -0,0 +1,381 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <CusModule title="节能分析">
|
|
|
+ <div class="grid-container">
|
|
|
+ <div class="left-panel">
|
|
|
+ <div class="spinner"></div>
|
|
|
+ <div class="value-display">
|
|
|
+ <span class="value">2589</span>
|
|
|
+ <span class="unit">度</span>
|
|
|
+ </div>
|
|
|
+ <div class="description">
|
|
|
+ <span class="text">本月用电量</span>
|
|
|
+ <div class="rate">
|
|
|
+ <span>环比</span>
|
|
|
+ <img src="@/assets/images/home/down-arrow.svg" alt="">
|
|
|
+ <span>12%</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right-panel ">
|
|
|
+ <div class="panel-content">
|
|
|
+ <div class="image-container">
|
|
|
+ <img src="@/assets/images/home/water.svg" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="whitespace-pre">
|
|
|
+ <span class="value">989</span>
|
|
|
+ <span class="unit">吨</span>
|
|
|
+ <div class="label">本月用水量</div>
|
|
|
+ <div class="rate">
|
|
|
+ <span>环比</span>
|
|
|
+ <img src="@/assets/images/home/down-arrow.svg" alt="">
|
|
|
+ <span>12%</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="panel-content">
|
|
|
+ <div class="image-container">
|
|
|
+ <img src="@/assets/images/home/cost.svg" alt="">
|
|
|
+ </div>
|
|
|
+ <div class="whitespace-pre">
|
|
|
+ <span class="value">4892</span>
|
|
|
+ <span class="unit">元</span>
|
|
|
+ <div class="label">本月用能费用</div>
|
|
|
+ <div class="rate">
|
|
|
+ <span>环比</span>
|
|
|
+ <img src="@/assets/images/home/down-arrow.svg" alt="">
|
|
|
+ <span>12%</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </CusModule>
|
|
|
+ <CusModule class="module-top" title="设备设施">
|
|
|
+ <div class="equip">
|
|
|
+ <div v-for="item in equipment" :style="{ 'color': item.color }" class="equip-item" :key="item.name">
|
|
|
+ <div><span>{{ item.value }}</span> <span class="unit">{{ item.unit }}</span></div>
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="pie-chart">
|
|
|
+ <BaseChart height="100%" width="100%" :option="pieOptions" />
|
|
|
+ </div>
|
|
|
+ </CusModule>
|
|
|
+ <CusModule class="module-top" title="告警信息">
|
|
|
+ <div class="seamless-header">
|
|
|
+ <div>告警内容</div>
|
|
|
+ <div>告警设备</div>
|
|
|
+ <div>告警时间</div>
|
|
|
+ </div>
|
|
|
+ <vue-seamless-scroll :data="listData" class="seamless-warp" :class-option="classOption">
|
|
|
+ <div class="seamless-item" v-for="(item, index) in listData" :key="index">
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ <div>{{ item.type }}</div>
|
|
|
+ <div>{{ item.createTime }}</div>
|
|
|
+ </div>
|
|
|
+ </vue-seamless-scroll>
|
|
|
+ </CusModule>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import CusModule from '../components/CusModule.vue';
|
|
|
+import BaseChart from '@/components/BaseChart/index.vue'
|
|
|
+import vueSeamlessScroll from 'vue-seamless-scroll'
|
|
|
+export default {
|
|
|
+ name: 'HomeRight',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ equipment: [{name: '设备总数', value: '2024', unit: '个', color: '#01A7F0'},
|
|
|
+ {name: '在线设备', value: '1800', unit: '个', color: '#B3E3E8'},
|
|
|
+ {name: '离线设备', value: '200', unit: '个', color: '#fff'},
|
|
|
+ {name: '故障设备', value: '24', unit: '个', color: '#EB808D'}],
|
|
|
+ classOption: {
|
|
|
+ step: 0.3, // 数值越大速度滚动越快
|
|
|
+ limitMoveNum: 4, // 开始无缝滚动的数据量 this.dataList.length
|
|
|
+ hoverStop: true, // 是否开启鼠标悬停stop
|
|
|
+ direction: 1, // 0向下 1向上 2向左 3向右
|
|
|
+ openWatch: true, // 开启数据实时监控刷新dom
|
|
|
+ singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
|
|
|
+ singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
|
|
|
+ waitTime: 1000 // 单步运动停止
|
|
|
+ },
|
|
|
+ listData: [
|
|
|
+ {
|
|
|
+ name: '温度超阈值上限',
|
|
|
+ type: '温湿度01',
|
|
|
+ createTime: '2024-10-07 12:15:46'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '制冷压力超阈值上限',
|
|
|
+ type: '精密空调',
|
|
|
+ createTime: '2024-10-08 11:11:41'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '检测到有水',
|
|
|
+ type: '水浸',
|
|
|
+ createTime: '2024-10-09 15:15:46'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '开门时间异常',
|
|
|
+ type: '东门门禁',
|
|
|
+ createTime: '2024-10-10 09:15:46'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '设备离线',
|
|
|
+ type: '摄像机1',
|
|
|
+ createTime: '2024-10-10 12:33:40'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '检测到有人',
|
|
|
+ type: '红外1',
|
|
|
+ createTime: '2024-10-10 12:35:40'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ CusModule,
|
|
|
+ BaseChart,
|
|
|
+ vueSeamlessScroll
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pieOptions () {
|
|
|
+ return {
|
|
|
+ legend: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item',
|
|
|
+ formatter: (params) => {
|
|
|
+ const {name, value, percent, } = params
|
|
|
+ return `${name} : ${value}个 (${percent}%)`
|
|
|
+ }
|
|
|
+ },
|
|
|
+ color: ["#3FA7FD", "#8AC540", "#F9AF39", "#82D8F9"],
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "类别统计",
|
|
|
+ type: "pie",
|
|
|
+ radius: ["40%", "55%"],
|
|
|
+ center: ["50%", "39%"],
|
|
|
+ emphasis: {
|
|
|
+ label: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ {value: 123, name: "照明设备", },
|
|
|
+ {value: 96, name: "暖通设备"},
|
|
|
+ {value: 43, name: "电气设备"},
|
|
|
+ {value: 21, name: "安防设备"},
|
|
|
+ ],
|
|
|
+ label: {
|
|
|
+ color: "#fff",
|
|
|
+ alignTo: "edge",
|
|
|
+ fontSize: 14,
|
|
|
+ minMargin: 5,
|
|
|
+ edgeDistance: 20,
|
|
|
+ lineHeight: 20,
|
|
|
+ formatter: "{name|{b}}\n{value|{c}个}",
|
|
|
+ rich: {
|
|
|
+ name: {
|
|
|
+ color: "#B3E3E8",
|
|
|
+ },
|
|
|
+ value: {
|
|
|
+ color: "#07E3F9",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ length: 5,
|
|
|
+ length2: 3,
|
|
|
+ smooth: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () { },
|
|
|
+ methods: {}
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped>
|
|
|
+@import url("../index.scss");
|
|
|
+
|
|
|
+.grid-container {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 20px;
|
|
|
+ .left-panel {
|
|
|
+ position: relative;
|
|
|
+ text-align: center;
|
|
|
+ margin-left: 20px;
|
|
|
+ width: 111px;
|
|
|
+ background: url('~@/assets/images/home/r1-left_bg.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+
|
|
|
+ .spinner {
|
|
|
+ position: absolute;
|
|
|
+ animation: spin 10s linear infinite;
|
|
|
+ top: 40px;
|
|
|
+ left: 25px;
|
|
|
+ width: 63px;
|
|
|
+ height: 63px;
|
|
|
+ background-image: url('~@/assets/images/home/r1-top_center.png');
|
|
|
+ }
|
|
|
+
|
|
|
+ .value-display {
|
|
|
+ margin-top: 10px;
|
|
|
+
|
|
|
+ span.value {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .description {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 8px;
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ span.text {
|
|
|
+ color: #B3E3E8;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .rate {
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .rate {
|
|
|
+ color: #00C852;
|
|
|
+ font-size: 12px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ img {
|
|
|
+ margin-left: 3px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-panel {
|
|
|
+ padding-left: 20px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .panel-content {
|
|
|
+ width: 200px;
|
|
|
+ height: 75px;
|
|
|
+ color: #B3E3E8;
|
|
|
+ background: url('~@/assets/images/home/l2_item_bg.png') no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .whitespace-pre {
|
|
|
+ margin-top: 5px;
|
|
|
+ margin-left: 20px;
|
|
|
+
|
|
|
+ span.value {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .image-container {
|
|
|
+ width: 70px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ img {
|
|
|
+ height: 24px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.equip {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 20px;
|
|
|
+ .equip-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ background: #1B4A64;
|
|
|
+ color: #B3E3E8;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 5px 13px;
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ >div:first-of-type {
|
|
|
+ span:first-of-type {
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.pie-chart {
|
|
|
+ margin: 30px;
|
|
|
+ height: 201px;
|
|
|
+ background: url("~@/assets/images/device/l1-pie_bg.png") no-repeat;
|
|
|
+ background-position: center;
|
|
|
+}
|
|
|
+
|
|
|
+.seamless-header {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 5px 10px;
|
|
|
+ color: #7DBAFF;
|
|
|
+ background: #1B4A64;
|
|
|
+ font-size: 16px;
|
|
|
+
|
|
|
+ >div:first-of-type,
|
|
|
+ >div:last-of-type {
|
|
|
+ flex-basis: 35%;
|
|
|
+ }
|
|
|
+
|
|
|
+ >div {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.seamless-warp {
|
|
|
+ overflow: hidden;
|
|
|
+ height: 200px;
|
|
|
+
|
|
|
+ .seamless-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 5px 0;
|
|
|
+ &:nth-child(odd){
|
|
|
+ background: #000;
|
|
|
+ }
|
|
|
+ >div:first-of-type,
|
|
|
+ >div:last-of-type {
|
|
|
+ flex-basis: 38%;
|
|
|
+ }
|
|
|
+ >div {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|