diff --git a/src/api/project.js b/src/api/project.js index ff15b0c58..3b9fc32cb 100644 --- a/src/api/project.js +++ b/src/api/project.js @@ -61,10 +61,10 @@ export function setLwConfig(id, data) { data: data }); } -/** 查询所有的某类型设备 */ -export function getDevicesByType(type) { +/** 查询某个项目下的所有的某类型设备 */ +export function getDevicesByType(project, type) { return request({ - url: `/api/device/${type}/all`, + url: `/api/device/${project}/${type}/all`, method: 'get' }); } diff --git a/src/views/system/deviceManage/editConfig.vue b/src/views/system/deviceManage/editConfig.vue index 4799d8558..019784336 100644 --- a/src/views/system/deviceManage/editConfig.vue +++ b/src/views/system/deviceManage/editConfig.vue @@ -277,7 +277,7 @@ export default { this.mapList = []; this.stationList = []; if (['VR_IBP', 'ISCS_LW'].includes(this.data.type)) { - getDevicesByType('LW').then(res => { + getDevicesByType(row.project, 'LW').then(res => { if (res.data && res.data.length) { this.lwList = res.data; } @@ -285,7 +285,7 @@ export default { this.$message.error('获取设备列表失败!'); }); } else if (this.data.type === 'ISCS_CW') { - getDevicesByType('CW').then(res => { + getDevicesByType(row.project, 'CW').then(res => { if (res.data && res.data.length) { this.lwList = res.data; } diff --git a/src/views/system/deviceManage/editConfigScreen.vue b/src/views/system/deviceManage/editConfigScreen.vue index ba4fdd780..bb2b8eb0d 100644 --- a/src/views/system/deviceManage/editConfigScreen.vue +++ b/src/views/system/deviceManage/editConfigScreen.vue @@ -143,7 +143,7 @@ export default { }, methods: { initData(row) { - getDevicesByType('IM').then(resp => { + getDevicesByType(row.project, 'IM').then(resp => { this.deviceList = resp.data; }).catch(()=> { this.$message.error('获取项目设备详情失败!');