From 3a73cd63039981d1f7cd324afea8f14f37738467 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 07 三月 2025 11:24:49 +0800 Subject: [PATCH] 1、统计分析和统计图表、对比分析和利用率走势分析、利用率分段分析和报警分析页面新增筛选条件保持跟TEEP页面一致 2、全局中重要程度的筛选方式由多选改为单选 3、设备监控与车间看板页面的设备详情弹窗中的图表调整为一直展示但若无数据则不展示图表的指针与数值 --- src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue | 1066 +++--- src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue | 647 ++- src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue | 18 src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue | 321 + src/views/mdc/base/DeviceBaseInfo.vue | 4 src/views/mdc/base/modules/deviceBaseInfo/EqumentDetaiModel.vue | 2695 ++++++++--------- src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue | 28 src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue | 232 + src/views/system/modules/SelectDeviceDrawer.vue | 1 src/views/mdc/base/modules/comparativeAnalysis/conparativeAnalysisPie.vue | 3 src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysisGauge.vue | 1 src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue | 950 ++--- src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue | 2649 +++++++-------- src/views/mdc/base/modules/deviceBaseInfo/EquipmentLayout.vue | 16 src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue | 462 +- src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue | 46 src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue | 250 + src/components/layouts/TabLayout.vue | 8 18 files changed, 4,775 insertions(+), 4,622 deletions(-) diff --git a/src/components/layouts/TabLayout.vue b/src/components/layouts/TabLayout.vue index ef9511f..31d3ea8 100644 --- a/src/components/layouts/TabLayout.vue +++ b/src/components/layouts/TabLayout.vue @@ -124,11 +124,9 @@ } }, 'activePage': function(key) { - console.log('key', key) let index = this.linkList.lastIndexOf(key) let waitRouter = this.pageList[index] // 銆怲ESTA-523銆戜慨澶嶏細涓嶅厑璁搁噸澶嶈烦杞矾鐢卞紓甯� - console.log('waitRouter', waitRouter, 'fullPath', this.$route.fullPath, waitRouter.fullPath !== this.$route.fullPath) if (waitRouter.path !== this.$route.fullPath) { this.$router.push(Object.assign({}, waitRouter)) } @@ -169,7 +167,6 @@ // update-begin-author:sunjianlei date:20200120 for: 鍔ㄦ�佹洿鏀归〉闈㈡爣棰� changeTitle(title) { - console.log('title', title) let projectTitle = 'MDC鏅烘収杞﹂棿' // 棣栭〉鐗规畩澶勭悊 if (this.$route.path === indexKey) { @@ -181,7 +178,6 @@ // update-end-author:sunjianlei date:20200120 for: 鍔ㄦ�佹洿鏀归〉闈㈡爣棰� changePage(key) { - console.log('changePage', key) this.activePage = key }, tabCallBack() { @@ -206,7 +202,6 @@ this.$message.warning('杩欐槸鏈�鍚庝竴椤碉紝涓嶈兘鍐嶅叧闂簡鍟�') return } - console.log('this.pageList ', this.pageList) let removeRoute = this.pageList.filter(item => item.path == key) this.pageList = this.pageList.filter(item => item.path !== key) let index = this.linkList.indexOf(key) @@ -219,8 +214,6 @@ let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || [] if (removeRoute && removeRoute[0]) { let componentName = removeRoute[0].meta.componentName - console.log('key: ', key) - console.log('componentName: ', componentName) if (cacheRouterArray.includes(componentName)) { cacheRouterArray.splice(cacheRouterArray.findIndex(item => item === componentName), 1) Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray) @@ -351,7 +344,6 @@ clickMenuTitleSelected(selectedMenus) { //console.log("鏂扮殑璺敱",newRoute) - console.log('clickTitle', this.activePage) this.activePage = selectedMenus[0].path if (!this.multipage) { this.linkList = [this.linkList[0], selectedMenus[0].path] diff --git a/src/views/mdc/base/DeviceBaseInfo.vue b/src/views/mdc/base/DeviceBaseInfo.vue index 0649db2..afb1ad9 100644 --- a/src/views/mdc/base/DeviceBaseInfo.vue +++ b/src/views/mdc/base/DeviceBaseInfo.vue @@ -39,9 +39,7 @@ </template> <script> - import { putAction, getAction } from '@/api/manage' - import { frozenBatch } from '@/api/api' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { getAction } from '@/api/manage' import JInput from '@/components/jeecg/JInput' import BaseTree from '../common/BaseTree' import EquipmentLayout from './modules/deviceBaseInfo/EquipmentLayout' diff --git a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue index 760f961..25eb0c4 100644 --- a/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue +++ b/src/views/mdc/base/modules/OEEAnalysis/OEEAnalysisList.vue @@ -16,7 +16,7 @@ @change="selectChange($event,'equipmentType')" > <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -32,7 +32,7 @@ @change="selectChange($event,'driveType')" > <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -76,7 +76,7 @@ @change="selectChange($event,'deviceLevel')" > <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -114,16 +114,13 @@ <a-col :md="6" :sm="6" :xs="6"> <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceImportanceLevel" - mode="multiple" + v-model="queryParam.deviceImportanceLevel" 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}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -141,7 +138,7 @@ > <a-select-option v-for="(item,index) in percentage_level_list" :value="item.value" :key="index"> - {{item.label}} + {{ item.label }} </a-select-option> </a-select> </a-form-item> @@ -174,537 +171,496 @@ <!--</template>--> </a-table> </div> - <!--<div class="pagination">--> - <!--<a-pagination--> - <!--:total=dataSource.total--> - <!--:show-total="(total, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉"--> - <!--:page-size="+queryParam.pageSize"--> - <!--:default-current="1"--> - <!--:current=+queryParam.pageNo--> - <!--show-size-changer--> - <!--:pageSizeOptions="['20','30','40','50']"--> - <!--@change="handlePageNoChange"--> - <!--@showSizeChange="handlePageSizeChange"--> - <!--/>--> - <!--</div>--> </div> </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 { getAction } from '@/api/manage' +import $ from 'jquery' +import '@/components/table2excel/table2excel' +import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' +import api from '@api/mdc' - // import EditableCell from './EditableCell.vue' +// import EditableCell from './EditableCell.vue' - export default { - name: 'OEEAnalysisList', - components: {}, - data() { - return { - dates: [moment().subtract('month', 1), moment().subtract('month', 1)], - queryParam: { - pageSize: 10000, - pageNo: 1 +export default { + name: 'OEEAnalysisList', + components: {}, + data() { + return { + dates: [moment().subtract('month', 1), moment().subtract('month', 1)], + queryParam: { + pageSize: 10000, + pageNo: 1 + }, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], + percentageLevel: [] + }, + queryParamEquip: {}, + queryParamPeople: {}, + url: { + list: '/mdc/mdcOverallEquipmentEfficiency/list', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + }, + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } }, - queryParams: { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [], - deviceImportanceLevel: [], - percentageLevel: [] + { + title: '杞﹂棿', + align: 'center', + dataIndex: 'productionName', + width: 110 }, - queryParamEquip: {}, - queryParamPeople: {}, - url: { - list: '/mdc/mdcOverallEquipmentEfficiency/list', - queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 120 }, - columns: [ - { - title: '搴忓彿', - dataIndex: '', - key: 'rowIndex', - width: 60, - align: 'center', - customRender: function(t, r, index) { - return parseInt(index) + 1 + { + title: '璁惧鍚嶇О', + align: 'center', + width: 120, + dataIndex: 'equipmentName' + }, + { + title: '璁惧鍨嬪彿', + align: 'center', + width: 120, + dataIndex: 'equipmentModel', + scopedSlots: { customRender: 'equipmentModel' } + }, + { + title: '鏃ユ湡', + align: 'center', + width: 100, + dataIndex: 'validDate' + }, + { + title: '鐝', + align: 'center', + width: 100, + dataIndex: 'shift' + }, + { + title: '姣忕彮灏忔椂', + dataIndex: 'shiftTimeCount', + align: 'center', + width: 100 + }, + { + title: '鍔犵彮鏃堕棿锛堝垎閽燂級', + dataIndex: 'overtime', + align: 'center', + width: 100 + }, + { + title: '瀹為檯鐝骇澶╂暟', + dataIndex: 'actualWorkDayCount', + align: 'center', + width: 100 + }, + { + title: '鏈堝害瀹為檯鐝骇鎬绘椂闂达紙鍒嗛挓锛�', + dataIndex: 'monthActualWorkDayTimeCount', + align: 'center', + width: 100 + }, + { + title: '闈炶鍒掑仠鏈烘崯澶憋紙鍒嗛挓锛夛紙涓�涓湀锛�', + children: [ + { + title: '鏁呴殰鍋滄満', + dataIndex: 'breakdownDownDuration', + align: 'center', + width: 100 + }, + { + title: '鎹㈠瀷璋冭瘯', + dataIndex: 'conversionDebugDuration', + align: 'center', + width: 100 + }, + { + title: '鐗╂枡鐭己', + dataIndex: 'materialShortageDuration', + align: 'center', + width: 100 + }, + { + title: '璁″垝绛変换鍔�', + dataIndex: 'plannedTaskDuration', + align: 'center', + width: 100 + }, + { + title: '妫�楠�', + dataIndex: 'inspectDuration', + align: 'center', + width: 100 + }, + { + title: '鍏朵粬', + dataIndex: 'otherDuration', + align: 'center', + width: 100 } - }, - { - title: '杞﹂棿', - align: 'center', - dataIndex: 'productionName', - width: 110 - }, - { - title: '璁惧缂栧彿', - align: 'center', - dataIndex: 'equipmentId', - width: 120 - }, - { - title: '璁惧鍚嶇О', - align: 'center', - width: 120, - dataIndex: 'equipmentName' - }, - { - title: '璁惧鍨嬪彿', - align: 'center', - width: 120, - dataIndex: 'equipmentModel', - scopedSlots: { customRender: 'equipmentModel' } - }, - { - title: '鏃ユ湡', - align: 'center', - width: 100, - dataIndex: 'validDate' - }, - { - title: '鐝', - align: 'center', - width: 100, - dataIndex: 'shift' - }, - { - title: '姣忕彮灏忔椂', - dataIndex: 'shiftTimeCount', - align: 'center', - width: 100 - }, - { - title: '鍔犵彮鏃堕棿锛堝垎閽燂級', - dataIndex: 'overtime', - align: 'center', - width: 100 - }, - { - title: '瀹為檯鐝骇澶╂暟', - dataIndex: 'actualWorkDayCount', - align: 'center', - width: 100 - }, - { - title: '鏈堝害瀹為檯鐝骇鎬绘椂闂达紙鍒嗛挓锛�', - dataIndex: 'monthActualWorkDayTimeCount', - align: 'center', - width: 100 - }, - { - title: '闈炶鍒掑仠鏈烘崯澶憋紙鍒嗛挓锛夛紙涓�涓湀锛�', - children: [ - { - title: '鏁呴殰鍋滄満', - dataIndex: 'breakdownDownDuration', - align: 'center', - width: 100 - }, - { - title: '鎹㈠瀷璋冭瘯', - dataIndex: 'conversionDebugDuration', - align: 'center', - width: 100 - }, - { - title: '鐗╂枡鐭己', - dataIndex: 'materialShortageDuration', - align: 'center', - width: 100 - }, - { - title: '璁″垝绛変换鍔�', - dataIndex: 'plannedTaskDuration', - align: 'center', - width: 100 - }, - { - title: '妫�楠�', - dataIndex: 'inspectDuration', - align: 'center', - width: 100 - }, - { - title: '鍏朵粬', - dataIndex: 'otherDuration', - align: 'center', - width: 100 - } - ] - }, - { - title: '璁″垝鍋滄満鏃堕棿锛堝垎閽燂級锛堜竴涓湀锛�', - children: [ - { - title: '璁″垝淇濆吇', - dataIndex: 'plannedMaintenanceDuration', - align: 'center', - width: 100 - }, - { - title: '浼氳/鍩硅', - dataIndex: 'conferenceTrainingDuration', - align: 'center', - width: 100 - }, - { - title: '鍏朵粬浼戞伅绛�', - dataIndex: 'otherRestDuration', - align: 'center', - width: 100 - }] - }, - { - title: '璐熻嵎鏃堕棿锛堝皬鏃讹級', - dataIndex: 'loadTime', - align: 'center', - width: 100 - }, - { - title: '鏃堕棿寮�鍔ㄧ巼', - dataIndex: 'timeActuationRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - // { - // title: '鍔犲伐闆朵欢鏁帮紙浠讹級', - // dataIndex: 'processQuantity', - // align: 'center', - // width: 120 - // }, - // { - // title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級', - // dataIndex: 'standardProcessDuration', - // align: 'center', - // width: 120 - // }, - { - title: '鎬ц兘寮�鍔ㄧ巼', - dataIndex: 'performanceRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - { - title: '搴熷搧鏁�', - dataIndex: 'unqualifiedQuantity', - align: 'center', - width: 100 - }, - { - title: '鍚堟牸鐜�', - dataIndex: 'passRate', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - }, - { - title: '璁惧缁煎悎鏁堢巼', - dataIndex: 'overallEquipmentEfficiency', - align: 'center', - width: 100, - customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 - } - ], - dataSource: [], - driveTypeList: [], - equipmentTypeList: [], - device_level_list: [], - device_category_list: [], - percentage_level_list: [], - scrollY: 465, - tableLoading: false, - toggleSearchStatus: false - } - }, - props: { nodeTree: '', Type: '', nodePeople: '' }, - created() { - const { isEquipment, productionId } = this.$route.params - if (productionId) { - console.log('productionId', productionId) - console.log('isEquipment', isEquipment) - if (!isEquipment) this.queryParam.parentId = productionId - else this.queryParam.equipmentId = productionId - } + ] + }, + { + title: '璁″垝鍋滄満鏃堕棿锛堝垎閽燂級锛堜竴涓湀锛�', + children: [ + { + title: '璁″垝淇濆吇', + dataIndex: 'plannedMaintenanceDuration', + align: 'center', + width: 100 + }, + { + title: '浼氳/鍩硅', + dataIndex: 'conferenceTrainingDuration', + align: 'center', + width: 100 + }, + { + title: '鍏朵粬浼戞伅绛�', + dataIndex: 'otherRestDuration', + align: 'center', + width: 100 + }] + }, + { + title: '璐熻嵎鏃堕棿锛堝皬鏃讹級', + dataIndex: 'loadTime', + align: 'center', + width: 100 + }, + { + title: '鏃堕棿寮�鍔ㄧ巼', + dataIndex: 'timeActuationRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + // { + // title: '鍔犲伐闆朵欢鏁帮紙浠讹級', + // dataIndex: 'processQuantity', + // align: 'center', + // width: 120 + // }, + // { + // title: '鏍囧噯鍔犲伐鏃堕棿锛堝垎閽燂級', + // dataIndex: 'standardProcessDuration', + // align: 'center', + // width: 120 + // }, + { + title: '鎬ц兘寮�鍔ㄧ巼', + dataIndex: 'performanceRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + { + title: '搴熷搧鏁�', + dataIndex: 'unqualifiedQuantity', + align: 'center', + width: 100 + }, + { + title: '鍚堟牸鐜�', + dataIndex: 'passRate', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + }, + { + title: '璁惧缁煎悎鏁堢巼', + dataIndex: 'overallEquipmentEfficiency', + align: 'center', + width: 100, + customRender: text => text != 0 ? parseFloat((text * 100).toFixed(2)) + '%' : 0 + } + ], + dataSource: [], + driveTypeList: [], + equipmentTypeList: [], + device_level_list: [], + device_importance_level_list: [], + percentage_level_list: [], + scrollY: 465, + tableLoading: false, + toggleSearchStatus: false + } + }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + created() { + const { isEquipment, productionId } = this.$route.params + if (productionId) { + console.log('productionId', productionId) + console.log('isEquipment', isEquipment) + if (!isEquipment) this.queryParam.parentId = productionId + else this.queryParam.equipmentId = productionId + } - this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') - this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') - this.queryParam.typeTree = '1' - this.loadData() - this.getDriveTypeByApi() - this.queryGroup() - this.initDictData('device_level') - this.initDictData('device_category') - this.initDictData('device_importance_level') - this.initDictData('percentage_level') + this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') + this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') + this.queryParam.typeTree = '1' + this.loadData() + this.getDriveTypeByApi() + this.queryGroup() + this.initDictData('device_level') + this.initDictData('device_category') + this.initDictData('device_importance_level') + this.initDictData('percentage_level') + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + // this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + }, + watch: { + Type(valmath) { + this.dataList = [] + this.queryParam.typeTree = valmath }, - mounted() { - window.addEventListener('resize', this.handleWindowResize) - // this.handleWindowResize() - }, - beforeDestroy() { - window.removeEventListener('resize', this.handleWindowResize) - }, - watch: { - Type(valmath) { - this.dataList = [] - this.queryParam.typeTree = valmath - }, - nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 - console.log(val) - 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() + nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + console.log(val) + 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 = '' } - }, - 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() - } + this.searchQuery() } }, - methods: { - initDictData(dictCode) { - // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 - if (getDictItemsFromCache(dictCode)) { - this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + 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() + } + } + }, + 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 } - //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� - ajaxGetDictItems(dictCode, null).then((res) => { - if (res.success) { - this[dictCode + '_list'] = res.result - return - } - }) - }, - selectChange(value, key) { - this.queryParams[key] = value - }, - dateParamChange(value) { - console.log('dateParamChangeValue', value) - this.dates = value - this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') - this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') - }, + }) + }, + selectChange(value, key) { + this.queryParams[key] = value + }, + dateParamChange(value) { + console.log('dateParamChangeValue', value) + this.dates = value + this.queryParam.startTime = moment(this.dates[0]).format('YYYY-MM') + this.queryParam.endTime = moment(this.dates[1]).format('YYYY-MM') + }, - handleDateChange(value) { - console.log('handleDateChangeValue', value) - if (!value.length) { - delete this.queryParam.startTime - delete this.queryParam.endTime - this.dates = [] - } - }, - - exportExcel() { - $('#EfficiencyShift').table2excel({ - exclude: '.noExl', - name: 'Excel Document Name', - filename: '璁惧缁煎悎鏁堢巼鍒嗘瀽', - exclude_img: true, - fileext: '.xls', - exclude_links: true, - exclude_inputs: true - }) - }, - - 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 => { - if (Array.isArray(this.queryParams[item])) { - // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 - this.queryParam[item] = this.queryParams[item].join() - if (this.queryParams[item].length === 0) delete this.queryParam[item] - console.log('this.queryParam', this.queryParam) - } - }) - this.loadData() - }, - - searchReset() { - this.queryParam = { - pageSize: 10000, - pageNo: 1, - typeTree: 1 - } - this.queryParams = { - equipmentType: [], - driveType: [], - deviceLevel: [], - deviceCategory: [] - } + handleDateChange(value) { + console.log('handleDateChangeValue', value) + if (!value.length) { + delete this.queryParam.startTime + delete this.queryParam.endTime this.dates = [] - this.loadData() - }, + } + }, - /** - * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 - */ - getDriveTypeByApi() { - api.getDriveTypeApi().then((res) => { - if (res.success) this.driveTypeList = res.result - }) - }, + exportExcel() { + $('#EfficiencyShift').table2excel({ + exclude: '.noExl', + name: 'Excel Document Name', + filename: '璁惧缁煎悎鏁堢巼鍒嗘瀽', + exclude_img: true, + fileext: '.xls', + exclude_links: true, + exclude_inputs: true + }) + }, - queryGroup() { - getAction(this.url.queryEquipmentType).then(res => { - if (res.success) { - this.equipmentTypeList = res.result.map(item => { - return { - label: item.equipmentTypeName, - value: item.equipmentTypeName - } - }) - } else { - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, + 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 => { + if (Array.isArray(this.queryParams[item])) { + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + this.queryParam[item] = this.queryParams[item].join() + if (this.queryParams[item].length === 0) delete this.queryParam[item] + } + }) + this.loadData() + }, - loadData() { - this.tableLoading = true - getAction(this.url.list, this.queryParam) - .then(res => { - if (res.success && res.result) { - this.dataSource = res.result - this.tableLoading = false + searchReset() { + this.queryParam = { + pageSize: 10000, + pageNo: 1, + typeTree: 1 + } + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [] + } + this.dates = [] + this.loadData() + }, + + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) + }, + + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName } }) - .finally(() => { - this.tableLoading = false - this.handleWindowResize() + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message }) - }, + } + }) + }, - /** - * 鍒嗛〉鍣ㄩ〉鏁板彂鐢熸敼鍙樻椂瑙﹀彂 - * @param page 鏀瑰彉鍚庨〉鏁� - * @param pageSize 鏀瑰彉鍚庢瘡椤靛睍绀烘暟鎹潯鏁� - */ - handlePageNoChange(page, pageSize) { - this.queryParam.pageNo = page - this.loadData() - }, + loadData() { + this.tableLoading = true + getAction(this.url.list, this.queryParam) + .then(res => { + if (res.success && res.result) { + this.dataSource = res.result + this.tableLoading = false + } + }) + .finally(() => { + this.tableLoading = false + this.handleWindowResize() + }) + }, - /** - * 鍒嗛〉鍣ㄦ瘡椤靛睍绀烘暟鎹潯鏁板彂鐢熸敼鍙樻椂瑙﹀彂 - * @param current 鏀瑰彉鍚庨〉鏁� - * @param size 鏀瑰彉鍚庢瘡椤靛睍绀烘暟鎹潯鏁� - */ - handlePageSizeChange(current, size) { - this.queryParam.pageSize = size - this.loadData() - }, - - onCellChange(key, dataIndex, value) { - console.log('瑙﹀彂onCellChange', key, dataIndex, value) - }, - - /** - * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� - */ - handleWindowResize() { - const devicePixelRatio = window.devicePixelRatio // 娴忚鍣ㄧ缉鏀炬瘮 - console.log('devicePixelRatio', devicePixelRatio) - if (devicePixelRatio < 1) return // 缂╂斁姣斿皬浜�1鏃朵笉杩涜楂樺害閲嶆柊璁剧疆锛屽洜涓簊crollY鍙樺ぇ鍚庤〃鏍艰秴鍑洪儴鍒嗕細琚殣钘忓鑷存粴鍔ㄦ潯涓嶅彲瑙� - const clientHeight = document.body.clientHeight || document.documentElement.clientHeight// 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� - console.log('clientHeight', clientHeight) - const containerTopToClientTopHeight = document.getElementById('EfficiencyShift').getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� - console.log('containerTopToClientTopHeight', containerTopToClientTopHeight) - // const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) // 琛ㄦ牸琛ㄥご楂樺害 - const tableHeadHeight = document.querySelector('.ant-table-thead th').offsetHeight // 琛ㄦ牸琛ㄥご楂樺害 - console.log('tableHeadHeight', tableHeadHeight) - // this.scrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight - const tableSuitableScrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉″悎閫傞珮搴︼紙琛ㄦ牸姘村钩婊氬姩鏉″垰濂藉湪鍙鍖哄煙鏈�涓嬫柟锛� - // const tableSuitableScrollY = 600 - console.log('tableSuitableScrollY', tableSuitableScrollY) - const tableContainerHeight = document.getElementById('EfficiencyShift').offsetHeight - console.log('tableContainerHeight', tableContainerHeight) - const tableMaxScrollY = tableContainerHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉℃渶澶ч珮搴︼紙鑻ヨ秴鍑哄垯姘村钩婊氬姩鏉¤閬尅锛� - console.log('tableMaxScrollY', tableMaxScrollY) - if (tableSuitableScrollY && tableSuitableScrollY < tableMaxScrollY) this.scrollY = tableSuitableScrollY - else this.scrollY = tableMaxScrollY - console.log('scrollY', this.scrollY) - } + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + const devicePixelRatio = window.devicePixelRatio // 娴忚鍣ㄧ缉鏀炬瘮 + console.log('devicePixelRatio', devicePixelRatio) + if (devicePixelRatio < 1) return // 缂╂斁姣斿皬浜�1鏃朵笉杩涜楂樺害閲嶆柊璁剧疆锛屽洜涓簊crollY鍙樺ぇ鍚庤〃鏍艰秴鍑洪儴鍒嗕細琚殣钘忓鑷存粴鍔ㄦ潯涓嶅彲瑙� + const clientHeight = document.body.clientHeight || document.documentElement.clientHeight// 娴忚鍣ㄥ彲瑙嗗尯鍩熼珮搴� + console.log('clientHeight', clientHeight) + const containerTopToClientTopHeight = document.getElementById('EfficiencyShift').getBoundingClientRect().top // 琛ㄦ牸瀹瑰櫒椤堕儴鍒版祻瑙堝櫒鍙鍖哄煙椤堕儴鐨勯棿璺� + console.log('containerTopToClientTopHeight', containerTopToClientTopHeight) + // const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2) // 琛ㄦ牸琛ㄥご楂樺害 + const tableHeadHeight = document.querySelector('.ant-table-thead th').offsetHeight // 琛ㄦ牸琛ㄥご楂樺害 + console.log('tableHeadHeight', tableHeadHeight) + // this.scrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight + const tableSuitableScrollY = clientHeight - containerTopToClientTopHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉″悎閫傞珮搴︼紙琛ㄦ牸姘村钩婊氬姩鏉″垰濂藉湪鍙鍖哄煙鏈�涓嬫柟锛� + // const tableSuitableScrollY = 600 + console.log('tableSuitableScrollY', tableSuitableScrollY) + const tableContainerHeight = document.getElementById('EfficiencyShift').offsetHeight + console.log('tableContainerHeight', tableContainerHeight) + const tableMaxScrollY = tableContainerHeight - tableHeadHeight // 琛ㄦ牸鍨傜洿婊氬姩鏉℃渶澶ч珮搴︼紙鑻ヨ秴鍑哄垯姘村钩婊氬姩鏉¤閬尅锛� + console.log('tableMaxScrollY', tableMaxScrollY) + if (tableSuitableScrollY && tableSuitableScrollY < tableMaxScrollY) this.scrollY = tableSuitableScrollY + else this.scrollY = tableMaxScrollY + console.log('scrollY', this.scrollY) } } +} </script> <style scoped lang="less"> - .pagination { - display: flex; - justify-content: end; - margin: 20px 0; - } +.pagination { + display: flex; + justify-content: end; + margin: 20px 0; +} +.device_list { + overflow: hidden; + display: flex; + flex-direction: column; +} + +@media screen and (min-width: 1920px) { .device_list { - overflow: hidden; - display: flex; - flex-direction: column; + height: 811px !important; } +} - @media screen and (min-width: 1920px) { - .device_list { - height: 811px !important; - } +@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; - } +@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; - } +@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; - } +@media screen and (max-width: 1280px) { + .device_list { + height: 564px !important; } +} - @media screen and (max-width: 1280px) { - .device_list { - height: 564px !important; - } +/deep/ .ant-table-body { + &::-webkit-scrollbar { + height: 12px; } - - /deep/ .ant-table-body { - &::-webkit-scrollbar { - height: 12px; - } - } +} </style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue index 6185aa3..eb4fe8a 100644 --- a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue +++ b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue @@ -1,7 +1,8 @@ <template> - <div id="StatisticsLegend" style="width: 100%; height: 100%; overflow: hidden;display: flex;flex-direction: column;background-color: #f5f4f4"> + <div id="StatisticsLegend" + style="width: 100%; height: 100%; overflow: hidden;display: flex;flex-direction: column;background-color: #f5f4f4"> <!-- 鏌ヨ鍖哄煙 --> - <div style="width: 100%; height: 44px; background-color: #fff" class="table-page-search-wrapper"> + <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" :xs="5"> @@ -9,11 +10,91 @@ <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParam.tierName"></a-input> </a-form-item> </a-col> - <a-col :md="4" :sm="4" :xs="4"> - <a-form-item label="鏃ユ湡"> - <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange" :allowClear="false"/> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> </a-form-item> </a-col> + <a-col :md="7" :sm="7"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="鏃ユ湡"> + <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' + @change="handleDateChange" :allowClear="false" style="width: 100%"/> + </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 + :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 + v-model="queryParams.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> <a-col :md="2" :sm="2" :xs="2"> <a-space> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> @@ -26,8 +107,8 @@ <!--寮�鏈虹巼--> <div class="PowerOnRate Line-box"> <!--<div class="title">--> - <!--<div class="circle"></div>--> - <!--<div class="text">鍒╃敤鐜�</div>--> + <!--<div class="circle"></div>--> + <!--<div class="text">鍒╃敤鐜�</div>--> <!--</div>--> <div class="PowerOnRate-box box-bottom"> <!--<div class="PowerOnRate-left" ref="PowerOnRatePie" id="PowerOnRatePie"></div>--> @@ -38,22 +119,30 @@ <p>{{StatCharUsedRate}}%</p> </div> <div class="PowerOnRate-right" ref="PowerOnRateLine" id="PowerOnRateLine"></div> - <div class="PowerOnRate_text" style="width: 8%"> + <div class="PowerOnRate_text" style="width: 8%"> <table width="85px;" align="center"> <tr> - <td align="right"><div style="width: 15px;height: 15px;background-color: #6496e9;position: static;"/></td> + <td align="right"> + <div style="width: 15px;height: 15px;background-color: #6496e9;position: static;"/> + </td> <td align="left">寮�鏈�</td> </tr> <tr> - <td align="right"><div style="width: 15px;height: 15px;background-color: #A8A8A8;position: static;"/></td> + <td align="right"> + <div style="width: 15px;height: 15px;background-color: #A8A8A8;position: static;"/> + </td> <td align="left">鍏虫満</td> </tr> <tr> - <td align="right"><div style="width: 15px;height: 15px;background-color: #4ecee1"/></td> + <td align="right"> + <div style="width: 15px;height: 15px;background-color: #4ecee1"/> + </td> <td align="left">杩愯</td> </tr> <tr> - <td align="right"><div style="width: 15px;height: 15px;background-color: #FCCE10"/></td> + <td align="right"> + <div style="width: 15px;height: 15px;background-color: #FCCE10"/> + </td> <td align="left">寰呮満</td> </tr> </table> @@ -87,70 +176,108 @@ <script> import moment from 'moment' import { putAction, getAction } from '@/api/manage' - import $ from 'jquery' import * as echarts from 'echarts' + import api from '@/api/mdc' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' + export default { name: 'StatisticalAnalysisMain', props: { equip: {} }, - data(){ - return{ - readOnly:true, - showday:true, - StatCharOpeningRate:0, - StatCharUsedRate:0, - StatCharUsedopeningRate:0, - openingLong:0, - waitingLong:0, - processLong:0, - closedLong:0, - totalLong:0, - UtilizationHeight:0, - StartupHeight:0, - quip:{}, + data() { + return { + readOnly: true, + showday: true, + StatCharOpeningRate: 0, + StatCharUsedRate: 0, + StatCharUsedopeningRate: 0, + openingLong: 0, + waitingLong: 0, + processLong: 0, + closedLong: 0, + totalLong: 0, + UtilizationHeight: 0, + StartupHeight: 0, + quip: {}, dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], queryParam: {}, - queryParams:{ - collectTime:null, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], + collectTime: null }, - shiftSubList: [], - shiftList: [], + toggleSearchStatus: false, url: { getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', - dayStatisticalRate:'/mdc/efficiencyReport/dayStatisticalRate', + dayStatisticalRate: '/mdc/efficiencyReport/dayStatisticalRate', getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction', - }, + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + } } }, - created(){ + created() { // let collectTime = moment(moment().add(-1,'d'),'YYYY-MM-DD'); - this.queryParams.collectTime = moment().add(-1,'d').format('YYYY-MM-DD') - this.queryParams.dateTime = moment().add(-1,'d').format('YYYYMMDD') + this.queryParams.collectTime = moment().add(-1, 'd').format('YYYY-MM-DD') + this.queryParams.dateTime = moment().add(-1, 'd').format('YYYYMMDD') this.initEquipmentNode() - // this.queryStatistical(); - // this.getTime(37800); + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_importance_level') }, - methods:{ - disabledDate(current){ - //Can not slect days before today and today - return current && current > moment().subtract('days', 1); + methods: { + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, - //鎶婄璁$畻鎴愬搴旂殑鏃跺垎绉掔殑鍑芥暟 - getTime(time){ - //杞崲涓烘椂鍒嗙 - let h = Math.round(time / 60 / 60) - h = h <10 ? '0' + h : h - //浣滀负杩斿洖鍊艰繑鍥� - // console.log(h); - return h; + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) }, - moment, - draw(){ + + 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 + } + }) + }, + + + draw() { //寮�濮嬫椂闂碶鍏虫満鏃堕棿\杩愯鏃堕棿\寰呮満鏃堕棿 - let PowerOnRateLine = this.$echarts.init(document.getElementById('PowerOnRateLine'), 'macarons'); + let PowerOnRateLine = this.$echarts.init(document.getElementById('PowerOnRateLine'), 'macarons') let PowerOnRateLine_option = { - tooltip:{ - trigger: 'axis', + tooltip: { + trigger: 'axis' }, grid: { left: '3%', @@ -166,50 +293,50 @@ // saveAsImage : {show: true,title:'淇濆瓨鍥剧墖',name :'璁惧鏁堢巼缁熻鎶ヨ〃'} // } // }, - xAxis :{ - type : 'category', - data:['寮�鏈烘椂闀�','鍏虫満鏃堕暱','杩愯鏃堕暱','寰呮満鏃堕暱'], - axisLabel:{ //鍧愭爣杞村瓧浣撻鑹� - textStyle:{ + xAxis: { + type: 'category', + data: ['寮�鏈烘椂闀�', '鍏虫満鏃堕暱', '杩愯鏃堕暱', '寰呮満鏃堕暱'], + axisLabel: { //鍧愭爣杞村瓧浣撻鑹� + textStyle: { color: '#000' } }, - axisLine:{ - lineStyle:{ - color:"#e5e5e5" + axisLine: { + lineStyle: { + color: '#e5e5e5' } }, - axisTick:{ //y杞村埢搴︾嚎 - show:false + axisTick: { //y杞村埢搴︾嚎 + show: false }, - splitLine:{ //缃戞牸 - show: false, + splitLine: { //缃戞牸 + show: false }, - boundaryGap: true, + boundaryGap: true }, - yAxis :{ + yAxis: { name: '鏃堕棿/灏忔椂', - type : 'value', - axisLabel:{ //鍧愭爣杞村瓧浣撻鑹� - textStyle:{ + type: 'value', + axisLabel: { //鍧愭爣杞村瓧浣撻鑹� + textStyle: { color: '#000' } }, - axisLine:{ - show:false, + axisLine: { + show: false }, - axisTick:{ //y杞村埢搴︾嚎 - show:false + axisTick: { //y杞村埢搴︾嚎 + show: false }, - splitLine:{ //缃戞牸 + splitLine: { //缃戞牸 show: true, - color:'#dadde4', - lineStyle:{ - type:"dashed" + color: '#dadde4', + lineStyle: { + type: 'dashed' } } }, - series:[ + series: [ // { // name:'鏇茬嚎', // type: 'line', @@ -253,53 +380,53 @@ // data: [this.openingLong, this.closedLong, this.processLong,this.waitingLong], // }, { - name:'鏌辩姸鍥�', + name: '鏌辩姸鍥�', type: 'bar', - data: [this.openingLong, this.closedLong, this.processLong,this.waitingLong], + data: [this.openingLong, this.closedLong, this.processLong, this.waitingLong], // data:[22,3,4,5], barWidth: 25, - label:{ - show:true, - position:"top", - textStyle:{ - color:'#000', + label: { + show: true, + position: 'top', + textStyle: { + color: '#000' }, // formatter:"鏃堕暱锛歿c}H", - formatter:params=>{ - const value=String(params.value) - return value.length==2&&value[0]==='0'?`鏃堕暱锛�${value.slice(1)}H`:`鏃堕暱锛�${value}H` + formatter: params => { + const value = String(params.value) + return value.length == 2 && value[0] === '0' ? `鏃堕暱锛�${value.slice(1)}H` : `鏃堕暱锛�${value}H` } }, itemStyle: { normal: { color: function(params) { let colorList = [ - ["#6496e9","#6bded3"], - ["#849db8","#b4b8cc"], - ["#4fe1c5","#4ecee1"], + ['#6496e9', '#6bded3'], + ['#849db8', '#b4b8cc'], + ['#4fe1c5', '#4ecee1'], // ["#9978fa","#88a1fa"], - ["#ffbb65","#fdc68b"], - ]; + ['#ffbb65', '#fdc68b'] + ] // return colorList[params.dataIndex]; - let colorItem = colorList[params.dataIndex]; - return new echarts.graphic.LinearGradient(0,0,0,1,[{ - offset:0, - color:colorItem[0] + let colorItem = colorList[params.dataIndex] + return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: colorItem[0] }, { - offset:1, - color:colorItem[1] - }],false) + offset: 1, + color: colorItem[1] + }], false) }, - barBorderRadius: [5, 5, 0, 0], + barBorderRadius: [5, 5, 0, 0] } - }, + } }] } - PowerOnRateLine.setOption(PowerOnRateLine_option); + PowerOnRateLine.setOption(PowerOnRateLine_option) //寮�鏈烘椂闂碶鍏虫満鏃堕棿 - let UtilizationLine = this.$echarts.init(document.getElementById('UtilizationLine'), 'macarons'); - let statChartPieOption1 = { + let UtilizationLine = this.$echarts.init(document.getElementById('UtilizationLine'), 'macarons') + let statChartPieOption1 = { // title: { // x: 'left', // subtext: '寮�鏈烘晥鐜�', @@ -312,9 +439,9 @@ tooltip: { trigger: 'item', // formatter: "{a} <br/>{b} : {c} ({d}%)"锛� - formatter:params=>{ - const value=String(params.value) - return value.length==2&&value[0]==='0'?`${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦:`${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦 + formatter: params => { + const value = String(params.value) + return value.length == 2 && value[0] === '0' ? `${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦 : `${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦 } }, legend: { @@ -331,8 +458,8 @@ /*center: ['55%', '55%'],*/ itemStyle: { normal: { - color: function (params) { - let colorList = [ '#6496e9','#849db8']; + color: function(params) { + let colorList = ['#6496e9', '#849db8'] return colorList[params.dataIndex] }, label: { @@ -340,21 +467,21 @@ position: 'top', // formatter: '{b}\n{c}', // formatter:params=>String(params.value).length==2?params.name+String(params.value).slice(1):params.name+String(params.value) - formatter:params=>{ - const value=String(params.value) - return value.length==2&&value[0]==='0'?params.name+' '+value.slice(1)+'H':params.name+' '+value+'H' + formatter: params => { + const value = String(params.value) + return value.length == 2 && value[0] === '0' ? params.name + ' ' + value.slice(1) + 'H' : params.name + ' ' + value + 'H' } } } }, - data: [{value: this.openingLong, name: '寮�鏈烘椂闂�'}, - {value: this.closedLong, name: '鍏虫満鏃堕棿'}] + data: [{ value: this.openingLong, name: '寮�鏈烘椂闂�' }, + { value: this.closedLong, name: '鍏虫満鏃堕棿' }] }] - }; - UtilizationLine.setOption(statChartPieOption1); + } + UtilizationLine.setOption(statChartPieOption1) //杩愯鏃堕棿\寰呮満鏃堕棿 - let StartupLine = this.$echarts.init(document.getElementById('StartupLine'), 'macarons'); + let StartupLine = this.$echarts.init(document.getElementById('StartupLine'), 'macarons') let statChartPieOption2 = { // title: { // x: 'left', @@ -363,9 +490,9 @@ tooltip: { trigger: 'item', // formatter: "{a} <br/>{b} : {c} ({d}%)", - formatter:params=>{ - const value=String(params.value) - return value.length==2&&value[0]==='0'?`${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦:`${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦 + formatter: params => { + const value = String(params.value) + return value.length == 2 && value[0] === '0' ? `${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦 : `${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦 } }, legend: { @@ -381,101 +508,119 @@ radius: '70%', itemStyle: { normal: { - color: function (params) { - var colorList = ['#4ecee1', '#FCCE10']; + color: function(params) { + var colorList = ['#4ecee1', '#FCCE10'] return colorList[params.dataIndex] }, label: { show: true, position: 'top', // formatter: '{b}\n{c}', - formatter:params=>{ - const value=String(params.value) - return value.length==2&&value[0]==='0'?params.name+' '+value.slice(1)+'H':params.name+' '+value+'H' + formatter: params => { + const value = String(params.value) + return value.length == 2 && value[0] === '0' ? params.name + ' ' + value.slice(1) + 'H' : params.name + ' ' + value + 'H' } } } }, - data: [{value: this.processLong, name: '杩愯鏃堕棿'}, - {value: this.waitingLong, name: '寰呮満鏃堕棿'}] + data: [{ value: this.processLong, name: '杩愯鏃堕棿' }, + { value: this.waitingLong, name: '寰呮満鏃堕棿' }] }] - }; - StartupLine.setOption(statChartPieOption2); + } + StartupLine.setOption(statChartPieOption2) }, - queryStatistical(){ - getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{ - if(res.success) { - // console.log(res); - this.StatCharOpeningRate = res.result.openRate; + + queryStatistical(queryParams) { + getAction(this.url.dayStatisticalRate, queryParams).then(res => { + if (res.success) { + this.StatCharOpeningRate = res.result.openRate //鍒╃敤鐜� - this.StatCharUsedRate = res.result.utilizationRate; + this.StatCharUsedRate = res.result.utilizationRate //寮�鏈虹巼 - this.UtilizationHeight = res.result.openRate; - this.StatCharUsedopeningRate = res.result.StartupHeight; - this.StartupHeight = res.result.StartupHeight; + this.UtilizationHeight = res.result.openRate + this.StatCharUsedopeningRate = res.result.StartupHeight + this.StartupHeight = res.result.StartupHeight this.openingLong = this.getTime(res.result.openLong) - this.waitingLong = this.getTime(res.result.waitLong); - this.processLong = this.getTime(res.result.processLong); - this.closedLong = this.getTime(res.result.closeLong); - this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong); - this.draw(); + this.waitingLong = this.getTime(res.result.waitLong) + this.processLong = this.getTime(res.result.processLong) + this.closedLong = this.getTime(res.result.closeLong) + this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong) + this.draw() } }) }, - dataChange(val) { - this.queryParam.collectTime1 = ""; - if(val){ - this.queryParams.dateTime = val.format('YYYYMMDD') - this.queryParams.collectTime = val.format('YYYY-MM-DD'); - } - }, + initEquipmentNode() { let _this = this getAction(this.url.getBaseTree).then((res) => { if (res.success) { - if(res.result[0]){ + if (res.result[0]) { _this.$set(this.queryParam, 'tierName', res.result[0].title) _this.$set(this.queryParams, 'parentId', res.result[0].key) } - // console.log(res.result[0].entity.tierName) - _this.queryStatistical() + _this.queryStatistical(this.queryParams) } else { - // this.$message.warn(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: 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('璇烽厤缃澶囷紒') - // } - // } - // }) }, + + searchQuery() { + const queryParams = Object.assign({}, this.queryParams) + + Object.keys(queryParams).forEach(item => { + if (Array.isArray(queryParams[item])) { + queryParams[item] = queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (queryParams[item].length === 0) delete queryParams[item] + } + }) + this.queryStatistical(queryParams) + }, + + handleDateChange(val) { + this.queryParam.collectTime1 = '' + if (val) { + this.queryParams.dateTime = val.format('YYYYMMDD') + this.queryParams.collectTime = val.format('YYYY-MM-DD') + } + }, + + selectChange(value, key) { + this.queryParams[key] = value + }, + searchReset() { this.queryParam = {} this.queryParams = { - collectTime:moment().add(-1,'d').format('YYYY-MM-DD'), - dateTime:moment().add(-1,'d').format('YYYYMMDD') + equipmentType: [], + driveType: [], + deviceLevel: [], + collectTime: moment().add(-1, 'd').format('YYYY-MM-DD'), + dateTime: moment().add(-1, 'd').format('YYYYMMDD') } this.initEquipmentNode() - // this.dates = [] - // this.queryStatistical() - // this.onClearSelected() }, - searchQuery(){ - this.queryStatistical(); + + disabledDate(current) { + //Can not slect days before today and today + return current && current > moment().subtract('days', 1) + }, + + //鎶婄璁$畻鎴愬搴旂殑鏃跺垎绉掔殑鍑芥暟 + getTime(time) { + //杞崲涓烘椂鍒嗙 + let h = Math.round(time / 60 / 60) + h = h < 10 ? '0' + h : h + //浣滀负杩斿洖鍊艰繑鍥� + // console.log(h); + return h } }, watch: { @@ -485,7 +630,7 @@ this.$set(this.queryParam, 'equipmentId', val.equipmentId) this.queryParams.parentId = '' this.queryParams.equipmentId = val.equipmentId - }else{ + } else { this.queryParams.parentId = val.key this.queryParams.equipmentId = '' this.$set(this.queryParam, 'tierName', val.title) @@ -497,85 +642,102 @@ </script> <style scoped> - .charContent{ + .charContent { display: flex; } - @media screen and (min-width: 1920px){ - #StatisticsLegend{ - height: 748px!important; + + @media screen and (min-width: 1920px) { + #StatisticsLegend { + height: 748px !important; overflow: scroll; } } - @media screen and (min-width: 1680px) and (max-width: 1920px){ - #StatisticsLegend{ - height: 748px!important; + + @media screen and (min-width: 1680px) and (max-width: 1920px) { + #StatisticsLegend { + height: 748px !important; overflow: scroll; } } - @media screen and (min-width: 1400px) and (max-width: 1680px){ - #StatisticsLegend{ - height: 600px!important; + + @media screen and (min-width: 1400px) and (max-width: 1680px) { + #StatisticsLegend { + height: 600px !important; overflow: scroll; } } - @media screen and (min-width: 1280px) and (max-width: 1400px){ - #StatisticsLegend{ - height: 501px!important; + + @media screen and (min-width: 1280px) and (max-width: 1400px) { + #StatisticsLegend { + height: 501px !important; overflow: scroll; } } - @media screen and (max-width: 1280px){ - #StatisticsLegend{ - height: 501px!important; + + @media screen and (max-width: 1280px) { + #StatisticsLegend { + height: 501px !important; overflow: scroll; } } - #StatisticsLegend .PowerOnRate{ + + #StatisticsLegend .PowerOnRate { flex: 1; margin-bottom: 15px; background-color: #fff; } - #StatisticsLegend .UtilizationStartup{ + + #StatisticsLegend .UtilizationStartup { flex: 1; display: flex; } - #StatisticsLegend .UtilizationStartup>div{ + + #StatisticsLegend .UtilizationStartup > div { flex: 1; background-color: #fff; } - #StatisticsLegend .UtilizationStartup .Utilization{ + + #StatisticsLegend .UtilizationStartup .Utilization { margin-right: 15px; } - .title{ + + .title { display: flex; align-items: center; padding-left: 15px; padding-top: 5px; } - .title .circle{ + + .title .circle { width: 15px; height: 15px; background-color: #7282ec; border-radius: 100%; margin-right: 10px; } - .title .text{ + + .title .text { font-size: 2vh; } - .Line-box{ + + .Line-box { display: flex; flex-direction: column; } - .Line-box .box-bottom{ + + .Line-box .box-bottom { flex: 1; } - .PowerOnRate-box{ + + .PowerOnRate-box { display: flex; } - .PowerOnRate-box .PowerOnRate-left{ + + .PowerOnRate-box .PowerOnRate-left { width: 25%; } - .PowerOnRate-box .PowerOnRate_text{ + + .PowerOnRate-box .PowerOnRate_text { width: 10%; display: flex; flex-direction: column; @@ -583,32 +745,41 @@ justify-content: center; font-weight: 800; } - .PowerOnRate-box .PowerOnRate-right{ + + .PowerOnRate-box .PowerOnRate-right { flex: 1; } - .Utilization-box{ + + .Utilization-box { display: flex; } - .Utilization-box .Utilization-left{ + + .Utilization-box .Utilization-left { width: 25%; } - .Utilization-box .Utilization-right{ + + .Utilization-box .Utilization-right { flex: 1; } - .Startup-box{ + + .Startup-box { display: flex; } - .Startup-box .Startup-left{ + + .Startup-box .Startup-left { width: 25%; } - .Startup-box .Startup-right{ + + .Startup-box .Startup-right { flex: 1; } - .left{ + + .left { display: flex; align-items: center; } - .left .left-box{ + + .left .left-box { width: 65%; height: 60%; margin: 0 auto; @@ -619,7 +790,8 @@ /*!*background-color: yellow;*!*/ /*border-image: linear-gradient(to top, #2bf3c7, #06a8f8) 1;*/ } - .left-box-con{ + + .left-box-con { width: 100%; height: 100%; position: relative; @@ -628,16 +800,18 @@ /*background-color: yellow;*/ border-image: linear-gradient(to top, #2bf3c7, #06a8f8) 1; } - .left .left-box .Rate-box-kong{ + + .left .left-box .Rate-box-kong { width: 100%; background: -moz-linear-gradient(bottom, #b5dec2 0%, #f4f5ba 100%); - background: -webkit-gradient(linear, bottom bottom, top top, color-stop(0%,#b5dec2), color-stop(100%,#f4f5ba)); - background: -webkit-linear-gradient(bottom, #b5dec2 0%,#f4f5ba 100%); - background: -o-linear-gradient(bottom, #b5dec2 0%,#f4f5ba 100%); - background: -ms-linear-gradient(bottom, #b5dec2 0%,#f4f5ba 100%); - background: linear-gradient(to top, #b5dec2 0%,#f4f5ba 100%); + background: -webkit-gradient(linear, bottom bottom, top top, color-stop(0%, #b5dec2), color-stop(100%, #f4f5ba)); + background: -webkit-linear-gradient(bottom, #b5dec2 0%, #f4f5ba 100%); + background: -o-linear-gradient(bottom, #b5dec2 0%, #f4f5ba 100%); + background: -ms-linear-gradient(bottom, #b5dec2 0%, #f4f5ba 100%); + background: linear-gradient(to top, #b5dec2 0%, #f4f5ba 100%); } - .left .left-box .Rate-box{ + + .left .left-box .Rate-box { position: absolute; text-align: center; bottom: 0; @@ -645,27 +819,30 @@ height: 89%; /*background-color: green;*/ background: -moz-linear-gradient(bottom, #06a8f8 0%, #2bf3c7 100%); - background: -webkit-gradient(linear, bottom bottom, top top, color-stop(0%,#06a8f8), color-stop(100%,#2bf3c7)); - background: -webkit-linear-gradient(bottom, #06a8f8 0%,#2bf3c7 100%); - background: -o-linear-gradient(bottom, #06a8f8 0%,#2bf3c7 100%); - background: -ms-linear-gradient(bottom, #06a8f8 0%,#2bf3c7 100%); - background: linear-gradient(to top, #06a8f8 0%,#2bf3c7 100%); + background: -webkit-gradient(linear, bottom bottom, top top, color-stop(0%, #06a8f8), color-stop(100%, #2bf3c7)); + background: -webkit-linear-gradient(bottom, #06a8f8 0%, #2bf3c7 100%); + background: -o-linear-gradient(bottom, #06a8f8 0%, #2bf3c7 100%); + background: -ms-linear-gradient(bottom, #06a8f8 0%, #2bf3c7 100%); + background: linear-gradient(to top, #06a8f8 0%, #2bf3c7 100%); } - .left .left-box .Rate-box p{ + + .left .left-box .Rate-box p { position: absolute; bottom: 0; color: #fff; width: 100%; text-align: center; } - .con-left{ + + .con-left { display: flex; flex-direction: column; flex-wrap: wrap; justify-content: space-around; align-items: center; } - .con-left>span{ + + .con-left > span { flex: 1; } </style> \ No newline at end of file diff --git a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue index 7cb1658..629f22f 100644 --- a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue +++ b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue @@ -2,20 +2,98 @@ <div id="StatisticsLegend" style="width: 100%; height: 100%; overflow: hidden;display: flex;flex-direction: column;background-color: #f5f4f4"> <!-- 鏌ヨ鍖哄煙 --> - <div style="width: 100%; height: 44px; background-color: #fff" class="table-page-search-wrapper"> + <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" :xs="5"> <a-form-item label="鍚嶇О"> - <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParam.tierName"></a-input> + <a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" readOnly v-model="queryParam.tierName"></a-input> </a-form-item> </a-col> - <a-col :md="4" :sm="4" :xs="4"> + <a-col :md="5" :sm="5"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="7" :sm="7"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="鏃ユ湡"> <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' - @change="dataChange" :allowClear="false"/> + @change="handleDateChange" :allowClear="false" style="width: 100%"/> </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 + :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 + v-model="queryParams.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> <a-col :md="2" :sm="2" :xs="2"> <a-space> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> @@ -92,16 +170,15 @@ <script> import moment from 'moment' import { putAction, getAction } from '@/api/manage' - import $ from 'jquery' import * as echarts from 'echarts' + import api from '@/api/mdc' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' export default { name: 'StatisticsLegend', props: { equip: {} }, data() { return { - readOnly: true, - showday: true, StatCharOpeningRate: 0, StatCharUsedRate: 0, StatCharUsedopeningRate: 0, @@ -114,16 +191,23 @@ StartupHeight: 0, quip: {}, dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], queryParam: {}, queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [], collectTime: undefined }, - shiftSubList: [], - shiftList: [], + toggleSearchStatus: false, url: { getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid', dayStatisticalRate: '/mdc/efficiencyReport/dayStatisticalRate', - getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction' + getBaseTree: '/mdc/mdcEquipment/queryTreeListByProduction', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' } } }, @@ -132,23 +216,71 @@ this.queryParams.collectTime = moment().add(-1, 'd').format('YYYY-MM-DD') this.queryParams.dateTime = moment().add(-1, 'd').format('YYYYMMDD') this.initEquipmentNode() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_importance_level') }, methods: { - disabledDate(current) { - //Can not slect days before today and today - return current && current > moment().subtract('days', 1) + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, - //鎶婄璁$畻鎴愬搴旂殑鏃跺垎绉掔殑鍑芥暟 - getTime(time) { - //杞崲涓烘椂鍒嗙 - let h = Math.round(time / 60 / 60) - h = h < 10 ? '0' + h : h - //浣滀负杩斿洖鍊艰繑鍥� - // console.log(h); - return h + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) }, - moment, + + 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 + } + }) + }, + + queryStatistical(queryParams) { + getAction(this.url.dayStatisticalRate, queryParams).then(res => { + if (res.success) { + this.StatCharOpeningRate = res.result.openRate + this.StatCharUsedRate = res.result.utilizationRate + this.UtilizationHeight = res.result.openRate + this.StatCharUsedopeningRate = res.result.usedOpenRate + this.StartupHeight = res.result.usedOpenRate + this.openingLong = this.getTime(res.result.openLong) + this.waitingLong = this.getTime(res.result.waitLong) + this.processLong = this.getTime(res.result.processLong) + this.closedLong = this.getTime(res.result.closeLong) + this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong) + this.draw() + } + }) + }, + draw() { //鍒╃敤鐜� //楗煎浘 @@ -579,29 +711,18 @@ } StartupLine.setOption(StartupLine_option) }, - queryStatistical() { - getAction(this.url.dayStatisticalRate, this.queryParams).then(res => { - if (res.success) { - this.StatCharOpeningRate = res.result.openRate - this.StatCharUsedRate = res.result.utilizationRate - this.UtilizationHeight = res.result.openRate - this.StatCharUsedopeningRate = res.result.usedOpenRate - this.StartupHeight = res.result.usedOpenRate - this.openingLong = this.getTime(res.result.openLong) - this.waitingLong = this.getTime(res.result.waitLong) - this.processLong = this.getTime(res.result.processLong) - this.closedLong = this.getTime(res.result.closeLong) - this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong) - this.draw() - } - }) + + selectChange(value, key) { + this.queryParams[key] = value }, - dataChange(val) { + + handleDateChange(val) { if (val) { this.queryParams.dateTime = val.format('YYYYMMDD') this.queryParams.collectTime = val.format('YYYY-MM-DD') } }, + initEquipmentNode() { let _this = this getAction(this.url.getBaseTree).then((res) => { @@ -623,7 +744,7 @@ _this.$set(this.queryParams, 'parentId', res.result[0].key) } } - this.queryStatistical() + this.queryStatistical(this.queryParams) } else { this.$notification.warning({ message: '娑堟伅', @@ -635,16 +756,45 @@ this.cardLoading = false }) }, + searchReset() { this.queryParam = {} this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [], collectTime: moment().add(-1, 'd').format('YYYY-MM-DD'), dateTime: moment().add(-1, 'd').format('YYYYMMDD') } this.initEquipmentNode() }, + searchQuery() { - this.queryStatistical() + const queryParams = Object.assign({}, this.queryParams) + + Object.keys(queryParams).forEach(item => { + if (Array.isArray(queryParams[item])) { + queryParams[item] = queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (queryParams[item].length === 0) delete queryParams[item] + } + }) + this.queryStatistical(queryParams) + }, + + disabledDate(current) { + //Can not slect days before today and today + return current && current > moment().subtract('days', 1) + }, + + //鎶婄璁$畻鎴愬搴旂殑鏃跺垎绉掔殑鍑芥暟 + getTime(time) { + //杞崲涓烘椂鍒嗙 + let h = Math.round(time / 60 / 60) + h = h < 10 ? '0' + h : h + //浣滀负杩斿洖鍊艰繑鍥� + // console.log(h); + return h } }, watch: { diff --git a/src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue b/src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue index 8f038ea..65cebb1 100644 --- a/src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue +++ b/src/views/mdc/base/modules/WorkshopSignage/EquipmentDetailModal.vue @@ -20,7 +20,7 @@ style="border-collapse: separate;border-spacing:0px; color: #fff" > <tr> - <td v-if="this.spindlebeilv != null"> + <td> <div class="mdcEquipMon" style="width: 250px; height: 200px;margin : 0 auto;padding: 0;" @@ -34,7 +34,8 @@ ></div> </div> </td> - <td v-if="this.feedbeilv != null"> + + <td> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -48,7 +49,8 @@ ></div> </div> </td> - <td v-if="this.spindleload != null"> + + <td v-if="resultData.driveType!=='HNC8'||resultData.driveType!=='HNC7'||resultData.driveType!=='LSV2'"> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -61,7 +63,8 @@ ></div> </div> </td> - <td v-if="this.rapidfeed != null"> + + <td v-else> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -81,148 +84,30 @@ title="鍩虹淇℃伅" :column="4" > - <a-descriptions-item label="璁惧缂栧彿">{{resultData.equipmentID|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍚嶇О">{{resultData.equipmentName|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="IP鍦板潃">{{resultData.equipmentIP|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="绔彛鍙�">{{resultData.dataPort|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="绯荤粺鐗堟湰鍙�">{{resultData.systemVersion|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="椹卞姩绫诲瀷">{{resultData.driveType|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍨嬪彿">{{resultData.equipmentModel|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="璁惧绫诲瀷">{{resultData.deviceType|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍔熺巼">{{resultData.devicePower|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="鏈夋晥杞存暟">{{resultData.validAxis|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="鏈�澶ц酱鏁�">{{resultData.maxAxis|formatDescriptionsItem}}</a-descriptions-item> - <a-descriptions-item label="澶囨敞">{{resultData.remark|formatDescriptionsItem}}</a-descriptions-item> + <a-descriptions-item label="璁惧缂栧彿">{{ resultData.equipmentID|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="璁惧鍚嶇О">{{ resultData.equipmentName|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="IP鍦板潃">{{ resultData.equipmentIP|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="绔彛鍙�">{{ resultData.dataPort|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="绯荤粺鐗堟湰鍙�">{{ resultData.systemVersion|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="椹卞姩绫诲瀷">{{ resultData.driveType|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="璁惧鍨嬪彿">{{ resultData.equipmentModel|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="璁惧绫诲瀷">{{ resultData.deviceType|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="璁惧鍔熺巼">{{ resultData.devicePower|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="鏈夋晥杞存暟">{{ resultData.validAxis|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="鏈�澶ц酱鏁�">{{ resultData.maxAxis|formatDescriptionsItem }} + </a-descriptions-item> + <a-descriptions-item label="澶囨敞">{{ resultData.remark|formatDescriptionsItem }}</a-descriptions-item> </a-descriptions> - - <!-- <a-descriptions - title="杩愯鏁版嵁" - v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' " - :column="4" - > - <a-descriptions-item label="涓昏酱鍊嶇巼(%)">{{resultData.spindlebeilv}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰鍊嶇巼(%)">{{resultData.feedbeilv}}</a-descriptions-item> - <a-descriptions-item label="涓昏酱璐熻嵎(%)">{{resultData.spindleload}}</a-descriptions-item> - <a-descriptions-item label="涓昏酱杞��(rpm)">{{resultData.spindlespeed}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰閫熷害(mm/min)">{{resultData.feedrate}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="杩愯鏁版嵁 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="涓昏酱鍊嶇巼(%)">{{resultData.spindlebeilv}}</a-descriptions-item> - <a-descriptions-item label="璁惧姝e父杩愯鏃堕棿">{{resultData.equipmentNormalTime}}</a-descriptions-item> - <a-descriptions-item label="蹇�熻繘缁欏�嶇巼(%)">{{resultData.rapidfeed}}</a-descriptions-item> - <a-descriptions-item label="NC姝e父杩愯鏃堕棿">{{resultData.nCNormalTime}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰鍊嶇巼(%)">{{resultData.feedbeilv}}</a-descriptions-item> - <a-descriptions-item label="璁惧杩愯鏃堕棿">{{resultData.equipmentTime}}</a-descriptions-item> - <a-descriptions-item label="褰撳墠鍒�鍏峰彿">{{resultData.toolNum}}</a-descriptions-item> - </a-descriptions> --> - - <!-- <a-descriptions - title="绋嬪簭淇℃伅" - v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' " - :column="4" - > - <a-descriptions-item label="搴忓垪鍙�">{{resultData.sequencenumber}}</a-descriptions-item> - <a-descriptions-item - label="褰撳墠鎵ц浠g爜" - :span="2" - >{{resultData.executingcode}}</a-descriptions-item> - <a-descriptions-item label="宸ヤ欢鍚嶇О">{{resultData.productName}}</a-descriptions-item> - </a-descriptions> --> - - <!-- <a-descriptions - title="绋嬪簭淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="褰撳墠绋嬪簭">{{resultData.program}}</a-descriptions-item> - <a-descriptions-item label="绋嬪簭鎵ц鐐�">{{resultData.programPosition}}</a-descriptions-item> - <a-descriptions-item label="鎿嶄綔妯″紡">{{resultData.operationType}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅缂栧彿涓�">{{resultData.firstErrorNum}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅涓�">{{resultData.firstError}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅">{{resultData.errorinfo}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅缂栧彿浜�">{{resultData.secondErrorNum}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅浜�">{{resultData.secondError}}</a-descriptions-item> - </a-descriptions> --> - - <!--<a-descriptions - title="杞寸洃鎺ф暟鎹� fro SIEMENS840DSL" - v-if="driverType == 'SIEMENS840DSL'" - :column="4" - > - <a-descriptions-item label="X杞存俯搴�">{{resultData.temperatureX}}</a-descriptions-item> - <a-descriptions-item label="Y杞存俯搴�">{{resultData.temperatureY}}</a-descriptions-item> - <a-descriptions-item label="Z杞存俯搴�">{{resultData.temperatureZ}}</a-descriptions-item> - <a-descriptions-item label="A杞存俯搴�">{{resultData.temperatureA}}</a-descriptions-item> - <a-descriptions-item label="B杞存俯搴�">{{resultData.temperatureB}}</a-descriptions-item> - <a-descriptions-item label="X杞寸數娴�">{{resultData.equipmentCurrentX}}</a-descriptions-item> - <a-descriptions-item label="Y杞寸數娴�">{{resultData.equipmentCurrentY}}</a-descriptions-item> - <a-descriptions-item label="Z杞寸數娴�">{{resultData.equipmentCurrentZ}}</a-descriptions-item> - <a-descriptions-item label="A杞寸數娴�">{{resultData.equipmentCurrentA}}</a-descriptions-item> - <a-descriptions-item label="B杞寸數娴�">{{resultData.equipmentCurrentB}}</a-descriptions-item> - <a-descriptions-item label="X杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorX}}</a-descriptions-item> - <a-descriptions-item label="Y杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorY}}</a-descriptions-item> - <a-descriptions-item label="Z杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorZ}}</a-descriptions-item> - <a-descriptions-item label="A杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorA}}</a-descriptions-item> - <a-descriptions-item label="B杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorB}}</a-descriptions-item> - </a-descriptions> ---> - <!-- <a-descriptions - title="鍧愭爣淇℃伅 " - v-if="driverType == 'FANUC'" - :column="3" - > - <a-descriptions-item label="缁濆鍧愭爣X">{{resultData.xabsolute}}</a-descriptions-item> - <a-descriptions-item label="缁濆鍧愭爣Y">{{resultData.yabsolute}}</a-descriptions-item> - <a-descriptions-item label="缁濆鍧愭爣Z">{{resultData.zabsolute}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣X">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣Y">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣Z">{{resultData.zmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> --> - <!---鏁版嵁婧愯皟鏁� 鍔ㄦ�佸睍绀� 杩愯鏁版嵁----> <a-descriptions title="杩愯鏁版嵁" @@ -239,40 +124,14 @@ > <a-tooltip @mouseenter="mouseEnterItem"> <template slot="title"> - {{item.value|formatDescriptionsItem}} + {{ item.value|formatDescriptionsItem }} </template> - <div class="description-item-class">{{item.value|formatDescriptionsItem}}</div> + <div class="description-item-class">{{ item.value|formatDescriptionsItem }}</div> </a-tooltip> </a-descriptions-item> </a-descriptions> - - <!--<a-descriptions--> - <!--title="鍧愭爣淇℃伅"--> - <!--v-show="xyzAliasesList != null"--> - <!--v-if="driverType != 'PLC'"--> - <!--:column="4"--> - <!-->--> - <!--<a-descriptions-item--> - <!--v-for="(item,id) in xyzAliasesList "--> - <!--:key="item.id"--> - <!--:label="item.title"--> - <!-->{{item.value}}</a-descriptions-item>--> - <!--</a-descriptions>--> - - <!--<a-descriptions--> - <!--title="鐗堟湰淇℃伅 for lsv2"--> - <!--v-if="driverType == 'LSV2'"--> - <!--:column="4"--> - <!--class="lsv2Data"--> - <!-->--> - <!--<a-descriptions-item label="NC鐗堟湰">{{resultData.ncversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="TNC鐗堟湰">{{resultData.tncversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="OPT鐗堟湰">{{resultData.optversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="PLC鐗堟湰">{{resultData.plcversion}}</a-descriptions-item>--> - <!--</a-descriptions>--> - </td> </tr> </table> @@ -290,1253 +149,1251 @@ </template> <script> - import { - getAction, - postAction - } from '@/api/manage' - import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' - import Template1 from '../../../../jeecg/JVxeDemo/layout-demo/Template1' +import { + getAction, + postAction +} from '@/api/manage' +import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' +import Template1 from '../../../../jeecg/JVxeDemo/layout-demo/Template1' - export default { - name: 'EqumentDetaiModal', - components: { Template1 }, - props: {}, - data() { - return { - mdcDriveTypeParamConfigList: [], - xyzAliasesList: [], - title: '', - //涓昏酱鍊嶇巼 - spindlebeilv: 1, - //杩涚粰鍊嶇巼 - feedbeilv: 1, - // 涓昏酱璐熻嵎 - spindleload: 1, - //蹇�熻繘缁欏�嶇巼 - rapidfeed: 1, - visible: false, - resultData: {}, - driverType: '', - deviceTypeDict: '', - url: { - mdcEquipmentDetailedInfo: '/mdc/mdcEquipment/mdcEquipmentDetailedInfo' - }, - modalTimer: null, - ee: ' ', - modalNode: null, - timeout: null - } - }, - mounted() { - - }, - watch: {}, - filters:{ - formatDescriptionsItem(value){ - return value?value:'鏃�' - } - }, - methods: { - drawLine() { - let _this = this - if (_this.spindlebeilv) { - //鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 - let mdcEquiMoniGauge1 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge1'), 'macarons') - let mdcEquiMoniGaugeOption1 = { - tooltip: { - formatter: '{a} <br/>{b} : {c}%' - }, - - series: [{ - name: '澶栭儴绾�', - type: 'gauge', - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ] - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20 // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false - }, //鍒诲害鏍峰紡 - splitLine: { - show: false - } - }, - { - name: '鍐呴儴瀹界嚎鏉�', - type: 'gauge', - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鍐呴儴缁嗙嚎鏉�', - type: 'gauge', - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '闂撮殧鏉″舰', - type: 'gauge', - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鏁版嵁', - type: 'gauge', - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.spindlebeilv / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.spindlebeilv - }] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�', - 'type': 'pie', - 'radius': ['4%', '2%'], - 'hoverAnimation': false, - tooltip: { - show: false - }, - cursor: 'default', - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - 'data': [1] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�2', - 'type': 'pie', - 'radius': '2%', - 'hoverAnimation': false, - cursor: 'default', - tooltip: { - show: false - }, - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - 'data': [1] - } - ] - } - mdcEquiMoniGauge1.setOption(mdcEquiMoniGaugeOption1) - } - if (_this.feedbeilv) { - let mdcEquiMoniGauge2 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge2'), 'macarons') - let mdcEquiMoniGaugeOption2 = { - tooltip: { - formatter: '{a} <br/>{b} : {c}%' - }, - - series: [{ - name: '澶栭儴绾�', - type: 'gauge', - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ] - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20 // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false - }, //鍒诲害鏍峰紡 - splitLine: { - show: false - } - }, - { - name: '鍐呴儴瀹界嚎鏉�', - type: 'gauge', - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鍐呴儴缁嗙嚎鏉�', - type: 'gauge', - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '闂撮殧鏉″舰', - type: 'gauge', - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鏁版嵁', - type: 'gauge', - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.feedbeilv / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.feedbeilv - }] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�', - 'type': 'pie', - 'radius': ['4%', '2%'], - 'hoverAnimation': false, - tooltip: { - show: false - }, - cursor: 'default', - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - 'data': [1] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�2', - 'type': 'pie', - 'radius': '2%', - 'hoverAnimation': false, - cursor: 'default', - tooltip: { - show: false - }, - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - 'data': [1] - } - ] - } - mdcEquiMoniGauge2.setOption(mdcEquiMoniGaugeOption2) - } - if (_this.spindleload) { - let mdcEquiMoniGauge3 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge3'), 'macarons') - let mdcEquiMoniGaugeOption3 = { - tooltip: { - formatter: '{a} <br/>{b} : {c}%' - }, - - series: [{ - name: '澶栭儴绾�', - type: 'gauge', - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 100, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ] - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20 // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false - }, //鍒诲害鏍峰紡 - splitLine: { - show: false - } - }, - { - name: '鍐呴儴瀹界嚎鏉�', - type: 'gauge', - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鍐呴儴缁嗙嚎鏉�', - type: 'gauge', - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '闂撮殧鏉″舰', - type: 'gauge', - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鏁版嵁', - type: 'gauge', - radius: '52.5%', - z: 3, - startAngle: 225, - max: 100, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.spindleload / 100, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.spindleload - }] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�', - 'type': 'pie', - 'radius': ['4%', '2%'], - 'hoverAnimation': false, - tooltip: { - show: false - }, - cursor: 'default', - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - 'data': [1] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�2', - 'type': 'pie', - 'radius': '2%', - 'hoverAnimation': false, - cursor: 'default', - tooltip: { - show: false - }, - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - 'data': [1] - } - ] - } - mdcEquiMoniGauge3.setOption(mdcEquiMoniGaugeOption3) - } - if (_this.rapidfeed) { - let mdcEquiMoniGauge4 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge4'), 'macarons') - let mdcEquiMoniGaugeOption4 = { - tooltip: { - formatter: '{a} <br/>{b} : {c}%' - }, - - series: [{ - name: '澶栭儴绾�', - type: 'gauge', - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ] - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20 // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false - }, //鍒诲害鏍峰紡 - splitLine: { - show: false - } - }, - { - name: '鍐呴儴瀹界嚎鏉�', - type: 'gauge', - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鍐呴儴缁嗙嚎鏉�', - type: 'gauge', - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '闂撮殧鏉″舰', - type: 'gauge', - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false - } - }, - { - name: '鏁版嵁', - type: 'gauge', - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.rapidfeed / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.rapidfeed - }] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�', - 'type': 'pie', - 'radius': ['4%', '2%'], - 'hoverAnimation': false, - tooltip: { - show: false - }, - cursor: 'default', - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - 'data': [1] - }, - // 鍐呭渾 - { - 'name': '鍐呭渾鐜�2', - 'type': 'pie', - 'radius': '2%', - 'hoverAnimation': false, - cursor: 'default', - tooltip: { - show: false - }, - 'labelLine': { - 'normal': { - 'show': false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - 'data': [1] - } - ] - } - mdcEquiMoniGauge4.setOption(mdcEquiMoniGaugeOption4) - } +export default { + name: 'EqumentDetaiModal', + components: { Template1 }, + props: {}, + data() { + return { + mdcDriveTypeParamConfigList: [], + xyzAliasesList: [], + title: '', + //涓昏酱鍊嶇巼 + spindlebeilv: 1, + //杩涚粰鍊嶇巼 + feedbeilv: 1, + // 涓昏酱璐熻嵎 + spindleload: 1, + //蹇�熻繘缁欏�嶇巼 + rapidfeed: 1, + visible: false, + resultData: {}, + driverType: '', + deviceTypeDict: '', + url: { + mdcEquipmentDetailedInfo: '/mdc/mdcEquipment/mdcEquipmentDetailedInfo' }, - - handleCancel() { - this.$emit('close') - this.visible = false - // this.modalNode.removeEventListener('mouseleave', this.closeModal) - if(this.modalTimer){ - clearInterval(this.modalTimer) - this.modalTimer = null - } - if (this.timeout) { - clearTimeout(this.timeout) - this.timeout = null - } - }, - - timerModel(id) { - this.ee = id - this.modalTimer = setInterval(() => { - setTimeout(this.initData(this.ee), 0) - }, 1000 * 4) - }, - - initData(id) { - let _this = this - this.visible = true - // _this.drawLine() - getAction(this.url.mdcEquipmentDetailedInfo, { id: id }).then((res) => { - if (res.success) { - _this.resultData = res.result - _this.driverType = res.result.deviceType - _this.spindlebeilv = res.result.spindlebeilv - _this.feedbeilv = res.result.feedbeilv - _this.spindleload = res.result.spindleload - _this.rapidfeed = res.result.rapidfeed - _this.mdcDriveTypeParamConfigList = res.result.mdcDriveTypeParamConfigList - _this.xyzAliasesList = res.result.xyzAliasesList - this.$nextTick(() => { - _this.drawLine() - }) - // _this.initDeviceType(_this.resultData.deviceType) - } else { - // _this.$message.warn(res.message) - _this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - }, - - getModalNode() { - // console.log(document.querySelector('.ant-modal-content')) - // this.modalNode = document.querySelector('.ant-modal-content') - // this.timeout = setTimeout(() => { - // this.modalNode.addEventListener('mouseleave', this.closeModal) - // }, 100) - }, - - closeModal() { - this.handleCancel() - }, - - mouseEnterItem(e){ - if (e.target.clientWidth >= e.target.scrollWidth) e.target.style.pointerEvents = 'none' // 闃绘榧犳爣浜嬩欢 pointer-events 灞炴�х敤浜庤缃厓绱犳槸鍚﹀榧犳爣浜嬩欢鍋氬嚭鍙嶅簲銆� - } - }, - beforeDestroy() { - clearInterval(this.modalTimer) - this.modalTimer = null + modalTimer: null, + ee: ' ', + modalNode: null, + timeout: null } + }, + mounted() { + + }, + watch: {}, + filters: { + formatDescriptionsItem(value) { + return value ? value : '鏃�' + } + }, + methods: { + drawLine() { + let _this = this + + let mdcEquiMoniGauge1 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge1'), 'macarons') + let mdcEquiMoniGaugeOption1 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.spindlebeilv / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.spindlebeilv ? true : false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.spindlebeilv ? true : false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.spindlebeilv + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge1.setOption(mdcEquiMoniGaugeOption1) + + let mdcEquiMoniGauge2 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge2'), 'macarons') + let mdcEquiMoniGaugeOption2 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.feedbeilv / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.feedbeilv ? true : false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.feedbeilv ? true : false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.feedbeilv + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge2.setOption(mdcEquiMoniGaugeOption2) + + if (_this.resultData !== 'HNC7' || _this.resultData == 'HNC8' || _this.resultData == 'LSV2') { + let mdcEquiMoniGauge3 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge3'), 'macarons') + let mdcEquiMoniGaugeOption3 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 100, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 100, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.spindleload / 100, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.spindleload ? true : false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.spindleload ? true : false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.spindleload + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge3.setOption(mdcEquiMoniGaugeOption3) + } else { + let mdcEquiMoniGauge4 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge4'), 'macarons') + let mdcEquiMoniGaugeOption4 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.rapidfeed / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.rapidfeed ? true : false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.rapidfeed ? true : false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.rapidfeed + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge4.setOption(mdcEquiMoniGaugeOption4) + } + }, + + handleCancel() { + this.$emit('close') + this.visible = false + // this.modalNode.removeEventListener('mouseleave', this.closeModal) + if (this.modalTimer) { + clearInterval(this.modalTimer) + this.modalTimer = null + } + if (this.timeout) { + clearTimeout(this.timeout) + this.timeout = null + } + }, + + timerModel(id) { + this.ee = id + this.modalTimer = setInterval(() => { + setTimeout(this.initData(this.ee), 0) + }, 1000 * 4) + }, + + initData(id) { + let _this = this + this.visible = true + // _this.drawLine() + getAction(this.url.mdcEquipmentDetailedInfo, { id: id }).then((res) => { + if (res.success) { + _this.resultData = res.result + _this.driverType = res.result.deviceType + _this.spindlebeilv = res.result.spindlebeilv + _this.feedbeilv = res.result.feedbeilv + _this.spindleload = res.result.spindleload + _this.rapidfeed = res.result.rapidfeed + _this.mdcDriveTypeParamConfigList = res.result.mdcDriveTypeParamConfigList + _this.xyzAliasesList = res.result.xyzAliasesList + this.$nextTick(() => { + _this.drawLine() + }) + // _this.initDeviceType(_this.resultData.deviceType) + } else { + // _this.$message.warn(res.message) + _this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + getModalNode() { + // console.log(document.querySelector('.ant-modal-content')) + // this.modalNode = document.querySelector('.ant-modal-content') + // this.timeout = setTimeout(() => { + // this.modalNode.addEventListener('mouseleave', this.closeModal) + // }, 100) + }, + + closeModal() { + this.handleCancel() + }, + + mouseEnterItem(e) { + if (e.target.clientWidth >= e.target.scrollWidth) e.target.style.pointerEvents = 'none' // 闃绘榧犳爣浜嬩欢 pointer-events 灞炴�х敤浜庤缃厓绱犳槸鍚﹀榧犳爣浜嬩欢鍋氬嚭鍙嶅簲銆� + } + }, + beforeDestroy() { + clearInterval(this.modalTimer) + this.modalTimer = null } +} </script> <style scoped lang="less"> - body { - overflow-y: hidden !important; - } +body { + overflow-y: hidden !important; +} - .full-modal { - .ant-modal { - top: 0; - padding-bottom: 0; - margin: 0; - background-color: #4a4a48 !important; - opacity: 0.9; - } - /deep/ .ant-modal-content { - display: flex; - flex-direction: column; - /*height: calc(100vh);*/ - background-color: #4a4a48; - } - .ant-modal-body { - flex: 1; - } +.full-modal { + .ant-modal { + top: 0; + padding-bottom: 0; + margin: 0; + background-color: #4a4a48 !important; + opacity: 0.9; } /deep/ .ant-modal-content { - /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ - /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ - /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - background-color: #312c2c; - opacity: 1; + display: flex; + flex-direction: column; + /*height: calc(100vh);*/ + background-color: #4a4a48; } - /deep/ .ant-modal-close { - color: #1191b0; - font-size: 24px; + .ant-modal-body { + flex: 1; } +} - /deep/ .ant-modal-close-x { - font-size: 24px; - } +/deep/ .ant-modal-content { + /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ + /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ + /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ + background-color: #312c2c; + opacity: 1; +} - /deep/ .ant-modal-footer { - border-top: none; - } +/deep/ .ant-modal-close { + color: #1191b0; + font-size: 24px; +} - /deep/ .ant-descriptions { - border: 1px solid #16738d; - margin: 10px 0; - } +/deep/ .ant-modal-close-x { + font-size: 24px; +} - /deep/ .ant-descriptions-title { - color: #fff; - padding: 10px; - margin-bottom: 0; - } +/deep/ .ant-modal-footer { + border-top: none; +} - /*/deep/ .ant-descriptions-view {*/ - /*padding: 0 20px;*/ - /*}*/ +/deep/ .ant-descriptions { + border: 1px solid #16738d; + margin: 10px 0; +} - /deep/ .ant-descriptions-view .ant-descriptions-row .ant-descriptions-item { - padding-bottom: 5px; - } +/deep/ .ant-descriptions-title { + color: #fff; + padding: 10px; + margin-bottom: 0; +} - /deep/ .ant-descriptions-item-colon { - color: #fff; - /*width: 5.1vw;*/ - } +/*/deep/ .ant-descriptions-view {*/ +/*padding: 0 20px;*/ +/*}*/ - /deep/ .ant-descriptions-item-content { - color: #fff; - border: 1px solid #4bcfc8; - padding: 0 10px; - min-width: 130px; - } +/deep/ .ant-descriptions-view .ant-descriptions-row .ant-descriptions-item { + padding-bottom: 5px; +} - .mdcEquipMon { - color: #fff; - } +/deep/ .ant-descriptions-item-colon { + color: #fff; + /*width: 5.1vw;*/ +} - /deep/ .ant-descriptions-item-label{ - width: 6.7vw; - text-align: right; - margin-right: 10px; - } +/deep/ .ant-descriptions-item-content { + color: #fff; + border: 1px solid #4bcfc8; + padding: 0 10px; + min-width: 130px; +} - /deep/ .operationData .ant-descriptions-item-content, - .lsv2Data .ant-descriptions-item-content - { - width: 130px; - vertical-align: bottom; - } +.mdcEquipMon { + color: #fff; +} - .description-item-class{ - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } +/deep/ .ant-descriptions-item-label { + width: 6.7vw; + text-align: right; + margin-right: 10px; +} + +/deep/ .operationData .ant-descriptions-item-content, +.lsv2Data .ant-descriptions-item-content { + width: 130px; + vertical-align: bottom; +} + +.description-item-class { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} </style> diff --git a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue index 8ee1144..5426507 100644 --- a/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue +++ b/src/views/mdc/base/modules/alarmAnalysis/alarmAnalysisMain.vue @@ -5,18 +5,102 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :md="7" :sm="7"> + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> <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 :lg="2" :md="2" :sm="2" :xs="2"> - <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + + <a-col :md="3" :sm="3" :xs="3"> + <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-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="6" :sm="6" :xs="6"> + <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 + v-model="queryParam.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> </a-col> </a-row> </a-form> </div> + <div id="DeviceList"> <div class="openRateTrendDg"> <a-table :columns="columns" :data-source="dataList" bordered :pagination="false" :scroll="{y:210}" @@ -51,13 +135,11 @@ <script> import moment from 'moment' - import { putAction, getAction } from '@/api/manage' + import { getAction } from '@/api/manage' import $ from 'jquery' import '@/components/table2excel/table2excel' - import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' - import { - JeecgListMixin - } from '@/mixins/JeecgListMixin' + import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' + import api from '@api/mdc' const columns = [ { title: '鎶ヨ鍙�', dataIndex: 'alarmCode', key: 'alarmCode', align: 'center' }, @@ -98,7 +180,6 @@ ] export default { - // mixins: [JeecgListMixin], name: 'alarmAnalysisMain', components: {}, data() { @@ -115,9 +196,17 @@ TreeIDTwo: 2, deviceTypeDict: '', dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], identifying: [], queryParam: {}, - queryParams: {}, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [] + }, queryParamEquip: {}, queryParamPeople: {}, efficiencyOptions: [ @@ -134,7 +223,8 @@ efficiencyList: '/mdc/alarmAnalyze/alarmList', listByType: '/mdc/MdcUtilizationRate/getByType', alarmTrend: '/mdc/alarmAnalyze/alarmTrend', - equipmentAlarmList: '/mdc/alarmAnalyze/equipmentAlarmList' + equipmentAlarmList: '/mdc/alarmAnalyze/equipmentAlarmList', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' }, tableHeads: [], pieDate: [0], @@ -142,7 +232,8 @@ YData: [0], columns, innerColumns, - hasRequsetAlarmCodeList: [] + hasRequestAlarmCodeList: [], + toggleSearchStatus: false } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -150,12 +241,11 @@ * 鐢熷懡鍛ㄦ湡 鎸傝浇鍓� * */ created() { - this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] - this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - this.queryParam.typeTree = '1' - this.loadData1() - + this.searchReset() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_importance_level') }, mounted() { this.drawWrin() @@ -234,6 +324,46 @@ } }, methods: { + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) + }, + + 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 + } + }) + }, + numBerTwo(value) { if (value) { return parseFloat((value * 100).toFixed(2)) @@ -241,6 +371,7 @@ return '0' } }, + TableDraw(key, val) { let that = this that.echartLoading = true @@ -257,15 +388,6 @@ }) that.XData = res.result.dateCountList.map(item => item.key) that.YData = res.result.dateCountList.map(item => item.count) - - // this.tableHeads = res.result.dates - // this.dataList = res.result - // this.draw() - // this.checkSameData(this.dataList) - // this.checkSameData1(this.dataList) - // this.checkSameData2(this.dataList) - // this.combineCell(); - // this.initDeviceType(this.dataList) that.drawWrin() } }) @@ -279,37 +401,12 @@ //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 - } - } - } - }) - } - } - } - }, + dateParamChange(v1, v2) { this.queryParam.startDate = v2[0] this.queryParam.endDate = v2[1] }, + searchQuery() { if (this.queryParam.typeTree == '1') { this.queryParam.parentId = this.queryParamEquip.parentId @@ -318,29 +415,44 @@ this.queryParam.parentId = this.queryParamPeople.parentId this.queryParam.equipmentId = '' } - this.loadData1() + + Object.keys(this.queryParams).forEach(item => { + if (Array.isArray(this.queryParams[item])) { + if (this.queryParams[item].length !== 0) this.queryParam[item] = this.queryParams[item].join() + else delete this.queryParam[item] + } + }) + this.loadData() }, - loadData1() { + + searchReset() { + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [] + } + this.queryParam = {} + this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] + this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + this.queryParam.typeTree = '1' + this.loadData() + }, + + loadData() { this.outerDataLoading = true this.tableHeads = [] this.dataList = [] getAction(this.url.efficiencyList, this.queryParam).then(res => { if (res.success) { - // this.tableHeads = res.result.dates this.dataList = res.result - this.hasRequsetAlarmCodeList = [] - // this.draw() - // this.checkSameData(this.dataList) - // this.checkSameData1(this.dataList) - // this.checkSameData2(this.dataList) - // this.combineCell(); - // this.initDeviceType(this.dataList) - + this.hasRequestAlarmCodeList = [] } }).finally(() => { this.outerDataLoading = false }) }, + drawWrin() { this.equipmentWarningPie = this.$echarts.init(document.getElementById('MdcEquipmentWarningPie'), 'macarons') let equipmentWarningPieOption = { @@ -483,7 +595,7 @@ let _this = this // 褰撳睍寮�鏃惰嫢璇ヨ鏈灞曞紑杩囨墠浼氳姹傚悗鍙版暟鎹紝灞曞紑杩囩殑鏁版嵁浼氳缂撳瓨鏃犻渶閲嶅璇锋眰 this.queryParam.alarmCode = record.alarmCode - if (expanded && !this.hasRequsetAlarmCodeList.includes(record.alarmCode)) { + if (expanded && !this.hasRequestAlarmCodeList.includes(record.alarmCode)) { this.innerDataLoading = true getAction(this.url.equipmentAlarmList, this.queryParam).then(res => { if (res.success) { @@ -492,7 +604,7 @@ item.innerDataList = res.result } }) - _this.hasRequsetAlarmCodeList.push(record.alarmCode) + _this.hasRequestAlarmCodeList.push(record.alarmCode) } }) .finally(() => { @@ -501,6 +613,10 @@ } }, + selectChange(value, key) { + this.queryParams[key] = value + }, + /** * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� */ diff --git a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysisGauge.vue b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysisGauge.vue index 1fa304c..4695a59 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysisGauge.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysisGauge.vue @@ -57,7 +57,6 @@ }, watch:{ dataList(val){ - console.log(val); this.TopLastList = val this.draw() }, diff --git a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue index 185e5e6..998f657 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/comparativeAnalysismain.vue @@ -5,30 +5,44 @@ <div style="width: 100%; background-color: #fff" class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <!--<a-col :md="5" :sm="5">--> - <!--<a-form-item label="鍚嶇О">--> - <!--<a-input placeholder="杈撳叆璁惧鍚嶇О鏌ヨ" :readOnly="readOnly" v-model="queryParam.tierName"></a-input>--> - <!--</a-form-item>--> - <!--</a-col>--> <a-col :md="5" :sm="5"> <a-form-item label="璁惧"> - <a-input-search :readOnly="true" v-model="queryParam.equipmentId" @search="deviceSearch" + <a-input-search readOnly v-model="queryParam.equipmentId" @search="deviceSearch" placeholder='璇烽�夋嫨璁惧'/> </a-form-item> </a-col> <a-col :md="5" :sm="5"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParam.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> <a-form-item label="椹卞姩绫诲瀷"> - <!--<j-dict-select-tag placeholder="璇烽�夋嫨椹卞姩绫诲瀷"--> - <!--:triggerChange="true" dictCode="mdc_driveType"--> - <!--v-model="queryParam.driveType" allow-clear/>--> - <a-auto-complete - v-model="queryParam.driveType" - :data-source="driveTypeList" - placeholder="椹卞姩绫诲瀷" - :filter-option="filterOption" - :allowClear="true" - /> + <a-select + :value="queryParam.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> </a-form-item> </a-col> <a-col :md="6" :sm="6" :xs="6"> @@ -36,7 +50,55 @@ <a-range-picker @change="dateParamChange" v-model="dates" format="YYYYMMDD"/> </a-form-item> </a-col> - <a-col> + + <a-col :md="2" :sm="2"> + <a + @click="toggleSearchStatus=!toggleSearchStatus" + @selectstart="$event.preventDefault()" + style="display: inline-block;height: 32px;line-height: 32px" + > + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> + </a-col> + </a-row> + + <a-row :gutter="24" v-if="toggleSearchStatus"> + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="璁惧绾у埆"> + <a-select + :value="queryParam.deviceLevel" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绾у埆" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'deviceLevel')" + > + <a-select-option v-for="(item,index) in device_level_list" :value="item.value" :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="5" :sm="5" :xs="5"> + <a-form-item label="閲嶈绋嬪害"> + <a-select + v-model="queryParam.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{item.label}} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :md="2" :sm="2" :xs="2"> <a-space> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> @@ -68,30 +130,22 @@ <script> import moment from 'moment' - import $ from 'jquery' import JDictSelectTag from '@/components/dict/JDictSelectTag' import JDate from '../../../../../components/jeecg/JDate' - import { - requestPut, - deleteAction, - getAction - } from '@/api/manage' + import { requestPut, deleteAction, getAction } from '@/api/manage' import comparativeAnalysisBar from './comparativeAnalysisBar' import comparativeAnalysisGauge from './comparativeAnalysisGauge' import conparativeAnalysisPie from './conparativeAnalysisPie' import '@/components/table2excel/table2excel' import JInput from '@/components/jeecg/JInput' import JEllipsis from '@/components/jeecg/JEllipsis' - import Tooltip from 'ant-design-vue/es/tooltip' import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' import api from '@/api/mdc' import SelectDeviceDrawer from '../../../../system/modules/SelectDeviceDrawer.vue' export default { name: 'comparativeAnalysismain', - // mixins: [JeecgListMixin], components: { - Tooltip, comparativeAnalysisBar, comparativeAnalysisGauge, conparativeAnalysisPie, @@ -112,40 +166,42 @@ AnalysisGauge: [], AnalysisPie: [], dates: [], - xianshi: '', - readOnly: true, queryParam: { - equipmentId: '' + equipmentId: '', + equipmentType: [], + driveType: [], + deviceLevel: [] }, queryParams: {}, queryParamEquip: {}, queryParamPeople: {}, - dataStartsoucre: [], url: { - comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis' + comparativeAnalysis: '/mdc/efficiencyReport/comparativeAnalysis', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' }, AnalysisList: {}, - driveTypeList: [] + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], + toggleSearchStatus: '' } }, watch: { Type(valmath) { this.dataList = [] this.queryParams.typeTree = valmath - // console.log(this.queryParams.typeTree) }, nodeTree(val) { //鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 if (JSON.stringify(val) != '{}') { if (val.equipmentId) { - // this.$set(this.queryParam, 'tierName', val.title) this.queryParamEquip.parentId = '' - // this.queryParams.equipmentId = val.equipmentId this.queryParam.equipmentId = val.equipmentId this.queryParamEquip.equipmentId = val.equipmentId } else { - // this.$set(this.queryParam, 'tierName', val.title) this.queryParamEquip.parentId = val.key this.queryParams.equipmentId = '' + this.queryParam.equipmentId = '' } this.searchQuery() } @@ -153,12 +209,10 @@ nodePeople(val) { if (JSON.stringify(val) != '{}') { if (val.equipmentId) { - // this.$set(this.queryParam, 'tierName', val.title) this.queryParamEquip.parentId = '' this.queryParams.equipmentId = val.equipmentId this.queryParamEquip.equipmentId = val.equipmentId } else { - // this.$set(this.queryParam, 'tierName', val.title) this.queryParamEquip.parentId = val.key this.queryParams.equipmentId = '' } @@ -167,63 +221,62 @@ } }, methods: { - tabChange(val) { - this.activeKey = val + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, - dateParamChange(v1, v2) { - // console.log(v1,v2) - this.queryParam.startTime = v2[0] - this.queryParam.endTime = v2[1] - console.log(v2[0], v2[1]) - }, - loadAnalysis() { - getAction(this.url.comparativeAnalysis, this.queryParam).then(res => { + + loadAnalysis(queryParam) { + getAction(this.url.comparativeAnalysis, queryParam).then(res => { if (res.success) { this.AnalysisList = res.result this.AnalysisBarList = res.result.graphics this.AnalysisGauge = res.result.meters this.AnalysisPie.push(res.result.pieCharts) } else { - this.$message.warning(res.message) + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false }) }, + searchQuery() { if (this.dates && this.dates.length > 0) { this.AnalysisList = [] this.AnalysisBarList = [] this.AnalysisGauge = [] this.AnalysisPie = [] - if (this.queryParams.typeTree == '1') { - this.queryParams.parentId = this.queryParamEquip.parentId - // this.queryParams.equipmentId = this.queryParamEquip.equipmentId - } else { - this.queryParams.parentId = this.queryParamEquip.parentId - // this.queryParams.equipmentId = "" - } - this.AnalysisList = [] + this.queryParams.parentId = this.queryParamEquip.parentId //鑾峰彇鏌ヨ鏉′欢 this.queryParam.parentId = this.queryParams.parentId - // this.queryParam.equipmentId = this.queryParams.equipmentId this.queryParam.typeTree = this.queryParams.typeTree - getAction(this.url.comparativeAnalysis, this.queryParam).then((res) => { - if (res.success) { - this.AnalysisList = res.result - this.AnalysisBarList = res.result.graphics - this.AnalysisGauge = res.result.meters - this.AnalysisPie.push(res.result.pieCharts) - } else { - // this.$message.warning(res.message) - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) + + const queryParam = Object.assign({}, this.queryParam) + Object.keys(queryParam).forEach(item => { + if (Array.isArray(queryParam[item])) { + queryParam[item] = queryParam[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (queryParam[item].length === 0) delete queryParam[item] } - }).finally(() => { - this.loading = false }) + this.loadAnalysis(queryParam) } else { this.$notification.warning({ message: '鎻愮ず', @@ -232,213 +285,61 @@ } }, + searchReset() { this.AnalysisList = [] this.AnalysisBarList = [] this.AnalysisGauge = [] this.AnalysisPie = [] - if (this.queryParams.typeTree == '1') { - this.typeTree = this.queryParams.typeTree - this.typeParent = this.queryParams.parentId - this.typeEquipment = this.queryParams.equipmentId - this.queryParams = {} - this.queryParam = {} - this.dates = [] - this.queryParams.typeTree = this.typeTree - this.queryParams.parentId = this.typeParent - if (this.queryParams.parentId != '') { - this.queryParams.equipmentId = '' - } else { - if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { - this.queryParams.equipmentId = this.typeEquipment - } else { - this.queryParams.equipmentId = this.queryParamEquip.equipmentId - } - } - getAction(this.url.comparativeAnalysis, this.queryParams).then((res) => { - if (res.success) { - this.AnalysisList = res.result - this.AnalysisBarList = res.result.graphics - this.AnalysisGauge = res.result.meters - this.AnalysisPie.push(res.result.pieCharts) - } else { - // this.$message.warning(res.message) - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - this.loading = false - }) - } else { - this.typeTree = this.queryParams.typeTree - this.typeParent = this.queryParams.parentId - this.typeEquipment = this.queryParams.equipmentId - this.queryParams = {} - this.queryParam = {} - this.dates = [] - this.queryParams.typeTree = this.typeTree - this.queryParams.parentId = this.typeParent - if (this.queryParams.parentId != '') { - this.queryParams.equipmentId = '' - } else { - if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { - this.queryParams.equipmentId = this.typeEquipment - } else { - this.queryParams.equipmentId = this.queryParamEquip.equipmentId - } - } - getAction(this.url.comparativeAnalysis, this.queryParams).then((res) => { - if (res.success) { - this.AnalysisList = res.result - this.AnalysisBarList = res.result.graphics - this.AnalysisGauge = res.result.meters - this.AnalysisPie.push(res.result.pieCharts) - } else { - // this.$message.warning(res.message) - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }).finally(() => { - this.loading = false - }) + this.typeTree = this.queryParams.typeTree + this.typeParent = this.queryParams.parentId + this.typeEquipment = this.queryParams.equipmentId + this.queryParams = {} + this.queryParam = { + equipmentType: [], + driveType: [], + deviceLevel: [] } + this.dates = [moment().subtract('days', 7), moment().subtract('days', 0)] + this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') + this.queryParams.typeTree = this.typeTree + this.queryParams.parentId = this.typeParent + if (this.queryParams.parentId != '') { + this.queryParams.equipmentId = '' + } else { + if (this.queryParams.equipmentId == this.queryParamEquip.equipmentId) { + this.queryParams.equipmentId = this.typeEquipment + } else { + this.queryParams.equipmentId = this.queryParamEquip.equipmentId + } + } + this.loadAnalysis(this.queryParam) }, - /** - * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 - */ + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 getDriveTypeByApi() { api.getDriveTypeApi().then((res) => { - this.driveTypeList = res.result.map(item => item.value) + if (res.success) this.driveTypeList = res.result }) }, - /** - * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� - * @param input 杈撳叆鐨勫唴瀹� - * @param option 閰嶇疆 - * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� - */ - filterOption(input, option) { - return ( - option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 - ) + + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return + } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) }, - // onChange(value, dateString) { - // // console.log('Selected Time: ', value); - // // console.log('Formatted Selected Time: ', dateString); - // }, - // searchReset() { - // if(this.queryParams.typeTree == "1"){ - // this.typeTree = this.queryParams.typeTree - // this.typeParent = this.queryParams.parentId - // this.typeEquipment = this.queryParams.equipmentId - // this.queryParams = {} - // this.queryParam = {} - // this.dates = [] - // this.queryParams.typeTree = this.typeTree - // this.queryParams.parentId = this.typeParent - // if(this.queryParams.parentId != ""){ - // this.queryParams.equipmentId = "" - // }else{ - // if(this.queryParams.equipmentId == this.queryParamEquip.equipmentId){ - // this.queryParams.equipmentId = this.typeEquipment - // }else{ - // this.queryParams.equipmentId = this.queryParamEquip.equipmentId - // } - // - // } - // - // this.ipagination.current = 1 - // this.ResetloadData(); - // }else{ - // this.typeTree = this.queryParams.typeTree - // this.typeParent = this.queryParams.parentId - // // this.typeEquipment = this.queryParams.equipmentId - // this.queryParams = {} - // this.queryParam = {} - // this.dates = [] - // this.queryParams.typeTree = this.typeTree - // this.queryParams.parentId = this.typeParent - // // this.queryParams.equipmentId = this.typeEquipment - // this.ipagination.current = 1 - // this.ResetloadData(); - // } - // - // }, - // ResetloadData() { - // if(!this.url.list){ - // this.$message.error("璇疯缃畊rl.list灞炴��!") - // return - // } - // var params = {} - // params.typeTree = this.queryParams.typeTree - // params.parentId = this.queryParams.parentId - // params.equipmentId = this.queryParams.equipmentId - // this.loading = true; - // getAction(this.url.list, params).then((res) => { - // if (res.success) { - // this.dataSource = res.result.records||res.result; - // }else{ - // this.$message.warning(res.message) - // } - // }).finally(() => { - // this.loading = false - // }) - // }, - // searchQuery(){ - // if(this.queryParams.typeTree == "1"){ - // this.queryParams.parentId = this.queryParamEquip.parentId - // // this.queryParams.equipmentId = this.queryParamEquip.equipmentId - // - // }else{ - // this.queryParams.parentId = this.queryParamPeople.parentId - // - // // this.queryParams.equipmentId = "" - // } - // this.dataSource = []; - // //鑾峰彇鏌ヨ鏉′欢 - // let param = {} - // param.parentId = this.queryParams.parentId; - // param.equipmentId = this.queryParams.equipmentId; - // param.startTime = this.queryParam.startTime; - // param.driveType = this.queryParam.driveType; - // param.endTime = this.queryParam.endTime; - // getAction(this.url.list,param).then((res) => { - // if(res.success){ - // this.dataSource = res.result.records||res.result; - // }else{ - // this.$message.warning(res.message) - // } - // }).finally(() => { - // this.loading = false - // }) - // }, - // loadData() { - // if(!this.url.list){ - // this.$message.error("璇疯缃畊rl.list灞炴��!") - // return - // } - // //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 - // var params = {} - // this.loading = true; - // params.startTime = this.queryParam.startTime; - // params.endTime = this.queryParam.endTime; - // params.typeTree = this.queryParams.typeTree - // getAction(this.url.list, params).then((res) => { - // if (res.success) { - // this.dataSource = res.result.records||res.result; - // }else{ - // this.$message.warning(res.message) - // } - // }).finally(() => { - // this.loading = false - // }) - // }, + deviceSearch() { - console.log('瑙﹀彂') this.$refs.selectDeviceDrawer.visible = true this.$refs.selectDeviceDrawer.selectedRowKeys = [] this.$refs.selectDeviceDrawer.selectedRows = [] @@ -450,14 +351,20 @@ * @param data 宸查�夋嫨鐨勮澶� */ selectOK(data) { - // let params = {} - // params.equipmentIdList = [] - // for (var a = 0; a < data.length; a++) { - // params.equipmentIdList.push(data[a]) - // } - console.log('data=', data) this.queryParam.equipmentId = data.join(',') - console.log('queryParam', this.queryParam.equipmentId) + }, + + selectChange(value, key) { + this.queryParam[key] = value + }, + + tabChange(val) { + this.activeKey = val + }, + + dateParamChange(v1, v2) { + this.queryParam.startTime = v2[0] + this.queryParam.endTime = v2[1] } }, created() { @@ -465,8 +372,11 @@ this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD') this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD') this.queryParam.typeTree = '1' - this.loadAnalysis() + this.loadAnalysis(this.queryParam) this.getDriveTypeByApi() + this.queryGroup() + this.initDictData('device_level') + this.initDictData('device_importance_level') } } </script> @@ -523,10 +433,6 @@ display: flex !important; height: 100% !important; flex-direction: column !important; - } - - .device_list .table-page-search-wrapper { - height: 6% !important; } .device_list #DeviceList { diff --git a/src/views/mdc/base/modules/comparativeAnalysis/conparativeAnalysisPie.vue b/src/views/mdc/base/modules/comparativeAnalysis/conparativeAnalysisPie.vue index 70872cb..eafad61 100644 --- a/src/views/mdc/base/modules/comparativeAnalysis/conparativeAnalysisPie.vue +++ b/src/views/mdc/base/modules/comparativeAnalysis/conparativeAnalysisPie.vue @@ -25,7 +25,6 @@ watch:{ dataList(val){ this.RateList = val - console.log(val) this.drawTu() }, }, @@ -118,7 +117,7 @@ this.openRate =[] this.usedRate = [] this.waitRate = [] - if(this.RateList.length>0){ + if(this.RateList.length>0&&this.RateList[0]!==null){ this.closeRate=this.RateList[0].closeRate this.openRate=this.RateList[0].openRate this.usedRate=this.RateList[0].processRate diff --git a/src/views/mdc/base/modules/deviceBaseInfo/EquipmentLayout.vue b/src/views/mdc/base/modules/deviceBaseInfo/EquipmentLayout.vue index 71d216f..68476e3 100644 --- a/src/views/mdc/base/modules/deviceBaseInfo/EquipmentLayout.vue +++ b/src/views/mdc/base/modules/deviceBaseInfo/EquipmentLayout.vue @@ -25,9 +25,6 @@ <script> import EqumentDetaiModel from './EqumentDetaiModel' import {getFileAccessHttpUrl} from '@/api/manage'; - import { - getAction - } from '@/api/manage' export default { name: 'EquipmentLayout', @@ -55,6 +52,7 @@ } return getFileAccessHttpUrl(img) }, + getStatusImgUrl(imgStaus){ if(imgStaus == 1){ return require("../../../../../assets/yellow.png"); @@ -70,12 +68,9 @@ return require("../../../../../assets/gray.png"); } }, - getBackgroundUrl(imgurl){ - return require("../../../../../assets/"+imgurl+".gif"); - }, + openDetail(item) { if(item.oporation == 0){ - // this.$message.warn("璁惧澶勪簬鍏虫満鐘舵�侊紒"); this.$notification.warning({ message:'娑堟伅', description:"璁惧澶勪簬鍏虫満鐘舵�侊紒" @@ -85,15 +80,8 @@ console.log(item); this.$refs.equmentDetaiModel.initData(item.id); this.$refs.equmentDetaiModel.timerModel(item.id); - // this.equipMessageTimer = setInterval(() => { - // setTimeout( this.$refs.equmentDetaiModel.initData(item.equipmentId),0) - // },1000*10) } }, - beforeDestroy(){ - // clearInterval(this.equipMessageTimer); - // this.equipMessageTimer = null - } } </script> <style scoped> diff --git a/src/views/mdc/base/modules/deviceBaseInfo/EqumentDetaiModel.vue b/src/views/mdc/base/modules/deviceBaseInfo/EqumentDetaiModel.vue index a448802..b91c9a0 100644 --- a/src/views/mdc/base/modules/deviceBaseInfo/EqumentDetaiModel.vue +++ b/src/views/mdc/base/modules/deviceBaseInfo/EqumentDetaiModel.vue @@ -19,7 +19,7 @@ style="border-collapse: separate;border-spacing:0px; color: #fff" > <tr> - <td v-if="this.spindlebeilv != null"> + <td> <div class="mdcEquipMon" style="width: 250px; height: 200px;margin : 0 auto;padding: 0;" @@ -33,7 +33,8 @@ ></div> </div> </td> - <td v-if="this.feedbeilv != null"> + + <td> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -47,7 +48,8 @@ ></div> </div> </td> - <td v-if="this.spindleload != null"> + + <td v-if="resultData.driveType!=='HNC8'||resultData.driveType!=='HNC7'||resultData.driveType!=='LSV2'"> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -60,7 +62,8 @@ ></div> </div> </td> - <td v-if="this.rapidfeed != null"> + + <td v-else> <div class="mdcEquipMon" style="width: 210px; height: 180px;margin : 0 auto;" @@ -80,149 +83,20 @@ title="鍩虹淇℃伅" :column="4" > - <a-descriptions-item label="璁惧缂栧彿">{{resultData.equipmentID}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍚嶇О">{{resultData.equipmentName}}</a-descriptions-item> - <a-descriptions-item label="IP鍦板潃">{{resultData.equipmentIP}}</a-descriptions-item> - <a-descriptions-item label="绔彛鍙�">{{resultData.dataPort}}</a-descriptions-item> - <a-descriptions-item label="绯荤粺鐗堟湰鍙�">{{resultData.systemVersion}}</a-descriptions-item> - <a-descriptions-item label="椹卞姩绫诲瀷">{{resultData.driveType}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍨嬪彿">{{resultData.equipmentModel}}</a-descriptions-item> - <a-descriptions-item label="璁惧绫诲瀷">{{resultData.deviceType}}</a-descriptions-item> - <a-descriptions-item label="璁惧鍔熺巼">{{resultData.devicePower}}</a-descriptions-item> - <a-descriptions-item label="鏈夋晥杞存暟">{{resultData.validAxis}}</a-descriptions-item> - <a-descriptions-item label="鏈�澶ц酱鏁�">{{resultData.maxAxis}}</a-descriptions-item> - <a-descriptions-item label="澶囨敞">{{resultData.remark}}</a-descriptions-item> + <a-descriptions-item label="璁惧缂栧彿">{{ resultData.equipmentID }}</a-descriptions-item> + <a-descriptions-item label="璁惧鍚嶇О">{{ resultData.equipmentName }}</a-descriptions-item> + <a-descriptions-item label="IP鍦板潃">{{ resultData.equipmentIP }}</a-descriptions-item> + <a-descriptions-item label="绔彛鍙�">{{ resultData.dataPort }}</a-descriptions-item> + <a-descriptions-item label="绯荤粺鐗堟湰鍙�">{{ resultData.systemVersion }}</a-descriptions-item> + <a-descriptions-item label="椹卞姩绫诲瀷">{{ resultData.driveType }}</a-descriptions-item> + <a-descriptions-item label="璁惧鍨嬪彿">{{ resultData.equipmentModel }}</a-descriptions-item> + <a-descriptions-item label="璁惧绫诲瀷">{{ resultData.deviceType }}</a-descriptions-item> + <a-descriptions-item label="璁惧鍔熺巼">{{ resultData.devicePower }}</a-descriptions-item> + <a-descriptions-item label="鏈夋晥杞存暟">{{ resultData.validAxis }}</a-descriptions-item> + <a-descriptions-item label="鏈�澶ц酱鏁�">{{ resultData.maxAxis }}</a-descriptions-item> + <a-descriptions-item label="澶囨敞">{{ resultData.remark }}</a-descriptions-item> </a-descriptions> - - <!-- <a-descriptions - title="杩愯鏁版嵁" - v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' " - :column="4" - > - <a-descriptions-item label="涓昏酱鍊嶇巼(%)">{{resultData.spindlebeilv}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰鍊嶇巼(%)">{{resultData.feedbeilv}}</a-descriptions-item> - <a-descriptions-item label="涓昏酱璐熻嵎(%)">{{resultData.spindleload}}</a-descriptions-item> - <a-descriptions-item label="涓昏酱杞��(rpm)">{{resultData.spindlespeed}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰閫熷害(mm/min)">{{resultData.feedrate}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="杩愯鏁版嵁 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="涓昏酱鍊嶇巼(%)">{{resultData.spindlebeilv}}</a-descriptions-item> - <a-descriptions-item label="璁惧姝e父杩愯鏃堕棿">{{resultData.equipmentNormalTime}}</a-descriptions-item> - <a-descriptions-item label="蹇�熻繘缁欏�嶇巼(%)">{{resultData.rapidfeed}}</a-descriptions-item> - <a-descriptions-item label="NC姝e父杩愯鏃堕棿">{{resultData.nCNormalTime}}</a-descriptions-item> - <a-descriptions-item label="杩涚粰鍊嶇巼(%)">{{resultData.feedbeilv}}</a-descriptions-item> - <a-descriptions-item label="璁惧杩愯鏃堕棿">{{resultData.equipmentTime}}</a-descriptions-item> - <a-descriptions-item label="褰撳墠鍒�鍏峰彿">{{resultData.toolNum}}</a-descriptions-item> - </a-descriptions> --> - - <!-- <a-descriptions - title="绋嬪簭淇℃伅" - v-if="driverType != 'LSV2' && driverType != 'ZUOLAN' " - :column="4" - > - <a-descriptions-item label="搴忓垪鍙�">{{resultData.sequencenumber}}</a-descriptions-item> - <a-descriptions-item - label="褰撳墠鎵ц浠g爜" - :span="2" - >{{resultData.executingcode}}</a-descriptions-item> - <a-descriptions-item label="宸ヤ欢鍚嶇О">{{resultData.productName}}</a-descriptions-item> - </a-descriptions> --> - - <!-- <a-descriptions - title="绋嬪簭淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="褰撳墠绋嬪簭">{{resultData.program}}</a-descriptions-item> - <a-descriptions-item label="绋嬪簭鎵ц鐐�">{{resultData.programPosition}}</a-descriptions-item> - <a-descriptions-item label="鎿嶄綔妯″紡">{{resultData.operationType}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅缂栧彿涓�">{{resultData.firstErrorNum}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅涓�">{{resultData.firstError}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅">{{resultData.errorinfo}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅缂栧彿浜�">{{resultData.secondErrorNum}}</a-descriptions-item> - <a-descriptions-item label="閿欒淇℃伅浜�">{{resultData.secondError}}</a-descriptions-item> - </a-descriptions> --> - - <!--<a-descriptions - title="杞寸洃鎺ф暟鎹� fro SIEMENS840DSL" - v-if="driverType == 'SIEMENS840DSL'" - :column="4" - > - <a-descriptions-item label="X杞存俯搴�">{{resultData.temperatureX}}</a-descriptions-item> - <a-descriptions-item label="Y杞存俯搴�">{{resultData.temperatureY}}</a-descriptions-item> - <a-descriptions-item label="Z杞存俯搴�">{{resultData.temperatureZ}}</a-descriptions-item> - <a-descriptions-item label="A杞存俯搴�">{{resultData.temperatureA}}</a-descriptions-item> - <a-descriptions-item label="B杞存俯搴�">{{resultData.temperatureB}}</a-descriptions-item> - <a-descriptions-item label="X杞寸數娴�">{{resultData.equipmentCurrentX}}</a-descriptions-item> - <a-descriptions-item label="Y杞寸數娴�">{{resultData.equipmentCurrentY}}</a-descriptions-item> - <a-descriptions-item label="Z杞寸數娴�">{{resultData.equipmentCurrentZ}}</a-descriptions-item> - <a-descriptions-item label="A杞寸數娴�">{{resultData.equipmentCurrentA}}</a-descriptions-item> - <a-descriptions-item label="B杞寸數娴�">{{resultData.equipmentCurrentB}}</a-descriptions-item> - <a-descriptions-item label="X杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorX}}</a-descriptions-item> - <a-descriptions-item label="Y杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorY}}</a-descriptions-item> - <a-descriptions-item label="Z杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorZ}}</a-descriptions-item> - <a-descriptions-item label="A杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorA}}</a-descriptions-item> - <a-descriptions-item label="B杞撮殢鍔ㄨ宸�">{{resultData.equipmentLagErrorB}}</a-descriptions-item> - </a-descriptions> ---> - <!-- <a-descriptions - title="鍧愭爣淇℃伅 " - v-if="driverType == 'FANUC'" - :column="3" - > - <a-descriptions-item label="缁濆鍧愭爣X">{{resultData.xabsolute}}</a-descriptions-item> - <a-descriptions-item label="缁濆鍧愭爣Y">{{resultData.yabsolute}}</a-descriptions-item> - <a-descriptions-item label="缁濆鍧愭爣Z">{{resultData.zabsolute}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣X">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣Y">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="鏈哄簥鍧愭爣Z">{{resultData.zmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅 for lsv2" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> - - <a-descriptions - title="鍧愭爣淇℃伅" - v-if="driverType == 'LSV2'" - :column="4" - > - <a-descriptions-item label="X鍧愭爣">{{resultData.xmachine}}</a-descriptions-item> - <a-descriptions-item label="Y鍧愭爣">{{resultData.ymachine}}</a-descriptions-item> - <a-descriptions-item label="Z鍧愭爣">{{resultData.zmachine}}</a-descriptions-item> - <a-descriptions-item label="A鍧愭爣">{{resultData.amachine}}</a-descriptions-item> - <a-descriptions-item label="B鍧愭爣">{{resultData.bmachine}}</a-descriptions-item> - <a-descriptions-item label="C鍧愭爣">{{resultData.cmachine}}</a-descriptions-item> - </a-descriptions> --> - <!---鏁版嵁婧愯皟鏁� 鍔ㄦ�佸睍绀� 杩愯鏁版嵁----> <a-descriptions title="杩愯鏁版嵁" @@ -239,40 +113,14 @@ > <a-tooltip @mouseenter="mouseEnterItem"> <template slot="title"> - {{item.value}} + {{ item.value }} </template> - <div class="description-item-class">{{item.value}}</div> + <div class="description-item-class">{{ item.value }}</div> </a-tooltip> </a-descriptions-item> </a-descriptions> - - <!--<a-descriptions--> - <!--title="鍧愭爣淇℃伅"--> - <!--v-show="xyzAliasesList != null"--> - <!--v-if="driverType != 'PLC'"--> - <!--:column="4"--> - <!-->--> - <!--<a-descriptions-item--> - <!--v-for="(item,id) in xyzAliasesList "--> - <!--:key="item.id"--> - <!--:label="item.title"--> - <!-->{{item.value}}</a-descriptions-item>--> - <!--</a-descriptions>--> - - <!--<a-descriptions--> - <!--title="鐗堟湰淇℃伅 for lsv2"--> - <!--v-if="driverType == 'LSV2'"--> - <!--:column="4"--> - <!--class="lsv2Data"--> - <!-->--> - <!--<a-descriptions-item label="NC鐗堟湰">{{resultData.ncversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="TNC鐗堟湰">{{resultData.tncversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="OPT鐗堟湰">{{resultData.optversion}}</a-descriptions-item>--> - <!--<a-descriptions-item label="PLC鐗堟湰">{{resultData.plcversion}}</a-descriptions-item>--> - <!--</a-descriptions>--> - </td> </tr> </table> @@ -282,1293 +130,1272 @@ :style="{ marginRight: '8px' }" @click="handleCancel" style="color: #1191b0;" - >鍏抽棴</a-button> + >鍏抽棴 + </a-button> </template> </a-modal> </div> </template> <script> - import { - getAction, - postAction - } from '@/api/manage' - import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' +import { getAction, } from '@/api/manage' - export default { - name: 'EqumentDetaiModel', - components: {}, - props: {}, - data() { - return { - mdcDriveTypeParamConfigList: [], - xyzAliasesList: [], - title: '', - //涓昏酱鍊嶇巼 - spindlebeilv: 1, - //杩涚粰鍊嶇巼 - feedbeilv: 1, - // 涓昏酱璐熻嵎 - spindleload: 1, - //蹇�熻繘缁欏�嶇巼 - rapidfeed: 1, - visible: false, - resultData: {}, - driverType: '', - deviceTypeDict: '', - url: { - mdcEquipmentDetailedInfo: '/mdc/mdcEquipment/mdcEquipmentDetailedInfo' - }, - modalTimer:null, - ee:" " - } - }, - mounted() { - }, - methods: { - drawLine() { - let _this = this - if (_this.spindlebeilv) { - //鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 - let mdcEquiMoniGauge1 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge1'), 'macarons') - let mdcEquiMoniGaugeOption1 = { - tooltip: { - formatter: "{a} <br/>{b} : {c}%" - }, - - series: [{ - name: "澶栭儴绾�", - type: "gauge", - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false, - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ], - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20, // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false, - }, //鍒诲害鏍峰紡 - splitLine: { - show: false, - }, - }, - { - name: "鍐呴儴瀹界嚎鏉�", - type: "gauge", - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鍐呴儴缁嗙嚎鏉�", - type: "gauge", - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "闂撮殧鏉″舰", - type: "gauge", - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鏁版嵁", - type: "gauge", - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.spindlebeilv / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff', - } - }, - data: [{ - name: '', - value: _this.spindlebeilv - }] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�', - "type": 'pie', - "radius": ['4%', '2%'], - "hoverAnimation": false, - tooltip: { - show: false - }, - cursor: "default", - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - "data": [1] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�2', - "type": 'pie', - "radius": '2%', - "hoverAnimation": false, - cursor: "default", - tooltip: { - show: false - }, - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - "data": [1] - }, - ] - }; - mdcEquiMoniGauge1.setOption(mdcEquiMoniGaugeOption1) - } - if (_this.feedbeilv) { - let mdcEquiMoniGauge2 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge2'), 'macarons') - let mdcEquiMoniGaugeOption2 = { - tooltip: { - formatter: "{a} <br/>{b} : {c}%" - }, - - series: [{ - name: "澶栭儴绾�", - type: "gauge", - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false, - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ], - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20, // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false, - }, //鍒诲害鏍峰紡 - splitLine: { - show: false, - }, - }, - { - name: "鍐呴儴瀹界嚎鏉�", - type: "gauge", - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鍐呴儴缁嗙嚎鏉�", - type: "gauge", - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "闂撮殧鏉″舰", - type: "gauge", - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鏁版嵁", - type: "gauge", - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.feedbeilv / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.feedbeilv - }] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�', - "type": 'pie', - "radius": ['4%', '2%'], - "hoverAnimation": false, - tooltip: { - show: false - }, - cursor: "default", - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - "data": [1] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�2', - "type": 'pie', - "radius": '2%', - "hoverAnimation": false, - cursor: "default", - tooltip: { - show: false - }, - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - "data": [1] - }, - ] - }; - mdcEquiMoniGauge2.setOption(mdcEquiMoniGaugeOption2) - } - if (_this.spindleload) { - let mdcEquiMoniGauge3 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge3'), 'macarons') - let mdcEquiMoniGaugeOption3 = { - tooltip: { - formatter: "{a} <br/>{b} : {c}%" - }, - - series: [{ - name: "澶栭儴绾�", - type: "gauge", - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false, - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 100, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ], - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20, // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false, - }, //鍒诲害鏍峰紡 - splitLine: { - show: false, - }, - }, - { - name: "鍐呴儴瀹界嚎鏉�", - type: "gauge", - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鍐呴儴缁嗙嚎鏉�", - type: "gauge", - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "闂撮殧鏉″舰", - type: "gauge", - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鏁版嵁", - type: "gauge", - radius: '52.5%', - z: 3, - startAngle: 225, - max: 100, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.spindleload / 100, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.spindleload - }] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�', - "type": 'pie', - "radius": ['4%', '2%'], - "hoverAnimation": false, - tooltip: { - show: false - }, - cursor: "default", - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - "data": [1] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�2', - "type": 'pie', - "radius": '2%', - "hoverAnimation": false, - cursor: "default", - tooltip: { - show: false - }, - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - "data": [1] - }, - ] - }; - mdcEquiMoniGauge3.setOption(mdcEquiMoniGaugeOption3) - } - if (_this.rapidfeed) { - let mdcEquiMoniGauge4 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge4'), 'macarons') - let mdcEquiMoniGaugeOption4 = { - tooltip: { - formatter: "{a} <br/>{b} : {c}%" - }, - - series: [{ - name: "澶栭儴绾�", - type: "gauge", - radius: '65%', // 鍔ㄦ�� - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#31F3FF'] // 鍔ㄦ�� - ], - width: 1 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { //鏍囬 - show: false, - } - }, - { - name: '澶栭儴鍒诲害', - type: 'gauge', - radius: '80%', - min: 0, //鏈�灏忓埢搴� - max: 300, //鏈�澶у埢搴� - splitNumber: 10, //鍒诲害鏁伴噺 - startAngle: 225, - endAngle: -45, - axisLine: { - show: false, - lineStyle: { - color: [ - [1, 'rgba(0,0,0,0)'] - ], - } - }, //浠〃鐩樿酱绾� - axisLabel: { - show: true, - color: '#31F3FF', - fontSize: 10, // 鍔ㄦ�� - distance: -20, // 鍔ㄦ�� - - }, //鍒诲害鏍囩銆� - axisTick: { - show: false, - }, //鍒诲害鏍峰紡 - splitLine: { - show: false, - }, - }, - { - name: "鍐呴儴瀹界嚎鏉�", - type: "gauge", - radius: '55%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 4 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鍐呴儴缁嗙嚎鏉�", - type: "gauge", - radius: '40%', - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [1, '#122B3C'] - ], - width: 3 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false, - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "闂撮殧鏉″舰", - type: "gauge", - radius: '52.5%', - z: 4, - splitNumber: 35, - startAngle: 225, - endAngle: -45, - axisLine: { - lineStyle: { - opacity: 0 - } - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - length: 20, - splitNumber: 1, - lineStyle: { - color: '#122B3C', - width: 1 - } - }, - splitLine: { - show: false - }, - detail: { - show: false - }, - title: { - show: false, - } - }, - { - name: "鏁版嵁", - type: "gauge", - radius: '52.5%', - z: 3, - startAngle: 225, - max: 300, - endAngle: -45, - axisLine: { - lineStyle: { - color: [ - [_this.rapidfeed / 300, '#31F3FF'], // 鍔ㄦ�� - [1, '#185363'] - ], - width: 4 - } - }, - tooltip: { - show: false - }, - axisLabel: { - show: false, - }, - axisTick: { - show: false, - }, - splitLine: { - show: false - }, - detail: { - show: true, - fontWeight: 'bold', - fontSize: 12, - color: '#fff' - }, - pointer: { - show: true, - width: 3, - itemStyle:{ - color:'#fff' - } - }, - data: [{ - name: '', - value: _this.rapidfeed - }] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�', - "type": 'pie', - "radius": ['4%', '2%'], - "hoverAnimation": false, - tooltip: { - show: false - }, - cursor: "default", - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#fff' - }, - animation: false, - "data": [1] - }, - // 鍐呭渾 - { - "name": '鍐呭渾鐜�2', - "type": 'pie', - "radius": '2%', - "hoverAnimation": false, - cursor: "default", - tooltip: { - show: false - }, - "labelLine": { - "normal": { - "show": false - } - }, - itemStyle: { - color: '#31F3FF' - }, - animation: false, - "data": [1] - }, - ] - }; - mdcEquiMoniGauge4.setOption(mdcEquiMoniGaugeOption4) - } +export default { + name: 'EqumentDetaiModel', + components: {}, + props: {}, + data() { + return { + mdcDriveTypeParamConfigList: [], + xyzAliasesList: [], + title: '', + //涓昏酱鍊嶇巼 + spindlebeilv: 1, + //杩涚粰鍊嶇巼 + feedbeilv: 1, + // 涓昏酱璐熻嵎 + spindleload: 1, + //蹇�熻繘缁欏�嶇巼 + rapidfeed: 1, + visible: false, + resultData: {}, + driverType: '', + deviceTypeDict: '', + url: { + mdcEquipmentDetailedInfo: '/mdc/mdcEquipment/mdcEquipmentDetailedInfo' }, - close() { - this.$emit('close') - this.visible = false - clearInterval(this.modalTimer); - this.modalTimer = null - }, - handleCancel() { - this.close() - clearInterval(this.modalTimer); - this.modalTimer = null - }, - // initDeviceType(deviceTypeId) { - // let dictCode = 'mdc_equipmentType' - // let items = [] - // items = getDictItemsFromCache(dictCode) - // if (items && items.length > 0) { - // for (let i = 0; i < items.length; i++) { - // if (deviceTypeId == items[i].value) { - // this.deviceTypeDict = 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 (deviceTypeId == items[i].value) { - // this.deviceTypeDict = items[i].title - // } - // } - // } - // }) - // } - // }, - timerModel(id){ - this.ee = id - this.modalTimer = setInterval(() => { - setTimeout( this.initData(this.ee),0) - },1000*4) - }, - - initData(id) { - let _this = this - this.visible = true - // _this.drawLine() - getAction(this.url.mdcEquipmentDetailedInfo, { id: id }).then((res) => { - if (res.success) { - _this.resultData = res.result - _this.driverType = res.result.deviceType - _this.spindlebeilv = res.result.spindlebeilv - _this.feedbeilv = res.result.feedbeilv - _this.spindleload = res.result.spindleload - _this.rapidfeed = res.result.rapidfeed; - _this.mdcDriveTypeParamConfigList = res.result.mdcDriveTypeParamConfigList; - _this.xyzAliasesList = res.result.xyzAliasesList; - this.$nextTick(() => { - _this.drawLine() - }) - // _this.initDeviceType(_this.resultData.deviceType) - } else { - // _this.$message.warn(res.message) - _this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); - } - }) - - }, - - mouseEnterItem(e){ - console.log(e, e.target, e.target.clientWidth, e.target.scrollWidth) - if (e.target.clientWidth >= e.target.scrollWidth) { - e.target.style.pointerEvents = 'none' // 闃绘榧犳爣浜嬩欢 pointer-events 灞炴�х敤浜庤缃厓绱犳槸鍚﹀榧犳爣浜嬩欢鍋氬嚭鍙嶅簲銆� - } - } - }, - beforeDestroy(){ - clearInterval(this.modalTimer); - this.modalTimer = null + modalTimer: null, + ee: ' ' } + }, + mounted() { + }, + methods: { + drawLine() { + let _this = this + + let mdcEquiMoniGauge1 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge1'), 'macarons') + let mdcEquiMoniGaugeOption1 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.spindlebeilv / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.spindlebeilv?true:false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.spindlebeilv?true:false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.spindlebeilv + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge1.setOption(mdcEquiMoniGaugeOption1) + + let mdcEquiMoniGauge2 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge2'), 'macarons') + let mdcEquiMoniGaugeOption2 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.feedbeilv / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.feedbeilv?true:false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.feedbeilv?true:false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.feedbeilv + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge2.setOption(mdcEquiMoniGaugeOption2) + + if (_this.resultData!=='HNC7'||_this.resultData=='HNC8'||_this.resultData=='LSV2'){ + let mdcEquiMoniGauge3 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge3'), 'macarons') + let mdcEquiMoniGaugeOption3 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 100, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 100, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.spindleload / 100, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.spindleload?true:false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.spindleload?true:false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.spindleload + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge3.setOption(mdcEquiMoniGaugeOption3) + } + else{ + let mdcEquiMoniGauge4 = this.$echarts.init(document.getElementById('mdcEquiMoniGauge4'), 'macarons') + let mdcEquiMoniGaugeOption4 = { + tooltip: { + formatter: '{a} <br/>{b} : {c}%' + }, + + series: [{ + name: '澶栭儴绾�', + type: 'gauge', + radius: '65%', // 鍔ㄦ�� + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#31F3FF'] // 鍔ㄦ�� + ], + width: 1 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { //鏍囬 + show: false + } + }, + { + name: '澶栭儴鍒诲害', + type: 'gauge', + radius: '80%', + min: 0, //鏈�灏忓埢搴� + max: 300, //鏈�澶у埢搴� + splitNumber: 10, //鍒诲害鏁伴噺 + startAngle: 225, + endAngle: -45, + axisLine: { + show: false, + lineStyle: { + color: [ + [1, 'rgba(0,0,0,0)'] + ] + } + }, //浠〃鐩樿酱绾� + axisLabel: { + show: true, + color: '#31F3FF', + fontSize: 10, // 鍔ㄦ�� + distance: -20 // 鍔ㄦ�� + + }, //鍒诲害鏍囩銆� + axisTick: { + show: false + }, //鍒诲害鏍峰紡 + splitLine: { + show: false + } + }, + { + name: '鍐呴儴瀹界嚎鏉�', + type: 'gauge', + radius: '55%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 4 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鍐呴儴缁嗙嚎鏉�', + type: 'gauge', + radius: '40%', + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [1, '#122B3C'] + ], + width: 3 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '闂撮殧鏉″舰', + type: 'gauge', + radius: '52.5%', + z: 4, + splitNumber: 35, + startAngle: 225, + endAngle: -45, + axisLine: { + lineStyle: { + opacity: 0 + } + }, + axisLabel: { + show: false + }, + axisTick: { + show: false, + length: 20, + splitNumber: 1, + lineStyle: { + color: '#122B3C', + width: 1 + } + }, + splitLine: { + show: false + }, + detail: { + show: false + }, + title: { + show: false + } + }, + { + name: '鏁版嵁', + type: 'gauge', + radius: '52.5%', + z: 3, + startAngle: 225, + max: 300, + endAngle: -45, + axisLine: { + lineStyle: { + color: [ + [_this.rapidfeed / 300, '#31F3FF'], // 鍔ㄦ�� + [1, '#185363'] + ], + width: 4 + } + }, + tooltip: { + show: false + }, + axisLabel: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + detail: { + show: _this.rapidfeed?true:false, + fontWeight: 'bold', + fontSize: 12, + color: '#fff' + }, + pointer: { + show: _this.rapidfeed?true:false, + width: 3, + itemStyle: { + color: '#fff' + } + }, + data: [{ + name: '', + value: _this.rapidfeed + }] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�', + 'type': 'pie', + 'radius': ['4%', '2%'], + 'hoverAnimation': false, + tooltip: { + show: false + }, + cursor: 'default', + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#fff' + }, + animation: false, + 'data': [1] + }, + // 鍐呭渾 + { + 'name': '鍐呭渾鐜�2', + 'type': 'pie', + 'radius': '2%', + 'hoverAnimation': false, + cursor: 'default', + tooltip: { + show: false + }, + 'labelLine': { + 'normal': { + 'show': false + } + }, + itemStyle: { + color: '#31F3FF' + }, + animation: false, + 'data': [1] + } + ] + } + mdcEquiMoniGauge4.setOption(mdcEquiMoniGaugeOption4) + } + }, + + close() { + this.$emit('close') + this.visible = false + clearInterval(this.modalTimer) + this.modalTimer = null + }, + + handleCancel() { + this.close() + clearInterval(this.modalTimer) + this.modalTimer = null + }, + + timerModel(id) { + this.ee = id + this.modalTimer = setInterval(() => { + setTimeout(this.initData(this.ee), 0) + }, 1000 * 4) + }, + + initData(id) { + let _this = this + this.visible = true + getAction(this.url.mdcEquipmentDetailedInfo, { id: id }).then((res) => { + if (res.success) { + _this.resultData = res.result + _this.driverType = res.result.deviceType + _this.spindlebeilv = res.result.spindlebeilv + _this.feedbeilv = res.result.feedbeilv + _this.spindleload = res.result.spindleload + _this.rapidfeed = res.result.rapidfeed + _this.mdcDriveTypeParamConfigList = res.result.mdcDriveTypeParamConfigList + _this.xyzAliasesList = res.result.xyzAliasesList + this.$nextTick(() => { + _this.drawLine() + }) + } else { + _this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + + }, + + mouseEnterItem(e) { + console.log(e, e.target, e.target.clientWidth, e.target.scrollWidth) + if (e.target.clientWidth >= e.target.scrollWidth) { + e.target.style.pointerEvents = 'none' // 闃绘榧犳爣浜嬩欢 pointer-events 灞炴�х敤浜庤缃厓绱犳槸鍚﹀榧犳爣浜嬩欢鍋氬嚭鍙嶅簲銆� + } + } + }, + beforeDestroy() { + clearInterval(this.modalTimer) + this.modalTimer = null } +} </script> <style scoped lang="less"> - body { - overflow-y: hidden !important; +body { + overflow-y: hidden !important; +} + +.full-modal { + .ant-modal { + top: 0; + padding-bottom: 0; + margin: 0; + background-color: #4a4a48 !important; + opacity: 0.5; } - .full-modal { - .ant-modal { - top: 0; - padding-bottom: 0; - margin: 0; - background-color: #4a4a48 !important; - opacity: 0.5; - } - /deep/ .ant-modal-content { - display: flex; - flex-direction: column; - /*height: calc(100vh);*/ - background-color: #4a4a48; - } - .ant-modal-body { - flex: 1; - } - } + /deep/ .ant-modal-content { - /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ - /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ - /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ - background-color: #312c2c; - opacity: 0.9; - } - /deep/ .ant-modal-close { - color: #1191b0; - font-size: 24px; - } - /deep/ .ant-modal-close-x { - font-size: 24px; - } - /deep/ .ant-modal-footer { - border-top: none; - } - /deep/ .ant-descriptions { - border: 1px solid #16738d; - margin: 10px 0; - } - /deep/ .ant-descriptions-title { - color: #fff; - padding: 10px; - margin-bottom: 0; - } - /deep/ .ant-descriptions-view { - padding: 0 20px; - } - /deep/ .ant-descriptions-view .ant-descriptions-row .ant-descriptions-item { - padding-bottom: 5px; - } - /deep/ .ant-descriptions-item-colon { - color: #fff; - width: 5.1vw; - } - /deep/ .ant-descriptions-item-content { - color: #fff; - border: 1px solid #4bcfc8; - padding: 0 10px; - width: auto; - min-width: 130px; - /*max-width: 300px;*/ - height: 25px; + display: flex; + flex-direction: column; + /*height: calc(100vh);*/ + background-color: #4a4a48; } - .mdcEquipMon { - color: #fff; + .ant-modal-body { + flex: 1; } - fieldset { - border: 1px solid #16738d; - padding: 17px; - margin: 14px; - } +} - fieldset legend { - display: inline; - width: 88px; - } +/deep/ .ant-modal-content { + background-color: #312c2c; + opacity: 0.9; +} - table tr td { - text-align: left; - color: #fff; - } +/deep/ .ant-modal-close { + color: #1191b0; + font-size: 24px; +} - table tr td input { - border: 1px solid #a6eff9; - } +/deep/ .ant-modal-close-x { + font-size: 24px; +} - .ant-btn { - padding: 0 10px; - margin-left: 3px; - color: #fff !important; - background-color: #1191b0; - border: none; - } +/deep/ .ant-modal-footer { + border-top: none; +} - .ant-form-item-control { - line-height: 0px; - } +/deep/ .ant-descriptions { + border: 1px solid #16738d; + margin: 10px 0; +} - /** 涓昏〃鍗曡闂磋窛 */ - .ant-form .ant-form-item { - margin-bottom: 10px; - } +/deep/ .ant-descriptions-title { + color: #fff; + padding: 10px; + margin-bottom: 0; +} - /** Tab椤甸潰琛岄棿璺� */ - .ant-tabs-content .ant-form-item { - margin-bottom: 0px; - } +/deep/ .ant-descriptions-view { + padding: 0 20px; +} - /deep/ .ant-descriptions-item-label{ - width: 6.7vw; - text-align: right; - margin-right: 10px; - } +/deep/ .ant-descriptions-view .ant-descriptions-row .ant-descriptions-item { + padding-bottom: 5px; +} - /deep/ .operationData .ant-descriptions-item-content - { - width: 130px; - overflow: hidden; - } +/deep/ .ant-descriptions-item-colon { + color: #fff; + width: 5.1vw; +} - .description-item-class{ - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } +/deep/ .ant-descriptions-item-content { + color: #fff; + border: 1px solid #4bcfc8; + padding: 0 10px; + width: auto; + min-width: 130px; + /*max-width: 300px;*/ + height: 25px; +} + +.mdcEquipMon { + color: #fff; +} + +fieldset { + border: 1px solid #16738d; + padding: 17px; + margin: 14px; +} + +fieldset legend { + display: inline; + width: 88px; +} + +table tr td { + text-align: left; + color: #fff; +} + +table tr td input { + border: 1px solid #a6eff9; +} + +.ant-btn { + padding: 0 10px; + margin-left: 3px; + color: #fff !important; + background-color: #1191b0; + border: none; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} + +/deep/ .ant-descriptions-item-label { + width: 6.7vw; + text-align: right; + margin-right: 10px; +} + +/deep/ .operationData .ant-descriptions-item-content { + width: 130px; + overflow: hidden; +} + +.description-item-class { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} </style> diff --git a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue index a280450..f85f45e 100644 --- a/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue +++ b/src/views/mdc/base/modules/efficiencyPOReport/EfficiencyPOList.vue @@ -92,12 +92,9 @@ <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceImportanceLevel" - mode="multiple" + v-model="queryParam.deviceImportanceLevel" 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"> @@ -256,14 +253,12 @@ equipmentTypeList: [], driveTypeList: [], device_level_list: [], - device_category_list: [], + device_importance_level_list: [], queryParam: {}, queryParams: { equipmentType: [], driveType: [], deviceLevel: [], - deviceCategory: [], - deviceImportanceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -539,9 +534,11 @@ 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] + if (Array.isArray(this.queryParams[item])) { + this.queryParam[item] = this.queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (this.queryParams[item].length === 0) delete this.queryParam[item] + } }) this.loadData() }, @@ -561,7 +558,6 @@ equipmentType: [], driveType: [], deviceLevel: [], - deviceCategory: [] } this.loadData() }, diff --git a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue index faa9c8b..d6a391d 100644 --- a/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue +++ b/src/views/mdc/base/modules/efficiencyReport/EfficiencyList.vue @@ -73,16 +73,12 @@ </a-row> <a-row :gutter="24" v-if="toggleSearchStatus"> - <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceImportanceLevel" - mode="multiple" + v-model="queryParam.deviceImportanceLevel" 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"> @@ -254,15 +250,13 @@ equipmentTypeList: [], driveTypeList: [], device_level_list: [], - device_category_list: [], + device_importance_level_list: [], identifying: [], queryParam: {}, queryParams: { equipmentType: [], driveType: [], - deviceLevel: [], - deviceCategory: [], - deviceImportanceLevel: [] + deviceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -546,9 +540,11 @@ 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] + if (Array.isArray(this.queryParams[item])) { + this.queryParam[item] = this.queryParams[item].join() + // 姝ゅ涓轰繚璇佹帴鍙e弬鏁颁笉澶氫綑锛屽彲鐪佺暐 + if (this.queryParams[item].length === 0) delete this.queryParam[item] + } }) this.loadData() }, @@ -566,15 +562,9 @@ this.queryParams = { equipmentType: [], driveType: [], - deviceLevel: [], - deviceCategory: [] + deviceLevel: [] } - // this.ipagination.current = 1 this.loadData() - // this.queryParam = {} - // this.dates = [] - // this.loadData() - // this.onClearSelected() }, loadData() { this.tableHeads = [] diff --git a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue index 58abebf..d8fabe4 100644 --- a/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue +++ b/src/views/mdc/base/modules/efficiencyShiftReport/EfficiencyShiftList.vue @@ -77,22 +77,22 @@ </a-row> <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.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 @@ -112,12 +112,9 @@ <a-col :md="5" :sm="5" :xs="5"> <a-form-item label="閲嶈绋嬪害"> <a-select - :value="queryParams.deviceImportanceLevel" - mode="multiple" + v-model="queryParam.deviceImportanceLevel" 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"> @@ -278,16 +275,13 @@ equipmentTypeList: [], driveTypeList: [], device_level_list: [], - device_category_list: [], device_importance_level_list: [], identifying: [], queryParam: {}, queryParams: { equipmentType: [], driveType: [], - deviceLevel: [], - deviceCategory: [], - deviceImportanceLevel: [] + deviceLevel: [] }, queryParamEquip: {}, queryParamPeople: {}, @@ -616,8 +610,7 @@ this.queryParams = { equipmentType: [], driveType: [], - deviceLevel: [], - deviceCategory: [] + deviceLevel: [] } this.loadData() // this.onClearSelected() @@ -810,7 +803,6 @@ z-index: 6; left: 632px; } - #EfficiencyShift { overflow: hidden; diff --git a/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue b/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue index 0f05931..8aff73a 100644 --- a/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue +++ b/src/views/mdc/base/modules/openRateFractionAnalysis/openRateFractionAnalysisMain.vue @@ -5,25 +5,107 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :md="7" :sm="7"> + <a-col :md="6" :sm="6"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> <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="17" :sm="17" :xs="17"> + + <a-col :md="9" :sm="9" :xs="9"> <a-form-item label="鏃堕棿娈�"> <a-space> <a-time-picker :default-value="moment('00:00', 'HH:mm')" format="HH:mm" @change="onChangeStart" :allowClear="false"/> 鑷� <a-time-picker :default-value="moment('08:00', 'HH:mm')" format="HH:mm" @change="onChangeEnd" :allowClear="false"/> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> </a-space> + </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="6" :sm="6"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6" :xs="6"> + <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 + v-model="queryParam.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{ item.label }} + </a-select-option> + </a-select> </a-form-item> </a-col> </a-row> </a-form> </div> + <div id="DeviceList"> <a-spin :spinning="loading"> <div id="Efficiency" class="container" style="margin-bottom: 15px;"> @@ -69,16 +151,13 @@ <script> import moment from 'moment' - import { putAction, getAction } from '@/api/manage' + import { getAction } from '@/api/manage' import $ from 'jquery' import '@/components/table2excel/table2excel' import { ajaxGetDictItems, getDictItemsFromCache, duplicateCheck } from '@/api/api' - import { - JeecgListMixin - } from '@/mixins/JeecgListMixin' + import api from '@api/mdc' export default { - // mixins: [JeecgListMixin], name: 'openRateFractionAnalysisMain', data() { return { @@ -92,9 +171,17 @@ TreeIDTwo: 2, deviceTypeDict: '', dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], identifying: [], queryParam: {}, - queryParams: {}, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [] + }, queryParamEquip: {}, queryParamPeople: {}, efficiencyOptions: [ @@ -109,14 +196,16 @@ dataList: [], url: { efficiencyList: '/mdc/efficiencyReport/utilizationRateSectionAnalyze', - listByType: '/mdc/MdcUtilizationRate/getByType' + listByType: '/mdc/MdcUtilizationRate/getByType', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' }, tableHeads: [], XData: [0], YData: [0], isLazyRequest: '',// 鏄惁寮�鍚噿鍔犺浇 - requestAlldataSize: 8,// 鎬诲叡璇锋眰鐨勫垪琛ㄩ」鏁扮洰 - everyRequestDataSize: 15// 姣忔璇锋眰鐨勫垪琛ㄩ」鏁扮洰 + requestAllDataSize: 8,// 鎬诲叡璇锋眰鐨勫垪琛ㄩ」鏁扮洰 + everyRequestDataSize: 15,// 姣忔璇锋眰鐨勫垪琛ㄩ」鏁扮洰 + toggleSearchStatus:false } }, props: { nodeTree: '', Type: '', nodePeople: '' }, @@ -124,13 +213,11 @@ * 鐢熷懡鍛ㄦ湡 鎸傝浇鍓� * */ created() { - this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] - this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - this.queryParam.startTime = '00:00' - this.queryParam.endTime = '08:00' - this.queryParam.typeTree = '1' - this.loadData1() + this.searchReset() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_importance_level') }, mounted() { @@ -182,22 +269,69 @@ } }, methods: { - moment, - onChangeStart(time, timeString) { - this.queryParam.startTime = timeString - // console.log(time, timeString); + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) }, - onChangeEnd(time, timeString) { - this.queryParam.endTime = timeString - // console.log(time, timeString); + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) }, - numBerTwo(value) { - if (value) { - return parseFloat((value * 100).toFixed(2)) - } else { - return '0' + + initDictData(dictCode) { + // //浼樺厛浠庣紦瀛樹腑璇诲彇瀛楀吀閰嶇疆 + if (getDictItemsFromCache(dictCode)) { + this[dictCode + '_list'] = getDictItemsFromCache(dictCode) + return } + //鏍规嵁瀛楀吀Code, 鍒濆鍖栧瓧鍏告暟缁� + ajaxGetDictItems(dictCode, null).then((res) => { + if (res.success) { + this[dictCode + '_list'] = res.result + return + } + }) }, + + loadData() { + this.loading = true + this.tableHeads = [] + this.dataList = [] + // 鑻ユ棩鏈熼�夋嫨鍣ㄨ缃殑鏌ヨ璇锋眰鏁伴噺瓒呰繃15鏉″垯寮�鍚噿鍔犺浇 + if (this.requestAllDataSize > 15) { + // 寮�鍚噿鍔犺浇鍚庡皢缁撴潫鏃ユ湡璁剧疆涓哄紑濮嬫棩鏈熶箣鍚庣殑14澶╋紝鍗冲厛鏌ヨ15澶╁唴鐨勬暟鎹� + this.queryParam.endDate = moment(this.queryParam.startDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') + this.isLazyRequest = true + this.tableScroll.removeEventListener('scroll', this.tableScrollX) // 涓洪伩鍏嶆粴鍔ㄦ潯鏈夋粴鍔ㄨ窛绂诲悗鍚庣偣鍑绘煡璇㈡寜閽Е鍙戞粴鍔ㄤ簨浠讹紝鍥犳鍦ㄨЕ鍙戜簨浠跺墠绉婚櫎浜嬩欢 + } + getAction(this.url.efficiencyList, this.queryParam).then(res => { + if (res.success) { + this.tableHeads = res.result.dates + this.dataList = res.result.mdcEfficiencyList + this.draw() + this.tableScroll.addEventListener('scroll', this.tableScrollX) + } + }).finally(() => { + this.loading = false + }) + }, + TableDraw(key, val) { this.XData = [0] this.YData[0] @@ -209,63 +343,10 @@ } this.XData = Xarr this.YData = Yarr - // if(this.openRateTrendAnalysisChart !=null && this.openRateTrendAnalysisChart != '' && this.openRateTrendAnalysisChart != undefined){ - // this.openRateTrendAnalysisChart.dispose() - // } this.draw() }, - //Can not slect days before today and today - disabledDate(current) { - return current && current > moment().subtract('days', 1) - }, - dateParamChange(v1, v2) { - this.queryParam.startDate = v2[0] - this.queryParam.endDate = v2[1] - this.dates = [v1[0], v1[1]] - }, - searchQuery() { - // 鍥犺Е搴曞埛鏂颁細淇敼鍙傛暟鏃堕棿鍊硷紝鏁呭湪姝ょ敤鏃堕棿閫夋嫨鍣ㄧ殑鏃堕棿鍊煎鍙傛暟鏃堕棿鍊煎啀娆¤祴鍊硷紝鑻ヤ笉杩欐牱鍋氬垯鍙傛暟鏃堕棿鍊煎垯浼氫笌鏃堕棿閫夋嫨鍣ㄤ笂鐨勬椂闂村�间笉涓�鑷� - this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - 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 = '' - } - this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 - this.loadData1() - }, - loadData1() { - this.loading = true - this.tableHeads = [] - this.dataList = [] - // 鑻ユ棩鏈熼�夋嫨鍣ㄨ缃殑鏌ヨ璇锋眰鏁伴噺瓒呰繃15鏉″垯寮�鍚噿鍔犺浇 - if (this.requestAlldataSize > 15) { - // 寮�鍚噿鍔犺浇鍚庡皢缁撴潫鏃ユ湡璁剧疆涓哄紑濮嬫棩鏈熶箣鍚庣殑14澶╋紝鍗冲厛鏌ヨ15澶╁唴鐨勬暟鎹� - this.queryParam.endDate = moment(this.queryParam.startDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') - this.isLazyRequest = true - this.tableScroll.removeEventListener('scroll', this.tableScrollX) // 涓洪伩鍏嶆粴鍔ㄦ潯鏈夋粴鍔ㄨ窛绂诲悗鍚庣偣鍑绘煡璇㈡寜閽Е鍙戞粴鍔ㄤ簨浠讹紝鍥犳鍦ㄨЕ鍙戜簨浠跺墠绉婚櫎浜嬩欢 - } - getAction(this.url.efficiencyList, this.queryParam).then(res => { - if (res.success) { - this.tableHeads = res.result.dates - this.dataList = res.result.mdcEfficiencyList - this.draw() - // this.checkSameData(this.dataList) - // this.checkSameData1(this.dataList) - // this.checkSameData2(this.dataList) - // this.combineCell(); - // this.initDeviceType(this.dataList) - this.tableScroll.addEventListener('scroll', this.tableScrollX) - } - }).finally(() => { - this.loading = false - }) - }, draw() { this.openRateTrendAnalysisChart = this.$echarts.init(document.getElementById('openRateTrendChart'), 'macarons') let openRateTrendChartOptions = { @@ -325,6 +406,80 @@ this.openRateTrendAnalysisChart.setOption(openRateTrendChartOptions, true) }, + searchQuery() { + // 鍥犺Е搴曞埛鏂颁細淇敼鍙傛暟鏃堕棿鍊硷紝鏁呭湪姝ょ敤鏃堕棿閫夋嫨鍣ㄧ殑鏃堕棿鍊煎鍙傛暟鏃堕棿鍊煎啀娆¤祴鍊硷紝鑻ヤ笉杩欐牱鍋氬垯鍙傛暟鏃堕棿鍊煎垯浼氫笌鏃堕棿閫夋嫨鍣ㄤ笂鐨勬椂闂村�间笉涓�鑷� + this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + + 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 = '' + } + this.requestAllDataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 + + Object.keys(this.queryParams).forEach(item => { + if (Array.isArray(this.queryParams[item])) { + if (this.queryParams[item].length !== 0) this.queryParam[item] = this.queryParams[item].join() + else delete this.queryParam[item] + } + }) + this.loadData() + }, + + searchReset() { + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [] + } + this.queryParam = {} + this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] + this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + this.queryParam.startTime = '00:00' + this.queryParam.endTime = '08:00' + this.queryParam.typeTree = '1' + this.loadData() + }, + + selectChange(value, key) { + this.queryParams[key] = value + }, + + onChangeStart(time, timeString) { + this.queryParam.startTime = timeString + // console.log(time, timeString); + }, + + onChangeEnd(time, timeString) { + this.queryParam.endTime = timeString + // console.log(time, timeString); + }, + + numBerTwo(value) { + if (value) { + return parseFloat((value * 100).toFixed(2)) + } else { + return '0' + } + }, + + //Can not slect days before today and today + disabledDate(current) { + return current && current > moment().subtract('days', 1) + }, + + dateParamChange(v1, v2) { + this.queryParam.startDate = v2[0] + this.queryParam.endDate = v2[1] + this.dates = [v1[0], v1[1]] + }, + + moment, + /** * 婊氬姩鏉¤Е搴曞埛鏂拌〃鏍兼暟鎹� */ diff --git a/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue b/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue index 8b4bcfd..2b86e83 100644 --- a/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue +++ b/src/views/mdc/base/modules/openRateTrendAnalysis/openRateTrendAnalysisMain.vue @@ -5,14 +5,97 @@ <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :md="7" :sm="7"> + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧绫诲瀷"> + <a-select + :value="queryParams.equipmentType" + mode="multiple" + placeholder="璇烽�夋嫨璁惧绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'equipmentType')" + > + <a-select-option v-for="(item,index) in equipmentTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-select + :value="queryParams.driveType" + mode="multiple" + placeholder="璇烽�夋嫨椹卞姩绫诲瀷" + allow-clear + :maxTagCount="1" + @change="selectChange($event,'driveType')" + > + <a-select-option v-for="(item,index) in driveTypeList" :value="item.value" :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> <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 :lg="2" :md="3" :sm="3" :xs="3"> - <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + + <a-col :md="3" :sm="3" :xs="3"> + <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-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="6" :sm="6" :xs="6"> + <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 + v-model="queryParam.deviceImportanceLevel" + placeholder="璇烽�夋嫨璁惧閲嶈绋嬪害" + allow-clear + > + <a-select-option v-for="(item,index) in device_importance_level_list" :value="item.value" + :key="index"> + {{ item.label }} + </a-select-option> + </a-select> + </a-form-item> </a-col> </a-row> </a-form> @@ -23,37 +106,37 @@ <!--琛ㄦ牸鍖哄煙--> <a-spin :spinning="loading"> <div id="Efficiency" class="container" style="margin-bottom: 15px;"> - <div class="table2"> - <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" - style="white-space: nowrap;text-align: center;"> - <thead> - <tr class="thead fixed equipname"> - <th class="thgu dong1 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;"> - 璁惧缂栧彿 - </th> - <th class="thgu dong2 name" rowspan="2" style="min-width: 162px; max-width: 162px;width: 162px;"> - 璁惧鍚嶇О - </th> - <th class="thgu dong3 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;"> - 璁惧绫诲瀷 - </th> - <template v-for="(tableHead, index) in tableHeads"> - <th class="timeth" :colspan="checkedList.length">{{tableHead}}</th> - </template> - </tr> - </thead> - <tbody> - <tr class="mathData" v-for="(item, index) in dataList" @click="TableDraw(index,item)"> - <td class="tdgu kaitou">{{item.equipmentId}}</td> - <td class="tdgu1 kaitou">{{item.equipmentName}}</td> - <td class="tdgu2 kaitou">{{item.equipmentType}}</td> - <template v-for="(tableHead, index) in item.dataList"> - <td :style="{background:tableHead.color }">{{tableHead.utilizationRate | numFilter}}</td> - </template> - </tr> - </tbody> - </table> - </div> + <div class="table2"> + <table class="dataContent table" border="1" cellspacing="0" cellpadding="0" + style="white-space: nowrap;text-align: center;"> + <thead> + <tr class="thead fixed equipname"> + <th class="thgu dong1 name" rowspan="2" style="min-width: 150px; max-width: 150px;width: 150px;"> + 璁惧缂栧彿 + </th> + <th class="thgu dong2 name" rowspan="2" style="min-width: 162px; max-width: 162px;width: 162px;"> + 璁惧鍚嶇О + </th> + <th class="thgu dong3 name" rowspan="2" style="min-width: 100px; max-width: 100px;width: 100px;"> + 璁惧绫诲瀷 + </th> + <template v-for="(tableHead, index) in tableHeads"> + <th class="timeth" :colspan="checkedList.length">{{ tableHead }}</th> + </template> + </tr> + </thead> + <tbody> + <tr class="mathData" v-for="(item, index) in dataList" @click="TableDraw(index,item)"> + <td class="tdgu kaitou">{{ item.equipmentId }}</td> + <td class="tdgu1 kaitou">{{ item.equipmentName }}</td> + <td class="tdgu2 kaitou">{{ item.equipmentType }}</td> + <template v-for="(tableHead, index) in item.dataList"> + <td :style="{background:tableHead.color }">{{ tableHead.utilizationRate | numFilter }}</td> + </template> + </tr> + </tbody> + </table> + </div> </div> </a-spin> <!--鍥炬爣鍖哄煙--> @@ -64,530 +147,503 @@ </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 { - JeecgListMixin - } from '@/mixins/JeecgListMixin' +import moment from 'moment' +import { getAction } from '@/api/manage' +import $ from 'jquery' +import '@/components/table2excel/table2excel' +import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' +import api from '@api/mdc' - export default { - // mixins: [JeecgListMixin], - name: 'openRateTrendAnalysisMain', - components: {}, - data() { - return { - dataSource: [], - /* table鍔犺浇鐘舵�� */ - loading: false, - typeTree: '', - typeParent: 1, - typeEquipment: 1, - TreeIDOne: 1, - TreeIDTwo: 2, - deviceTypeDict: '', - dates: [], - identifying: [], - queryParam: {}, - queryParams: {}, - queryParamEquip: {}, - queryParamPeople: {}, - efficiencyOptions: [ - { label: '鍒╃敤鐜�', value: 'lyl' }, - { label: '寮�鏈虹巼', value: 'kjl' }, - { label: '寮�鏈烘椂闂�', value: 'kjsj' }, - { label: '鍔犲伐鏃堕棿', value: 'jgsj' }, - { label: '寰呮満鏃堕棿', value: 'djsj' }, - { label: '鍏虫満鏃堕棿', value: 'gjsj' } - ], - checkedList: ['lyl'], - dataList: [], - url: { - efficiencyList: '/mdc/efficiencyReport/utilizationRateTrendAnalyze', - listByType: '/mdc/MdcUtilizationRate/getByType' - }, - tableHeads: [], - XData: [0], - YData: [0], - isLazyRequest: '',// 鏄惁寮�鍚噿鍔犺浇 - requestAlldataSize: 8,// 鎬诲叡璇锋眰鐨勫垪琛ㄩ」鏁扮洰 - everyRequestDataSize: 15// 姣忔璇锋眰鐨勫垪琛ㄩ」鏁扮洰 +export default { + name: 'openRateTrendAnalysisMain', + components: {}, + data() { + return { + dataSource: [], + /* table鍔犺浇鐘舵�� */ + loading: false, + typeTree: '', + typeParent: 1, + typeEquipment: 1, + TreeIDOne: 1, + TreeIDTwo: 2, + deviceTypeDict: '', + dates: [], + equipmentTypeList: [], + driveTypeList: [], + device_level_list: [], + device_importance_level_list: [], + identifying: [], + queryParam: {}, + queryParams: { + equipmentType: [], + driveType: [], + deviceLevel: [] + }, + queryParamEquip: {}, + queryParamPeople: {}, + efficiencyOptions: [ + { label: '鍒╃敤鐜�', value: 'lyl' }, + { label: '寮�鏈虹巼', value: 'kjl' }, + { label: '寮�鏈烘椂闂�', value: 'kjsj' }, + { label: '鍔犲伐鏃堕棿', value: 'jgsj' }, + { label: '寰呮満鏃堕棿', value: 'djsj' }, + { label: '鍏虫満鏃堕棿', value: 'gjsj' } + ], + checkedList: ['lyl'], + dataList: [], + url: { + efficiencyList: '/mdc/efficiencyReport/utilizationRateTrendAnalyze', + listByType: '/mdc/MdcUtilizationRate/getByType', + queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType' + }, + tableHeads: [], + XData: [0], + YData: [0], + isLazyRequest: '',// 鏄惁寮�鍚噿鍔犺浇 + requestAlldataSize: 8,// 鎬诲叡璇锋眰鐨勫垪琛ㄩ」鏁扮洰 + everyRequestDataSize: 15,// 姣忔璇锋眰鐨勫垪琛ㄩ」鏁扮洰 + toggleSearchStatus: false + } + }, + props: { nodeTree: '', Type: '', nodePeople: '' }, + /** + * 鐢熷懡鍛ㄦ湡 鎸傝浇鍓� + * */ + created() { + this.searchReset() + this.queryGroup() + this.getDriveTypeByApi() + this.initDictData('device_level') + this.initDictData('device_importance_level') + }, + mounted() { + this.tableScroll = document.querySelector('.table2') + window.addEventListener('resize', this.handleWindowResize) + }, + beforeDestroy() { + this.tableScroll.removeEventListener('scroll', this.tableScrollX) + window.removeEventListener('resize', 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() } }, - props: { nodeTree: '', Type: '', nodePeople: '' }, - /** - * 鐢熷懡鍛ㄦ湡 鎸傝浇鍓� - * */ - created() { + 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' + } + } + }, + methods: { + queryGroup() { + getAction(this.url.queryEquipmentType).then(res => { + if (res.success) { + this.equipmentTypeList = res.result.map(item => { + return { + label: item.equipmentTypeName, + value: item.equipmentTypeName + } + }) + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + }, + + // 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + if (res.success) this.driveTypeList = res.result + }) + }, + + 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 + } + }) + }, + + loadData() { + this.loading = true + this.tableHeads = [] + this.dataList = [] + // 鑻ユ棩鏈熼�夋嫨鍣ㄨ缃殑鏌ヨ璇锋眰鏁伴噺瓒呰繃15鏉″垯寮�鍚噿鍔犺浇 + if (this.requestAlldataSize > 15) { + // 寮�鍚噿鍔犺浇鍚庡皢缁撴潫鏃ユ湡璁剧疆涓哄紑濮嬫棩鏈熶箣鍚庣殑14澶╋紝鍗冲厛鏌ヨ15澶╁唴鐨勬暟鎹� + this.queryParam.endDate = moment(this.queryParam.startDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') + this.isLazyRequest = true + this.tableScroll.removeEventListener('scroll', this.tableScrollX) // 涓洪伩鍏嶆粴鍔ㄦ潯鏈夋粴鍔ㄨ窛绂诲悗鍚庣偣鍑绘煡璇㈡寜閽Е鍙戞粴鍔ㄤ簨浠讹紝鍥犳鍦ㄨЕ鍙戜簨浠跺墠绉婚櫎浜嬩欢 + } + getAction(this.url.efficiencyList, this.queryParam).then(res => { + if (res.success) { + this.tableHeads = res.result.dates + this.dataList = res.result.mdcEfficiencyList + this.draw() + this.tableScroll.addEventListener('scroll', this.tableScrollX) + } + }).finally(() => { + this.loading = false + }) + }, + + TableDraw(key, val) { + this.XData = [0] + this.YData[0] + var Xarr = [] + var Yarr = [] + for (var i = 0; i < val.dataList.length; i++) { + Xarr.push(val.dataList[i].theDate) + Yarr.push(this.numBerTwo(val.dataList[i].utilizationRate)) + } + this.XData = Xarr + this.YData = Yarr + + this.draw() + }, + + searchQuery() { + // 鍥犺Е搴曞埛鏂颁細淇敼鍙傛暟鏃堕棿鍊硷紝鏁呭湪姝ょ敤鏃堕棿閫夋嫨鍣ㄧ殑鏃堕棿鍊煎鍙傛暟鏃堕棿鍊煎啀娆¤祴鍊硷紝鑻ヤ笉杩欐牱鍋氬垯鍙傛暟鏃堕棿鍊煎垯浼氫笌鏃堕棿閫夋嫨鍣ㄤ笂鐨勬椂闂村�间笉涓�鑷� + this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') + this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + + 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 = '' + } + this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 + + Object.keys(this.queryParams).forEach(item => { + if (Array.isArray(this.queryParams[item])) { + if (this.queryParams[item].length !== 0) this.queryParam[item] = this.queryParams[item].join() + else delete this.queryParam[item] + } + }) + this.loadData() + }, + + searchReset() { + this.queryParams = { + equipmentType: [], + driveType: [], + deviceLevel: [] + } + this.queryParam = {} this.dates = [moment().subtract('days', 8), moment().subtract('days', 1)] this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - this.queryParam.typeTree = '1' - this.loadData1() + this.loadData() }, - mounted() { - this.tableScroll = document.querySelector('.table2') - window.addEventListener('resize',this.handleWindowResize) - }, - beforeDestroy() { - this.tableScroll.removeEventListener('scroll', this.tableScrollX) - window.removeEventListener('resize',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' - } - } - }, - methods: { - numBerTwo(value) { - if (value) { - return parseFloat((value * 100).toFixed(2)) - } else { - return '0' - } - }, - TableDraw(key, val) { - this.XData = [0] - this.YData[0] - var Xarr = [] - var Yarr = [] - for (var i = 0; i < val.dataList.length; i++) { - Xarr.push(val.dataList[i].theDate) - Yarr.push(this.numBerTwo(val.dataList[i].utilizationRate)) - } - this.XData = Xarr - this.YData = Yarr - // if(this.openRateTrendAnalysisChart !=null && this.openRateTrendAnalysisChart != '' && this.openRateTrendAnalysisChart != undefined){ - // this.openRateTrendAnalysisChart.dispose() - // } - this.draw() - }, - 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 - } - } - } - }) + draw() { + this.openRateTrendAnalysisChart = this.$echarts.init(document.getElementById('openRateTrendChart'), 'macarons') + let openRateTrendChartOptions = { + title: { + text: '鍒╃敤鐜囪蛋鍔垮垎鏋�', + x: 'center', + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#151414' + } + }, + tooltip: { + trigger: 'axis' + }, + toolbox: { + show: true, + feature: { + mark: { show: true }, + dataView: { show: true, readOnly: false }, + magicType: { show: true, type: ['line', 'bar'] }, + restore: { show: true }, + saveAsImage: { show: true } + } + }, + calculable: true, + xAxis: [ + { + type: 'category', + data: this.XData + } + ], + yAxis: [ + { + type: 'value' + } + ], + series: [ + { + name: '鍒╃敤鐜�', + type: 'line', + data: this.YData, + markPoint: { + data: [ + { type: 'max', name: '鏈�澶у��', symbolSize: 70 }, + { type: 'min', name: '鏈�灏忓��', symbolSize: 70 } + ] + }, + markLine: { + data: [ + { type: 'average', name: '骞冲潎鍊�' } + ] } } - } - }, - dateParamChange(v1, v2) { - this.queryParam.startDate = v2[0] - this.queryParam.endDate = v2[1] - this.dates = [v1[0], v1[1]] - }, - searchQuery() { - // 鍥犺Е搴曞埛鏂颁細淇敼鍙傛暟鏃堕棿鍊硷紝鏁呭湪姝ょ敤鏃堕棿閫夋嫨鍣ㄧ殑鏃堕棿鍊煎鍙傛暟鏃堕棿鍊煎啀娆¤祴鍊硷紝鑻ヤ笉杩欐牱鍋氬垯鍙傛暟鏃堕棿鍊煎垯浼氫笌鏃堕棿閫夋嫨鍣ㄤ笂鐨勬椂闂村�间笉涓�鑷� - this.queryParam.startDate = moment(this.dates[0]).format('YYYYMMDD') - this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + ] + } + this.openRateTrendAnalysisChart.setOption(openRateTrendChartOptions, true) + }, - 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 = '' - } - this.requestAlldataSize = moment.duration(moment(this.queryParam.endDate) - moment(this.queryParam.startDate), 'millisecond').asDays() + 1 - this.loadData1() - }, - // searchReset() { - // this.typeTree = this.queryParam.typeTree - // this.typeParent = this.queryParam.parentId - // this.typeEquipment = this.queryParam.equipmentId - // this.queryParam = {} - // this.dates = [] - // this.queryParam.typeTree = this.typeTree - // this.queryParam.parentId = this.typeParent - // this.queryParam.equipmentId = this.typeEquipment - // // this.ipagination.current = 1 - // this.loadData1(); - // // this.queryParam = {} - // // this.dates = [] - // // this.loadData() - // // this.onClearSelected() - // }, - // loadData1() { - // let that = this - // that.columns=[ - // { - // title: '璁惧缂栧彿', - // align: 'center', - // dataIndex: 'equipmentId', - // width:'150px' - // }, - // { - // title: '璁惧鍚嶇О', - // align: 'center', - // dataIndex: 'equipmentName', - // width:'150px' - // }, - // ] - // that.tableHeads = [] - // that.dataList = [] - // getAction(this.url.efficiencyList, that.queryParam).then(res => { - // var tmp = {} - // console.log(res) - // if (res.success) - // - // that.dataSource = res.result.mdcEfficiencyList - // for(var k = 0;k<that.dataSource[0].dataList.length;k++){ - // that.columns.push( - // { - // title:that.dataSource[0].dataList.theDate, - // align: 'center', - // width:'120px', - // // dataIndex:'utilizationRate', - // } - // ) - // } - // for(var i = 0;i<that.dataSource.length;i++){ - // for (var j = 0; j < that.dataSource[i].dataList.length;j++){ - // // that.columns.push( - // // { - // // title:that.dataSource[0].dataList[j].theDate, - // // align: 'center', - // // width:'120px', - // // dataIndex:'utilizationRate', - // // } - // // ) - // } - // - // } - // console.log(that.columns) - // console.log(that.dataSource) - // // this.initDeviceType(this.dataList) - // this.draw() - // } - // } - loadData1() { + selectChange(value, key) { + this.queryParams[key] = value + }, + + numBerTwo(value) { + if (value) { + return parseFloat((value * 100).toFixed(2)) + } else { + return '0' + } + }, + + disabledDate(current) { + //Can not slect days before today and today + return current && current > moment().subtract('days', 1) + }, + + dateParamChange(v1, v2) { + this.queryParam.startDate = v2[0] + this.queryParam.endDate = v2[1] + this.dates = [v1[0], v1[1]] + }, + + /** + * 婊氬姩鏉¤Е搴曞埛鏂拌〃鏍兼暟鎹� + */ + tableScrollX() { + // 褰撴粴鍔ㄦ潯瑙﹀簳涓旀噿鍔犺浇寮�鍚椂瑙﹀彂婊氬姩鏉¤Е搴曞埛鏂� + if (Math.ceil(this.tableScroll.scrollLeft + this.tableScroll.clientWidth) + 1 >= this.tableScroll.scrollWidth && this.isLazyRequest) { this.loading = true - this.tableHeads = [] - this.dataList = [] - // 鑻ユ棩鏈熼�夋嫨鍣ㄨ缃殑鏌ヨ璇锋眰鏁伴噺瓒呰繃15鏉″垯寮�鍚噿鍔犺浇 - if (this.requestAlldataSize > 15) { - // 寮�鍚噿鍔犺浇鍚庡皢缁撴潫鏃ユ湡璁剧疆涓哄紑濮嬫棩鏈熶箣鍚庣殑14澶╋紝鍗冲厛鏌ヨ15澶╁唴鐨勬暟鎹� - this.queryParam.endDate = moment(this.queryParam.startDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') - this.isLazyRequest = true - this.tableScroll.removeEventListener('scroll', this.tableScrollX) // 涓洪伩鍏嶆粴鍔ㄦ潯鏈夋粴鍔ㄨ窛绂诲悗鍚庣偣鍑绘煡璇㈡寜閽Е鍙戞粴鍔ㄤ簨浠讹紝鍥犳鍦ㄨЕ鍙戜簨浠跺墠绉婚櫎浜嬩欢 + this.queryParam.startDate = moment(this.queryParam.endDate).add(1, 'days').format('YYYYMMDD') + // 鍒ゆ柇璁剧疆鎳掑姞杞藉悗鐨勭粨鏉熸椂闂存槸鍚﹁秴杩囨椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勭粨鏉熸椂闂� + if (moment(this.queryParam.endDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') - moment(this.dates[1]).format('YYYYMMDD') < 0) { + //鍐嶆鏌ヨ鍚�15澶╁唴鐨勬暟鎹� + this.queryParam.endDate = moment(this.queryParam.endDate).add(this.everyRequestDataSize, 'days').format('YYYYMMDD') + } else { + // 濡傛灉涓嶅皬浜庢椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勬椂闂村垯璁剧疆璇锋眰缁撴潫鏃ユ湡涓烘椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勭粨鏉熸椂闂村苟涓斿叧闂噿鍔犺浇锛堟剰鍛崇潃鏈�鍚庝竴娆¤Е搴曞埛鏂帮級 + this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') + this.isLazyRequest = false } getAction(this.url.efficiencyList, this.queryParam).then(res => { if (res.success) { - this.tableHeads = res.result.dates - this.dataList = res.result.mdcEfficiencyList + this.tableHeads = [...this.tableHeads, ...res.result.dates] + this.dataList.forEach(item1 => { + res.result.mdcEfficiencyList.forEach(item2 => { + if (item1.equipmentId === item2.equipmentId) { + item1.dataList = [...item1.dataList, ...item2.dataList] + } + }) + }) this.draw() - // this.checkSameData(this.dataList) - // this.checkSameData1(this.dataList) - // this.checkSameData2(this.dataList) - // this.combineCell(); - // this.initDeviceType(this.dataList) - this.tableScroll.addEventListener('scroll', this.tableScrollX) } }).finally(() => { this.loading = false }) - }, - draw() { - this.openRateTrendAnalysisChart = this.$echarts.init(document.getElementById('openRateTrendChart'), 'macarons') - let openRateTrendChartOptions = { - title: { - text: '鍒╃敤鐜囪蛋鍔垮垎鏋�', - x: 'center', - textStyle: { - fontSize: 18, - fontWeight: 'bolder', - color: '#151414' - } - }, - tooltip: { - trigger: 'axis' - }, - toolbox: { - show: true, - feature: { - mark: { show: true }, - dataView: { show: true, readOnly: false }, - magicType: { show: true, type: ['line', 'bar'] }, - restore: { show: true }, - saveAsImage: { show: true } - } - }, - calculable: true, - xAxis: [ - { - type: 'category', - data: this.XData - } - ], - yAxis: [ - { - type: 'value' - } - ], - series: [ - { - name: '鍒╃敤鐜�', - type: 'line', - data: this.YData, - markPoint: { - data: [ - { type: 'max', name: '鏈�澶у��', symbolSize: 70 }, - { type: 'min', name: '鏈�灏忓��', symbolSize: 70 } - ] - }, - markLine: { - data: [ - { type: 'average', name: '骞冲潎鍊�' } - ] - } - } - ] - } - this.openRateTrendAnalysisChart.setOption(openRateTrendChartOptions, true) - }, - - /** - * 婊氬姩鏉¤Е搴曞埛鏂拌〃鏍兼暟鎹� - */ - tableScrollX() { - // 褰撴粴鍔ㄦ潯瑙﹀簳涓旀噿鍔犺浇寮�鍚椂瑙﹀彂婊氬姩鏉¤Е搴曞埛鏂� - if (Math.ceil(this.tableScroll.scrollLeft + this.tableScroll.clientWidth) + 1 >= this.tableScroll.scrollWidth && this.isLazyRequest) { - this.loading = true - this.queryParam.startDate = moment(this.queryParam.endDate).add(1, 'days').format('YYYYMMDD') - // 鍒ゆ柇璁剧疆鎳掑姞杞藉悗鐨勭粨鏉熸椂闂存槸鍚﹁秴杩囨椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勭粨鏉熸椂闂� - if (moment(this.queryParam.endDate).add(this.everyRequestDataSize - 1, 'days').format('YYYYMMDD') - moment(this.dates[1]).format('YYYYMMDD') < 0) { - //鍐嶆鏌ヨ鍚�15澶╁唴鐨勬暟鎹� - this.queryParam.endDate = moment(this.queryParam.endDate).add(this.everyRequestDataSize, 'days').format('YYYYMMDD') - } else { - // 濡傛灉涓嶅皬浜庢椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勬椂闂村垯璁剧疆璇锋眰缁撴潫鏃ユ湡涓烘椂闂撮�夋嫨鍣ㄤ腑璁剧疆鐨勭粨鏉熸椂闂村苟涓斿叧闂噿鍔犺浇锛堟剰鍛崇潃鏈�鍚庝竴娆¤Е搴曞埛鏂帮級 - this.queryParam.endDate = moment(this.dates[1]).format('YYYYMMDD') - this.isLazyRequest = false - } - getAction(this.url.efficiencyList, this.queryParam).then(res => { - if (res.success) { - this.tableHeads = [...this.tableHeads, ...res.result.dates] - this.dataList.forEach(item1 => { - res.result.mdcEfficiencyList.forEach(item2 => { - if (item1.equipmentId === item2.equipmentId) { - item1.dataList = [...item1.dataList, ...item2.dataList] - } - }) - }) - this.draw() - } - }).finally(() => { - this.loading = false - }) - } - }, - - /** - * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� - */ - handleWindowResize(){ - if(this.openRateTrendAnalysisChart) this.openRateTrendAnalysisChart.resize() } + }, + + /** + * 褰撴祻瑙堝櫒鍙绐楀彛灏哄鍙戠敓鏀瑰彉鏃惰Е鍙� + */ + handleWindowResize() { + if (this.openRateTrendAnalysisChart) this.openRateTrendAnalysisChart.resize() } } +} </script> <style scoped> - .dataContent { - white-space: nowrap; - /*margin: 0;*/ - /*border: none;*/ - border-collapse: separate; - border-spacing: 0; - /*table-layout: fixed;*/ - border: 1px solid #ccc; - /*border: 1px solid #ccc;*/ - width: 100%; - text-align: center; - } +.dataContent { + white-space: nowrap; + /*margin: 0;*/ + /*border: none;*/ + border-collapse: separate; + border-spacing: 0; + /*table-layout: fixed;*/ + border: 1px solid #ccc; + /*border: 1px solid #ccc;*/ + width: 100%; + 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 tr td { - height: 35px; - } +.dataContent tr td { + height: 35px; +} - .dataContent .mathData td { - padding: 10px; - cursor: pointer; - } +.dataContent .mathData td { + padding: 10px; + cursor: pointer; +} - .dataContent .mathData:hover td { - background-color: #e6f7ff; - } +.dataContent .mathData:hover td { + background-color: #e6f7ff; +} - .table2 { - width: 100%; - height: 100%; - overflow: auto; - } +.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 .kaitou { - z-index: 1; - background-color: white; - } +.table tbody tr .kaitou { + z-index: 1; + background-color: white; +} - .table tbody tr .tdgu1 { - position: sticky; - left: 150px; - z-index: 2; - } +.table tbody tr .tdgu1 { + position: sticky; + left: 150px; + z-index: 2; +} - .table tbody tr .tdgu2 { - position: sticky; - left: 312px; - z-index: 2; - } +.table tbody tr .tdgu2 { + position: sticky; + left: 312px; + 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: 6 !important; - } +.table2 thead .gudingth th { + position: sticky; + top: 32px; + z-index: 6 !important; +} - .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: 150px; - } +.table2 thead .equipname .dong2 { + z-index: 5; + left: 150px; +} - .table2 thead .equipname .dong3 { - z-index: 5; - left: 312px; - } +.table2 thead .equipname .dong3 { + z-index: 5; + left: 312px; +} - .efficiency_list #DeviceList { - height: 90% !important; - } +.efficiency_list #DeviceList { + height: 90% !important; +} - #Efficiency{ - overflow: hidden; - } +#Efficiency { + overflow: hidden; +} - #openRateTrendChart{ - width: 100%; - height: 60%; - } +#openRateTrendChart { + width: 100%; + height: 60%; +} - @media screen and (min-width: 1920px) { - #Efficiency { - height: 337px !important; - } +@media screen and (min-width: 1920px) { + #Efficiency { + height: 337px !important; } +} - @media screen and (min-width: 1680px) and (max-width: 1920px) { - #Efficiency { - height: 337px !important; - } +@media screen and (min-width: 1680px) and (max-width: 1920px) { + #Efficiency { + height: 337px !important; } +} - @media screen and (min-width: 1400px) and (max-width: 1680px) { - #Efficiency { - height: 337px !important; - } +@media screen and (min-width: 1400px) and (max-width: 1680px) { + #Efficiency { + height: 337px !important; } +} - @media screen and (min-width: 1280px) and (max-width: 1400px) { - #Efficiency { - height: 200px !important; - } +@media screen and (min-width: 1280px) and (max-width: 1400px) { + #Efficiency { + height: 200px !important; } +} - @media screen and (max-width: 1280px) { - #Efficiency { - height: 200px !important; - } +@media screen and (max-width: 1280px) { + #Efficiency { + height: 200px !important; } +} </style> \ No newline at end of file diff --git a/src/views/system/modules/SelectDeviceDrawer.vue b/src/views/system/modules/SelectDeviceDrawer.vue index af9990b..911a41a 100644 --- a/src/views/system/modules/SelectDeviceDrawer.vue +++ b/src/views/system/modules/SelectDeviceDrawer.vue @@ -127,7 +127,6 @@ this.getTreeDataSource(res.result) this.treeDataSource = res.result this.generateList(this.treeDataSource) - console.log('treeDataSource', this.treeDataSource) this.expandedKeys = this.allTreeKeys } else { this.$message.warn(res.message) -- Gitblit v1.9.3