代码调整
This commit is contained in:
parent
1f432892fc
commit
5e71eeb265
@ -411,7 +411,7 @@ export default {
|
||||
this.roleList = covertRoleList;
|
||||
const roleCode = this.formIbp.roleCode || this.formIm.roleCode || this.formLw.roleCode || this.formIscs.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] || []; }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export default {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
data: {},
|
||||
clientList: ConstConfig.ConstSelect.clientList,
|
||||
clientList:[],
|
||||
screenList: [
|
||||
{ label: '第一屏', value: 1 },
|
||||
{ label: '第二屏', value: 2 },
|
||||
@ -70,7 +70,8 @@ export default {
|
||||
stationList: [],
|
||||
standList: [],
|
||||
psdList: [],
|
||||
roleList:[]
|
||||
roleList:[],
|
||||
clientListMap:{}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -96,7 +97,7 @@ export default {
|
||||
{ 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: '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' }
|
||||
]
|
||||
};
|
||||
@ -106,7 +107,7 @@ export default {
|
||||
items: [
|
||||
{ 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: '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' }
|
||||
]
|
||||
};
|
||||
@ -115,7 +116,7 @@ export default {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ 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' }
|
||||
]
|
||||
};
|
||||
@ -124,7 +125,7 @@ export default {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ 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' }
|
||||
]
|
||||
};
|
||||
@ -133,7 +134,7 @@ export default {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ 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' }
|
||||
]
|
||||
};
|
||||
@ -199,12 +200,18 @@ export default {
|
||||
getMapFunctioById(functionId).then(response=>{
|
||||
if (resp.data) {
|
||||
const roleList = resp.data[response.data.simType];
|
||||
const clientListMapIn = ConstConfig.ConstSelect.clientMap;
|
||||
this.clientListMap = clientListMapIn[response.data.simType];
|
||||
const covertRoleList = [];
|
||||
roleList.forEach(member => {
|
||||
const data = self.handleMember(member, self.stationList);
|
||||
covertRoleList.push(data);
|
||||
});
|
||||
this.clientList = [];
|
||||
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) {
|
||||
const data = { value: member.id, label: '', memberType: member.type };
|
||||
const device = stationList.find(station => station.code === member.deviceCode) || {};
|
||||
|
Loading…
Reference in New Issue
Block a user