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'
          }
        })
      },
    }
  }