¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false" class="device_list"> |
| | | <div class="com_box"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <!--<a-col :md="5" :sm="5">--> |
| | | <!--<a-form-item label="åç§°">--> |
| | | <!--<a-input placeholder="è¾å
¥è®¾å¤åç§°æ¥è¯¢" :readOnly="readOnly" v-model="queryParam.tierName"></a-input>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="驱å¨ç±»å"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©é©±å¨ç±»å" |
| | | :triggerChange="true" dictCode="mdc_driveType" |
| | | v-model="queryParam.driveType" allow-clear/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="9" :sm="9" :xs="4"> |
| | | <a-form-item label="æ¶é´"> |
| | | <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="2" :sm="3" :xs="3"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | </a-col> |
| | | <a-col :md="2" :sm="2" :xs="2"> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- tableåºå-begin --> |
| | | <div id="DeviceList"> |
| | | <a-tabs :activeKey="activeKey" @change="tabChange" tabPosition="top"> |
| | | <a-tab-pane key="1" tab="å¾å½¢"> |
| | | <comparative-analysis-bar ref="AnalysisBar" :dataList='AnalysisBarList'></comparative-analysis-bar> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="2" tab="仪表" forceRender> |
| | | <comparative-analysis-gauge ref="AnalysisGauge" :dataList="AnalysisGauge"></comparative-analysis-gauge> |
| | | </a-tab-pane> |
| | | <a-tab-pane key="3" tab="饼å¾" forceRender> |
| | | <conparative-analysis-pie ref="AnalysisPie" :dataList="AnalysisPie"></conparative-analysis-pie> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | </div> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import moment from 'moment' |
| | | import $ from 'jquery' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JDate from '../../../../../components/jeecg/JDate' |
| | | import { |
| | | requestPut, |
| | | deleteAction, |
| | | getAction |
| | | } from '@/api/manage' |
| | | import comparativeAnalysisBar from './comparativeAnalysisBar' |
| | | import comparativeAnalysisGauge from'./comparativeAnalysisGauge' |
| | | import conparativeAnalysisPie from './conparativeAnalysisPie' |
| | | import '@/components/table2excel/table2excel' |
| | | import JInput from '@/components/jeecg/JInput' |
| | | import JEllipsis from '@/components/jeecg/JEllipsis' |
| | | import Tooltip from 'ant-design-vue/es/tooltip' |
| | | import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' |
| | | export default { |
| | | name: 'comparativeAnalysismain', |
| | | // mixins: [JeecgListMixin], |
| | | components: { |
| | | Tooltip, |
| | | comparativeAnalysisBar, |
| | | comparativeAnalysisGauge, |
| | | conparativeAnalysisPie, |
| | | JDictSelectTag, |
| | | JInput, |
| | | JDate, |
| | | JEllipsis |
| | | }, |
| | | props: { nodeTree: '', Type:'',nodePeople: '' }, |
| | | data() { |
| | | return { |
| | | activeKey: '1', |
| | | typeTree:"", |
| | | typeParent:1, |
| | | typeEquipment:1, |
| | | AnalysisBarList:[], |
| | | AnalysisGauge:[], |
| | | AnalysisPie:[], |
| | | dates: [], |
| | | xianshi:"", |
| | | readOnly:true, |
| | | queryParam: {}, |
| | | queryParams:{}, |
| | | queryParamEquip:{}, |
| | | queryParamPeople:{}, |
| | | dataStartsoucre:[], |
| | | url: { |
| | | comparativeAnalysis:'/mdc/efficiencyReport/comparativeAnalysis' |
| | | }, |
| | | AnalysisList:{} |
| | | } |
| | | }, |
| | | watch:{ |
| | | Type(valmath){ |
| | | this.dataList = []; |
| | | this.queryParams.typeTree = valmath |
| | | // console.log(this.queryParams.typeTree) |
| | | }, |
| | | nodeTree(val) { //çå¬currSelected ååï¼å°åååçæ°å¼ä¼ éç» getCurrSelected äºä»¶ |
| | | if (JSON.stringify(val) != '{}') { |
| | | if (val.equipmentId) { |
| | | // this.$set(this.queryParam, 'tierName', val.title) |
| | | this.queryParamEquip.parentId = "" |
| | | this.queryParams.equipmentId = val.equipmentId |
| | | this.queryParamEquip.equipmentId = val.equipmentId |
| | | } else { |
| | | // this.$set(this.queryParam, 'tierName', val.title) |
| | | this.queryParamEquip.parentId = val.key |
| | | this.queryParams.equipmentId = '' |
| | | } |
| | | this.searchQuery() |
| | | |
| | | } |
| | | }, |
| | | nodePeople(val){ |
| | | |
| | | if (JSON.stringify(val) != '{}') { |
| | | if (val.equipmentId) { |
| | | // this.$set(this.queryParam, 'tierName', val.title) |
| | | this.queryParamEquip.parentId = "" |
| | | this.queryParams.equipmentId = val.equipmentId |
| | | this.queryParamEquip.equipmentId = val.equipmentId |
| | | } else { |
| | | // this.$set(this.queryParam, 'tierName', val.title) |
| | | this.queryParamEquip.parentId = val.key |
| | | this.queryParams.equipmentId = '' |
| | | } |
| | | this.searchQuery() |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | tabChange(val) { |
| | | this.activeKey = val |
| | | }, |
| | | dateParamChange(v1, v2) { |
| | | // console.log(v1,v2) |
| | | this.queryParam.startTime = v2[0] |
| | | this.queryParam.endTime = v2[1] |
| | | console.log(v2[0],v2[1]) |
| | | }, |
| | | loadAnalysis(){ |
| | | getAction(this.url.comparativeAnalysis,this.queryParam).then(res => { |
| | | if (res.success) { |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | searchQuery(){ |
| | | this.AnalysisList = [] |
| | | this.AnalysisBarList = [] |
| | | this.AnalysisGauge = [] |
| | | this.AnalysisPie = [] |
| | | if(this.queryParams.typeTree == "1"){ |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | |
| | | }else{ |
| | | this.queryParams.parentId = this.queryParamEquip.parentId |
| | | |
| | | // this.queryParams.equipmentId = "" |
| | | } |
| | | this.AnalysisList = []; |
| | | //è·åæ¥è¯¢æ¡ä»¶ |
| | | this.queryParam.parentId = this.queryParams.parentId; |
| | | this.queryParam.equipmentId = this.queryParams.equipmentId; |
| | | this.queryParam.typeTree = this.queryParams.typeTree |
| | | getAction(this.url.comparativeAnalysis,this.queryParam).then((res) => { |
| | | if(res.success){ |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | }else{ |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | searchReset() { |
| | | this.AnalysisList = [] |
| | | this.AnalysisBarList = [] |
| | | this.AnalysisGauge = [] |
| | | this.AnalysisPie = [] |
| | | if(this.queryParams.typeTree == "1"){ |
| | | this.typeTree = this.queryParams.typeTree |
| | | this.typeParent = this.queryParams.parentId |
| | | this.typeEquipment = this.queryParams.equipmentId |
| | | this.queryParams = {} |
| | | this.queryParam = {} |
| | | this.dates = [] |
| | | this.queryParams.typeTree = this.typeTree |
| | | this.queryParams.parentId = this.typeParent |
| | | if(this.queryParams.parentId != ""){ |
| | | this.queryParams.equipmentId = "" |
| | | }else{ |
| | | if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ |
| | | this.queryParams.equipmentId = this.typeEquipment |
| | | }else{ |
| | | this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | } |
| | | } |
| | | getAction(this.url.comparativeAnalysis,this.queryParams).then((res) => { |
| | | if(res.success){ |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | }else{ |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }else{ |
| | | this.typeTree = this.queryParams.typeTree |
| | | this.typeParent = this.queryParams.parentId |
| | | this.typeEquipment = this.queryParams.equipmentId |
| | | this.queryParams = {} |
| | | this.queryParam = {} |
| | | this.dates = [] |
| | | this.queryParams.typeTree = this.typeTree |
| | | this.queryParams.parentId = this.typeParent |
| | | if(this.queryParams.parentId != ""){ |
| | | this.queryParams.equipmentId = "" |
| | | }else{ |
| | | if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ |
| | | this.queryParams.equipmentId = this.typeEquipment |
| | | }else{ |
| | | this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | } |
| | | } |
| | | getAction(this.url.comparativeAnalysis,this.queryParams).then((res) => { |
| | | if(res.success){ |
| | | this.AnalysisList = res.result |
| | | this.AnalysisBarList = res.result.graphics |
| | | this.AnalysisGauge = res.result.meters |
| | | this.AnalysisPie.push(res.result.pieCharts) |
| | | }else{ |
| | | // this.$message.warning(res.message) |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | // onChange(value, dateString) { |
| | | // // console.log('Selected Time: ', value); |
| | | // // console.log('Formatted Selected Time: ', dateString); |
| | | // }, |
| | | // searchReset() { |
| | | // if(this.queryParams.typeTree == "1"){ |
| | | // this.typeTree = this.queryParams.typeTree |
| | | // this.typeParent = this.queryParams.parentId |
| | | // this.typeEquipment = this.queryParams.equipmentId |
| | | // this.queryParams = {} |
| | | // this.queryParam = {} |
| | | // this.dates = [] |
| | | // this.queryParams.typeTree = this.typeTree |
| | | // this.queryParams.parentId = this.typeParent |
| | | // if(this.queryParams.parentId != ""){ |
| | | // this.queryParams.equipmentId = "" |
| | | // }else{ |
| | | // if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ |
| | | // this.queryParams.equipmentId = this.typeEquipment |
| | | // }else{ |
| | | // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // this.ipagination.current = 1 |
| | | // this.ResetloadData(); |
| | | // }else{ |
| | | // this.typeTree = this.queryParams.typeTree |
| | | // this.typeParent = this.queryParams.parentId |
| | | // // this.typeEquipment = this.queryParams.equipmentId |
| | | // this.queryParams = {} |
| | | // this.queryParam = {} |
| | | // this.dates = [] |
| | | // this.queryParams.typeTree = this.typeTree |
| | | // this.queryParams.parentId = this.typeParent |
| | | // // this.queryParams.equipmentId = this.typeEquipment |
| | | // this.ipagination.current = 1 |
| | | // this.ResetloadData(); |
| | | // } |
| | | // |
| | | // }, |
| | | // ResetloadData() { |
| | | // if(!this.url.list){ |
| | | // this.$message.error("请设置url.list屿§!") |
| | | // return |
| | | // } |
| | | // var params = {} |
| | | // params.typeTree = this.queryParams.typeTree |
| | | // params.parentId = this.queryParams.parentId |
| | | // params.equipmentId = this.queryParams.equipmentId |
| | | // this.loading = true; |
| | | // getAction(this.url.list, params).then((res) => { |
| | | // if (res.success) { |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | // searchQuery(){ |
| | | // if(this.queryParams.typeTree == "1"){ |
| | | // this.queryParams.parentId = this.queryParamEquip.parentId |
| | | // // this.queryParams.equipmentId = this.queryParamEquip.equipmentId |
| | | // |
| | | // }else{ |
| | | // this.queryParams.parentId = this.queryParamPeople.parentId |
| | | // |
| | | // // this.queryParams.equipmentId = "" |
| | | // } |
| | | // this.dataSource = []; |
| | | // //è·åæ¥è¯¢æ¡ä»¶ |
| | | // let param = {} |
| | | // param.parentId = this.queryParams.parentId; |
| | | // param.equipmentId = this.queryParams.equipmentId; |
| | | // param.startTime = this.queryParam.startTime; |
| | | // param.driveType = this.queryParam.driveType; |
| | | // param.endTime = this.queryParam.endTime; |
| | | // getAction(this.url.list,param).then((res) => { |
| | | // if(res.success){ |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | // loadData() { |
| | | // if(!this.url.list){ |
| | | // this.$message.error("请设置url.list屿§!") |
| | | // return |
| | | // } |
| | | // //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | // var params = {} |
| | | // this.loading = true; |
| | | // params.startTime = this.queryParam.startTime; |
| | | // params.endTime = this.queryParam.endTime; |
| | | // params.typeTree = this.queryParams.typeTree |
| | | // getAction(this.url.list, params).then((res) => { |
| | | // if (res.success) { |
| | | // this.dataSource = res.result.records||res.result; |
| | | // }else{ |
| | | // this.$message.warning(res.message) |
| | | // } |
| | | // }).finally(() => { |
| | | // this.loading = false |
| | | // }) |
| | | // }, |
| | | }, |
| | | created() { |
| | | this.dates = [moment().subtract('days', 7), moment().subtract('days', 0)] |
| | | this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') |
| | | this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') |
| | | this.queryParam.typeTree = "1"; |
| | | this.loadAnalysis(); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | /*@import '~@assets/less/common.less';*/ |
| | | |
| | | @media screen and (min-width: 1920px){ |
| | | .device_list{ |
| | | height: 811px!important; |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px){ |
| | | .device_list{ |
| | | height: 811px!important; |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px){ |
| | | .device_list{ |
| | | height: 663px!important; |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px){ |
| | | .device_list{ |
| | | height: 564px!important; |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | @media screen and (max-width: 1280px){ |
| | | .device_list{ |
| | | height: 564px!important; |
| | | overflow: scroll; |
| | | } |
| | | } |
| | | /*.device_list{*/ |
| | | /*display: flex;*/ |
| | | /*}*/ |
| | | /*.device_list .table-page-search-wrapper{*/ |
| | | /**/ |
| | | /*}*/ |
| | | /deep/ .ant-card-body{ |
| | | height: 100%!important; |
| | | } |
| | | .device_list .com_box{ |
| | | display: flex!important; |
| | | height: 100%!important; |
| | | flex-direction: column!important; |
| | | } |
| | | .device_list .table-page-search-wrapper{ |
| | | height: 6%!important; |
| | | } |
| | | .device_list #DeviceList{ |
| | | height: 90%!important; |
| | | } |
| | | </style> |