|
@@ -1,214 +1,118 @@
|
|
|
<script lang="ts" setup>
|
|
|
-import { onMounted, reactive, ref } from 'vue'
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
+import {onMounted, reactive, ref} from 'vue'
|
|
|
+import {useRoute} from 'vue-router'
|
|
|
import RightFrame from '@/components/RightFrame.vue'
|
|
|
import Card01 from '@/components/card/Card01.vue'
|
|
|
-import {stations} from '@/utils/station'
|
|
|
import StripeTable from '@/components/StripeTable.vue'
|
|
|
import ColorTag from '@/components/tag/ColorTag.vue'
|
|
|
-import ImageTag from '@/components/tag/ImageTag.vue'
|
|
|
-import { getDetailInfo, getDeviceInfo } from '@/api/device'
|
|
|
+import {getDeviceInfo, getOperationsPersonnelData} from '@/api/device'
|
|
|
import Chart from '@/components/Chart.vue'
|
|
|
+import {getPie3DSimple} from "@/utils/chart";
|
|
|
|
|
|
const route = useRoute()
|
|
|
-let dibaImage = ref(new URL('@/assets/images/dike.png', import.meta.url).href)
|
|
|
-const jiankong = new URL('@/assets/images/tmp/jiankong.png', import.meta.url).href
|
|
|
|
|
|
-
|
|
|
-function getStation(stcd) {
|
|
|
- return stations.find(item => item.stcd === stcd)
|
|
|
-}
|
|
|
-
|
|
|
-const station = ref(getStation(route.params.stcd))
|
|
|
-const introduces = ref(station.value.detail?.split('\n'))
|
|
|
-const introduceImg = new URL(station.value.img, import.meta.url).href
|
|
|
-
|
|
|
-const deviceInfoColumns = [
|
|
|
- { label: '设备名称', prop: 'name' },
|
|
|
- { label: '设备位置', prop: 'loc', width: '110' },
|
|
|
- { label: '设备状态', prop: 'status', width: '110' }
|
|
|
+const color = ['#005aff', '#f8b551']
|
|
|
+const equipmentStatusData = reactive({
|
|
|
+ total: 10,
|
|
|
+ onlineTotal: 8,
|
|
|
+ "缺数": 0,
|
|
|
+ "上下限异常": 1,
|
|
|
+ "数据中断": 0,
|
|
|
+ "其他": 1,
|
|
|
+})
|
|
|
+const operationsPersonnelColumns = [
|
|
|
+ {label: '姓名', prop: 'name'},
|
|
|
+ {label: '已处理', prop: 'processed', width: '100'},
|
|
|
+ {label: '未处理', prop: 'untreated', width: '100'},
|
|
|
]
|
|
|
-
|
|
|
-const deviceInfoData = [
|
|
|
- { name: '总磷分析仪', loc: '100米', status: '正常' },
|
|
|
- { name: '总氮分析仪', loc: '100米', status: '正常' },
|
|
|
- { name: '水位计', loc: '100米', status: '正常' },
|
|
|
- { name: '氢氮分析仪', loc: '100米', status: '正常' }
|
|
|
+const operationsPersonnelData = reactive([])
|
|
|
+const deviceColumns = [
|
|
|
+ {label: '设备类型', prop: 'deviceType', width: '110'},
|
|
|
+ {label: '设备名称', prop: 'deviceName'},
|
|
|
+ {label: '运行状态', prop: 'state', width: '90'}
|
|
|
]
|
|
|
-
|
|
|
-const wqData = ref([])
|
|
|
-const wlData = reactive({ ss: '3.80', zg: '4.65', zd: '4.65', bz: '4.65', jj: '4.65' })
|
|
|
-
|
|
|
-const moduleTableColumns = [
|
|
|
- {
|
|
|
- label: '耗材名称', prop: 'partsName', width: '100', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '剩余有效期', prop: 'useDate', width: '100', convertFn: (data) => {
|
|
|
- return Number(data).toFixed(0)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '时间', prop: 'offDate', width: '190', convertFn: (data) => {
|
|
|
- return data
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
-const reagentTableColumns = [
|
|
|
- {
|
|
|
- label: '试剂名称', prop: 'stnm', width: '110', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '添加体积', prop: 'z', width: '80', convertFn: (data) => {
|
|
|
- return Number(data).toFixed(2)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '时间', prop: 'tm', width: '200', convertFn: (data) => {
|
|
|
- return data ? data.substring(5, 16) : ''
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
-const deviceTableColumns = [
|
|
|
- {
|
|
|
- label: '设备类型', prop: 'deviceType', width: '110', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '设备名称', prop: 'deviceName', width: '110', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- },{
|
|
|
- label: '运行状态', prop: 'state', width: '90', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- label: '运行情况', prop: 'online', width: '100', convertFn: (data) => {
|
|
|
- return data ? data.trim() : ''
|
|
|
- }
|
|
|
- }
|
|
|
-]
|
|
|
-const operationTableData = reactive([])
|
|
|
-const deviceTableData = reactive([])
|
|
|
+const deviceData = reactive([])
|
|
|
|
|
|
const right3Ref = ref(null)
|
|
|
|
|
|
function reloadRight3() {
|
|
|
- const option = {
|
|
|
- // backgroundColor: "#0B2D55",
|
|
|
- tooltip: {
|
|
|
- axisPointer: {
|
|
|
- type: 'cross'
|
|
|
- }
|
|
|
+ const optionData = [
|
|
|
+ {
|
|
|
+ name: '故障',
|
|
|
+ value: 1,
|
|
|
+ itemStyle: {
|
|
|
+ color: '#f3914b',
|
|
|
+ },
|
|
|
},
|
|
|
- grid: {
|
|
|
- top: '14%',
|
|
|
- left: '2%',
|
|
|
- right: '4%',
|
|
|
- bottom: '5%',
|
|
|
- containLabel: true
|
|
|
+ {
|
|
|
+ name: '提醒',
|
|
|
+ value: 4,
|
|
|
+ itemStyle: {
|
|
|
+ color: '#f5bf53'
|
|
|
+ }
|
|
|
},
|
|
|
- xAxis: [{
|
|
|
- type: 'category',
|
|
|
- axisLine: { // 坐标轴轴线相关设置。数学上的x轴
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- color: '#233e64'
|
|
|
- }
|
|
|
- },
|
|
|
- axisLabel: { // 坐标轴刻度标签的相关设置
|
|
|
- color: '#02cacf'
|
|
|
- },
|
|
|
- axisTick: { show: false },
|
|
|
- data: ['1-16氯管', 'p3-16氯管', '3-16氯管']
|
|
|
- }],
|
|
|
- yAxis: [{
|
|
|
- name: '个',
|
|
|
- nameTextStyle: {
|
|
|
- color: '#02cacf'
|
|
|
- },
|
|
|
- min: value => (value.min - 1).toFixed(0),
|
|
|
- max: value => (value.max + 1).toFixed(0),
|
|
|
- axisLabel: {
|
|
|
- margin: 20,
|
|
|
- color: '#02cacf'
|
|
|
- },
|
|
|
- splitLine: {
|
|
|
- show: true,
|
|
|
- lineStyle: {
|
|
|
- color: '#233e64'
|
|
|
- }
|
|
|
- },
|
|
|
- axisLine: {
|
|
|
- show: true
|
|
|
+ {
|
|
|
+ name: '巡检',
|
|
|
+ value: 6,
|
|
|
+ itemStyle: {
|
|
|
+ color: '#92d1f4'
|
|
|
}
|
|
|
- }],
|
|
|
- series: [{
|
|
|
- name: '水位',
|
|
|
- type: 'bar',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '定时巡检',
|
|
|
+ value: 3,
|
|
|
itemStyle: {
|
|
|
- color: function (params) {
|
|
|
- // 根据params的
|
|
|
- const colorsMap = [
|
|
|
- '#4768ec',
|
|
|
- '#92da76',
|
|
|
- '#dc8a5e',
|
|
|
- ]
|
|
|
- //返回对应的颜色
|
|
|
- return colorsMap[params.dataIndex]
|
|
|
- }
|
|
|
- },
|
|
|
- barWidth: 50,
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top'
|
|
|
- },
|
|
|
- data: [3, 5, 6]
|
|
|
+ color: '#0e2d5b'
|
|
|
+ }
|
|
|
}
|
|
|
- ]
|
|
|
- }
|
|
|
- right3Ref.value.loadChart(option)
|
|
|
+ ]
|
|
|
+ const option = getPie3DSimple(optionData, 0.8);
|
|
|
+ //是否需要label指引线,如果要就添加一个透明的2d饼状图并调整角度使得labelLine和3d的饼状图对齐,并再次setOption
|
|
|
+ option.series.push({
|
|
|
+ name: 'pie2d',
|
|
|
+ type: 'pie',
|
|
|
+ label: {
|
|
|
+ opacity: 1,
|
|
|
+ position: 'outside',
|
|
|
+ fontSize: 12,
|
|
|
+ lineHeight: 20,
|
|
|
+ textStyle: {
|
|
|
+ fontSize: 12,
|
|
|
+ color: '#fff'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ length: 30,
|
|
|
+ length2: 30
|
|
|
+ },
|
|
|
+ minAngle: 10,
|
|
|
+ startAngle: -50, // 起始角度,支持范围[0, 360]。
|
|
|
+ clockwise: false, // 饼图的扇区是否是顺时针排布。上述这两项配置主要是为了对齐3d的样式
|
|
|
+ radius: ['40%', '60%'],
|
|
|
+ center: ['50%', '50%'],
|
|
|
+ data: optionData.map(item => {
|
|
|
+ item.itemStyle.opacity = 0
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ });
|
|
|
+ right3Ref.value.loadChart(option, 'bindListen')
|
|
|
}
|
|
|
|
|
|
function getDeviceInfoList() {
|
|
|
getDeviceInfo().then(res => {
|
|
|
- deviceTableData.push(...res)
|
|
|
+ deviceData.push(...res)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
function getDeviceDetailInfoList() {
|
|
|
- getDetailInfo().then(res => {
|
|
|
- operationTableData.push(...res)
|
|
|
+ getOperationsPersonnelData().then(res => {
|
|
|
+ operationsPersonnelData.push(...res)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
const imgSrc = ref(new URL('@/assets/images/szpj.png', import.meta.url).href)
|
|
|
|
|
|
onMounted(() => {
|
|
|
- wqData.value = [
|
|
|
- { label: '水温', value: '22.3', unit: '℃', imgSrc: new URL('@/assets/images/sz-wd.png', import.meta.url).href },
|
|
|
- { label: '浊度', value: '235', unit: 'NTU', imgSrc: new URL('@/assets/images/sz-zd.png', import.meta.url).href },
|
|
|
- {
|
|
|
- label: '溶解氧',
|
|
|
- value: '8.22',
|
|
|
- unit: 'mg/L',
|
|
|
- imgSrc: new URL('@/assets/images/sz-rjy.png', import.meta.url).href
|
|
|
- },
|
|
|
- {
|
|
|
- label: '电导率',
|
|
|
- value: '8.22',
|
|
|
- unit: 'US/cm',
|
|
|
- imgSrc: new URL('@/assets/images/sz-ddl.png', import.meta.url).href
|
|
|
- },
|
|
|
- { label: '总磷', value: '22.3', unit: 'mg/L', imgSrc: new URL('@/assets/images/sz-zl.png', import.meta.url).href },
|
|
|
- { label: '总氮', value: '22.3', unit: 'mg/L', imgSrc: new URL('@/assets/images/sz-tn.png', import.meta.url).href },
|
|
|
- { label: '氨氮', value: '22.3', unit: 'mg/L', imgSrc: new URL('@/assets/images/sz-ad.png', import.meta.url).href }
|
|
|
- ]
|
|
|
getDeviceInfoList()
|
|
|
getDeviceDetailInfoList()
|
|
|
reloadRight3()
|
|
@@ -218,69 +122,61 @@ onMounted(() => {
|
|
|
<template>
|
|
|
<right-frame>
|
|
|
<template #leftModule>
|
|
|
- <card01 style="height: 70%" title="运行实态">
|
|
|
- <el-row style="height: 120px;">
|
|
|
+ <card01 style="height: 33%" title="运行实态">
|
|
|
+ <el-row style="height: 66%;">
|
|
|
<el-col :span="7">
|
|
|
<div class="device_num">
|
|
|
<span class="background-image">设备管理</span>
|
|
|
- <span style="font-size: 26px;font-weight: bold;">31</span>
|
|
|
+ <span style="font-size: 26px;font-weight: bold;">{{ equipmentStatusData.total }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="10">
|
|
|
<div style="display: flex;justify-content: center;">
|
|
|
<div style="position: absolute;bottom:40%;font-size:16px;">设备清单</div>
|
|
|
- <img :src="imgSrc" style="height: 120px;" />
|
|
|
+ <img :src="imgSrc" style="height: 120px;"/>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="7">
|
|
|
<div class="device_num">
|
|
|
<span class="background-image">在线设备</span>
|
|
|
- <span style="font-size: 26px;font-weight: bold;">30</span>
|
|
|
+ <span style="font-size: 26px;font-weight: bold;">{{ equipmentStatusData.onlineTotal }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row style="height: calc(100% - 120px)">
|
|
|
- <stripe-table :columns="deviceTableColumns" :data="deviceTableData"></stripe-table>
|
|
|
+ <el-row :gutter="10" style="height: 33%;">
|
|
|
+ <el-col :span="6" style="height: 100%;">
|
|
|
+ <!-- #adcbe0 -->
|
|
|
+ <color-tag :value="equipmentStatusData['缺数']" backgroundColor="#bb232f" label="缺数"></color-tag>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="height: 100%;">
|
|
|
+ <!-- #adcbe0 -->
|
|
|
+ <color-tag :value="equipmentStatusData['上下限异常']" backgroundColor="#b38b30"
|
|
|
+ label="上下限异常"></color-tag>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="height: 100%;">
|
|
|
+ <!-- #adcbe0 -->
|
|
|
+ <color-tag :value="equipmentStatusData['数据中断']" background-color="#97759c" label="数据中断"></color-tag>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="height: 100%;">
|
|
|
+ <color-tag :value="equipmentStatusData['其他']" backgroundColor="#adcbe0" label="其他"></color-tag>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
+ </card01>
|
|
|
+ <card01 style="height: 33%" title="维护情况">
|
|
|
+ <chart ref="right3Ref"></chart>
|
|
|
+ </card01>
|
|
|
+ <card01 style="height: 33%" title="运维人员统计">
|
|
|
+ <stripe-table :columns="operationsPersonnelColumns" :data="operationsPersonnelData"></stripe-table>
|
|
|
</card01>
|
|
|
</template>
|
|
|
<template #rightModule>
|
|
|
- <card01 style="height: 33%" title="配件运维信息">
|
|
|
- <stripe-table :columns="moduleTableColumns" :data="operationTableData"></stripe-table>
|
|
|
- </card01>
|
|
|
- <card01 style="height: 33%" title="耗材余量监控">
|
|
|
- <chart ref="right3Ref"></chart>
|
|
|
+ <card01 title="设备清单">
|
|
|
+ <stripe-table :columns="deviceColumns" :data="deviceData"></stripe-table>
|
|
|
</card01>
|
|
|
</template>
|
|
|
</right-frame>
|
|
|
</template>
|
|
|
<style lang="scss" scoped>
|
|
|
-@use "@/assets/styles/introduce.scss";
|
|
|
-
|
|
|
-.difang-water-level {
|
|
|
- position: absolute;
|
|
|
- bottom: 10px;
|
|
|
- width: 80%;
|
|
|
- height: 60%;
|
|
|
- background-color: rgba(0, 204, 255, 0.6);
|
|
|
- border-top: 3px solid rgba(0, 204, 255);
|
|
|
-
|
|
|
- .difang-water-level-value {
|
|
|
- position: absolute;
|
|
|
- top: -2rem;
|
|
|
- font-size: 1.2rem;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-.difang-image {
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
-}
|
|
|
-
|
|
|
.background-image {
|
|
|
background-image: url(/src/assets/images/layout/menu-right.png);
|
|
|
background-repeat: no-repeat;
|