From 3a73cd63039981d1f7cd324afea8f14f37738467 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 07 三月 2025 11:24:49 +0800 Subject: [PATCH] 1、统计分析和统计图表、对比分析和利用率走势分析、利用率分段分析和报警分析页面新增筛选条件保持跟TEEP页面一致 2、全局中重要程度的筛选方式由多选改为单选 3、设备监控与车间看板页面的设备详情弹窗中的图表调整为一直展示但若无数据则不展示图表的指针与数值 --- src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue | 462 +++++++++++++++++++++++---------------------------------- 1 files changed, 184 insertions(+), 278 deletions(-) diff --git a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue index 185e5e6..998f657 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue @@ -5,30 +5,44 @@ <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="璁惧"> - <a-input-search :readOnly="true" v-model="queryParam.equipmentId" @search="deviceSearch" + <a-input-search readOnly v-model="queryParam.equipmentId" @search="deviceSearch" placeholder='璇烽�夋嫨璁惧'/> </a-form-item> </a-col> <a-col :md="5" :sm="5"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParam.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> <a-form-item label="椹卞姩绫诲瀷"> - <!--<j-dict-select-tag placeholder="璇烽�夋嫨椹卞姩绫诲瀷"--> - <!--:triggerChange="true" dictCode="mdc_driveType"--> - <!--v-model="queryParam.driveType" allow-clear/>--> - <a-auto-complete - v-model="queryParam.driveType" - :data-source="driveTypeList" - placeholder="椹卞姩绫诲瀷" - :filter-option="filterOption" - :allowClear="true" - /> + <a-select + :value="queryParam.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> </a-form-item> </a-col> <a-col :md="6" :sm="6" :xs="6"> @@ -36,7 +50,55 @@ <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD"/> </a-form-item> </a-col> - <a-col> + + <a-col :md="2" :sm="2"> + <a + @click="toggleSearchStatus=!toggleSearchStatus" + @selectstart="$event.preventDefault()" + style="display: inline-block;height: 32px;line-height: 32px" + > + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </a-col> + </a-row> + + <a-row :gutter="24" v-if="toggleSearchStatus"> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绾у埆"> + <a-select + :value="queryParam.deviceLevel" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绾у埆" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceLevel')" + > + <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="閲嶈绋嬪害"> + <a-select + v-model="queryParam.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :md="2" :sm="2" :xs="2"> <a-space> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> @@ -68,30 +130,22 @@ <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 { 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' import api from '@/api/mdc' import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer.vue' export default { name: 'comparativeAnalysismain', - // mixins: [JeecgListMixin], components: { - Tooltip, comparativeAnalysisBar, comparativeAnalysisGauge, conparativeAnalysisPie, @@ -112,40 +166,42 @@ AnalysisGauge: [], AnalysisPie: [], dates: [], - xianshi: '', - readOnly: true, queryParam: { - equipmentId: '' + equipmentId: '', + equipmentType: [], + driveType: [], + deviceLevel: [] }, queryParams: {}, queryParamEquip: {}, queryParamPeople: {}, - dataStartsoucre: [], url: { - comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis' + comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' }, AnalysisList: {}, - driveTypeList: [] + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], + toggleSearchStatus: '' } }, 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.queryParam.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.queryParam.equipmentId = '' } this.searchQuery() } @@ -153,12 +209,10 @@ 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 = '' } @@ -167,63 +221,62 @@ } }, methods: { - tabChange(val) { - this.activeKey = val + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, - 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 => { + + loadAnalysis(queryParam) { + getAction(this.url.comparativeAnalysis, 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 }) }, + searchQuery() { if (this.dates && this.dates.length > 0) { 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.queryParams.parentId = this.queryParamEquip.parentId //鑾峰彇鏌ヨ鏉′欢 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 - }) + + const queryParam = Object.assign({}, this.queryParam) + Object.keys(queryParam).forEach(item => { + if (Array.isArray(queryParam[item])) { + queryParam[item] = queryParam[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (queryParam[item].length === 0) delete queryParam[item] } - }).finally(() => { - this.loading = false }) + this.loadAnalysis(queryParam) } else { this.$notification.warning({ message: '鎻愮ず', @@ -232,213 +285,61 @@ } }, + 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 - }) + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = { + equipmentType: [], + driveType: [], + deviceLevel: [] } + 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.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.loadAnalysis(this.queryParam) }, - /** - * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 - */ + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 getDriveTypeByApi() { api.getDriveTypeApi().then((res) => { - this.driveTypeList = res.result.map(item => item.value) + if (res.success) this.driveTypeList = res.result }) }, - /** - * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� - * @param input 杈撳叆鐨勫唴瀹� - * @param option 閰嶇疆 - * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� - */ - filterOption(input, option) { - return ( - option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 - ) + + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) }, - // 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("璇疯缃畊rl.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("璇疯缃畊rl.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 - // }) - // }, + deviceSearch() { - console.log('瑙﹀彂') this.$refs.selectDeviceDrawer.visible = true this.$refs.selectDeviceDrawer.selectedRowKeys = [] this.$refs.selectDeviceDrawer.selectedRows = [] @@ -450,14 +351,20 @@ * @param data 宸查�夋嫨鐨勮澶� */ selectOK(data) { - // let params = {} - // params.equipmentIdList = [] - // for (var a = 0; a < data.length; a++) { - // params.equipmentIdList.push(data[a]) - // } - console.log('data=', data) this.queryParam.equipmentId = data.join(',') - console.log('queryParam', this.queryParam.equipmentId) + }, + + selectChange(value, key) { + this.queryParam[key] = value + }, + + tabChange(val) { + this.activeKey = val + }, + + dateParamChange(v1, v2) { + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] } }, created() { @@ -465,8 +372,11 @@ this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') this.queryParam.typeTree = '1' - this.loadAnalysis() + this.loadAnalysis(this.queryParam) this.getDriveTypeByApi() + this.queryGroup() + this.initDictData('device_level') + this.initDictData('device_importance_level') } } </script> @@ -523,10 +433,6 @@ display: flex !important; height: 100% !important; flex-direction: column !important; - } - - .device_list .table-page-search-wrapper { - height: 6% !important; } .device_list #DeviceList { -- Gitblit v1.9.3