代码调整

This commit is contained in:
joylink_cuiweidong 2022-12-29 11:31:40 +08:00
parent 1f432892fc
commit 5e71eeb265
2 changed files with 20 additions and 8 deletions

View File

@ -411,7 +411,7 @@ export default {
this.roleList = covertRoleList; this.roleList = covertRoleList;
const roleCode = this.formIbp.roleCode || this.formIm.roleCode || this.formLw.roleCode || this.formIscs.roleCode; const roleCode = this.formIbp.roleCode || this.formIm.roleCode || this.formLw.roleCode || this.formIscs.roleCode;
const role = this.roleList.find(each=>{ return each.value == roleCode; }); const role = this.roleList.find(each=>{ return each.value == roleCode; });
this.clientList = this.clientListMap[role.memberType] || []; if (role) { this.clientList = this.clientListMap[role.memberType] || []; }
} }
}); });
} }

View File

@ -21,7 +21,7 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
data: {}, data: {},
clientList: ConstConfig.ConstSelect.clientList, clientList:[],
screenList: [ screenList: [
{ label: '第一屏', value: 1 }, { label: '第一屏', value: 1 },
{ label: '第二屏', value: 2 }, { label: '第二屏', value: 2 },
@ -70,7 +70,8 @@ export default {
stationList: [], stationList: [],
standList: [], standList: [],
psdList: [], psdList: [],
roleList:[] roleList:[],
clientListMap:{}
}; };
}, },
computed: { computed: {
@ -96,7 +97,7 @@ export default {
{ prop: 'stationCode', label: '关联车站:', type: 'select', options: this.stationList, optionLabel: 'name', optionValue: 'code', deviceChange: this.stationCodeChange}, { prop: 'stationCode', label: '关联车站:', type: 'select', options: this.stationList, optionLabel: 'name', optionValue: 'code', deviceChange: this.stationCodeChange},
{ prop: 'standCode', label: '关联站台:', type: 'select', options: this.standList, optionLabel: 'name', optionValue: 'code', deviceChange: this.standCodeChange}, { prop: 'standCode', label: '关联站台:', type: 'select', options: this.standList, optionLabel: 'name', optionValue: 'code', deviceChange: this.standCodeChange},
{ prop: 'psdCode', label: '关联屏蔽门:', type: 'select', options: this.psdList, optionLabel: 'code', optionValue: 'code' }, { prop: 'psdCode', label: '关联屏蔽门:', type: 'select', options: this.psdList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' }, { prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' } { prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
] ]
}; };
@ -106,7 +107,7 @@ export default {
items: [ items: [
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' }, { prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'quadrant', label: '屏幕配置:', type: 'select', options: this.screenList, optionLabel: 'label', optionValue: 'value'}, { prop: 'quadrant', label: '屏幕配置:', type: 'select', options: this.screenList, optionLabel: 'label', optionValue: 'value'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' }, { prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' } { prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
] ]
}; };
@ -115,7 +116,7 @@ export default {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' }, { prop: 'deviceCode', label: '教研机:', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code' },
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' }, { prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' } { prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
] ]
}; };
@ -124,7 +125,7 @@ export default {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'}, { prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' }, { prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' } { prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
] ]
}; };
@ -133,7 +134,7 @@ export default {
labelWidth: '150px', labelWidth: '150px',
items: [ items: [
{ prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'}, { prop: 'deviceCode', label: '教研机', type: 'select', options: this.deviceList, optionLabel: 'code', optionValue: 'code'},
{ prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value' }, { prop: 'roleCode', label: '关联角色:', type: 'select', options: this.roleList, optionLabel: 'label', optionValue: 'value', deviceChange:this.roleChange },
{ prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' } { prop: 'client', label: '关联客户端:', type: 'select', options: this.clientList, optionLabel: 'label', optionValue: 'value' }
] ]
}; };
@ -199,12 +200,18 @@ export default {
getMapFunctioById(functionId).then(response=>{ getMapFunctioById(functionId).then(response=>{
if (resp.data) { if (resp.data) {
const roleList = resp.data[response.data.simType]; const roleList = resp.data[response.data.simType];
const clientListMapIn = ConstConfig.ConstSelect.clientMap;
this.clientListMap = clientListMapIn[response.data.simType];
const covertRoleList = []; const covertRoleList = [];
roleList.forEach(member => { roleList.forEach(member => {
const data = self.handleMember(member, self.stationList); const data = self.handleMember(member, self.stationList);
covertRoleList.push(data); covertRoleList.push(data);
}); });
this.clientList = [];
self.roleList = covertRoleList; self.roleList = covertRoleList;
const roleCode = this.formData.roleCode;
const role = this.roleList.find(each=>{ return each.value == roleCode; });
if (role) { this.clientList = this.clientListMap[role.memberType] || []; }
} }
}); });
} }
@ -216,6 +223,11 @@ export default {
}); });
} }
}, },
roleChange(role) {
this.formData.client = '';
const roleMember = this.roleList.find(each=>{ return each.value == role; });
if (roleMember) { this.clientList = this.clientListMap[roleMember.memberType] || []; }
},
handleMember(member, stationList) { handleMember(member, stationList) {
const data = { value: member.id, label: '', memberType: member.type }; const data = { value: member.id, label: '', memberType: member.type };
const device = stationList.find(station => station.code === member.deviceCode) || {}; const device = stationList.find(station => station.code === member.deviceCode) || {};