| | |
| | | <template> |
| | | <div class="container"> |
| | | <div class="left"> |
| | | <div class="liuliang"> |
| | | <div class="liuliang-title">流量统计</div> |
| | | <div class="liuliang-c">流量</div> |
| | | </div> |
| | | <div class="gongdian"> |
| | | <div class="gongdian-title">流量统计</div> |
| | | <div class="gongdian-c">流量</div> |
| | | </div> |
| | | </div> |
| | | <div class="center" > |
| | | <!-- 地图窗口 --> |
| | | <div class="map"> |
| | |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">运行时长:</span> |
| | | <span class="val-status">{{item.longtime}}</span> |
| | | <span class="val-status">{{}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">瞬时流量:</span> |
| | | <span class="val-status">{{item.ssll}}</span> |
| | | <span class="name">工作状态:</span> |
| | | <span class="val-status">{{}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">累计流量:</span> |
| | | <span class="val-status">{{item.ljll}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">流速:</span> |
| | | <span class="val-status">{{item.ls}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">启泵次数:</span> |
| | | <span class="val-status">{{item.qdnumber}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">1号水池水位:</span> |
| | | <span class="val-status">{{item.oneWater}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">2号水池水位:</span> |
| | | <span class="val-status">{{item.twoWater}}</span> |
| | | <span class="name">水池水位:</span> |
| | | <span class="val-status">{{item.yewei}}</span> |
| | | </div> |
| | | <div class="message-item"> |
| | | <span class="name">其他详细信息:</span> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="right"> |
| | | <!-- 实时监控 --> |
| | | <div class="jiankong"> |
| | | <div class="jiankong-t">实时监控</div> |
| | | <div class="jiankong-c"> |
| | | <div class="switch"> |
| | | <div class="switch-l">泵房监控</div> |
| | | <div class="switch-r"> |
| | | <div class="more" :class="{active: selectType==='two'}" @click="changeType('two')">多屏模式 </div> |
| | | <div class="single" :class="{active: selectType==='single'}" @click="changeType('single')">单屏模式</div> |
| | | <div class="right-box"> |
| | | <!-- 实时监控 --> |
| | | <div class="jiankong"> |
| | | <div class="jiankong-t">实时监控</div> |
| | | <div class="jiankong-c"> |
| | | <div class="switch"> |
| | | <div class="switch-l">泵房监控</div> |
| | | <div class="switch-r"> |
| | | <div class="more" :class="{active: selectType==='two'}" @click="changeType('two')">多屏模式 </div> |
| | | <div class="single" :class="{active: selectType==='single'}" @click="changeType('single')">单屏模式</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="video-box"> |
| | | <div class="two" v-if="selectType==='two'"> |
| | | <div class="list" v-for="(item, index) in showList" :key="index"> |
| | | <div class="item" v-if="item?.deviceId"> |
| | | <VideoPlayer :item="item" /> |
| | | <div class="video-box"> |
| | | <div class="two" v-if="selectType==='two'"> |
| | | <div class="list" v-for="(item, index) in showList" :key="index"> |
| | | <div class="item" v-if="item?.deviceId"> |
| | | <VideoPlayer :item="item" /> |
| | | </div> |
| | | <div v-else class="item"></div> |
| | | </div> |
| | | </div> |
| | | <div class="single" v-else> |
| | | <div class="item" v-if="showList[0]?.deviceId"> |
| | | <VideoPlayer :item="showList[0]" /> |
| | | </div> |
| | | <div v-else class="item"></div> |
| | | </div> |
| | | </div> |
| | | <div class="single" v-else> |
| | | <div class="item" v-if="showList[0]?.deviceId"> |
| | | <VideoPlayer :item="showList[0]" /> |
| | | </div> |
| | | </div> |
| | | <!-- 报警记录 --> |
| | | <div class="warnRecord"> |
| | | <div class="warnRecord-title">报警记录</div> |
| | | <div class="warnRecord-info"> |
| | | <div class="into-t">报警信息</div> |
| | | <div class="info-list"> |
| | | <div class="item" v-for="(item, index) in warnList" :key="index"> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.pointName" |
| | | placement="top" |
| | | > |
| | | {{item.pointName}} |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.facilityName" |
| | | placement="top" |
| | | > |
| | | {{item.facilityName}} |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.description" |
| | | placement="top" |
| | | > |
| | | {{item.description}} |
| | | </el-tooltip> |
| | | </div> |
| | | <div v-else class="item"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 报警记录 --> |
| | | <div class="warnRecord"> |
| | | <div class="warnRecord-title">报警记录</div> |
| | | <div class="warnRecord-info"> |
| | | <div class="into-t">报警信息</div> |
| | | <div class="info-list"> |
| | | <div class="item" v-for="(item, index) in warnList" :key="index"> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.pointName" |
| | | placement="top" |
| | | > |
| | | {{item.pointName}} |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.facilityName" |
| | | placement="top" |
| | | > |
| | | {{item.facilityName}} |
| | | </el-tooltip> |
| | | <el-tooltip |
| | | effect="dark" |
| | | :content="item.description" |
| | | placement="top" |
| | | > |
| | | {{item.description}} |
| | | </el-tooltip> |
| | | </div> |
| | | <div class="warnRecord-datashow"> |
| | | <div ref="warningRef" class="warning" /> |
| | | </div> |
| | | </div> |
| | | <div class="warnRecord-datashow"> |
| | | <div ref="warningRef" class="warning" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import { UniversalTransition, LabelLayout } from "echarts/features"; |
| | | import { CanvasRenderer } from "echarts/renderers"; |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {getPumpData} from '@/api/screen/index.js' |
| | | import {getVideoList} from '@/api/screen/video.js' |
| | | import VideoPlayer from "@/components/VideoPlayer/VideoPlayer.vue"; |
| | | |
| | | |
| | |
| | | LabelLayout, |
| | | ]); |
| | | |
| | | const openStatus = reactive({ |
| | | bengfang: false, |
| | | shuixiang: false, |
| | | jieguan: false |
| | | }) |
| | | |
| | | const mapSize = ref(90); // 初始化地图大小为100 |
| | | const gonghaoRef = ref(); |
| | | const liuliangRef = ref(); |
| | | const warningRef = ref(); |
| | | let gonghaoCharts = null; |
| | | let liuliangCharts = null; |
| | | let warningCharts = null; |
| | | |
| | | const tucengVal = ref(0); |
| | |
| | | const videoList = ref([]) |
| | | const showList = ref([]) |
| | | const warnList = ref([]) |
| | | const showMsg = ref() |
| | | const pointList = ref([ |
| | | { name: '碧桂园', shuijin: '正常', longtime: '1280天13小时59分', ssll: '+10㎡/s', ljll: '㎡', ls: '10m/s', qdnumber: '10次', oneWater: '2.26m', twoWater: '4.26m', left: 40, top: 22 }, |
| | | { name: '龙湖公馆', shuijin: '正常', longtime: '1280天13小时59分', ssll: '+10㎡/s', ljll: '㎡', ls: '10m/s', qdnumber: '10次', oneWater: '2.26m', twoWater: '4.26m', left: 52, top: 35 }, |
| | | ]) |
| | | const tongjiTable = reactive({ |
| | | selectName: '', |
| | | tongjiList: [], |
| | | namelist: [] |
| | | }) |
| | | const showMsg = ref(0) |
| | | const pointList = ref([]) |
| | | |
| | | const clickMsgFun = (index: number) => { |
| | | showMsg.value = showMsg.value === index ? null : index; |
| | | } |
| | | |
| | | // 获取定位随机值 |
| | | const getRandom = (min, max) => { |
| | | return Math.floor(Math.random() * (max - min) + min); |
| | | } |
| | | |
| | | const setOpenStatus = (type: string) => { |
| | | switch (type) { |
| | | case "bengfang": |
| | | openStatus.bengfang = openStatus.bengfang ? false : true; |
| | | break; |
| | | case "shuixiang": |
| | | openStatus.shuixiang = openStatus.shuixiang ? false : true; |
| | | break; |
| | | case "jieguan": |
| | | openStatus.jieguan = openStatus.jieguan ? false : true; |
| | | break |
| | | } |
| | | } |
| | | |
| | | // 图表实例 |
| | | const setGonghaoCharts = (xData, sData) => { |
| | | if(gonghaoRef.value) { |
| | | gonghaoCharts = echarts.init(gonghaoRef.value); |
| | | const option = { |
| | | grid: { |
| | | top: 30, |
| | | bottom: 40, |
| | | left: 40 |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: xData, |
| | | axisLabel: { |
| | | color: '#fff', |
| | | fontSize: '0.5rem', |
| | | rotate: 30, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | color: '#fff', |
| | | fontSize: '0.5rem', |
| | | } |
| | | }, |
| | | tooltip: { |
| | | show: true |
| | | }, |
| | | series: [ |
| | | { |
| | | data: sData, |
| | | type: 'line', |
| | | areaStyle: {} |
| | | } |
| | | ] |
| | | }; |
| | | gonghaoCharts.setOption(option); |
| | | } |
| | | } |
| | | const setLiuliangCharts = (xData, sData) => { |
| | | if(liuliangRef.value) { |
| | | liuliangCharts = echarts.init(liuliangRef.value); |
| | | const option = { |
| | | grid: { |
| | | top: 30, |
| | | bottom: 40, |
| | | left: 40 |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: xData, |
| | | axisLabel: { |
| | | color: '#fff', |
| | | fontSize: '0.5rem', |
| | | rotate: 30, |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | color: '#fff', |
| | | fontSize: '0.5rem', |
| | | } |
| | | }, |
| | | tooltip: { |
| | | show: true |
| | | }, |
| | | series: [ |
| | | { |
| | | data: sData, |
| | | type: 'line', |
| | | areaStyle: {} |
| | | } |
| | | ] |
| | | }; |
| | | liuliangCharts.setOption(option); |
| | | } |
| | | } |
| | | const setWarningCharts = (data) => { |
| | | if(warningRef.value) { |
| | | warningCharts = echarts.init(warningRef.value); |
| | |
| | | } |
| | | } |
| | | |
| | | // 获取功耗数据 |
| | | const getGonghaoData = () => { |
| | | getHomeGonghao().then(res => { |
| | | let xdata = []; |
| | | let sdata = []; |
| | | let newArr = res.data.length > 5 ? res.data.slice(0,5) : res.data |
| | | newArr.forEach((item) => { |
| | | xdata.push(item.pointName) |
| | | sdata.push(item.value) |
| | | }) |
| | | setGonghaoCharts(xdata, sdata) |
| | | }) |
| | | } |
| | | // 获取流量统计 |
| | | const getLiuliangData = () => { |
| | | getHomeLiuliang().then(res => { |
| | | let xdata = []; |
| | | let sdata = []; |
| | | let newArr = res.data.length > 5 ? res.data.slice(0,5) : res.data |
| | | newArr.forEach((item) => { |
| | | xdata.push(item.pointName) |
| | | sdata.push(item.value) |
| | | }) |
| | | setLiuliangCharts(xdata, sdata) |
| | | }) |
| | | } |
| | | |
| | | // 切换播放模式 |
| | | const changeType = (type) => { |
| | | selectType.value = type |
| | | showList.value = [] |
| | | if(type === 'two') { |
| | | showList.value = videoList.value.slice(0, 2).concat(Array(4 - videoList.value.length).fill(null)) |
| | | showList.value = videoList.value.slice(0, 2).concat(Array(2 - videoList.value.length).fill(null)) |
| | | } else { |
| | | showList.value = videoList.value.slice(0, 1) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // 获取统计数据 |
| | | const getTongjiData = () => { |
| | | getHomeTongji().then(res => { |
| | | tongjiTable.tongjiList = res.data.statementValueList; |
| | | tongjiTable.namelist = res.data.statementNameList; |
| | | // 获取视频列表 |
| | | const getVideo = async (id) => { |
| | | if(id) { |
| | | getVideoList({pointId: id}).then(res => { |
| | | videoList.value = res.data; |
| | | changeType(selectType.value) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 获取泵房信息 |
| | | const getPumpInfo = () => { |
| | | const pump = [] |
| | | getPumpData().then(res => { |
| | | res.data.forEach((el, index) => { |
| | | const yewei = el.parameterVOList.find(item => item.columnsCode === '1001') |
| | | const shuijin = el.parameterVOList.find(item => item.columnsCode === 'SQ') |
| | | pump.push({ |
| | | left: 84, top: 28, |
| | | name: el.facilityName, |
| | | yewei: yewei.columnValue + yewei?.columnsUnits, |
| | | shuijin: !Number(shuijin.columnValue) ? '正常' : '异常', |
| | | }) |
| | | }) |
| | | |
| | | pointList.value = pump |
| | | }) |
| | | } |
| | | |
| | | const clearName = () => { |
| | | tongjiTable.selectName = '' |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // getGonghaoData() |
| | | // getLiuliangData() |
| | | getPumpInfo() |
| | | // getWarning() |
| | | // getTongjiData() |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | // 地图动态变化样式 不能单独抽离到scss文件中 |
| | | .container { |
| | | background-image: url("@/assets/images_lc/map.png"); |
| | | // 动态获取图片大小 |
| | | background-size: v-bind('mapSize + "%"'); |
| | | background-size: 100%; |
| | | background-repeat: no-repeat; |
| | | background-position: 50% 50%; |
| | | transition: background-size 0.3s ease; |
| | |
| | | color: white; |
| | | overflow: hidden; |
| | | |
| | | .left { |
| | | width: 20%; |
| | | flex-shrink: 0; |
| | | flex-grow: 0; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 1rem; |
| | | .liuliang{ |
| | | height: 45%; |
| | | background: url("@/assets/images_lc/realTimeMonitoring.png") no-repeat; |
| | | background-size: 100% 100%; |
| | | &-title { |
| | | background-image: url('@/assets/images_lc/title_font.png'); |
| | | padding-left: 16%; |
| | | font-size: 1.2rem; |
| | | } |
| | | } |
| | | .gongdian{ |
| | | height: 55%; |
| | | background: url("@/assets/images_lc/warnRecord.png") no-repeat; |
| | | background-size: 100% 100%; |
| | | &-title { |
| | | background-image: url('@/assets/images_lc/title_font.png'); |
| | | padding-left: 16%; |
| | | font-size: 1.2rem; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .center { |
| | | width: 58%; |
| | | width: 80%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .map { |
| | |
| | | } |
| | | .message{ |
| | | width: 12rem; |
| | | height: 16rem; |
| | | height: 14rem; |
| | | background: url("@/assets/images_lc/point-message.png") no-repeat; |
| | | backdrop-filter: blur(3px); |
| | | background-size: 100% 100%; |
| | | padding: 0 0.2rem; |
| | | position: absolute; |
| | | right: -12rem; |
| | | right: 2rem; |
| | | top: 0; |
| | | z-index: 100; |
| | | .message-item{ |
| | | font-size: 0.7rem; |
| | | padding: 0.3rem 0 0.3rem 0.9rem; |
| | | padding: 0.5rem 0 0.5rem 0.9rem; |
| | | .name{ |
| | | margin-right: 0.3rem; |
| | | margin-right: 0.5rem; |
| | | } |
| | | .val-status{ |
| | | color: #22E195; |
| | |
| | | |
| | | .right { |
| | | width: 20%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 1rem; |
| | | &:hover{ |
| | | .right-box{ |
| | | transform: translateX(0); |
| | | } |
| | | } |
| | | .right-box{ |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 1rem; |
| | | transform: translateX(100%); |
| | | transition: all .5s; |
| | | } |
| | | .jiankong { |
| | | height: 40%; |
| | | height: 45%; |
| | | background-image: url('@/assets/images_lc/realTimeMonitoring.png'); |
| | | backdrop-filter: blur(3px); |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | &-t { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | .list{ |
| | | width: 49%; |
| | | height: 100%; |
| | | width: 100%; |
| | | height: 48%; |
| | | .item{ |
| | | height: 100%; |
| | | background-color: #000; |
| | |
| | | } |
| | | |
| | | .warnRecord { |
| | | height: 60%; |
| | | height: 55%; |
| | | background-image: url('@/assets/images_lc/warnRecord.png'); |
| | | backdrop-filter: blur(3px); |
| | | background-repeat: no-repeat; |
| | | background-size: 100% 100%; |
| | | display: flex; |