From 65a5e8c7ec6d6eab78b76c5831eaf40c30e23c61 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 13 九月 2024 14:56:50 +0800 Subject: [PATCH] 1、设备管理页面设备种类字段改成重要程度字段;新增设备异常状态字段,若表格记录的设备状态不为正常时,则标红此表格记录 2、设备利用率、设备开动率、班次利用率以及设备综合效率分析新增按照重要程度字段查询表格数据;左侧树数据新增参数key,用来过滤异常状态设备 3、设备利用率页面新增设备型号字段 --- src/views/mdc/base/EquipmentList.vue | 148 +++- src/views/mdc/base/EfficiencyReport.vue | 2 src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 1092 ++++++++++++++++-------------- vue.config.js | 33 src/store/modules/Production.js | 4 src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue | 58 + src/views/mdc/base/OEEAnalysis.vue | 2 src/views/mdc/base/modules/EquipmentList/UserModal.vue | 481 ++++++------- src/views/mdc/common/BaseTree.vue | 126 +- src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue | 106 ++ src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue | 41 src/views/mdc/base/EfficiencyShiftReport.vue | 2 src/views/mdc/base/EfficiencyPOReport.vue | 2 13 files changed, 1,156 insertions(+), 941 deletions(-) diff --git a/src/store/modules/Production.js b/src/store/modules/Production.js index fc21e70..6ef7408 100644 --- a/src/store/modules/Production.js +++ b/src/store/modules/Production.js @@ -22,9 +22,9 @@ actions: { // 浜х嚎鏍� - QueryProduction({ commit }) { + QueryProduction({ commit },key) { return new Promise((resolve, reject) => { - getAction("/mdc/mdcEquipment/queryTreeListByProduction").then(response => { + getAction("/mdc/mdcEquipment/queryTreeListByProduction",{key}).then(response => { if(response.success){ const result = response.result Vue.ls.set(SYS_PRODUCTION, result) diff --git a/src/views/mdc/base/EfficiencyPOReport.vue b/src/views/mdc/base/EfficiencyPOReport.vue index b9749d0..be55b7a 100644 --- a/src/views/mdc/base/EfficiencyPOReport.vue +++ b/src/views/mdc/base/EfficiencyPOReport.vue @@ -5,7 +5,7 @@ <a-col :md="5"> <a-tabs :activeKey="activeKey" @change="tabChange"> <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> - <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + <base-tree @getCurrSelected="changeSelectionNode" :filterAbnormalDeviceKey="'1'"></base-tree> </a-tab-pane> <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇">, <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> diff --git a/src/views/mdc/base/EfficiencyReport.vue b/src/views/mdc/base/EfficiencyReport.vue index e9cc7ef..f20c7bc 100644 --- a/src/views/mdc/base/EfficiencyReport.vue +++ b/src/views/mdc/base/EfficiencyReport.vue @@ -5,7 +5,7 @@ <a-col :md="5"> <a-tabs :activeKey="activeKey" @change="tabChange"> <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> - <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + <base-tree @getCurrSelected="changeSelectionNode" :filterAbnormalDeviceKey="'1'"></base-tree> </a-tab-pane> <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇">, <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> diff --git a/src/views/mdc/base/EfficiencyShiftReport.vue b/src/views/mdc/base/EfficiencyShiftReport.vue index 1a72217..e7e633a 100644 --- a/src/views/mdc/base/EfficiencyShiftReport.vue +++ b/src/views/mdc/base/EfficiencyShiftReport.vue @@ -5,7 +5,7 @@ <a-col :md="5"> <a-tabs :activeKey="activeKey" @change="tabChange"> <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> - <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + <base-tree @getCurrSelected="changeSelectionNode" :filterAbnormalDeviceKey="'1'"></base-tree> </a-tab-pane> <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇"> <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> diff --git a/src/views/mdc/base/EquipmentList.vue b/src/views/mdc/base/EquipmentList.vue index 009143b..d254554 100644 --- a/src/views/mdc/base/EquipmentList.vue +++ b/src/views/mdc/base/EquipmentList.vue @@ -6,19 +6,19 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-form-item label="璁惧缂栧彿"> <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input> </a-form-item> </a-col> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-form-item label="璁惧鍚嶇О"> <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> </a-form-item> </a-col> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-form-item label="杞﹂棿鍚嶇О"> <!--<a-input placeholder="璇疯緭鍏ヨ溅闂村悕绉�" v-model="queryParam.productionName"></a-input>--> <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="璇烽�夋嫨杞﹂棿" @@ -26,29 +26,45 @@ </a-form-item> </a-col> - <a-col :md="4" :sm="4"> - <a-form-item label="璁惧绾у埆"> - <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="queryParam.deviceLevel" - allow-clear/> - </a-form-item> - </a-col> + <template v-if="toggleSearchStatus"> + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧绾у埆"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="queryParam.deviceLevel" + allow-clear/> + </a-form-item> + </a-col> + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧绉嶇被"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="queryParam.deviceCategory" + allow-clear/> + </a-form-item> + </a-col> - <a-col :md="4" :sm="4"> - <a-form-item label="璁惧绉嶇被"> - <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="queryParam.deviceCategory" - allow-clear/> - </a-form-item> - </a-col> + <a-col :md="6" :sm="6"> + <a-form-item label="寮傚父鐘舵��"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧寮傚父鐘舵��" dictCode="device_abnormal_status" + v-model="queryParam.deviceAbnormalStatus" + allow-clear/> + </a-form-item> + </a-col> + </template> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a + @click="toggleSearchStatus=!toggleSearchStatus" + style="margin-left: 8px" + > + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> </a-col> </a-row> </a-form> </div> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <!-- 鎿嶄綔鎸夐挳鍖哄煙路 --> <div class="table-operator" style="border-top: 5px"> <a-button @click="handleAdd" type="primary" icon="plus">娣诲姞璁惧</a-button> <a-button type="primary" icon="download" @click="handleExportXls('璁惧淇℃伅')">瀵煎嚭</a-button> @@ -86,6 +102,33 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + <!--<template slot="equipmentId" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentName" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="productionName" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentType" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="driveType" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentIp" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="devicePower" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="systemVersion" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <template slot="deviceAbnormalStatus" slot-scope="text,record"> + <div :style="{color:text&&text!==1?'#f00':null}">{{record.deviceAbnormalStatus_dictText}}</div> + </template> <span slot="action" slot-scope="text, record"> <a @click="handleEdit(record)">缂栬緫</a> @@ -108,8 +151,6 @@ </a-menu> </a-dropdown> </span> - - </a-table> </div> <!-- table鍖哄煙-end --> @@ -124,11 +165,13 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { queryProductionTreeList } from '@/api/api' import { mapActions } from 'vuex' + import Template1 from '../../jeecg/JVxeDemo/layout-demo/Template1' export default { name: 'EquipmentList', mixins: [JeecgListMixin], components: { + Template1, UserModal }, data() { @@ -164,6 +207,7 @@ align: 'center', dataIndex: 'equipmentId', width: 200 + // sorter: true }, { title: '璁惧鍚嶇О', @@ -180,14 +224,16 @@ { title: '璁惧绫诲瀷', align: 'center', - width: 200, + width: 180, dataIndex: 'equipmentType' }, + { title: '椹卞姩绫诲瀷', align: 'center', width: 200, dataIndex: 'driveType' + // sorter: true }, { title: '鏈哄簥IP', @@ -198,21 +244,26 @@ { title: '璁惧鍔熺巼', align: 'center', - width: 200, + width: 150, dataIndex: 'devicePower' }, - { - title: '閮ㄩ棬', - align: 'center', - width: 200, - dataIndex: 'orgCodeTxt' - }, - + // { + // title: '閮ㄩ棬', + // align: "center", + // width: 200, + // dataIndex: 'orgCodeTxt' + // }, { title: '绯荤粺鐗堟湰', align: 'center', - width: 200, + width: 150, dataIndex: 'systemVersion' + }, + { + title: '寮傚父鐘舵��', + align: 'center', + width: 100, + dataIndex: 'deviceAbnormalStatus' }, { title: '鎿嶄綔', @@ -222,7 +273,6 @@ width: 150, fixed: 'right' } - ], url: { list: '/mdc/mdcEquipment/list', @@ -261,46 +311,53 @@ title: '璁惧缂栧彿', align: 'center', dataIndex: 'equipmentId', - width: 200 + width: 200, + scopedSlots: { customRender: 'equipmentId' } // sorter: true }, { title: '璁惧鍚嶇О', align: 'center', width: 200, - dataIndex: 'equipmentName' + dataIndex: 'equipmentName', + scopedSlots: { customRender: 'equipmentName' } }, { title: '杞﹂棿', align: 'center', width: 200, - dataIndex: 'productionName' + dataIndex: 'productionName', + scopedSlots: { customRender: 'productionName' } }, { title: '璁惧绫诲瀷', align: 'center', - width: 200, - dataIndex: 'equipmentType' + width: 180, + dataIndex: 'equipmentType', + scopedSlots: { customRender: 'equipmentType' } }, { title: '椹卞姩绫诲瀷', align: 'center', width: 200, - dataIndex: 'driveType' + dataIndex: 'driveType', + scopedSlots: { customRender: 'driveType' } // sorter: true }, { title: '鏈哄簥IP', align: 'center', width: 200, - dataIndex: 'equipmentIp' + dataIndex: 'equipmentIp', + scopedSlots: { customRender: 'equipmentIp' } }, { title: '璁惧鍔熺巼', align: 'center', - width: 200, - dataIndex: 'devicePower' + width: 150, + dataIndex: 'devicePower', + scopedSlots: { customRender: 'devicePower' } }, // { // title: '閮ㄩ棬', @@ -308,12 +365,19 @@ // width: 200, // dataIndex: 'orgCodeTxt' // }, - { title: '绯荤粺鐗堟湰', align: 'center', - width: 200, - dataIndex: 'systemVersion' + width: 150, + dataIndex: 'systemVersion', + scopedSlots: { customRender: 'systemVersion' } + }, + { + title: '寮傚父鐘舵��', + align: 'center', + width: 100, + dataIndex: 'deviceAbnormalStatus', + scopedSlots: { customRender: 'deviceAbnormalStatus' } }, { title: '鎿嶄綔', diff --git a/src/views/mdc/base/OEEAnalysis.vue b/src/views/mdc/base/OEEAnalysis.vue index d75d4e4..7586c9e 100644 --- a/src/views/mdc/base/OEEAnalysis.vue +++ b/src/views/mdc/base/OEEAnalysis.vue @@ -5,7 +5,7 @@ <a-col :md="5"> <a-tabs :activeKey="activeKey" @change="tabChange"> <a-tab-pane key="1" tab="杞﹂棿灞傜骇" force-render> - <base-tree @getCurrSelected="changeSelectionNode"></base-tree> + <base-tree @getCurrSelected="changeSelectionNode" :filterAbnormalDeviceKey="'1'"></base-tree> </a-tab-pane> <a-tab-pane v-if="isDepartType == 0" key="2" tab="閮ㄩ棬灞傜骇"> <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree> diff --git a/src/views/mdc/base/modules/EquipmentList/UserModal.vue b/src/views/mdc/base/modules/EquipmentList/UserModal.vue index b46e6c4..d393663 100644 --- a/src/views/mdc/base/modules/EquipmentList/UserModal.vue +++ b/src/views/mdc/base/modules/EquipmentList/UserModal.vue @@ -25,12 +25,12 @@ <a-form-model-item label="缁熶竴缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> <a-input-search :readOnly="true" v-model="model.equipmentId" - :disabled="disSeach" @search="deviceSearch" enter-button placeholder='璇烽�夋嫨缁熶竴缂栫爜' /> + :disabled="disSeach" @search="deviceSearch" enter-button placeholder='璇烽�夋嫨缁熶竴缂栫爜'/> </a-form-model-item> </a-col> <a-col :span="12"> <a-form-model-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentName"> - <a-input allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" + <a-input allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName"/> </a-form-model-item> </a-col> @@ -38,8 +38,11 @@ <a-row :gutter="24"> <a-col :span="12"> - <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled"> - <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" @back="backDepartInfo" :backDepart="true" :treeOpera="true"></j-select-equipment-depart> + <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" + v-show="!departDisabled"> + <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" + @back="backDepartInfo" :backDepart="true" + :treeOpera="true"></j-select-equipment-depart> </a-form-model-item> <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> @@ -53,9 +56,12 @@ </a-form-model-item> </a-col> <a-col :span="12"> - <a-form-model-item label="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled" ref="selectedProduction" prop="selectedProduction"> + <a-form-model-item label="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled" + ref="selectedProduction" prop="selectedProduction"> <!--<j-select-equipment-production v-decorator="['selectedProduction',{rules:[{required:true,message:'璇烽�夋嫨杞﹂棿!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>--> - <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production> + <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" + @back="backProductionInfo" :backProduction="true" + :treeProductOpera="true"></j-select-equipment-production> </a-form-model-item> </a-col> @@ -67,13 +73,13 @@ v-model="model.systemVersion"/> </a-form-model-item> <a-form-model-item v-if="isDepartType == 0" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷" - :triggerChange="true" - v-model="model.equipmentType"> - <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'> - {{item.equipmentTypeName}} - </a-select-option> - </a-select> + <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷" + :triggerChange="true" + v-model="model.equipmentType"> + <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'> + {{item.equipmentTypeName}} + </a-select-option> + </a-select> </a-form-model-item> </a-col> @@ -119,23 +125,48 @@ <a-row :gutter="24"> <a-col :span="12"> <a-form-model-item label="绯荤粺绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type" v-model="model.systemType" allow-clear/> + <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type" + v-model="model.systemType" allow-clear/> </a-form-model-item> </a-col> <a-col :span="12"> - <a-form-model-item label="璁惧绾у埆" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="model.deviceLevel" allow-clear/> + <a-form-model-item label="寮傚父鐘舵��" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧寮傚父鐘舵��" dictCode="device_abnormal_status" + v-model="model.deviceAbnormalStatus" allow-clear :defaultValue="1"/> </a-form-model-item> </a-col> </a-row> <a-row :gutter="24"> + <!--<a-col :span="12">--> + <!--<a-form-model-item label="璁惧绉嶇被" :labelCol="labelCol" :wrapperCol="wrapperCol">--> + <!--<j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory"--> + <!--allow-clear/>--> + <!--</a-form-model-item>--> + <!--</a-col>--> <a-col :span="12"> - <a-form-model-item label="璁惧绉嶇被" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory" allow-clear/> + <a-form-model-item label="璁惧绾у埆" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-dict-select-tag @change="handleDeviceLevelChange" placeholder="璇烽�夋嫨璁惧绾у埆" + dictCode="device_level" + v-model="model.deviceLevel" allow-clear/> </a-form-model-item> </a-col> - <a-col :span="12"> + <a-col :span="12" v-if="model.deviceLevel==='A'"> + <a-form-model-item label="閲嶈绋嬪害" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" dictCode="device_importance_level" + v-model="model.deviceImportanceLevel" allow-clear/> + </a-form-model-item> + </a-col> + <a-col :span="12" v-else> + <a-form-model-item label="鎺掑簭" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ帓搴�" + v-model="model.sortNo" style="width: 100%"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="12" v-if="model.deviceLevel==='A'"> <a-form-model-item label="鎺掑簭" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ帓搴�" v-model="model.sortNo" style="width: 100%"/> @@ -179,128 +210,129 @@ import pick from 'lodash.pick' import moment from 'moment' import Vue from 'vue' - import { ACCESS_TOKEN } from "@/store/mutation-types" + import { ACCESS_TOKEN } from '@/store/mutation-types' import { getAction } from '@/api/manage' - import { addEquipment,editEquipment,queryUserRole,queryall } from '@/api/api' - import { disabledAuthFilter } from "@/utils/authFilter" + import { addEquipment, editEquipment, queryUserRole, queryall } from '@/api/api' + import { disabledAuthFilter } from '@/utils/authFilter' import { duplicateCheck } from '@/api/api' import JSelectEquipmentProduction from '../../../../../components/jeecgbiz/JSelectEquipmentProduction' import JSelectProduction from '../../../../../components/jeecgbiz/JSelectProduction' import DeviceListModel from './DeviceListModal' import JSelectEquipmentDepart from '../../../../../components/jeecgbiz/JSelectEquipmentDepart' - import AFormModelItem from 'ant-design-vue/es/form-model/FormItem' - import {mapActions} from 'vuex' + import { mapActions } from 'vuex' + export default { - name: "UserModal", + name: 'UserModal', components: { - AFormModelItem, JSelectProduction, JSelectEquipmentDepart, JSelectEquipmentProduction, DeviceListModel }, - data () { + data() { return { - disSeach:false, + disSeach: false, departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰 productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰 roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰 - modalWidth:800, - drawerWidth:700, - modaltoggleFlag:true, + modalWidth: 800, + drawerWidth: 700, + modaltoggleFlag: true, confirmDirty: false, - userId:"", //淇濆瓨鐢ㄦ埛id + userId: '', //淇濆瓨鐢ㄦ埛id // disableSubmit:false, disableSubmit: true, - dateFormat:"YYYY-MM-DD", + dateFormat: 'YYYY-MM-DD', form: this.$form.createForm(this), - validatorRules:{ + validatorRules: { // equipmentId: [{required: false, message: '璇烽�夋嫨璁惧缂栧彿!'}, {validator: this.validatequipmentId}], equipmentId: [ { - required: true, message: '璇烽�夋嫨璁惧缂栧彿!' - }, + required: true, message: '璇烽�夋嫨璁惧缂栧彿!' + } ], equipmentName: [ { required: true, message: '璇疯緭鍏ヨ澶囧悕绉�!' - }, + } ], equipmentModel: [ { required: true, message: '璇疯緭鍏ヨ澶囧瀷鍙�!' - }, + } ], selectedProduction: [ { - required:true,message: '璇烽�夋嫨杞﹂棿' + required: true, message: '璇烽�夋嫨杞﹂棿' } ] }, - departIdShow:false, - title:"鎿嶄綔", + departIdShow: false, + title: '鎿嶄綔', visible: false, model: { - equipmentId: "", - equipmentName: "", - equipmentModel: "", - equipmentIp: "", - dataPort: "", - driveType: "", - systemType: "", - deviceLevel: "", - deviceCategory: "" + equipmentId: '', + equipmentName: '', + equipmentModel: '', + equipmentIp: '', + dataPort: '', + driveType: '', + systemType: '', + deviceLevel: '', + deviceAbnormalStatus: '' + // deviceCategory: '' }, labelCol: { xs: { span: 24 }, - sm: { span: 8 }, + sm: { span: 8 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 15 }, + sm: { span: 15 } }, - uploadLoading:false, + uploadLoading: false, confirmLoading: false, - headers:{}, + headers: {}, url: { - fileUpload: window._CONFIG['domianURL']+"/sys/common/upload", - userWithDepart: "/mdc/mdcEquipment/equipmentDepartList", // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url + fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload', + userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url //寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬭溅闂翠俊鎭渶瑕佺殑url userProductionList: '/mdc/mdcEquipment/equipmentProductionList', - userId:"/sys/user/generateUserId", // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url - syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//鍚屾鐢ㄦ埛鍒板伐浣滄祦 + userId: '/sys/user/generateUserId', // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url + syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//鍚屾鐢ㄦ埛鍒板伐浣滄祦 queryTenantList: '/sys/tenant/queryList', - check:'/sys/duplicate/check', - queryEquipmentType:'/mdc/mdcEquipmentType/queryEquipmentType' + check: '/sys/duplicate/check', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' }, tenantsOptions: [], - rolesOptions:[], - nextDepartOptions:[], - nextProductionOptions:[], - selectList:[], - isDepartType:'' + rolesOptions: [], + nextDepartOptions: [], + nextProductionOptions: [], + selectList: [], + isDepartType: '' } }, - created () { - const token = Vue.ls.get(ACCESS_TOKEN); - this.headers = {"X-Access-Token":token} + created() { + const token = Vue.ls.get(ACCESS_TOKEN) + this.headers = { 'X-Access-Token': token } this.queryGroup() this.queryTreeData() // this.initRoleList() // this.initTenantList() }, - computed:{ - uploadAction:function () { - return this.url.fileUpload; + computed: { + uploadAction: function() { + return this.url.fileUpload } }, methods: { + moment, ...mapActions(['QueryDepartTree']), queryTreeData() { this.QueryDepartTree().then(res => { @@ -309,11 +341,11 @@ } else { // this.$message.warn(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } - }).finally(() =>{ + }).finally(() => { }) }, queryGroup() { @@ -326,9 +358,9 @@ } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -336,16 +368,16 @@ }, getDeviceRows(val) { console.log(val) - if(val.equipmentid ){ + if (val.equipmentid) { this.removeValidate() this.model.equipmentId = val.equipmentid this.model.equipmentName = val.equipmentname - this.model.equipmentModel = val.equipmentmodel - this.model.equipmentIp = val.equipmentip - this.model.dataPort = val.dataport - this.model.driveType = val.drivetype - this.model.controlSystem = val.controlsystem - this.model.saveTableName = val.savetablename + this.model.equipmentModel = val.equipmentmodel + this.model.equipmentIp = val.equipmentip + this.model.dataPort = val.dataport + this.model.driveType = val.drivetype + this.model.controlSystem = val.controlsystem + this.model.saveTableName = val.savetablename // setTimeout(() =>{ // this.form.setFieldsValue({ // equipmentId: val.equipmentid, @@ -365,66 +397,79 @@ this.$refs.deviceListModel.title = '閫夋嫨璁惧' this.$refs.deviceListModel.disableSubmit = false }, - add () { + add() { // this.form.resetFields() // this.$refs.formModel.resetFields() - this.refresh(); + this.refresh() - this.edit({activitiSync:'1',userIdentity:1,equipmentId:"",equipmentName:"",equipmentModel:"",equipmentIp:'',dataPort:"",driveType:"",controlSystem:"",saveTableName:""}); + this.edit({ + activitiSync: '1', + userIdentity: 1, + equipmentId: '', + equipmentName: '', + equipmentModel: '', + equipmentIp: '', + dataPort: '', + driveType: '', + controlSystem: '', + saveTableName: '', + deviceImportanceLevel: '', + deviceAbnormalStatus: 1 + }) }, - edit (record) { - let that = this; - that.visible = true; + edit(record) { + let that = this + that.visible = true //鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害 - this.resetScreenSize(); + this.resetScreenSize() // that.userId = record.id; // console.log(record) - that.model = Object.assign({}, record); + that.model = Object.assign({}, record) // that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record); // this.model = Object.assign({}, record) this.$nextTick(() => { this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', - 'driveType', 'sortNo', 'remark','systemVersion','devicePower','controlSystem','saveTableName')) + 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName')) }) - if(record.hasOwnProperty("id")){ + if (record.hasOwnProperty('id')) { // that.getUserRoles(record.id); - that.getUserDeparts(record.id); + that.getUserDeparts(record.id) } // console.log('that.model=',that.model) }, - isDisabledAuth(code){ - return disabledAuthFilter(code); + isDisabledAuth(code) { + return disabledAuthFilter(code) }, //绐楀彛鏈�澶у寲鍒囨崲 - toggleScreen(){ - if(this.modaltoggleFlag){ - this.modalWidth = window.innerWidth; - }else{ - this.modalWidth = 800; + toggleScreen() { + if (this.modaltoggleFlag) { + this.modalWidth = window.innerWidth + } else { + this.modalWidth = 800 } - this.modaltoggleFlag = !this.modaltoggleFlag; + this.modaltoggleFlag = !this.modaltoggleFlag }, // 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄 - resetScreenSize(){ - let screenWidth = document.body.clientWidth; - if(screenWidth < 500){ - this.drawerWidth = screenWidth; - }else{ - this.drawerWidth = 700; + resetScreenSize() { + let screenWidth = document.body.clientWidth + if (screenWidth < 500) { + this.drawerWidth = screenWidth + } else { + this.drawerWidth = 700 } }, - getUserDeparts(userid){ - let that = this; + getUserDeparts(userid) { + let that = this //閮ㄩ棬鐨剈rl - getAction(that.url.userWithDepart,{equipmentId:userid}).then((res)=>{ - if(res.success){ + getAction(that.url.userWithDepart, { equipmentId: userid }).then((res) => { + if (res.success) { // console.log(res.result) - let departOptions=[]; - let selectDepartKeys=[] + let departOptions = [] + let selectDepartKeys = [] for (let i = 0; i < res.result.length; i++) { - selectDepartKeys.push(res.result[i].key); + selectDepartKeys.push(res.result[i].key) //鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗� departOptions.push({ value: res.result[i].key, @@ -432,22 +477,22 @@ }) } - that.model.selectedDeparts = selectDepartKeys.join(",") + that.model.selectedDeparts = selectDepartKeys.join(',') // that.model.selectedProduction = selectDepartKeys.join(",") - that.nextDepartOptions=departOptions; + that.nextDepartOptions = departOptions // console.log('that.nextDepartOptions=',that.nextDepartOptions) } }) - getAction(that.url.userProductionList,{equipmentId:userid}).then((res)=>{ - if(res.success){ + getAction(that.url.userProductionList, { equipmentId: userid }).then((res) => { + if (res.success) { // console.log(res.result) - let ProductionOptions=[]; - let selectProductKeys=[] + let ProductionOptions = [] + let selectProductKeys = [] // console.log(res.result) for (let i = 0; i < res.result.length; i++) { - selectProductKeys.push(res.result[i].key); + selectProductKeys.push(res.result[i].key) //鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗� ProductionOptions.push({ value: res.result[i].key, @@ -455,9 +500,9 @@ }) } - that.model.selectedProduction = selectProductKeys.join(",") + that.model.selectedProduction = selectProductKeys.join(',') - that.nextProductionOptions=ProductionOptions; + that.nextProductionOptions = ProductionOptions // console.log('that.nextProductionOptions=',that.nextProductionOptions) } }) @@ -465,169 +510,109 @@ }, backDepartInfo(info) { // console.log(info) - this.model.departIds = this.model.selectedDeparts; - this.nextDepartOptions = info.map((item,index,arr)=>{ - let c = {label:item.text, value: item.value+""} - return c; + this.model.departIds = this.model.selectedDeparts + this.nextDepartOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c }) }, backProductionInfo(info) { // console.log(info) - this.model.productionIds = this.model.selectedProduction; - this.nextProductionOptions = info.map((item,index,arr)=>{ - let c = {label:item.text, value: item.value+""} - return c; + this.model.productionIds = this.model.selectedProduction + this.nextProductionOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c }) }, - - refresh () { - this.userId="" - this.nextDepartOptions=[]; - this.nextProductionOptions = []; - this.departIdShow=false; - }, - close () { - this.$emit('close'); - this.visible = false; - this.disableSubmit = false; - this.nextDepartOptions=[]; + refresh() { + this.userId = '' + this.nextDepartOptions = [] this.nextProductionOptions = [] - this.departIdShow=false; + this.departIdShow = false + }, + close() { + this.$emit('close') + this.visible = false + this.disableSubmit = false + this.nextDepartOptions = [] + this.nextProductionOptions = [] + this.departIdShow = false // this.$refs.form.resetFields(); }, - moment, - handleSubmit () { - const that = this; + handleDeviceLevelChange() { + this.model.deviceImportanceLevel = '' + }, + handleSubmit() { + const that = this // 瑙﹀彂琛ㄥ崟楠岃瘉 this.$refs.form.validate(valid => { if (valid) { - that.confirmLoading = true; + that.confirmLoading = true //濡傛灉鏄笂绾ф嫨浼犲叆departIds,鍚﹀垯涓虹┖ // if(this.model.userIdentity!==2){ // this.model.departIds=""; // } - let obj; - if(!this.model.id){ - this.model.id = this.userId; - obj=addEquipment(this.model); - }else{ - obj=editEquipment(this.model,{ - id: this.model.id - }); + let obj + if (!this.model.id) { + this.model.id = this.userId + obj = addEquipment(this.model) + } else { + obj = editEquipment(this.model, { + id: this.model.id + }) } - obj.then((res)=>{ - if(res.success){ + obj.then((res) => { + if (res.success) { // that.$message.success(res.message); that.$notification.success({ - message:'娑堟伅', - description:res.message - }); - that.$emit('ok'); - }else{ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + } else { // that.$message.warning(res.message); that.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { - that.confirmLoading = false; - that.close(); + that.confirmLoading = false + that.close() }) - }else{ - return false; + } else { + return false } }) }, - // handleSubmit () { - // const that = this; - // // 瑙﹀彂琛ㄥ崟楠岃瘉 - // this.form.validateFields((err,values) => { - // if (!err) { - // that.confirmLoading = true; - // let formData = Object.assign(this.model, values) - // let obj; - // if(!this.model.id){ - // // this.model.id = this.userId; - // this.form.resetFields() - // obj=addEquipment(formData); - // }else{ - // this.form.resetFields() - // obj=editEquipment(formData); - // // this.$nextTick(() => { - // // this.form.setFieldsValue(pick(this.model, 'tierType', 'parentName', 'tierNumber', 'tierName', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort', - // // 'driveType', 'controlSystem', 'sortNo', 'remark','systemVersion','devicePower')) - // // }) - // // obj=editEquipment(formData,{ - // // id: this.model.id - // // }); - // } - // obj.then((res)=>{ - // if(res.success){ - // that.$message.success(res.message); - // that.$emit('ok'); - // }else{ - // that.$message.warning(res.message); - // } - // }).finally(() => { - // that.confirmLoading = false; - // that.close(); - // }) - // }else{ - // return false; - // } - // }) - // }, - - // validatequipmentId(rule, value, callback){ - // if(!value){ - // callback() - // }else{ - // console.log(1111111111111111) - // var params = { - // tableName: 'mdc_equipment', - // fieldName: 'equipment_id', - // fieldVal: value, - // // dataId: this.userId - // }; - // duplicateCheck(params).then((res) => { - // if (res.success) { - // callback() - // } else { - // callback("璁惧缂栧彿宸插瓨鍦�!") - // } - // }) - // - // } - // }, - handleConfirmBlur(e) { - const value = e.target.value; + const value = e.target.value this.confirmDirty = this.confirmDirty || !!value }, - identityChange(e){ - if(e.target.value===1){ - this.departIdShow=false; - }else{ - this.departIdShow=true; + identityChange(e) { + if (e.target.value === 1) { + this.departIdShow = false + } else { + this.departIdShow = true } }, /** * 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉 */ - removeValidate(){ + removeValidate() { this.$refs.form.clearValidate() } - }, + } } </script> <style scoped> .avatar-uploader > .ant-upload { - width:104px; - height:104px; + width: 104px; + height: 104px; } + .ant-upload-select-picture-card i { font-size: 49px; color: #999; @@ -638,9 +623,9 @@ color: #666; } - .ant-table-tbody .ant-table-row td{ - padding-top:10px; - padding-bottom:10px; + .ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; } .drawer-bottom-button { diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue index 0833281..52d0796 100644 --- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue +++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue @@ -21,7 +21,7 @@ </a-select> </a-form-item> </a-col> - <a-col :md="5" :sm="5" :xs="5"> + <a-col :md="6" :sm="6" :xs="6"> <a-form-item label="椹卞姩绫诲瀷"> <a-select :value="queryParams.driveType" @@ -37,20 +37,16 @@ </a-select> </a-form-item> </a-col> - <a-col :md="4" :sm="4" :xs="4"> - <a-form-item label="璁惧绾у埆"> - <a-select - :value="queryParams.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-col :md="5" :sm="5" :xs="5"> + <a-form-item label="鏃堕棿"> + <a-range-picker + :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']" + format="YYYY-MM" + :value="dates" + :mode="['month', 'month']" + @panelChange="dateParamChange" + @change="handleDateChange" + /> </a-form-item> </a-col> <a-col :md="5" :sm="5" :xs="5"> @@ -69,19 +65,68 @@ </a-select> </a-form-item> </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-range-picker - :placeholder="['寮�濮嬫椂闂�', '缁撴潫鏃堕棿']" - format="YYYY-MM" - :value="dates" - :mode="['month', 'month']" - @panelChange="dateParamChange" - @change="handleDateChange" - /> + <a-form-item label="璁惧绾у埆"> + <a-select + :value="queryParams.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--> + <!--:value="queryParams.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 + :value="queryParams.deviceImportanceLevel" + mode="multiple" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceImportanceLevel')" + > + <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" style="margin-bottom: 20px"> @@ -106,7 +151,7 @@ :loading="tableLoading" :pagination="false" :scroll="{x:'max-content',y:scrollY}" bordered> <!--<template slot="equipmentModel" slot-scope="text, record">--> - <!--<editable-cell :text="text" @change="onCellChange(record.id, 'equipmentModel', $event)"/>--> + <!--<editable-cell :text="text" @change="onCellChange(record.id, 'equipmentModel', $event)"/>--> <!--</template>--> </a-table> </div> @@ -138,7 +183,7 @@ export default { name: 'OEEAnalysisList', - components: { }, + components: {}, data() { return { dates: [moment().subtract('month', 1), moment().subtract('month', 1)], @@ -150,7 +195,8 @@ equipmentType: [], driveType: [], deviceLevel: [], - deviceCategory: [] + deviceCategory: [], + deviceImportanceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -352,7 +398,8 @@ device_level_list: [], device_category_list: [], scrollY: 465, - tableLoading: false + tableLoading: false, + toggleSearchStatus: false } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -373,6 +420,7 @@ this.queryGroup() this.initDictData('device_level') this.initDictData('device_category') + this.initDictData('device_importance_level') }, mounted() { window.addEventListener('resize', this.handleWindowResize) diff --git a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue index 8253a9b..1a46371 100644 --- a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -21,7 +21,7 @@ </a-select> </a-form-item> </a-col> - <a-col :md="5" :sm="5"> + <a-col :md="6" :sm="6"> <a-form-item label="椹卞姩绫诲瀷"> <a-select :value="queryParams.driveType" @@ -37,11 +37,41 @@ </a-select> </a-form-item> </a-col> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-form-item label="鏃堕棿"> - <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" :allowClear="false"/> + <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" + :allowClear="false"/> </a-form-item> </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绉嶇被"> + <a-select + :value="queryParams.deviceCategory" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绉嶇被" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceCategory')" + > + <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </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 @@ -58,23 +88,25 @@ </a-select> </a-form-item> </a-col> - <a-col :md="4" :sm="4" :xs="4"> - <a-form-item label="璁惧绉嶇被"> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceCategory" + :value="queryParams.deviceImportanceLevel" mode="multiple" - placeholder="璇烽�夋嫨璁惧绉嶇被" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" allow-clear :maxTagCount="1" - @change="selectChange($event,'deviceCategory')" + @change="selectChange($event,'deviceImportanceLevel')" > - <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + <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" type="flex" align="middle"> <a-col :md="24" :sm="24" :xs="24" style="display: flex;justify-content: space-between;align-items: flex-start"> @@ -104,18 +136,25 @@ </a-row> </a-form> </div> + <a-spin :spinning="spinning"> - <div class="container" id="EfficiencyPO" style="margin-top: 20px;" > + <div class="container" id="EfficiencyPO" style="margin-top: 20px;"> <div class="table2"> - <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" style="white-space: nowrap" v-if="dataList.length>0"> + <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" style="white-space: nowrap" + v-if="dataList.length>0"> <thead> <tr class="thead fixed equipname"> - <th class="thgu dong1 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;height: 66px">鍏徃</th> - <th class="thgu dong2 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">杞﹂棿</th> - <th class="thgu dong3 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">宸ユ</th> - <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧缂栧彿</th> - <th class="thgu dong5 name" rowspan="2" style="min-width: 162px; max-width: 162px;width: 162px;">璁惧鍚嶇О</th> - <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷</th> + <th class="thgu dong1 name" rowspan="2" + style="min-width: 50px; max-width: 50px;width: 50px;height: 66px">鍏徃 + </th> + <th class="thgu dong2 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">杞﹂棿</th> + <th class="thgu dong3 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">宸ユ</th> + <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧缂栧彿 + </th> + <th class="thgu dong5 name" rowspan="2" style="min-width: 162px; max-width: 162px;width: 162px;">璁惧鍚嶇О + </th> + <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷 + </th> <!--<th rowspan="2">缁勫埆</th>--> <template v-for="(tableHead, index) in tableHeads"> <th class="timeth" :colspan="checkedList.length">{{tableHead}}</th> @@ -135,31 +174,38 @@ <tbody> <tr class="mathData" v-for="(item, index) in dataList"> <template v-if="item.level1!=='鍚堣'&&item.level1!=='骞冲潎鍊�'"> - <td class="tdgu kaitou" :rowspan="item.level1span" :class="{hidden: item.level1dis,noExl:item.level1dis}" v-show="!item.level1dis"> + <td class="tdgu kaitou" :rowspan="item.level1span" + :class="{hidden: item.level1dis,noExl:item.level1dis}" v-show="!item.level1dis"> <div class="wenzi"> {{item.level1}} </div> </td> - <td class="tdgu1 kaitou" :rowspan="item.level2span" :class="{hidden: item.level2dis,noExl:item.level2dis}" v-show="!item.level2dis"> + <td class="tdgu1 kaitou" :rowspan="item.level2span" + :class="{hidden: item.level2dis,noExl:item.level2dis}" v-show="!item.level2dis"> <div class="wenzi"> {{item.level2}} </div> </td> - <td class="tdgu2 kaitou" :rowspan="item.level3span" :class="{hidden: item.level3dis,noExl:item.level3dis}" v-show="!item.level3dis"> + <td class="tdgu2 kaitou" :rowspan="item.level3span" + :class="{hidden: item.level3dis,noExl:item.level3dis}" v-show="!item.level3dis"> <div class="wenzi"> {{item.level3}} </div> </td> - <td class="tdgu3 kaitou">{{item.equipmentId}}</td> - <td style="min-width: 162px; max-width: 162px;width: 162px;" class="tdgu4 kaitou">{{item.equipmentName}}</td> - <td class="tdgu5 kaitou">{{item.equipmentType}}</td> + <td class="tdgu3 kaitou">{{item.equipmentId}}</td> + <td style="min-width: 162px; max-width: 162px;width: 162px;" class="tdgu4 kaitou"> + {{item.equipmentName}} + </td> + <td class="tdgu5 kaitou">{{item.equipmentType}}</td> </template> <template v-else> <td colspan="6" class="tdgu kaitou">{{item.level1}}</td> </template> <template v-for="(tableHead, index) in item.dataList"> - <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('lyl') > -1">{{tableHead.startRate | numFilter}}</td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('lyl') > -1"> + {{tableHead.startRate | numFilter}} + </td> <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjl') > -1"> {{tableHead.openRate | numFilter}} </td> @@ -187,541 +233,543 @@ </template> <script> -import moment from 'moment' -import { putAction, getAction } from '@/api/manage' -import $ from 'jquery' -import '@/components/table2excel/table2excel' -import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' -import api from '@/api/mdc' + import moment from 'moment' + import { putAction, getAction } from '@/api/manage' + import $ from 'jquery' + import '@/components/table2excel/table2excel' + import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' + import api from '@/api/mdc' -export default { - name: 'EfficiencyPOList', - components: {}, - data() { - return { - typeTree:"", - typeParent:1, - typeEquipment:1, - dates: [], - equipmentTypeList:[], - driveTypeList:[], - device_level_list: [], - device_category_list: [], - queryParam: {}, - queryParams: { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [] - }, - queryParamEquip:{}, - queryParamPeople:{}, - identifying: [], - efficiencyOptions: [ - { label: '寮�鍔ㄧ巼', value: 'lyl' }, - { label: '寮�鏈虹巼', value: 'kjl' }, - { label: '寮�鏈烘椂闂�', value: 'kjsj' }, - { label: '鍔犲伐鏃堕棿', value: 'jgsj' }, - { label: '寰呮満鏃堕棿', value: 'djsj' }, - { label: '鍏虫満鏃堕棿', value: 'gjsj' } - ], - checkedList: ['lyl'], - dataList: [], - url: { - list: '/mdc/efficiencyReport/efficiencyPOList', - listByType: '/mdc/MdcUtilizationRate/getByType', - queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' - }, - tableHeads: [], - spinning:false - } - }, - props: { nodeTree: '', Type:'',nodePeople: ''}, - created() { - this.showIdentifying() - this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] - this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') - this.queryParam.typeTree = "1" - this.loadData() - this.queryGroup() - this.getDriveTypeByApi() - this.initDictData('device_level') - this.initDictData('device_category') - }, - mounted() { - window.addEventListener('resize', this.handleWindowResize) - this.handleWindowResize() - }, - watch: { - Type(valmath){ - this.dataList = []; - this.queryParam.typeTree = valmath - }, - nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 - if (JSON.stringify(val) != '{}') { - if (val.equipmentId != null) { - this.queryParamEquip.parentId = '' - this.queryParamEquip.equipmentId = val.equipmentId - } else { - this.queryParamEquip.parentId = val.key - this.queryParamEquip.equipmentId = '' - } - this.searchQuery() + export default { + name: 'EfficiencyPOList', + components: {}, + data() { + return { + typeTree: '', + typeParent: 1, + typeEquipment: 1, + dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_category_list: [], + queryParam: {}, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], + deviceCategory: [], + deviceImportanceLevel: [] + }, + queryParamEquip: {}, + queryParamPeople: {}, + identifying: [], + efficiencyOptions: [ + { label: '寮�鍔ㄧ巼', value: 'lyl' }, + { label: '寮�鏈虹巼', value: 'kjl' }, + { label: '寮�鏈烘椂闂�', value: 'kjsj' }, + { label: '鍔犲伐鏃堕棿', value: 'jgsj' }, + { label: '寰呮満鏃堕棿', value: 'djsj' }, + { label: '鍏虫満鏃堕棿', value: 'gjsj' } + ], + checkedList: ['lyl'], + dataList: [], + url: { + list: '/mdc/efficiencyReport/efficiencyPOList', + listByType: '/mdc/MdcUtilizationRate/getByType', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + }, + tableHeads: [], + spinning: false, + toggleSearchStatus: false } }, - nodePeople(val){ - if (JSON.stringify(val) != '{}') { - if (val.equipmentId != null) { - this.queryParamPeople.parentId = val.equipmentId - this.queryParamPeople.equipmentId = '' - } else { - this.queryParamPeople.parentId = val.key - this.queryParamPeople.equipmentId = '' - } - this.searchQuery() - } - } - }, - filters: { - numFilter(value) { - if (value) { - return parseFloat((value * 100).toFixed(2)) - } else { - return '0' - } - }, - - /** - * 鏍煎紡鍖栨椂闂� - * @param seconds 绉掓暟 - * @returns '' 鏍煎紡鍖栧悗鏃堕棿瀛楃涓� - */ - getFormattedTime(seconds) { - if (seconds) { - return parseFloat((seconds / 3600).toFixed(2)) - } else { - return '0' - } - }, - }, - methods: { - 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 - } - }) - }, - selectChange(value, key) { - this.queryParams[key] = value - }, - checkSameData(dataList){ - let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 - let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� - dataList.map((item,index)=>{ - let level1 = item.level1; - let _index = cache[level1]; - if(_index!==undefined){ - indices[_index].push(index) - }else{ - cache[level1] = indices.length - indices.push([index]) - } - }) - let result = []; - indices.map((item)=>{ - item.map((index)=>{ - result.push(dataList[index]) - }) - }) - this.dataList = result - }, - checkSameData1(dataList){ - let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 - let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� - dataList.map((item,index)=>{ - let level2 = item.level2; - let _index = cache[level2]; - if(_index!==undefined){ - indices[_index].push(index) - }else{ - cache[level2] = indices.length - indices.push([index]) - } - }) - let result = []; - indices.map((item)=>{ - item.map((index)=>{ - result.push(dataList[index]) - }) - }) - this.dataList = result - }, - checkSameData2(dataList){ - let cache = {}; //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 - let indices = []; //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� - dataList.map((item,index)=>{ - let level3 = item.level3; - let _index = cache[level3]; - if(_index!==undefined){ - indices[_index].push(index) - }else{ - cache[level3] = indices.length - indices.push([index]) - } - }) - let result = []; - indices.map((item)=>{ - item.map((index)=>{ - result.push(dataList[index]) - }) - }) - this.dataList = result - }, - // 鍚堝苟 - combineCell() { - console.log(this.dataList) - let list =this.dataList; - for (let field in list[0]) { - var k = 0; - while (k < list.length) { - list[k][field + 'span'] = 1; - list[k][field + 'dis'] = false; - for (var i = k + 1; i <= list.length - 1; i++) { - if (list[k][field] == list[i][field] && list[k][field] != '') { - list[k][field + 'span']++; - list[k][field + 'dis'] = false; - list[i][field + 'span'] = 1; - list[i][field + 'dis'] = true; - } else { - break; - } - } - k = i; - } - } - return list; - }, - disabledDate(current){ - //Can not slect days before today and today - return current && current > moment().subtract('days', 1); - }, - initDeviceType(deviceList) { - let dictCode = 'mdc_equipmentType' - let items = [] - items = getDictItemsFromCache(dictCode) - if (deviceList && items.length > 0) { - for (let a = 0; a < deviceList.length; a++) { - if (items && items.length > 0) { - for (let i = 0; i < items.length; i++) { - if (deviceList[a].equipmentType == items[i].value) { - deviceList[a].equipmentType = items[i].title - } - } - } else { - ajaxGetDictItems(dictCode, null).then((res) => { - if (res.success) { - let items = res.result - for (let i = 0; i < items.length; i++) { - if (deviceList[a].equipmentType == items[i].value) { - deviceList[a].equipmentType = items[i].title - } - } - } - }) - } - } - } - }, - exportExcel() { - $("#EfficiencyPO").table2excel({ - exclude: ".noExl", - name: "Excel Document Name", - filename: "璁惧寮�鍔ㄧ巼", - exclude_img: true, - fileext: ".xls", - exclude_links: true, - exclude_inputs: true - }); - }, - showIdentifying() { - getAction(this.url.listByType, { type: 'kdl' }).then(res => { - if (res.success) { - this.identifying = res.result - } - }) - }, - dateParamChange(v1, v2) { - this.queryParam.startTime = v2[0] - this.queryParam.endTime = v2[1] - // 鐐瑰嚮鏃堕棿閫夋嫨鍣ㄧ殑娓呯┖鎸夐挳鏃朵細瑙﹀彂姝ゅ垽鏂�(鐐瑰嚮閲嶇疆鎸夐挳涓嶄細瑙﹀彂)锛屽疄鐜伴噸缃垪琛ㄥ姛鑳斤紝鍒囧疄鏀瑰彉鍒楄〃鏄剧ず鏁堟灉 - if(!this.queryParam.startTime&&!this.queryParam.endTime)this.searchReset() - }, - efficiencyOptionsOnChange(checkedList) { - // let index = checkedList.indexOf('lyl') - // if (index < 0) { - // // this.$message.warn('涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�') - // this.$notification.warning({ - // message:'娑堟伅', - // description:"涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�" - // }) - // return false - // } - this.checkedList = checkedList - }, - searchQuery() { - if(this.queryParam.typeTree == "1"){ - this.queryParam.parentId = this.queryParamEquip.parentId - this.queryParam.equipmentId = this.queryParamEquip.equipmentId - }else{ - this.queryParam.parentId = this.queryParamPeople.parentId - this.queryParam.equipmentId = "" - } - Object.keys(this.queryParams).forEach(item => { - this.queryParam[item] = this.queryParams[item].join() - // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 - if (this.queryParams[item].length === 0) delete this.queryParam[item] - }) - this.loadData() - }, - searchReset() { - this.typeTree = this.queryParam.typeTree - this.typeParent = this.queryParam.parentId - this.typeEquipment = this.queryParam.equipmentId - this.queryParam = {} - this.queryParam.typeTree = this.typeTree - this.queryParam.parentId = this.typeParent - this.queryParam.equipmentId = this.typeEquipment + props: { nodeTree: '', Type: '', nodePeople: '' }, + created() { + this.showIdentifying() this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') - // this.ipagination.current = 1 - this.queryParams = { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [] - } - this.loadData(); + this.queryParam.typeTree = '1' + this.loadData() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_category') + this.initDictData('device_importance_level') }, - loadData() { - this.spinning=true - this.tableHeads = [] - this.dataList = [] - getAction(this.url.list, this.queryParam).then(res => { - if (res.success) { - // console.log(res.result) - this.tableHeads = res.result.dates - this.dataList = res.result.mdcEfficiencyList - if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) { - this.$notification.info({ + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.handleWindowResize() + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath + }, + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamEquip.parentId = '' + this.queryParamEquip.equipmentId = val.equipmentId + } else { + this.queryParamEquip.parentId = val.key + this.queryParamEquip.equipmentId = '' + } + this.searchQuery() + } + }, + nodePeople(val) { + if (JSON.stringify(val) != '{}') { + if (val.equipmentId != null) { + this.queryParamPeople.parentId = val.equipmentId + this.queryParamPeople.equipmentId = '' + } else { + this.queryParamPeople.parentId = val.key + this.queryParamPeople.equipmentId = '' + } + this.searchQuery() + } + } + }, + filters: { + numFilter(value) { + if (value) { + return parseFloat((value * 100).toFixed(2)) + } else { + return '0' + } + }, + + /** + * 鏍煎紡鍖栨椂闂� + * @param seconds 绉掓暟 + * @returns '' 鏍煎紡鍖栧悗鏃堕棿瀛楃涓� + */ + getFormattedTime(seconds) { + if (seconds) { + return parseFloat((seconds / 3600).toFixed(2)) + } else { + return '0' + } + } + }, + methods: { + 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 + } + }) + }, + selectChange(value, key) { + this.queryParams[key] = value + }, + checkSameData(dataList) { + let cache = {} //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = [] //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item, index) => { + let level1 = item.level1 + let _index = cache[level1] + if (_index !== undefined) { + indices[_index].push(index) + } else { + cache[level1] = indices.length + indices.push([index]) + } + }) + let result = [] + indices.map((item) => { + item.map((index) => { + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + checkSameData1(dataList) { + let cache = {} //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = [] //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item, index) => { + let level2 = item.level2 + let _index = cache[level2] + if (_index !== undefined) { + indices[_index].push(index) + } else { + cache[level2] = indices.length + indices.push([index]) + } + }) + let result = [] + indices.map((item) => { + item.map((index) => { + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + checkSameData2(dataList) { + let cache = {} //瀛樺偍鐨勬槸閿槸kclx 鐨勫�硷紝鍊兼槸kclx 鍦╥ndeces涓暟缁勭殑涓嬫爣 + let indices = [] //鏁扮粍涓瘡涓�涓�兼槸涓�涓暟缁勶紝鏁扮粍涓殑姣忎竴涓厓绱犳槸鍘熸暟缁勪腑鐩稿悓kclx鐨勪笅鏍� + dataList.map((item, index) => { + let level3 = item.level3 + let _index = cache[level3] + if (_index !== undefined) { + indices[_index].push(index) + } else { + cache[level3] = indices.length + indices.push([index]) + } + }) + let result = [] + indices.map((item) => { + item.map((index) => { + result.push(dataList[index]) + }) + }) + this.dataList = result + }, + // 鍚堝苟 + combineCell() { + console.log(this.dataList) + let list = this.dataList + for (let field in list[0]) { + var k = 0 + while (k < list.length) { + list[k][field + 'span'] = 1 + list[k][field + 'dis'] = false + for (var i = k + 1; i <= list.length - 1; i++) { + if (list[k][field] == list[i][field] && list[k][field] != '') { + list[k][field + 'span']++ + list[k][field + 'dis'] = false + list[i][field + 'span'] = 1 + list[i][field + 'dis'] = true + } else { + break + } + } + k = i + } + } + return list + }, + disabledDate(current) { + //Can not slect days before today and today + return current && current > moment().subtract('days', 1) + }, + initDeviceType(deviceList) { + let dictCode = 'mdc_equipmentType' + let items = [] + items = getDictItemsFromCache(dictCode) + if (deviceList && items.length > 0) { + for (let a = 0; a < deviceList.length; a++) { + if (items && items.length > 0) { + for (let i = 0; i < items.length; i++) { + if (deviceList[a].equipmentType == items[i].value) { + deviceList[a].equipmentType = items[i].title + } + } + } else { + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + let items = res.result + for (let i = 0; i < items.length; i++) { + if (deviceList[a].equipmentType == items[i].value) { + deviceList[a].equipmentType = items[i].title + } + } + } + }) + } + } + } + }, + exportExcel() { + $('#EfficiencyPO').table2excel({ + exclude: '.noExl', + name: 'Excel Document Name', + filename: '璁惧寮�鍔ㄧ巼', + exclude_img: true, + fileext: '.xls', + exclude_links: true, + exclude_inputs: true + }) + }, + showIdentifying() { + getAction(this.url.listByType, { type: 'kdl' }).then(res => { + if (res.success) { + this.identifying = res.result + } + }) + }, + dateParamChange(v1, v2) { + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] + // 鐐瑰嚮鏃堕棿閫夋嫨鍣ㄧ殑娓呯┖鎸夐挳鏃朵細瑙﹀彂姝ゅ垽鏂�(鐐瑰嚮閲嶇疆鎸夐挳涓嶄細瑙﹀彂)锛屽疄鐜伴噸缃垪琛ㄥ姛鑳斤紝鍒囧疄鏀瑰彉鍒楄〃鏄剧ず鏁堟灉 + if (!this.queryParam.startTime && !this.queryParam.endTime) this.searchReset() + }, + efficiencyOptionsOnChange(checkedList) { + // let index = checkedList.indexOf('lyl') + // if (index < 0) { + // // this.$message.warn('涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�') + // this.$notification.warning({ + // message:'娑堟伅', + // description:"涓嶈兘鍙栨秷鏌ヨ鍒╃敤鐜�" + // }) + // return false + // } + this.checkedList = checkedList + }, + searchQuery() { + if (this.queryParam.typeTree == '1') { + this.queryParam.parentId = this.queryParamEquip.parentId + this.queryParam.equipmentId = this.queryParamEquip.equipmentId + } else { + this.queryParam.parentId = this.queryParamPeople.parentId + this.queryParam.equipmentId = '' + } + Object.keys(this.queryParams).forEach(item => { + this.queryParam[item] = this.queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (this.queryParams[item].length === 0) delete this.queryParam[item] + }) + this.loadData() + }, + searchReset() { + this.typeTree = this.queryParam.typeTree + this.typeParent = this.queryParam.parentId + this.typeEquipment = this.queryParam.equipmentId + this.queryParam = {} + this.queryParam.typeTree = this.typeTree + this.queryParam.parentId = this.typeParent + this.queryParam.equipmentId = this.typeEquipment + this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] + this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + // this.ipagination.current = 1 + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [], + deviceCategory: [] + } + this.loadData() + }, + loadData() { + this.spinning = true + this.tableHeads = [] + this.dataList = [] + getAction(this.url.list, this.queryParam).then(res => { + if (res.success) { + // console.log(res.result) + this.tableHeads = res.result.dates + this.dataList = res.result.mdcEfficiencyList + if (res.result.mdcEfficiencyList && !res.result.mdcEfficiencyList.length) { + this.$notification.info({ + message: '娑堟伅', + description: '鏆傛棤璇ヨ澶囩被鍨嬫暟鎹�' + }) + } + this.checkSameData(this.dataList) + this.checkSameData1(this.dataList) + this.checkSameData2(this.dataList) + this.combineCell() + // this.initDeviceType(this.dataList) + } + }).finally(() => { + this.spinning = false + }) + }, + 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.$message.warning(res.message) + this.$notification.warning({ message: '娑堟伅', - description: '鏆傛棤璇ヨ澶囩被鍨嬫暟鎹�' + description: res.message }) } - this.checkSameData(this.dataList) - this.checkSameData1(this.dataList) - this.checkSameData2(this.dataList) - this.combineCell(); - // this.initDeviceType(this.dataList) - } - }).finally(()=>{ - this.spinning=false - }) - }, - 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.$message.warning(res.message) - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - this.loading = false - }) - }, + }).finally(() => { + this.loading = false + }) + }, - /** - * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 - */ - getDriveTypeByApi(){ - api.getDriveTypeApi().then((res)=>{ - if (res.success) this.driveTypeList = res.result - }) - }, + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) + }, - /** - * 鍒嗚鲸鐜囨敼鍙樻椂鍚屾椂鏀瑰彉琛ㄦ牸楂樺害宸蹭繚璇侀椤典竴杩涘叆涓嶆嫋鍔ㄥ瀭鐩存粴鍔ㄦ潯鏃跺嵆鍙嫋鍔ㄨ〃鏍兼按骞虫粴鍔ㄦ潯 - */ - handleWindowResize() { - const tableContainer = document.getElementById('EfficiencyPO') // 琛ㄦ牸瀹瑰櫒 - const clientHeight = document.documentElement.clientHeight || document.body.clientHeight // 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� - const containerTopToClientTopHeight = tableContainer.getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� - tableContainer.style.height = (clientHeight - containerTopToClientTopHeight - 32) + 'px' + /** + * 鍒嗚鲸鐜囨敼鍙樻椂鍚屾椂鏀瑰彉琛ㄦ牸楂樺害宸蹭繚璇侀椤典竴杩涘叆涓嶆嫋鍔ㄥ瀭鐩存粴鍔ㄦ潯鏃跺嵆鍙嫋鍔ㄨ〃鏍兼按骞虫粴鍔ㄦ潯 + */ + handleWindowResize() { + const tableContainer = document.getElementById('EfficiencyPO') // 琛ㄦ牸瀹瑰櫒 + const clientHeight = document.documentElement.clientHeight || document.body.clientHeight // 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� + const containerTopToClientTopHeight = tableContainer.getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� + tableContainer.style.height = (clientHeight - containerTopToClientTopHeight - 32) + 'px' + } } } -} </script> <style scoped> -/*table鏍峰紡*/ -.table2{ - width: 100%; - height: 100%; - overflow: auto; -} + /*table鏍峰紡*/ + .table2 { + width: 100%; + height: 100%; + overflow: auto; + } -.table2 thead tr th:first-child, -.table tbody tr .tdgu{ - position: sticky; - left: 0; - z-index: 1; -} + .table2 thead tr th:first-child, + .table tbody tr .tdgu { + position: sticky; + left: 0; + z-index: 1; + } -.table tbody tr .wenzi{ - /*writing-mode: vertical-lr;*/ - /*text-orientation: upright;*/ - transform: rotate(360deg); - writing-mode: vertical-lr; - letter-spacing: 2px; -} + .table tbody tr .wenzi { + /*writing-mode: vertical-lr;*/ + /*text-orientation: upright;*/ + transform: rotate(360deg); + writing-mode: vertical-lr; + letter-spacing: 2px; + } -.table tbody tr .kaitou{ - z-index: 1; - background-color: white; -} + .table tbody tr .kaitou { + z-index: 1; + background-color: white; + } -.table tbody tr .tdgu1{ - position: sticky; - left: 50px; - z-index: 2; -} + .table tbody tr .tdgu1 { + position: sticky; + left: 50px; + z-index: 2; + } -.table tbody tr .tdgu2{ - position: sticky; - left: 100px; - z-index: 2; -} + .table tbody tr .tdgu2 { + position: sticky; + left: 100px; + z-index: 2; + } -.table tbody tr .tdgu3{ - position: sticky; - left: 150px; - z-index: 2; -} + .table tbody tr .tdgu3 { + position: sticky; + left: 150px; + z-index: 2; + } -.table tbody tr .tdgu4{ - position: sticky; - left: 250px; - z-index: 2; -} + .table tbody tr .tdgu4 { + position: sticky; + left: 250px; + z-index: 2; + } -.table tbody tr .tdgu5{ - position: sticky; - left: 412px; - z-index: 2; -} + .table tbody tr .tdgu5 { + position: sticky; + left: 412px; + z-index: 2; + } -.table2 thead tr .timeth, -.table2 thead tr .thgu { - position: sticky; - top:0; - z-index: 3; -} + .table2 thead tr .timeth, + .table2 thead tr .thgu { + position: sticky; + top: 0; + z-index: 3; + } -.table2 thead .gudingth th{ - position: sticky; - top: 32px; - z-index: 2; -} + .table2 thead .gudingth th { + position: sticky; + top: 32px; + z-index: 2; + } -.table2 thead .equipname .name{ - z-index: 3; -} + .table2 thead .equipname .name { + z-index: 3; + } -.table2 thead .equipname .dong1{ - z-index: 4; - left: 0; -} + .table2 thead .equipname .dong1 { + z-index: 4; + left: 0; + } -.table2 thead .equipname .dong2{ - z-index: 5; - left: 50px; -} + .table2 thead .equipname .dong2 { + z-index: 5; + left: 50px; + } + .table2 thead .equipname .dong3 { + z-index: 5; + left: 100px; + } -.table2 thead .equipname .dong3{ - z-index: 5; - left: 100px; -} + .table2 thead .equipname .dong4 { + z-index: 5; + left: 150px; + } -.table2 thead .equipname .dong4{ - z-index: 5; - left: 150px; -} + .table2 thead .equipname .dong5 { + z-index: 5; + left: 250px; + } -.table2 thead .equipname .dong5{ - z-index: 5; - left: 250px; -} + .table2 thead .equipname .dong6 { + z-index: 5; + left: 412px; + } -.table2 thead .equipname .dong6{ - z-index: 5; - left: 412px; -} + #EfficiencyPO { + overflow: hidden; + } -#EfficiencyPO{ - overflow: hidden; -} + .identifyingclass { + width: 55px; + height: 15px; + display: inline-block + } -.identifyingclass { - width: 55px; - height: 15px; - display: inline-block -} + .dataContent { + white-space: nowrap; + /*margin: 0;*/ + border-collapse: separate; + border-spacing: 0; + /*table-layout: fixed;*/ + border: 1px solid #ccc; + /*border: 1px solid #ccc;*/ + width: 100%; + /*height: 100%;*/ + /*overflow: hidden;*/ + /*overflow-y: auto;*/ + text-align: center; + } -.dataContent { - white-space: nowrap; - /*margin: 0;*/ - border-collapse: separate; - border-spacing: 0; - /*table-layout: fixed;*/ - border: 1px solid #ccc; - /*border: 1px solid #ccc;*/ - width: 100%; - /*height: 100%;*/ - /*overflow: hidden;*/ - /*overflow-y: auto;*/ - text-align: center; -} + .dataContent .thead th { + background-color: #fafafa; + text-align: center; + height: 30px; + padding: 5px; + } -.dataContent .thead th { - background-color: #fafafa; - text-align: center; - height: 30px; - padding: 5px; -} + .dataContent .notfixed th { + width: auto; + } -.dataContent .notfixed th { - width: auto; -} - -.dataContent .mathData td { - padding: 10px; -} + .dataContent .mathData td { + padding: 10px; + } </style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue index 26b51b7..2bc960a 100644 --- a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue +++ b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue @@ -22,7 +22,7 @@ </a-select> </a-form-item> </a-col> - <a-col :md="5" :sm="5"> + <a-col :md="6" :sm="6"> <a-form-item label="椹卞姩绫诲瀷"> <a-select :value="queryParams.driveType" @@ -38,12 +38,41 @@ </a-select> </a-form-item> </a-col> - <a-col :md="4" :sm="4"> + <a-col :md="6" :sm="6"> <a-form-item label="鏃堕棿"> <a-range-picker @change="dateParamChange" :disabledDate="disabledDate" format="YYYYMMDD" v-model="dates" :allowClear="false"/> </a-form-item> </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绉嶇被"> + <a-select + :value="queryParams.deviceCategory" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绉嶇被" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceCategory')" + > + <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </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 @@ -61,16 +90,17 @@ </a-form-item> </a-col> <a-col :md="5" :sm="5" :xs="5"> - <a-form-item label="璁惧绉嶇被"> + <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceCategory" + :value="queryParams.deviceImportanceLevel" mode="multiple" - placeholder="璇烽�夋嫨璁惧绉嶇被" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" allow-clear :maxTagCount="1" - @change="selectChange($event,'deviceCategory')" + @change="selectChange($event,'deviceImportanceLevel')" > - <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> {{item.label}} </a-select-option> </a-select> @@ -129,6 +159,8 @@ </th> <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧绫诲瀷 </th> + <th class="thgu dong6 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧鍨嬪彿 + </th> <!--<th rowspan="2">缁勫埆</th>--> <template v-for="(tableHead, index) in tableHeads"> <th class="timeth" :colspan="checkedList.length">{{tableHead}}</th> @@ -173,11 +205,12 @@ {{item.equipmentName}} </td> <td class="tdgu5 kaitou">{{item.equipmentType}}</td> + <td class="tdgu5 kaitou">{{item.equipmentModel}}</td> </template> <!--鍚堣涓庡钩鍧囧�煎尯鍩�--> <template v-else> - <td colspan="6" class="tdgu kaitou">{{item.level1}}</td> + <td colspan="7" class="tdgu kaitou">{{item.level1}}</td> </template> <template v-for="(tableHead, index) in item.dataList"> @@ -185,7 +218,7 @@ {{tableHead.utilizationRate | numFilter}} </td> <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjl') > -1"> - {{tableHead.openRate | numFilter}} + {{tableHead.openRate | n umFilter}} </td> <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjsj') > -1"> {{tableHead.openLong | getFormattedTime}} @@ -243,7 +276,8 @@ equipmentType: [], driveType: [], deviceLevel: [], - deviceCategory: [] + deviceCategory: [], + deviceImportanceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -270,7 +304,8 @@ processLongRowAverage: '', waitLongRowAverage: '', closeLongRowAverage: '', - spinning: false + spinning: false, + toggleSearchStatus: false } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -285,6 +320,7 @@ this.getDriveTypeByApi() this.initDictData('device_level') this.initDictData('device_category') + this.initDictData('device_importance_level') }, mounted() { window.addEventListener('resize', this.handleWindowResize) diff --git a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue index 59a6f7e..44422dc 100644 --- a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue +++ b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue @@ -78,6 +78,22 @@ <a-row :gutter="24" v-if="toggleSearchStatus"> <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绉嶇被"> + <a-select + :value="queryParams.deviceCategory" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绉嶇被" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceCategory')" + > + <a-select-option v-for="(item,index) in device_category_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 :value="queryParams.deviceLevel" @@ -94,16 +110,17 @@ </a-form-item> </a-col> <a-col :md="5" :sm="5" :xs="5"> - <a-form-item label="璁惧绉嶇被"> + <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceCategory" + :value="queryParams.deviceImportanceLevel" mode="multiple" - placeholder="璇烽�夋嫨璁惧绉嶇被" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" allow-clear :maxTagCount="1" - @change="selectChange($event,'deviceCategory')" + @change="selectChange($event,'deviceImportanceLevel')" > - <a-select-option v-for="(item,index) in device_category_list" :value="item.value" :key="index"> + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> {{item.label}} </a-select-option> </a-select> @@ -141,6 +158,7 @@ </a-form> </div> </div> + <a-spin :spinning="spinning"> <div class="container" id="EfficiencyShift" style="margin-top: 20px;"> <div class="table2"> @@ -148,7 +166,9 @@ v-if="dataList.length>0"> <thead> <tr class="thead fixed equipname"> - <th class="thgu dong1 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;height: 66px">鍏徃</th> + <th class="thgu dong1 name" rowspan="2" + style="min-width: 50px; max-width: 50px;width: 50px;height: 66px">鍏徃 + </th> <th class="thgu dong2 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">杞﹂棿</th> <th class="thgu dong3 name" rowspan="2" style="min-width: 50px; max-width: 50px;width: 50px;">宸ユ</th> <th class="thgu dong4 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;">璁惧缂栧彿 @@ -207,7 +227,9 @@ </template> <!--<td>{{item.tierType}}</td>--> <template v-for="(tableHead, index) in item.dataList"> - <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('lyl') > -1">{{tableHead.utilizationRate | numFilter}}</td> + <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('lyl') > -1"> + {{tableHead.utilizationRate | numFilter}} + </td> <td :style="{background:tableHead.color }" v-if="checkedList.indexOf('kjsj') > -1"> {{tableHead.openLong | getFormattedTime}} </td> @@ -254,13 +276,15 @@ driveTypeList: [], device_level_list: [], device_category_list: [], + device_importance_level_list: [], identifying: [], queryParam: {}, queryParams: { equipmentType: [], driveType: [], deviceLevel: [], - deviceCategory: [] + deviceCategory: [], + deviceImportanceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -305,6 +329,7 @@ this.getDriveTypeByApi() this.initDictData('device_level') this.initDictData('device_category') + this.initDictData('device_importance_level') }, mounted() { window.addEventListener('resize', this.handleWindowResize) diff --git a/src/views/mdc/common/BaseTree.vue b/src/views/mdc/common/BaseTree.vue index 445f539..11835c5 100644 --- a/src/views/mdc/common/BaseTree.vue +++ b/src/views/mdc/common/BaseTree.vue @@ -1,28 +1,28 @@ <template> - <a-card class="tree_con" :loading="cardLoading" :bordered="false" > + <a-card class="tree_con" :loading="cardLoading" :bordered="false"> <a-spin :spinning="loading"> <div style="display: flex;flex-direction: column;height: 100%"> - <div> - <a-alert type="info" :showIcon="false" style="margin-right: 54px;padding-left: 5px"> - <div slot="message"> - <span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> - <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">鍙栨秷</a> - <span v-else>鏃�</span> - </div> - </a-alert> - <div class="drawer-bottom-button"> - <a-dropdown :trigger="['click']" placement="bottomCenter"> - <a-menu slot="overlay"> - <a-menu-item key="1" @click="expandAll">灞曞紑鎵�鏈�</a-menu-item> - <a-menu-item key="2" @click="closeAll">鍚堝苟鎵�鏈�</a-menu-item> - <a-menu-item key="3" @click="refreshTree">鍒锋柊</a-menu-item> - </a-menu> - <a-button> - <a-icon type="bars"/> - </a-button> - </a-dropdown> + <div> + <a-alert type="info" :showIcon="false" style="margin-right: 54px;padding-left: 5px"> + <div slot="message"> + <span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> + <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">鍙栨秷</a> + <span v-else>鏃�</span> </div> + </a-alert> + <div class="drawer-bottom-button"> + <a-dropdown :trigger="['click']" placement="bottomCenter"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="expandAll">灞曞紑鎵�鏈�</a-menu-item> + <a-menu-item key="2" @click="closeAll">鍚堝苟鎵�鏈�</a-menu-item> + <a-menu-item key="3" @click="refreshTree">鍒锋柊</a-menu-item> + </a-menu> + <a-button> + <a-icon type="bars"/> + </a-button> + </a-dropdown> </div> + </div> <a-input-search @search="handleSearch" style="width:100%;margin-top: 10px" placeholder="妫�绱� 绫诲埆缂栫爜/鍚嶇О" allowClear v-model="searchInput" @change="handleChange"/> <!-- showLine --> @@ -58,7 +58,7 @@ </div> </div> </a-spin> - <tier-model ref="tierModalForm" @ok="modalFormOk"></tier-model> + <tier-model ref="tierModalForm" @ok="modalFormOk"></tier-model> </a-card> </template> @@ -70,7 +70,7 @@ } from '@/api/manage' import Tooltip from 'ant-design-vue/es/tooltip' import TierModel from './modules/baseTree/TierModel' - import {mapActions} from 'vuex' + import { mapActions } from 'vuex' export default { name: 'BaseTree', @@ -80,6 +80,10 @@ default() { return true } + }, + filterAbnormalDeviceKey: { + type: String, + default: '' } }, components: { @@ -105,7 +109,7 @@ allTreeKeys: [], currSelected: {}, hiding: false, - mathChange:'' + mathChange: '' } } , @@ -149,17 +153,17 @@ queryTreeData() { this.loading = true this.cardLoading = true - this.QueryProduction().then(res => { + this.QueryProduction(this.filterAbnormalDeviceKey).then(res => { if (res.success) { this.dataList = [] this.allTreeKeys = [] this.treeDataSource = res.result this.generateList(res.result) - this.expandedKeys=this.allTreeKeys + this.expandedKeys = this.allTreeKeys } else { this.$message.warn(res.message) } - }).finally(() =>{ + }).finally(() => { this.loading = false this.cardLoading = false }) @@ -181,7 +185,7 @@ let search = this.searchInput let expandedKeys = this.dataList .map(item => { - if(item.title !=null){ + if (item.title != null) { if (item.title.indexOf(search) > -1) { return this.getParentKey(item.key, this.treeDataSource) } @@ -200,7 +204,7 @@ let expandedKeys = this.dataList .map(item => { - if(item.title !=null){ + if (item.title != null) { if (item.title.indexOf(search) > -1) { return this.getParentKey(item.key, this.treeDataSource) } @@ -262,9 +266,9 @@ if (!ids) { // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') this.$notification.warning({ - message:'娑堟伅', - description:"璇烽�夋嫨涓�鏉¤褰�" - }); + message: '娑堟伅', + description: '璇烽�夋嫨涓�鏉¤褰�' + }) return } else { var that = this @@ -276,7 +280,7 @@ deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { if (res.success) { that.$message.success(res.message) - that.queryTreeData(); + that.queryTreeData() } else { that.$message.warning(res.message) } @@ -288,7 +292,7 @@ } }, modalFormOk(val) { - console.log("mmm") + console.log('mmm') // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 this.queryTreeData() // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 @@ -298,7 +302,7 @@ watch: { currSelected(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 this.$emit('getCurrSelected', val) - }, + } } } </script> @@ -368,37 +372,41 @@ border-radius: 0 0 2px 2px; } - .tree_con{ + .tree_con { overflow: hidden; } - @media screen and (min-width: 1920px){ - .tree_con{ - height: 748px!important; - } - } - @media screen and (min-width: 1680px) and (max-width: 1920px){ - .tree_con{ - height: 748px!important; - } - } - @media screen and (min-width: 1400px) and (max-width: 1680px){ - .tree_con{ - height: 600px!important; - } - } - @media screen and (min-width: 1280px) and (max-width: 1400px){ - .tree_con{ - height: 501px!important; - } - } - @media screen and (max-width: 1280px){ - .tree_con{ - height: 501px!important; + @media screen and (min-width: 1920px) { + .tree_con { + height: 748px !important; } } - /deep/ .ant-card-body,/deep/ .ant-spin-nested-loading,/deep/ .ant-spin-container{ + @media screen and (min-width: 1680px) and (max-width: 1920px) { + .tree_con { + height: 748px !important; + } + } + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + .tree_con { + height: 600px !important; + } + } + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + .tree_con { + height: 501px !important; + } + } + + @media screen and (max-width: 1280px) { + .tree_con { + height: 501px !important; + } + } + + /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container { height: 100%; } </style> diff --git a/vue.config.js b/vue.config.js index 243647b..168df3c 100644 --- a/vue.config.js +++ b/vue.config.js @@ -40,11 +40,11 @@ // 鐢熶骇鐜锛屽紑鍚痡s\css鍘嬬缉 if (process.env.NODE_ENV === 'production') { - config.plugin('compressionPlugin').use(new CompressionPlugin({ - test: /\.(js|css|less)$/, // 鍖归厤鏂囦欢鍚� - threshold: 10240, // 瀵硅秴杩�10k鐨勬暟鎹帇缂� - deleteOriginalAssets: false // 涓嶅垹闄ゆ簮鏂囦欢 - })) + config.plugin('compressionPlugin').use(new CompressionPlugin({ + test: /\.(js|css|less)$/, // 鍖归厤鏂囦欢鍚� + threshold: 10240, // 瀵硅秴杩�10k鐨勬暟鎹帇缂� + deleteOriginalAssets: false // 涓嶅垹闄ゆ簮鏂囦欢 + })) } // 閰嶇疆 webpack 璇嗗埆 markdown 涓烘櫘閫氱殑鏂囦欢 @@ -60,9 +60,9 @@ .rule('vxe') .test(/\.js$/) .include - .add(resolve('node_modules/vxe-table')) - .add(resolve('node_modules/vxe-table-plugin-antd')) - .end() + .add(resolve('node_modules/vxe-table')) + .add(resolve('node_modules/vxe-table-plugin-antd')) + .end() .use() .loader('babel-loader') .end() @@ -84,15 +84,16 @@ devServer: { port: 3000, + open: true, proxy: { - /* '/api': { - target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API鎺ュ彛绯荤粺 - ws: false, - changeOrigin: true, - pathRewrite: { - '/jeecg-boot': '' //榛樿鎵�鏈夎姹傞兘鍔犱簡jeecg-boot鍓嶇紑锛岄渶瑕佸幓鎺� - } - }, */ + /* '/api': { + target: 'https://mock.ihx.me/mock/5baf3052f7da7e07e04a5116/antd-pro', //mock API鎺ュ彛绯荤粺 + ws: false, + changeOrigin: true, + pathRewrite: { + '/jeecg-boot': '' //榛樿鎵�鏈夎姹傞兘鍔犱簡jeecg-boot鍓嶇紑锛岄渶瑕佸幓鎺� + } + }, */ '/jeecg-boot': { target: 'http://localhost:8080', // 璇锋眰鏈湴 闇�瑕乯eecg-boot鍚庡彴椤圭洰 ws: false, -- Gitblit v1.9.3