diff --git a/src/api/substation/substation.js b/src/api/substation/substation.js index 1f993b7..11126c0 100644 --- a/src/api/substation/substation.js +++ b/src/api/substation/substation.js @@ -47,6 +47,20 @@ export const queryDeviceByProApi = (data) => { }) } +// 查询倾角,拉力柱状图数据接口 +export const getTowerDevAttributeRecordByDevice = (data) => { + return request.get(`/base/screen/info/getTowerDevAttributeRecordByDevice`, { + params: data + }) +} + +// 根据设备类型编码(环境、基坑、倾角、拉力)查询当天预警信息 +export const getDevTypeCodeDetails = (data) => { + return request.get(`/base/screen/homeTwo/getDevTypeCodeDetails`, { + params: data + }) +} + // 根据设备id查询最新室外环境监测信息 export const queryEnvironmentInfoByIdApi = (data) => { return request.get(`/base/screen/info/getDevAttributeLatestInfoById`, { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 613036c..6169f9e 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -199,3 +199,9 @@ ul { text-align: right; border-top: 1px solid #393737; } + +.maxsize { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} \ No newline at end of file diff --git a/src/components/dialog/angleDialog.vue b/src/components/dialog/angleDialog.vue new file mode 100644 index 0000000..7b9dd33 --- /dev/null +++ b/src/components/dialog/angleDialog.vue @@ -0,0 +1,301 @@ + + + + + diff --git a/src/components/dialog/dipDialog.vue b/src/components/dialog/dipDialog.vue index 269874e..8519d73 100644 --- a/src/components/dialog/dipDialog.vue +++ b/src/components/dialog/dipDialog.vue @@ -110,19 +110,20 @@ export default { devType: 119 }) if(res.data.data.length !== 0) { - this.pitVal = res.data.data[0].devId - this.currentSelIndex = res.data.data[0].devId; this.pitRange = res.data.data.map(item => { return { label: item.devName, value: item.devId } }) + this.pitVal = this.proData.id; + this.currentSelIndex = this.proData.id; await this.getPitData(this.pitVal) } }, //获取ercharts数据 async getPitData(devId) { + this.desHander() let res = await queryPitDataApi({ devId }) @@ -396,6 +397,16 @@ export default { let H2SChart = echarts.init(document.querySelector('#H2SChart')) H2SChart.setOption(H2SOption) }, + desHander(){ + let myChart1 = echarts.init(document.querySelector('#O2Chart')); + myChart1.dispose(); + let myChart2 = echarts.init(document.querySelector('#fireChart')); + myChart2.dispose(); + let myChart3 = echarts.init(document.querySelector('#COChart')); + myChart3.dispose(); + let myChart4 = echarts.init(document.querySelector('#H2SChart')); + myChart4.dispose(); + }, getFormattedDate() { const today = new Date() // 获取今天的日期 const year = today.getFullYear() // 获取年份 diff --git a/src/components/dialog/envirDialog.vue b/src/components/dialog/envirDialog.vue index d13036c..5426ca5 100644 --- a/src/components/dialog/envirDialog.vue +++ b/src/components/dialog/envirDialog.vue @@ -114,19 +114,20 @@ export default { devType: 116 }) if(res.data.data.length !== 0) { - this.deviceVal = res.data.data[0].devId; - this.currentSelIndex = res.data.data[0].devId; this.deviceRange = res.data.data.map(item => { return { label: item.devName, value: item.devId } }) + this.deviceVal = this.proData.id; + this.currentSelIndex = this.proData.id; await this.getChartsData(this.deviceVal) } }, //获取echart数据 async getChartsData(devId) { + this.desHander() let res = await queryChartsInfoByIdApi({devId}) this.generateCharts(res.data) }, @@ -403,6 +404,17 @@ export default { let airChart = echarts.init(document.querySelector('#airChart')) airChart.setOption(airOption) }, + desHander(){ + console.log(111) + let myChart1 = echarts.init(document.querySelector('#tempWetChart')); + myChart1.dispose(); + let myChart2 = echarts.init(document.querySelector('#windChart')); + myChart2.dispose(); + let myChart3 = echarts.init(document.querySelector('#loudChart')); + myChart3.dispose(); + let myChart4 = echarts.init(document.querySelector('#airChart')); + myChart4.dispose(); + }, closeDialog() { this.$emit('closeDialog') } diff --git a/src/components/dialog/pullDialog.vue b/src/components/dialog/pullDialog.vue new file mode 100644 index 0000000..69c060f --- /dev/null +++ b/src/components/dialog/pullDialog.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/src/components/home/commonDialog.vue b/src/components/home/commonDialog.vue index 54d239c..6521c22 100644 --- a/src/components/home/commonDialog.vue +++ b/src/components/home/commonDialog.vue @@ -167,6 +167,19 @@ > + + + + + @@ -181,12 +194,16 @@ import { } from '@/api/tableApis' import EnvirDialog from '@/components/dialog/envirDialog.vue' import DipDialog from '@/components/dialog/dipDialog.vue' +import PullDialog from '@/components/dialog/pullDialog.vue' +import AngleDialog from '@/components/dialog/angleDialog.vue' export default { name: 'commonDialog', components: { Pagination, EnvirDialog, - DipDialog + DipDialog, + PullDialog, + AngleDialog }, data() { return { @@ -207,6 +224,10 @@ export default { envirData:{}, dipOpen: false, dipData:{}, + angleOpen: false, + angleData:{}, + pullOpen: false, + pullData:{}, proTypeRange: [ { label: '变电工程', value: '1' }, { label: '线路工程', value: '2' }, @@ -467,6 +488,12 @@ export default { } else if(v.devTypeName === '基坑监测类') { this.dipOpen = true; this.dipData=v; + } else if(v.devTypeName === '组塔倾角监测类') { + this.angleOpen = true; + this.angleData=v; + } else if(v.devTypeName === '组塔拉力监测类') { + this.pullOpen = true; + this.pullData=v; } } }, diff --git a/src/components/home/leftThree.vue b/src/components/home/leftThree.vue index 4bb5aa0..d48a56f 100644 --- a/src/components/home/leftThree.vue +++ b/src/components/home/leftThree.vue @@ -74,6 +74,7 @@ export default { this.$emit('openDialog', { order: v }) }, async getProjData() { + let res = await queryProjInfoApi() this.projData = res.data this.getProjBar() diff --git a/src/components/home/rightTwo.vue b/src/components/home/rightTwo.vue index b160639..57190a7 100644 --- a/src/components/home/rightTwo.vue +++ b/src/components/home/rightTwo.vue @@ -76,7 +76,11 @@ export default { }, methods: { async getRiskData() { - let res = await queryRiskInfoApi() + let param = { + startTime:this.timeFormat(), + endTime:this.timeFormat(), + } + let res = await queryRiskInfoApi(param) this.tableList = res.data }, toggleDialog(v) { @@ -93,6 +97,29 @@ export default { } } }, + timeFormat() { + let date = new Date(); + // 若传入时间为假值,则取当前时间 + let formatStr = 'yyyy-mm-dd'; + const timeSource = { + 'y': date.getFullYear().toString(), // 年 + 'm': (date.getMonth() + 1).toString().padStart(2, '0'), // 月 + 'd': date.getDate().toString().padStart(2, '0'), // 日 + 'h': date.getHours().toString().padStart(2, '0'), // 时 + 'M': date.getMinutes().toString().padStart(2, '0'), // 分 + 's': date.getSeconds().toString().padStart(2, '0') // 秒 + // 有其他格式化字符需求可以继续添加,必须转化成字符串 + } + for (const key in timeSource) { + const [ret] = new RegExp(`${key}+`).exec(formatStr) || [] + if (ret) { + // 年可能只需展示两位 + const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0 + formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex)) + } + } + return formatStr + }, }, } diff --git a/src/components/substation/envirDetect.vue b/src/components/substation/envirDetect.vue index aa2e794..155b8fe 100644 --- a/src/components/substation/envirDetect.vue +++ b/src/components/substation/envirDetect.vue @@ -112,22 +112,25 @@ :row-style="rowStyle" > + @@ -141,7 +144,8 @@ import { queryDeviceByProApi, queryEnvironmentInfoByIdApi, queryChartsInfoByIdApi, - queryWarnInfoByIdApi + queryWarnInfoByIdApi, + getDevTypeCodeDetails } from '@/api/substation/substation' export default { components: { @@ -194,10 +198,12 @@ export default { mounted() { console.log(this.sendMsg) this.getDeviceData(this.sendMsg.projectId) + this.getDevTypeCodeDetails(this.sendMsg.projectId) }, methods: { async getDeviceData(proId) { let res = await queryDeviceByProApi({ + powerId:this.sendMsg.gtId, proId, devType: 116 }) @@ -213,6 +219,15 @@ export default { await this.getChartsData(this.deviceVal) } }, + //预警信息 + async getDevTypeCodeDetails(proId) { + let param= { + proId:proId, + devTypeCode: 116 + } + let res = await getDevTypeCodeDetails(param) + this.tableList=res.data + }, async getEnvironmentData(devId) { let res = await queryEnvironmentInfoByIdApi({ devId diff --git a/src/components/substation/pitDetect.vue b/src/components/substation/pitDetect.vue index eccdbfc..6e7b706 100644 --- a/src/components/substation/pitDetect.vue +++ b/src/components/substation/pitDetect.vue @@ -123,10 +123,10 @@
- 当日监测记录 + 预警信息
+
@@ -177,7 +180,8 @@ import { queryPitDataApi, queryLimitSpaceApi, queryNewLimitSpaceApi, - queryEnvironmentInfoByIdApi + queryEnvironmentInfoByIdApi, + getDevTypeCodeDetails } from '@/api/substation/substation' import * as echarts from 'echarts' export default { @@ -201,7 +205,8 @@ export default { pitList: [ ], - todayRecordList: [] + todayRecordList: [], + tableList: [] } }, created() { @@ -210,13 +215,16 @@ export default { mounted() { console.log(this.sendMsg) - this.getLimitData(this.sendMsg.projectId) + // this.getLimitData(this.sendMsg.projectId) this.getDeviceData(this.sendMsg.projectId) + //预警信息 + this.getDevTypeCodeDetails(this.sendMsg.projectId) // this.generateCharts() }, methods: { async getDeviceData(proId) { let res = await queryDeviceByProApi({ + powerId:this.sendMsg.gtId, proId, devType: 119 }) @@ -245,6 +253,15 @@ export default { }) this.generateCharts(res.data) }, + //预警信息 + async getDevTypeCodeDetails(proId) { + let param= { + proId:proId, + devTypeCode: 119 + } + let res = await getDevTypeCodeDetails(param) + this.tableList=res.data + }, async getLimitData(proId) { let res = await queryNewLimitSpaceApi({ proId diff --git a/src/components/substation/towerDetect.vue b/src/components/substation/towerDetect.vue index 83473d0..9844ffc 100644 --- a/src/components/substation/towerDetect.vue +++ b/src/components/substation/towerDetect.vue @@ -273,11 +273,13 @@ export default { methods: { async getDeviceData(proId) { let angleRes = await queryDeviceByProApi({ + powerId:this.sendMsg.gtId, proId, devType: 117 }) this.towerAngleList = angleRes.data.data let pullRes = await queryDeviceByProApi({ + powerId:this.sendMsg.gtId, proId, devType: 118 }) diff --git a/src/views/Lines/index.vue b/src/views/Lines/index.vue index 2c72789..8291a75 100644 --- a/src/views/Lines/index.vue +++ b/src/views/Lines/index.vue @@ -235,8 +235,14 @@ export default { proj.proPowerList.forEach(tower => { this.geoData.push({ name: tower.gtName, - projName: tower.gtName, + gtId:tower.id, + projName: proj.projectName+'-'+tower.gtName, projectId: proj.projectId, + // province: proj.areaName, + devTypeNum: tower.devTypeNum, + devNum: tower.devNum, + successNum: tower.successNum, + errorNum: tower.errorNum, itemStyle: { normal: { areaColor: '#7DDEFF' } }, value: [ Number(tower.lon),