代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-08 16:01:28 +08:00
parent cf693b6d59
commit d06d0eec15
3 changed files with 6 additions and 6 deletions

View File

@ -61,10 +61,10 @@ export function setLwConfig(id, data) {
data: data data: data
}); });
} }
/** 查询所有的某类型设备 */ /** 查询某个项目下的所有的某类型设备 */
export function getDevicesByType(type) { export function getDevicesByType(project, type) {
return request({ return request({
url: `/api/device/${type}/all`, url: `/api/device/${project}/${type}/all`,
method: 'get' method: 'get'
}); });
} }

View File

@ -277,7 +277,7 @@ export default {
this.mapList = []; this.mapList = [];
this.stationList = []; this.stationList = [];
if (['VR_IBP', 'ISCS_LW'].includes(this.data.type)) { 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) { if (res.data && res.data.length) {
this.lwList = res.data; this.lwList = res.data;
} }
@ -285,7 +285,7 @@ export default {
this.$message.error('获取设备列表失败!'); this.$message.error('获取设备列表失败!');
}); });
} else if (this.data.type === 'ISCS_CW') { } else if (this.data.type === 'ISCS_CW') {
getDevicesByType('CW').then(res => { getDevicesByType(row.project, 'CW').then(res => {
if (res.data && res.data.length) { if (res.data && res.data.length) {
this.lwList = res.data; this.lwList = res.data;
} }

View File

@ -143,7 +143,7 @@ export default {
}, },
methods: { methods: {
initData(row) { initData(row) {
getDevicesByType('IM').then(resp => { getDevicesByType(row.project, 'IM').then(resp => {
this.deviceList = resp.data; this.deviceList = resp.data;
}).catch(()=> { }).catch(()=> {
this.$message.error('获取项目设备详情失败!'); this.$message.error('获取项目设备详情失败!');