art: 系统管理-用户管理-添加选择设备,并根据是否有设备管理模块功能区分加载 哪个模块的设备倏
已修改4个文件
65 ■■■■■ 文件已修改
src/api/api.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/ProductionManager/ProductionModal.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/SelectDeviceModal.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/modules/UserModal.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -101,6 +101,8 @@
//加载我的通告信息
const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`
//系统配置参数值获取
const getSystemConfigValue = (params)=>getAction("/system/sysParams/query/by/settingKey",params);
// 中转HTTP请求
export const transitRESTful = {
  get: (url, parameter) => getAction(getTransitURL(url), parameter),
@@ -169,7 +171,8 @@
  deleteByProduction,
  queryById,
  addEquipment,
  editEquipment
  editEquipment,
  getSystemConfigValue
}
src/views/system/modules/ProductionManager/ProductionModal.vue
@@ -121,7 +121,6 @@
        })
      },
      add (depart) {
        debugger
        this.visible = true;
        this.model = {}
        if(depart){
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'
          }
        })
      },
    }
  }
src/views/system/modules/UserModal.vue
@@ -150,21 +150,21 @@
          ></j-select-production>
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--label="选择设备"-->
          <!--:labelCol="labelCol"-->
          <!--:wrapperCol="wrapperCol"-->
          <!--v-show="!productionDisabled"-->
        <!--&gt;-->
          <!--<a-input-search-->
            <!--:readOnly="true"-->
            <!--v-model="model.equipmentIds"-->
            <!--@search="deviceSearch"-->
            <!--enter-button-->
            <!--placeholder="请选择设备"-->
            <!--:disabled="!model.selectedProduction"-->
          <!--/>-->
        <!--</a-form-model-item>-->
        <a-form-model-item
          label="选择设备"
          :labelCol="labelCol"
          :wrapperCol="wrapperCol"
          v-show="!productionDisabled"
        >
          <a-input-search
            :readOnly="true"
            v-model="model.equipmentIds"
            @search="deviceSearch"
            enter-button
            placeholder="请选择设备"
            :disabled="!model.selectedProduction"
          />
        </a-form-model-item>
        <!--<a-form-model-item-->
          <!--label="首页权限"-->