art: 系统管理-用户管理-添加选择设备,并根据是否有设备管理模块功能区分加载 哪个模块的设备倏
| | |
| | | //加载我的通告信息 |
| | | 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), |
| | |
| | | deleteByProduction, |
| | | queryById, |
| | | addEquipment, |
| | | editEquipment |
| | | editEquipment, |
| | | getSystemConfigValue |
| | | } |
| | | |
| | | |
| | |
| | | }) |
| | | }, |
| | | add (depart) { |
| | | debugger |
| | | this.visible = true; |
| | | this.model = {} |
| | | if(depart){ |
| | |
| | | } 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', |
| | |
| | | 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: { |
| | |
| | | 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 = [] |
| | |
| | | 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' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | } |
| | | } |
| | |
| | | ></j-select-production> |
| | | </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="选择设备" |
| | | :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="首页权限"--> |