|
@@ -0,0 +1,672 @@
|
|
|
+<template>
|
|
|
+ <div class="module-container">
|
|
|
+ <el-row>
|
|
|
+ <el-col
|
|
|
+ :span="24"
|
|
|
+ class="filter-container"
|
|
|
+ >
|
|
|
+ <el-cascader
|
|
|
+ v-model="project"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ :options="projectList"
|
|
|
+ :props="projectProps"
|
|
|
+ @change="filterCharts"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter="15"
|
|
|
+ class="content-container"
|
|
|
+ >
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-row class="two-third-container">
|
|
|
+ <dataContainer title="设备状态">
|
|
|
+ <div
|
|
|
+ id="deviceStatus"
|
|
|
+ class="charts-container"
|
|
|
+ />
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="one-third-container">
|
|
|
+ <dataContainer title="电梯故障率">
|
|
|
+ <div
|
|
|
+ id="elevatorRatio"
|
|
|
+ class="charts-container"
|
|
|
+ />
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-row class="two-third-container">
|
|
|
+ <dataContainer title="基础数据">
|
|
|
+ <div class="base-info-container">
|
|
|
+ <div class="base-info-card">
|
|
|
+ <div class="base-info-title base-info-icon1">
|
|
|
+ 在管设备
|
|
|
+ </div>
|
|
|
+ <div class="base-info-data">
|
|
|
+ {{ baseInfoOption.deviceNum }}
|
|
|
+ </div>
|
|
|
+ <div class="base-info-tip">
|
|
|
+ 在管项目
|
|
|
+ <span>{{ baseInfoOption.projectNum }}</span>
|
|
|
+ 个 在管机房
|
|
|
+ <span>{{ baseInfoOption.dpaNum }}</span>
|
|
|
+ 个
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="base-info-card">
|
|
|
+ <div class="base-info-title base-info-icon2">
|
|
|
+ 设备完好率
|
|
|
+ </div>
|
|
|
+ <div class="base-info-data">
|
|
|
+ {{ baseInfoOption.runningRate }}%
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="base-info-card">
|
|
|
+ <div class="base-info-title base-info-icon3">
|
|
|
+ 巡检完成率
|
|
|
+ </div>
|
|
|
+ <div class="base-info-data">
|
|
|
+ {{ baseInfoOption.maintenance }}%
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="base-info-card">
|
|
|
+ <div class="base-info-title base-info-icon4">
|
|
|
+ 维保完成率
|
|
|
+ </div>
|
|
|
+ <div class="base-info-data">
|
|
|
+ {{ baseInfoOption.inspection }}%
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="one-third-container">
|
|
|
+ <dataContainer title="巡检任务">
|
|
|
+ <div
|
|
|
+ id="patrolTask"
|
|
|
+ class="charts-container"
|
|
|
+ />
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-row class="two-third-container">
|
|
|
+ <dataContainer title="设备类型">
|
|
|
+ <div
|
|
|
+ id="deviceType"
|
|
|
+ class="charts-container"
|
|
|
+ />
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="one-third-container">
|
|
|
+ <dataContainer title="维保任务">
|
|
|
+ <div
|
|
|
+ id="maintenanceTask"
|
|
|
+ class="charts-container"
|
|
|
+ />
|
|
|
+ </dataContainer>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import dataContainer from 'comps/dataContainer/index.vue'
|
|
|
+import matchSize from 'utils/matchSize'
|
|
|
+import * as echarts from 'echarts'
|
|
|
+import {
|
|
|
+ getProjectDictionary
|
|
|
+} from 'api/dictionary'
|
|
|
+import {
|
|
|
+ getDeviceStatusDataOfProjectScreen,
|
|
|
+ getBaseDataOfProjectScreen,
|
|
|
+ getDeviceTypeDataOfProjectScreen,
|
|
|
+ getTaskDataOfProjectScreen
|
|
|
+} from 'api/project'
|
|
|
+import { getStore } from '../../utils/store'
|
|
|
+export default {
|
|
|
+ name: 'ProjectScreen',
|
|
|
+ components: {
|
|
|
+ dataContainer
|
|
|
+ },
|
|
|
+ mixins: [
|
|
|
+ matchSize
|
|
|
+ ],
|
|
|
+ props: {
|
|
|
+ resizeHeight: {
|
|
|
+ type: Number,
|
|
|
+ default: 500
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ project: [null],
|
|
|
+ projectList: [],
|
|
|
+ projectProps: {
|
|
|
+ label: 'projectName',
|
|
|
+ value: 'projectId'
|
|
|
+ },
|
|
|
+ filterForm: {
|
|
|
+ companyId: 249,
|
|
|
+ areaId: '',
|
|
|
+ projectId: '',
|
|
|
+ projectName: ''
|
|
|
+ },
|
|
|
+ colorList: ['#87c9fa', '#b7e9ff', '#007afc', '#4aa1ff', '#71b5ff', '#26baff', '#e8f5ff', '#299ff6'],
|
|
|
+ chartsList: ['deviceStatus', 'elevatorRatio', 'patrolTask', 'deviceType', 'maintenanceTask'],
|
|
|
+ baseInfoOption: {
|
|
|
+ deviceNum: 0,
|
|
|
+ projectNum: 0,
|
|
|
+ dpaNum: 0,
|
|
|
+ runningRate: 0,
|
|
|
+ maintenance: 0,
|
|
|
+ inspection: 0
|
|
|
+ },
|
|
|
+ deviceStatusOption: [
|
|
|
+ { name: '维修中', key: 'repairNum' },
|
|
|
+ { name: '关机中', key: 'normalClosedNum' },
|
|
|
+ { name: '维保中', key: 'maintainNum' },
|
|
|
+ { name: '故障中', key: 'faultNum' },
|
|
|
+ { name: '停机中', key: 'stopNum' },
|
|
|
+ { name: '运行中', key: 'runningNum' }
|
|
|
+ ],
|
|
|
+ taskOption: [
|
|
|
+ { name: '未完成', key: 'unFinishNum' },
|
|
|
+ { name: '已销单', key: 'auditNum' },
|
|
|
+ { name: '过期', key: 'expireNum' },
|
|
|
+ { name: '未派单', key: 'waitingNum' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.filterForm.companyId = getStore({ name: 'companyIdScreen', type: 'session' }) || 249
|
|
|
+ getProjectDictionary({
|
|
|
+ companyId: getStore({ name: 'companyIdScreen', type: 'session' }) || 249
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.projectList = res.data
|
|
|
+ this.projectList.unshift({
|
|
|
+ projectId: null,
|
|
|
+ projectName: '全部项目'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getScreenData()
|
|
|
+ // setInterval(() => {
|
|
|
+ // this.getScreenData()
|
|
|
+ // }, 60000)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 选取项目过滤图表
|
|
|
+ filterCharts (value) {
|
|
|
+ this.filterForm = {
|
|
|
+ companyId: getStore({ name: 'companyIdScreen', type: 'session' }) || 249,
|
|
|
+ areaId: '',
|
|
|
+ projectId: '',
|
|
|
+ projectName: ''
|
|
|
+ }
|
|
|
+ if (value && value.length && value[0]) {
|
|
|
+ const projectOption = this.projectList.find(item => item.projectId == value)
|
|
|
+ this.filterForm = {
|
|
|
+ companyId: projectOption.companyId,
|
|
|
+ areaId: projectOption.areaId,
|
|
|
+ projectId: projectOption.projectId,
|
|
|
+ projectName: projectOption.projectName
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getScreenData()
|
|
|
+ },
|
|
|
+ // 获取数据可视化数据
|
|
|
+ getScreenData () {
|
|
|
+ this.getDeviceStatusData()
|
|
|
+ this.getElevatorData()
|
|
|
+ this.getBaseData()
|
|
|
+ this.getDeviceTypeData()
|
|
|
+ this.getTaskData()
|
|
|
+ },
|
|
|
+ // 获取设备状态数据
|
|
|
+ getDeviceStatusData () {
|
|
|
+ const that = this
|
|
|
+ getDeviceStatusDataOfProjectScreen({
|
|
|
+ ...this.filterForm,
|
|
|
+ lpCategory: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const myChart = echarts.init(document.getElementById('deviceStatus'))
|
|
|
+ myChart.clear()
|
|
|
+ myChart.off('click')
|
|
|
+ myChart.off('legendselectchanged')
|
|
|
+ myChart.setOption({
|
|
|
+ color: that.colorList,
|
|
|
+ title: {
|
|
|
+ text: '状态总数',
|
|
|
+ subtext: JSON.stringify(res.data.totalNum),
|
|
|
+ textStyle: {
|
|
|
+ color: that.$store.state.primaryColor,
|
|
|
+ fontSize: 18 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio
|
|
|
+ },
|
|
|
+ subtextStyle: {
|
|
|
+ fontSize: 24 * that.sizeRatio,
|
|
|
+ color: '#FFFFFF',
|
|
|
+ lineHeight: 32 * that.sizeRatio
|
|
|
+ },
|
|
|
+ left: 'center',
|
|
|
+ top: '34%'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ icon: 'circle',
|
|
|
+ bottom: 20 * that.sizeRatio,
|
|
|
+ left: 'center',
|
|
|
+ orient: 'horizontal',
|
|
|
+ itemWidth: 14 * that.sizeRatio,
|
|
|
+ formatter: function (name) {
|
|
|
+ return '{nam|' + name + ' }\n{val|' + res.data[that.deviceStatusOption.find(item => item.name == name).key] + '}'
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ rich: {
|
|
|
+ nam: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 14 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio,
|
|
|
+ color: that.$store.state.primaryColor
|
|
|
+ },
|
|
|
+ val: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ color: that.$store.state.warningColor
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '设备状态',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['35%', '50%'],
|
|
|
+ center: ['50%', '40%'],
|
|
|
+ minAngle: 1,
|
|
|
+ roseType: 'radius',
|
|
|
+ label: {
|
|
|
+ formatter: '{b}: {c}'
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ length: 20,
|
|
|
+ length2: 20,
|
|
|
+ maxSurfaceAngle: 180
|
|
|
+ }
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ shadowColor: that.$store.state.shadowColor,
|
|
|
+ shadowBlur: 8
|
|
|
+ },
|
|
|
+ data: that.deviceStatusOption.map((item, index) => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ value: res.data[item.key]
|
|
|
+ }
|
|
|
+ }).sort((a, b) => {
|
|
|
+ return b.value - a.value
|
|
|
+ }).map((item, index) => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ value: item.value,
|
|
|
+ label: {
|
|
|
+ color: that.colorList[index],
|
|
|
+ fontSize: 14 * that.sizeRatio
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取基础数据
|
|
|
+ getBaseData () {
|
|
|
+ getBaseDataOfProjectScreen({
|
|
|
+ ...this.filterForm,
|
|
|
+ lpCategory: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.baseInfoOption = {
|
|
|
+ deviceNum: res.data.deviceIndicator.totalNum,
|
|
|
+ projectNum: res.data.projectNum,
|
|
|
+ dpaNum: res.data.dpaNum,
|
|
|
+ runningRate: res.data.deviceIndicator.runningRate,
|
|
|
+ maintenance: res.data.patrolTaskInidcators.find(site => site.lpCategory == 1).finishRate,
|
|
|
+ inspection: res.data.patrolTaskInidcators.find(site => site.lpCategory == 2).finishRate
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取设备类型数据
|
|
|
+ getDeviceTypeData () {
|
|
|
+ const that = this
|
|
|
+ getDeviceTypeDataOfProjectScreen({
|
|
|
+ ...this.filterForm,
|
|
|
+ lpCategory: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const otherData = res.data.reduce((total, item, index) => {
|
|
|
+ return index > 6 ? total + item.totalNum : total
|
|
|
+ }, 0)
|
|
|
+ res.data = res.data.slice(0, 7)
|
|
|
+ res.data.push({
|
|
|
+ sysName: '其他',
|
|
|
+ totalNum: otherData
|
|
|
+ })
|
|
|
+ const totalNum = res.data.reduce((total, item) => {
|
|
|
+ return total + item.totalNum
|
|
|
+ }, 0)
|
|
|
+ const myChart = echarts.init(document.getElementById('deviceType'))
|
|
|
+ myChart.clear()
|
|
|
+ myChart.off('click')
|
|
|
+ myChart.off('legendselectchanged')
|
|
|
+ myChart.setOption({
|
|
|
+ color: that.colorList,
|
|
|
+ title: {
|
|
|
+ text: '类型总数',
|
|
|
+ subtext: JSON.stringify(totalNum),
|
|
|
+ textStyle: {
|
|
|
+ color: that.$store.state.primaryColor,
|
|
|
+ fontSize: 18 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio
|
|
|
+ },
|
|
|
+ subtextStyle: {
|
|
|
+ fontSize: 24 * that.sizeRatio,
|
|
|
+ color: '#FFFFFF',
|
|
|
+ lineHeight: 32 * that.sizeRatio
|
|
|
+ },
|
|
|
+ left: 'center',
|
|
|
+ top: '34%'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ icon: 'circle',
|
|
|
+ bottom: 20 * that.sizeRatio,
|
|
|
+ left: 'center',
|
|
|
+ orient: 'horizontal',
|
|
|
+ itemWidth: 14 * that.sizeRatio,
|
|
|
+ formatter: function (name) {
|
|
|
+ return '{nam|' + name + ' }\n{val|' + res.data.find(site => site.sysName == name).totalNum + '}'
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ rich: {
|
|
|
+ nam: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 14 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio,
|
|
|
+ color: that.$store.state.primaryColor
|
|
|
+ },
|
|
|
+ val: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ color: that.$store.state.warningColor
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '设备状态',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['35%', '50%'],
|
|
|
+ center: ['50%', '40%'],
|
|
|
+ minAngle: 1,
|
|
|
+ roseType: 'radius',
|
|
|
+ label: {
|
|
|
+ formatter: '{b}: {c}'
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ length: 20,
|
|
|
+ length2: 20,
|
|
|
+ maxSurfaceAngle: 180
|
|
|
+ }
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ shadowColor: that.$store.state.shadowColor,
|
|
|
+ shadowBlur: 8
|
|
|
+ },
|
|
|
+ data: res.data.map((item, index) => {
|
|
|
+ return {
|
|
|
+ name: item.sysName,
|
|
|
+ value: item.totalNum,
|
|
|
+ label: {
|
|
|
+ color: that.colorList[index],
|
|
|
+ fontSize: 14 * that.sizeRatio
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取巡检任务、维保任务数据
|
|
|
+ getTaskData () {
|
|
|
+ const that = this
|
|
|
+ for (let i = 1; i <= 2; i++) {
|
|
|
+ getTaskDataOfProjectScreen({
|
|
|
+ ...this.filterForm,
|
|
|
+ lpCategory: i
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200 && res.data.length) {
|
|
|
+ const myChart = echarts.init(document.getElementById(i == 1 ? 'patrolTask' : 'maintenanceTask'))
|
|
|
+ myChart.clear()
|
|
|
+ myChart.off('click')
|
|
|
+ myChart.off('legendselectchanged')
|
|
|
+ myChart.setOption({
|
|
|
+ color: that.colorList,
|
|
|
+ title: {
|
|
|
+ text: '任务总数',
|
|
|
+ subtext: JSON.stringify(res.data[0].totalNum),
|
|
|
+ textAlign: 'center',
|
|
|
+ textStyle: {
|
|
|
+ color: that.$store.state.primaryColor,
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ lineHeight: 20 * that.sizeRatio
|
|
|
+ },
|
|
|
+ subtextStyle: {
|
|
|
+ fontSize: 20 * that.sizeRatio,
|
|
|
+ color: '#FFFFFF',
|
|
|
+ lineHeight: 24 * that.sizeRatio
|
|
|
+ },
|
|
|
+ left: '37%',
|
|
|
+ top: '38%'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ icon: 'circle',
|
|
|
+ right: 40 * that.sizeRatio,
|
|
|
+ top: 'center',
|
|
|
+ orient: 'vertical',
|
|
|
+ itemWidth: 14 * that.sizeRatio,
|
|
|
+ formatter: function (name) {
|
|
|
+ return '{nam|' + name + ' }\n{val|' + res.data[0][that.taskOption.find(item => item.name == name).key] + '}'
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ rich: {
|
|
|
+ nam: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 14 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio,
|
|
|
+ color: that.$store.state.primaryColor
|
|
|
+ },
|
|
|
+ val: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ color: that.$store.state.warningColor
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '设备状态',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['40%', '68%'],
|
|
|
+ center: ['38%', '50%'],
|
|
|
+ minAngle: 1,
|
|
|
+ roseType: 'radius',
|
|
|
+ label: {
|
|
|
+ formatter: '{b}: {c}'
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ length: 20,
|
|
|
+ length2: 20,
|
|
|
+ maxSurfaceAngle: 180
|
|
|
+ }
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ shadowColor: that.$store.state.shadowColor,
|
|
|
+ shadowBlur: 8
|
|
|
+ },
|
|
|
+ data: that.taskOption.map((item, index) => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ value: res.data[0][item.key],
|
|
|
+ label: {
|
|
|
+ color: that.colorList[index],
|
|
|
+ fontSize: 14 * that.sizeRatio
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取电梯故障率数据
|
|
|
+ getElevatorData () {
|
|
|
+ const elevatorList = [{
|
|
|
+ name: '未完成',
|
|
|
+ value: 40
|
|
|
+ }, {
|
|
|
+ name: '已销单',
|
|
|
+ value: 30
|
|
|
+ }, {
|
|
|
+ name: '过期',
|
|
|
+ value: 20
|
|
|
+ }, {
|
|
|
+ name: '未派单',
|
|
|
+ value: 10
|
|
|
+ }]
|
|
|
+ const that = this
|
|
|
+ const myChart = echarts.init(document.getElementById('elevatorRatio'))
|
|
|
+ myChart.clear()
|
|
|
+ myChart.setOption({
|
|
|
+ color: that.colorList,
|
|
|
+ title: {
|
|
|
+ text: '任务总数',
|
|
|
+ subtext: '0',
|
|
|
+ textAlign: 'center',
|
|
|
+ textStyle: {
|
|
|
+ color: that.$store.state.primaryColor,
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ lineHeight: 20 * that.sizeRatio
|
|
|
+ },
|
|
|
+ subtextStyle: {
|
|
|
+ fontSize: 20 * that.sizeRatio,
|
|
|
+ color: '#FFFFFF',
|
|
|
+ lineHeight: 24 * that.sizeRatio
|
|
|
+ },
|
|
|
+ left: '37%',
|
|
|
+ top: '38%'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ icon: 'circle',
|
|
|
+ right: 40 * that.sizeRatio,
|
|
|
+ top: 'center',
|
|
|
+ orient: 'vertical',
|
|
|
+ itemWidth: 14 * that.sizeRatio,
|
|
|
+ formatter: function (name) {
|
|
|
+ return '{nam|' + name + ' }\n{val|' + elevatorList.find(item => item.name == name).value + '}'
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ rich: {
|
|
|
+ nam: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 14 * that.sizeRatio,
|
|
|
+ lineHeight: 24 * that.sizeRatio,
|
|
|
+ color: that.$store.state.primaryColor
|
|
|
+ },
|
|
|
+ val: {
|
|
|
+ align: 'center',
|
|
|
+ fontSize: 16 * that.sizeRatio,
|
|
|
+ color: that.$store.state.warningColor
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '设备状态',
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['40%', '68%'],
|
|
|
+ center: ['38%', '50%'],
|
|
|
+ minAngle: 1,
|
|
|
+ roseType: 'radius',
|
|
|
+ label: {
|
|
|
+ formatter: '{b}: {c}'
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ normal: {
|
|
|
+ length: 20,
|
|
|
+ length2: 20,
|
|
|
+ maxSurfaceAngle: 180
|
|
|
+ }
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ shadowColor: that.$store.state.shadowColor,
|
|
|
+ shadowBlur: 8
|
|
|
+ },
|
|
|
+ data: elevatorList.map((item, index) => {
|
|
|
+ return {
|
|
|
+ name: item.name,
|
|
|
+ value: item.value,
|
|
|
+ label: {
|
|
|
+ color: that.colorList[index],
|
|
|
+ fontSize: 14 * that.sizeRatio
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重绘图表尺寸
|
|
|
+ resizeCharts () {
|
|
|
+ try {
|
|
|
+ this.chartsList.forEach(item => {
|
|
|
+ echarts.init(document.getElementById(item)).resize()
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ console.log('当前挂载实例未成功,三秒倒计时后重启')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.resizeCharts()
|
|
|
+ }, 3000)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+ @import '../../assets/css/storeColor';
|
|
|
+ .base-info-data{
|
|
|
+ height: calc(100% - 56px);
|
|
|
+ }
|
|
|
+ .base-info-tip{
|
|
|
+ margin-top: -4vh;
|
|
|
+ }
|
|
|
+</style>
|