diff --git a/web/components.d.ts b/web/components.d.ts index 37fb8d1..ce04f43 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -49,7 +49,6 @@ declare module 'vue' { Haikang: typeof import('./src/components/monitor/haikang.vue')['default'] LockOutlined: typeof import('@ant-design/icons-vue')['LockOutlined'] Map: typeof import('./src/components/Home/Map.vue')['default'] - Map_tianditu: typeof import('./src/components/Home/Map_tianditu.vue')['default'] Modal: typeof import('./src/components/Home/Modal.vue')['default'] OnLine: typeof import('./src/components/Home/onLine.vue')['default'] OperateCom: typeof import('./src/components/OperateCom.vue')['default'] diff --git a/web/public/config/columnList.js b/web/public/config/columnList.js index bff4cff..ebb9567 100644 --- a/web/public/config/columnList.js +++ b/web/public/config/columnList.js @@ -671,6 +671,14 @@ export const stationOptions = [ { // 0:未启用,1:启用 + label: '投运时间', + value: [], + key: 'operation_date', + type: 'date-picker' + }, + { + // 0:未启用,1:启用 + label: '场站运行模式', value: undefined, key: 'work_mode', diff --git a/web/public/index.html b/web/public/index.html index a8ea0b2..02dfcde 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -5,7 +5,8 @@ - <%= htmlWebpackPlugin.options.title %> + + 能源站监控与运行管理系统 diff --git a/web/src/components/DetailInfo.vue b/web/src/components/DetailInfo.vue index 2f82a93..7715f1e 100644 --- a/web/src/components/DetailInfo.vue +++ b/web/src/components/DetailInfo.vue @@ -86,7 +86,7 @@ v-model:value="propsInfo.ruleForm.value[item.key]" :placeholder="'请输入' + item.label" :disabled="props.disabled" - value-format="YYYY-MM-DD HH:mm:ss" + value-format="YYYY-MM-DD" /> - - - - diff --git a/web/src/components/Home/Modal.vue b/web/src/components/Home/Modal.vue index 42e634e..b913c7e 100644 --- a/web/src/components/Home/Modal.vue +++ b/web/src/components/Home/Modal.vue @@ -11,10 +11,10 @@ :is="item.componentId" :props-info="modalInfo[item.infoKey]" :props-total=" - ['prefab', 'dataTotal'].includes(item.infoKey) + ['prefab', 'envTotal'].includes(item.infoKey) ? item.infoKey == 'prefab' ? modalInfo.prefabTotal - : modalInfo.dataTotal + : modalInfo.envInfoTotal : modalInfo.allTotal " > @@ -103,7 +103,7 @@ export default { title: '环境信息', class: 'envInfo', componentId:markRaw( EnvInfo), - infoKey: 'dataTotal' + infoKey: 'envTotal' } ], sysName: '', @@ -163,12 +163,12 @@ export default { } const res = await getReq('/queryStationData', query) if (res.errcode === 0) { - this.modalInfo.dataTotal = res.data + this.modalInfo.envInfoTotal = res.data } else { throw res } } catch (error) { - this.modalInfo.dataTotal = {} + this.modalInfo.envInfoTotal = {} } }, // 查询场站信息 diff --git a/web/src/components/Home/Modal/DisCharge.vue b/web/src/components/Home/Modal/DisCharge.vue index 0803c8a..0ea11bf 100644 --- a/web/src/components/Home/Modal/DisCharge.vue +++ b/web/src/components/Home/Modal/DisCharge.vue @@ -122,7 +122,7 @@ export default { left: '3%', right: '4%', bottom: '5%', - containLabel: true + // containLabel: true }, xAxis: { type: 'category', diff --git a/web/src/components/Home/Modal/EnvInfo.vue b/web/src/components/Home/Modal/EnvInfo.vue index 3f36c03..e966ac6 100644 --- a/web/src/components/Home/Modal/EnvInfo.vue +++ b/web/src/components/Home/Modal/EnvInfo.vue @@ -30,26 +30,6 @@ export default { }, data() { return { - coolingList: [ - { - label: '关机', - value: '0' - }, - { - label: '开机', - value: '1' - } - ], - aircList: [ - { - label: '关机', - value: '0' - }, - { - label: '开机', - value: '1' - } - ], list: [ { key: 'coolingStatus', @@ -96,14 +76,8 @@ export default { handler(newVal, oldVal) { if (newVal !== oldVal) { this.list.forEach((item) => { - if (item.key == 'coolingStatus') { - item.value = this.coolingList.find( - (e) => e.value == this.propsTotal[item.key] - ).label ||'关机' - } else if (item.key == 'aircStatus') { - item.value = this.aircList.map( - (e) => e.value == this.propsTotal[item.key] - )[0].label||'关机' + if ( ['coolingStatus','aircStatus'].includes(item.key) ) { + item.value =['关机','开机'][this.propsTotal[item.key]] } else { item.value = this.propsTotal[item.key] } diff --git a/web/src/components/Home/Modal/PrefabCabin.vue b/web/src/components/Home/Modal/PrefabCabin.vue index f514a7f..a5ab4b7 100644 --- a/web/src/components/Home/Modal/PrefabCabin.vue +++ b/web/src/components/Home/Modal/PrefabCabin.vue @@ -130,10 +130,11 @@ export default { this.curStatus=['正常','故障'][this.propsTotal.status] this.list.forEach((item) => { if(item.key=='work_mode'){ - item.value =item.list.map((item)=>this.propsTotal[item.key]==item.value)[0].label + item.value = ['手动','峰谷套利','增网配容','应急供电','并网保电','自定时段'][this.propsTotal[item.key]] + // console.log(item.list.map((item)=>this.propsTotal[item.key]==item.value)[0].label,"145",item.list.map((item)=>this.propsTotal[item.key]==item.value)) + // item.value =item.list.map((item)=>==item.value)[0].label }else { item.value = this.propsTotal[item.key] - } }) } diff --git a/web/src/components/Home/Modal/Revenue.vue b/web/src/components/Home/Modal/Revenue.vue index acb7028..3b66b91 100644 --- a/web/src/components/Home/Modal/Revenue.vue +++ b/web/src/components/Home/Modal/Revenue.vue @@ -134,7 +134,7 @@ export default { left: '3%', right: '4%', bottom: '5%', - containLabel: true + // containLabel: true }, xAxis: { type: 'category', diff --git a/web/src/components/Home/Modal/Utilization.vue b/web/src/components/Home/Modal/Utilization.vue index b3f1707..22e30ca 100644 --- a/web/src/components/Home/Modal/Utilization.vue +++ b/web/src/components/Home/Modal/Utilization.vue @@ -115,7 +115,7 @@ export default { left: '3%', right: '4%', bottom: '5%', - containLabel: true + // containLabel: true }, xAxis: { type: 'category', diff --git a/web/src/components/Home/Operational.vue b/web/src/components/Home/Operational.vue index 2e3e6b8..06a651a 100644 --- a/web/src/components/Home/Operational.vue +++ b/web/src/components/Home/Operational.vue @@ -145,7 +145,7 @@ export default { left: '3%', right: '4%', bottom: '5%', - containLabel: true + // containLabel: true }, xAxis: { type: 'category', diff --git a/web/src/components/predict/predictEcharts.vue b/web/src/components/predict/predictEcharts.vue index c0369ce..70a2f6a 100644 --- a/web/src/components/predict/predictEcharts.vue +++ b/web/src/components/predict/predictEcharts.vue @@ -73,7 +73,7 @@ export default { left: '3%', right: '3%', bottom: '15%', - containLabel: true + // containLabel: true }, dataZoom: [ { diff --git a/web/src/components/statisticalAnalysis/energyEchart.vue b/web/src/components/statisticalAnalysis/energyEchart.vue index 495d6cf..6d90c69 100644 --- a/web/src/components/statisticalAnalysis/energyEchart.vue +++ b/web/src/components/statisticalAnalysis/energyEchart.vue @@ -135,7 +135,7 @@ export default { left: '3%', right: '3%', bottom: '5%', - containLabel: true, + // containLabel: true, }, xAxis: { type: 'category', @@ -270,7 +270,7 @@ export default { handlePagesizeChange(pageOption) { - this.$emit('pagesizeChange_energy', pageOption) + this.$emit('pagesizeChange', pageOption) } }, diff --git a/web/src/style/antd.scss b/web/src/style/antd.scss index f985e34..dccfb26 100644 --- a/web/src/style/antd.scss +++ b/web/src/style/antd.scss @@ -31,6 +31,11 @@ $page-border: #cad2dd; .ant-switch .ant-switch-handle::before { background-color: #0a1b2f !important; } + +.ant-picker .ant-picker-clear { + background: none; + color: #ffffff; +} .ant-select, .ant-cascader { .ant-select-selector { diff --git a/web/src/views/statisticalAnalysis.vue b/web/src/views/statisticalAnalysis.vue index 6ba7cff..f10827e 100644 --- a/web/src/views/statisticalAnalysis.vue +++ b/web/src/views/statisticalAnalysis.vue @@ -48,7 +48,7 @@ :page-option="tableList[activeKey].pageOption" :table-info="tableList[activeKey].tableInfo" :table-data="tableList[activeKey].tableData" - @pagesizeChange="pagesizeChange()" + @pagesizeChange="pagesizeChange" > @@ -60,6 +60,7 @@ import energyEchart from '@/components/statisticalAnalysis/energyEchart.vue' import searchBox from '@/components/SearchBox.vue' import { postReq, getReq } from '@/request/api' import { getRunDays, getDateDaysAgo } from '@/utils/dealWithData' +import { contentQuotesLinter } from 'ant-design-vue/es/_util/cssinjs/linters' export default { name: 'StatisicalAnView', @@ -509,7 +510,7 @@ export default { this.renderKey += 1 }, resetDataForInactiveKey() { - // 重置非当前激活页面的数据,减少内存占用 + // 重置非当前激活页面的数据 Object.keys(this.echartsInfo).forEach((key) => { if (key != this.activeKey) { this.echartsInfo[key].chartData = {} @@ -519,7 +520,11 @@ export default { Object.keys(this.tableList).forEach((key) => { if (key != this.activeKey) { - this.echartsInfo[key].tableData = {} + this.tableList[key].tableData = [] + this.tableList[key].pageOption={ + page: 1, + pageSize: 10, + count: 1 } } }) }, @@ -556,21 +561,25 @@ export default { ...this.paramsDate, category: this.activeKey, page_size: currentInfo.pageOption.pageSize, - pageNumber: currentInfo.pageOption.page + page: currentInfo.pageOption.page } try { const res = await getReq('/queryStatDetailList', query) if (res.errcode === 0) { this.tableList[this.activeKey].tableData = res.data.list || res.data - this.tableList[this.activeKey].pageOption.count = res.data.count || 0 + this.tableList[this.activeKey].pageOption.count = res.count || 0 + this.tableList[this.activeKey].pageOption.page = res.page || 0 + this.tableList[this.activeKey].pageOption.pageSize = res.page_size || 0 this.loading.table = false } else { throw res } } catch (error) { this.tableList[this.activeKey].tableData = [] - this.tableList[this.activeKey].pageOption.count = 0 + this.tableList[this.activeKey].pageOption.count = 0 + this.tableList[this.activeKey].pageOption.page = 0 + this.tableList[this.activeKey].pageOption.pageSize = 0 this.loading.table = false } }, @@ -579,7 +588,7 @@ export default { if (this.activeKey) { this.getStatCharts() // 定时获取最新实时数据 } - }, 10000) // 30秒刷新一次 + }, 10000) }, async getStationList() { @@ -601,7 +610,6 @@ export default { if (!this.stationId) { this.stationId = this.stationList[0].value } - //V I P } } else { const err = { tip: res.errmsg } @@ -619,7 +627,6 @@ export default { onSearch(data) { this.paramsDate.start_date = data.time ? data.time[0] : '' this.paramsDate.end_date = data.time ? data.time[1] : '' - this.tableList[this.activeKey].pageOption.page = 1 this.getStationList(), this.getEchartsListForActiveKey(), this.getTableListForActiveKey() }, @@ -628,7 +635,6 @@ export default { }, async getStatCharts() { - const currentInfo = this.echartsInfo[this.activeKey] const query = { dt: this.paramsDate.end_date, station_id: this.stationId, @@ -638,16 +644,11 @@ export default { const res = await getReq('/queryStatCharts', query) if (res.errcode === 0) { this.echartsInfo[this.activeKey].chartDatav = res.data - // x轴0点到24点 } else { throw res } } catch (error) { - this.echartsInfo[this.activeKey].chartDatav = { - V: [100.0, 100.0, 100.0], // 电压曲线 - I: [10.0, 10.0, 10.0], // 电流曲线 - P: [1000.0, 1000.0, 1000.0] // 功率曲线 - } + this.echartsInfo[this.activeKey].chartDatav = {} } } } diff --git a/web/src/views/sub/Home.vue b/web/src/views/sub/Home.vue index 16fbfc4..be6a01d 100644 --- a/web/src/views/sub/Home.vue +++ b/web/src/views/sub/Home.vue @@ -54,6 +54,7 @@ export default { components: { Map }, data() { return { + refreshInterval:null, showFlag: false, stationId: null, deviceInfo: {}, @@ -109,31 +110,44 @@ export default { return this.list.filter((_, index) => index % 2 !== 0).slice(0, 3) // 右列取前3个奇数索引 } }, + beforeUnmount() { + if(this.refreshInterval){ + clearInterval(this.refreshInterval) + this.refreshInterval=null + } + }, async mounted() { - await Promise.all([ - this.getOnLineList(), - this.getStatTotalList(), - this.getOperTotalList(), - this.getStatDayList(1), - this.getStatDayList(2), - this.getStatDayList(3) - ]).then((r) => { - if ( - this.deviceInfo.energy && - this.deviceInfo.charge && - this.deviceInfo.pv - ) { - const newArr = this.mergedArray( - this.deviceInfo.energy, - this.deviceInfo.charge, - this.deviceInfo.pv - ) - this.deviceInfo.alarm = newArr - } - }) + await this.loadAllData() + this.refreshInterval=setInterval(async()=>{ + await this.loadAllData() + },30000) //30s刷新一次 + }, methods: { + async loadAllData(){ + await Promise.all([ + this.getOnLineList(), + this.getStatTotalList(), + this.getOperTotalList(), + this.getStatDayList(1), + this.getStatDayList(2), + this.getStatDayList(3) + ]).then((r) => { + if ( + this.deviceInfo.energy && + this.deviceInfo.charge && + this.deviceInfo.pv + ) { + const newArr = this.mergedArray( + this.deviceInfo.energy, + this.deviceInfo.charge, + this.deviceInfo.pv + ) + this.deviceInfo.alarm = newArr + } + }) + }, getCurrentStation(e) { this.stationId = e }, diff --git a/web/src/views/system/station.vue b/web/src/views/system/station.vue index 57bfec4..f729f88 100644 --- a/web/src/views/system/station.vue +++ b/web/src/views/system/station.vue @@ -238,19 +238,16 @@ export default { stationOptions.forEach((e, index) => { e.list.forEach((i) => { if (i.key == 'work_mode') { - console.log(row[i.key], 'rrrrrrrrr') switch (row[i.key]) { case '1': case '5': e.ruleForm[i.key] =row[i.key] - // this.$refs.EditCom.workModeIdSelect = row[i.key] e.ruleForm['policy_id'] = row ? row['policy_id'] : '' stationOptions[0].list[stationOptions[0].list.length - 1].type = 'select' break default: e.ruleForm[i.key] =row[i.key] - console.log('1245') stationOptions[0].list[stationOptions[0].list.length - 1].type = 'unshow' break