From dbb3445dc720a8f36b3424e73f2e02a6b0f9deb6 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期日, 27 四月 2025 11:31:57 +0800 Subject: [PATCH] art: 从沃克项目迁移设备管理代码到航宇 --- src/views/system/modules/SelectDeviceModal.vue | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/views/system/modules/SelectDeviceModal.vue b/src/views/system/modules/SelectDeviceModal.vue index 599de84..e3f8b69 100644 --- a/src/views/system/modules/SelectDeviceModal.vue +++ b/src/views/system/modules/SelectDeviceModal.vue @@ -58,6 +58,7 @@ } from '@/api/manage' import BaseTree from '@/views/mdc/common/BaseTree' import DepartTree from '@/views/mdc/base/modules/DepartList/DepartListTree/DepartTree' + import { getSystemConfigValue } from '@api/api' export default { name: 'SelectDeviceModal', @@ -85,16 +86,20 @@ expandedKeys: [], checkedKeys: [], url: { - getDeviceTree: '/mdc/mdcEquipment/loadTreeListByProductionIds' + getDeviceTree: '/mdc/mdcEquipment/loadTreeListByProductionIds', + getEquipmentTree: '/eam/equipment/loadTreeListByProductionIds', }, selectedWorkshopIds: '', dataList: [], allTreeKeys: [], visible: false, - dataSource: [] + dataSource: [], + //绯荤粺鏄惁瀹炴柦璁惧绠$悊妯″潡 + eamModuleFlag: true, } }, created() { + this.loadEamSystemConfigValue(); this.closeAll() }, methods: { @@ -105,7 +110,15 @@ queryTreeData(value) { this.loading = true this.selectedWorkshopIds = value - getAction(this.url.getDeviceTree, { ids: value }) + let url = ''; + if(this.eamModuleFlag) { + //鍔犺浇璁惧绠$悊鐨勬爲缁撴瀯 + url = this.url.getEquipmentTree + }else { + //鍔犺浇MDC鐨勬爲缁撴瀯 + url = this.url.getDeviceTree + } + getAction(url, { ids: value }) .then(res => { if (res.success) { this.dataList = [] @@ -176,7 +189,15 @@ handleOk() { this.$emit('selectFinished', this.deviceNodes) this.visible = false - } + }, + loadEamSystemConfigValue() { + let params = {settingKey: 'has_eam_module'}; + getSystemConfigValue(params).then(res => { + if (res.success) { + this.eamModuleFlag = res.result.settingValue === '1' + } + }) + }, } } -- Gitblit v1.9.3