From ec68cffd70d2a2788f7c74af55a11563aaf611d1 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期三, 06 十二月 2023 15:47:38 +0800 Subject: [PATCH] 1、登录页面优化首次登录会出现404字样,需要明确用户登录后显示页面是否为首页/消息页或者角色中可设置 2、驱动参数管理页面新增或修改控制系统中英文名称规则限制字符数最少6位调整为2位 3、效率段管理页面效率段颜色可自定义 4、设备利用率、设备开动率、班次利用率页面增加可按照设备类型筛选查询 5、对比分析页面增加通过选择设备来对比 6、设备日利用率和设备日利用率对比页面优化选择树节点后查询区域的设备名称字段不会更新问题 --- src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue | 862 ++++++++++++++++++++++++++------------------------------ 1 files changed, 399 insertions(+), 463 deletions(-) diff --git a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue index 87b3561..e903acd 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue @@ -1,56 +1,68 @@ <template> - <a-card :bordered="false" class="device_list"> + <div :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="4" :sm="4">--> - <!--<a-form-model-item label="椹卞姩绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">--> - <!--<j-dict-select-tag :disabled="true" :readOnly="disableSubmit" placeholder="璇烽�夋嫨椹卞姩绫诲瀷"--> - <!--:triggerChange="true" dictCode="mdc_driveType"--> - <!--v-model="model.driveType" allow-clear/>--> - <!--</a-form-model-item>--> - <!--</a-col>--> - <a-col :md="9" :sm="9" :xs="4"> - <a-form-item label="鏃堕棿"> - <a-range-picker @change="dateParamChange" v-model="dates" format="YYYY-MM-DD"/> - </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 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" + placeholder='璇烽�夋嫨璁惧'/> + </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-auto-complete + v-model="queryParam.driveType" + :data-source="driveTypeList" + placeholder="椹卞姩绫诲瀷" + :filter-option="filterOption" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="6" :xs="6"> + <a-form-item label="鏃堕棿"> + <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD"/> + </a-form-item> + </a-col> + <a-col> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </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> - <!-- table鍖哄煙-begin --> - <div id="DeviceList"> - <a-tabs :activeKey="activeKey" @change="tabChange" tabPosition="top"> - <a-tab-pane key="1" tab="鍥惧舰" force-render> - <comparative-analysis-bar></comparative-analysis-bar> - <!--<log-list :dataList='normalList' ref="logList" :loadingequip='loadingstayus'></log-list>--> - </a-tab-pane> - <a-tab-pane key="2" tab="浠〃"> - <comparative-analysis-gauge></comparative-analysis-gauge> - <!--<work-log-list :dataList='runList' ref="workLogList" :loadingrun="loadingrunStatus"></work-log-list>--> - </a-tab-pane> - <a-tab-pane key="3" tab="楗煎浘"> - <conparative-analysis-pie></conparative-analysis-pie> - <!--<alarm-log-list :dataList='waringList' ref="alarmLogList" :loadingwarn="loadingwarnStatus"></alarm-log-list>--> - </a-tab-pane> - </a-tabs> - </div> - <!-- table鍖哄煙-end --> - </div> - </a-card> + + <selectDeviceModal ref="selectDeviceModal" @selectFinished="selectOK" :title="'閫夋嫨璁惧'"></selectDeviceModal> + </div> </template> <script> @@ -64,19 +76,19 @@ getAction } from '@/api/manage' import comparativeAnalysisBar from './comparativeAnalysisBar' - import comparativeAnalysisGauge from'./comparativeAnalysisGauge' + import comparativeAnalysisGauge from './comparativeAnalysisGauge' import conparativeAnalysisPie from './conparativeAnalysisPie' import '@/components/table2excel/table2excel' - import { - JeecgListMixin - } from '@/mixins/JeecgListMixin' 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 selectDeviceModal from '../../../../system/modules/SelectDeviceModal.vue' + export default { name: 'comparativeAnalysismain', - mixins: [JeecgListMixin], + // mixins: [JeecgListMixin], components: { Tooltip, comparativeAnalysisBar, @@ -85,102 +97,68 @@ JDictSelectTag, JInput, JDate, - JEllipsis + JEllipsis, + selectDeviceModal }, - props: { nodeTree: '', Type:'',nodePeople: '' }, + props: { nodeTree: '', Type: '', nodePeople: '' }, data() { return { activeKey: '1', - typeTree:"", - typeParent:1, - typeEquipment:1, + typeTree: '', + typeParent: 1, + typeEquipment: 1, + AnalysisBarList: [], + AnalysisGauge: [], + AnalysisPie: [], dates: [], - xianshi:"", - readOnly:true, - queryParam: {}, - queryParams:{}, - queryParamEquip:{}, - queryParamPeople:{}, - dataStartsoucre:[], - columns: [ - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentId' - }, - { - title: '璁惧鍚嶇О', - align: 'center', - dataIndex: 'equipmentName', - defaultSortOrder:'descend', - sorter: (a, b) => {return a.equipmentName>b.equipmentName?1:-1} - }, - { - title: '缁翠慨绫诲瀷', - align: 'center', - dataIndex: 'mdcRepairTypeDictText' - }, - { - title: '寮�濮嬫椂闂�', - align: 'center', - dataIndex: 'startTime', - // scopedSlots:{customRender:'startTime'}, - // customRender:(text,row,index) => { - // return moment(text).format("YYYY-MM-DD HH:mm:ss") - // } - }, - { - title: '缁撴潫鏃堕棿', - align: 'center', - dataIndex: 'endTime' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - scopedSlots: {customRender: 'action'}, - align: "center", - width: 150 - } - ], + xianshi: '', + readOnly: true, + queryParam: { + equipmentId: '' + }, + queryParams: {}, + queryParamEquip: {}, + queryParamPeople: {}, + dataStartsoucre: [], url: { - list: '/mdc/mdcEquipmentRepair/pageList', - deleteBatch: '/mdc/mdcEquipmentRepair/delete', - getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', - getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction', - } + comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis' + }, + AnalysisList: {}, + driveTypeList: [] } }, - watch:{ - Type(valmath){ - this.dataList = []; + 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.$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.$set(this.queryParam, 'tierName', val.title) this.queryParamEquip.parentId = val.key this.queryParams.equipmentId = '' } this.searchQuery() } }, - nodePeople(val){ + nodePeople(val) { if (JSON.stringify(val) != '{}') { if (val.equipmentId) { - this.$set(this.queryParam, 'tierName', val.title) - this.queryParamEquip.parentId = "" + // 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.queryParamPeople.parentId = val.key + // this.$set(this.queryParam, 'tierName', val.title) + this.queryParamEquip.parentId = val.key this.queryParams.equipmentId = '' } this.searchQuery() @@ -188,34 +166,6 @@ } }, methods: { - initEquipmentNode(id) { - let _this = this - getAction(this.url.getBaseTree).then((res) => { - if (res.success) { - // console.log(res.result[0].entity.tierName) - _this.$set(this.queryParam, 'tierName', res.result[0].title) - _this.$set(this.queryParams, 'parentId', res.result[0].key) - // _this.queryStatistical() - } else { - this.$message.warn(res.message) - } - }).finally(() => { - this.loading = false - this.cardLoading = false - }) - // getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => { - // if (res.success) { - // if (res.result) { - // _this.$set(this.queryParam, 'tierName', res.result.tierName) - // _this.$set(this.queryParam, 'equipmentId', res.result.equipmentId) - // // _this.quip = res.result - // _this.searchQuery() - // } else { - // _this.$message.warning('璇烽厤缃澶囷紒') - // } - // } - // }) - }, tabChange(val) { this.activeKey = val }, @@ -223,322 +173,300 @@ // console.log(v1,v2) this.queryParam.startTime = v2[0] this.queryParam.endTime = v2[1] - // console.log(v2[0],v2[1]) + console.log(v2[0], v2[1]) }, - onChange(value, dateString) { - // console.log('Selected Time: ', value); - // console.log('Formatted Selected Time: ', dateString); + 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 + }) }, - onOk(value) { - console.log('onOk: ', value); + 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.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 + }) + } else { + this.$notification.warning({ + message: '鎻愮ず', + description: '璇烽�夋嫨鏃堕棿' + }) + } + }, searchReset() { - if(this.queryParams.typeTree == "1"){ + this.AnalysisList = [] + this.AnalysisBarList = [] + this.AnalysisGauge = [] + this.AnalysisPie = [] + if (this.queryParams.typeTree == '1') { this.typeTree = this.queryParams.typeTree - this.typeParent = this.queryParams.parentId + 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{ + 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{ + 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.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 - } - //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 - var params = this.getQueryParams();//鏌ヨ鏉′欢 - if(!params){ - return false; - } - 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; - // this.initDeviceType(this.dataSource) - //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - // this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; - } - //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - }else{ - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - handleEdit: function (record) { - this.$refs.modalFormedit.edit(record); - this.$refs.modalFormedit.title = "缂栬緫"; - this.$refs.modalFormedit.disableSubmit = false; - }, - handleTableChange(pagination, filters, sorter) { - this.dataSource = [] - //鍒嗛〉銆佹帓搴忋�佺瓫閫夊彉鍖栨椂瑙﹀彂 - //TODO 绛涢�� - // console.log(pagination) - if (Object.keys(sorter).length > 0) { - this.isorter.column = sorter.field; - this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" - } - this.ipagination = pagination; - //鑾峰彇鏌ヨ鏉′欢 - let sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) - sqp['superQueryMatchType'] = this.superQueryMatchType - } - var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); - param.pageNo = this.ipagination.current; - param.pageSize = this.ipagination.pageSize; - param.field = this.getQueryField(); - param.parentId = this.queryParams.parentId; - param.equipmentId = this.queryParams.equipmentId; - param.startTime = this.queryParam.startTime; - param.endTime = this.queryParam.endTime; - getAction(this.url.list,param).then((res) => { - if(res.success){ - this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; - } - }else{ - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - searchQueryEdit(){ - if(this.queryParams.typeTree == "1"){ - this.queryParams.parentId = this.queryParamEquip.parentId - }else{ - this.queryParams.parentId = this.queryParamPeople.parentId - this.queryParams.equipmentIds = "" - } - this.dataSource = []; - //鑾峰彇鏌ヨ鏉′欢 - let sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) - sqp['superQueryMatchType'] = this.superQueryMatchType - } - var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); - param.pageNo = this.ipagination.current; - param.pageSize = this.ipagination.pageSize; - param.field = this.getQueryField(); - param.parentId = this.queryParams.parentId; - param.equipmentId = this.queryParams.equipmentId; - param.startTime = this.queryParam.startTime; - param.endTime = this.queryParam.endTime; - getAction(this.url.list,param).then((res) => { - if(res.success){ - this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; - } - }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 sqp = {} - if(this.superQueryParams){ - sqp['superQueryParams']=encodeURI(this.superQueryParams) - sqp['superQueryMatchType'] = this.superQueryMatchType - } - var param = Object.assign(sqp, this.queryParams, this.isorter ,this.filters); - param.pageNo = 1; - param.pageSize = this.ipagination.pageSize; - param.field = this.getQueryField(); - param.parentId = this.queryParams.parentId; - param.equipmentId = this.queryParams.equipmentId; - param.startTime = this.queryParam.startTime; - param.endTime = this.queryParam.endTime; - // console.log(param); - getAction(this.url.list,param).then((res) => { - if(res.success){ - this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; - } - }else{ - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - loadData(arg) { - if(!this.url.list){ - this.$message.error("璇疯缃畊rl.list灞炴��!") - return - } - //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 - if (arg === 1) { - this.ipagination.current = 1; - } - var params = this.getQueryParams();//鏌ヨ鏉′欢 - if(!params){ - return false; - } - this.loading = true; - getAction(this.url.list, params).then((res) => { - if (res.success) { - this.dataSource = res.result.records||res.result; - // this.initDeviceType(this.dataSource) - //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - // this.dataSource = res.result.records||res.result; - if(res.result.total) - { - this.ipagination.total = res.result.total; - }else{ - this.ipagination.total = 0; - } - //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ - }else{ - this.$message.warning(res.message) - } - }).finally(() => { - this.loading = false - }) - }, - modalFormOk(val) { - // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 - this.searchQueryEdit(); - // this.$emit('openBasetree','') - this.selectedRowKeys = [] - }, - handleDelete: function (id) { - if(!this.url.deleteBatch){ - this.$message.error("璇疯缃畊rl.delete灞炴��!") - return - } - var that = this; - deleteAction(that.url.deleteBatch, {id: id}).then((res) => { - if (res.success) { - //閲嶆柊璁$畻鍒嗛〉闂 - that.reCalculatePage(1) - that.$message.success(res.message); - that.searchQuery(); + if (this.queryParams.parentId != '') { + this.queryParams.equipmentId = '' } else { - that.$message.warning(res.message); - } - }); - }, - handleAdd() { - this.$refs.modalForm.add(this.node) - this.$refs.modalForm.title = '鏂板' - this.$refs.modalForm.disableSubmit = false - }, - handleAddXIU() { - this.$refs.modalFormadd.add() - this.$refs.modalFormadd.title = '鏂板' - this.$refs.modalFormadd.disableSubmit = false - }, - pQuery(parentId) { - this.queryParam.parentId = parentId[0] - if(this.selectedRowKeys.length >= 1) { - this.selectedRowKeys.length = 0 - } - this.loadData() - }, - onSelectChange(selectedRowKeys) { - this.selectedRowKeys = selectedRowKeys - }, - initEquipment(id) { - let _this = this - getAction(this.url.getEquipmentByPid, { pid: id }).then((res) => { - if (res.success) { - if (res.result) { - _this.$set(this.queryParams, 'equipmentName', res.result.equipmentName) - _this.$set(this.queryParams, 'equipmentId', res.result.equipmentId) - _this.equipment = res.result - _this.searchQuery() + if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { + this.queryParams.equipmentId = this.typeEquipment } else { - _this.$message.warning('璇烽厤缃澶囷紒') + 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 + }) + } + }, + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + this.driveTypeList = res.result.map(item => item.value) }) }, - exportExcel() { - $("#DeviceList").table2excel({ - exclude: ".noExl", - name: "Excel Document Name", - filename: "璁惧缁翠慨璇︽儏", - exclude_img: true, - fileext: ".xls", - exclude_links: true, - exclude_inputs: true - }); + /** + * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� + * @param input 杈撳叆鐨勫唴瀹� + * @param option 閰嶇疆 + * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� + */ + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 + ) }, + // 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.selectDeviceModal.visible = true + this.$refs.selectDeviceModal.selectedRowKeys = [] + this.$refs.selectDeviceModal.selectedRows = [] + this.$refs.selectDeviceModal.checkedKeys = this.queryParam.equipmentId.split(',') + this.$refs.selectDeviceModal.expandAll() + }, + + /** + * 閫夋嫨宸叉湁璁惧鍚庣偣鍑荤‘瀹氭椂瑙﹀彂 + * @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) + } }, 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.initEquipmentNode() + this.queryParam.typeTree = '1' + this.loadAnalysis() + this.getDriveTypeByApi() } } </script> @@ -546,54 +474,62 @@ <style lang="less" scoped> /*@import '~@assets/less/common.less';*/ - @media screen and (min-width: 1920px){ - .device_list{ - height: 811px!important; + @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; + + @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; + + @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; + + @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; + + @media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; overflow: scroll; } } + /*.device_list{*/ - /*display: flex;*/ + /*display: flex;*/ /*}*/ /*.device_list .table-page-search-wrapper{*/ - /**/ + /**/ /*}*/ - /deep/ .ant-card-body{ - height: 100%!important; + /deep/ .ant-card-body { + height: 100% !important; } - .device_list .com_box{ - display: flex!important; - height: 100%!important; - flex-direction: column!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 .table-page-search-wrapper { + height: 6% !important; } - .device_list #DeviceList{ - height: 90%!important; + + .device_list #DeviceList { + height: 90% !important; } </style> -- Gitblit v1.9.3