代码调整

This commit is contained in:
dong 2022-09-15 14:23:58 +08:00
parent 63f4505ed9
commit e8c23acab7
3 changed files with 21 additions and 10 deletions

View File

@ -81,7 +81,7 @@ export default {
this.$refs.editDetails.backStep();
},
handleCondition(index, row, key) {
this.$refs.editCondition.doShow(row[key], index, key);
this.$refs.editCondition.doShow(row, index, key);
},
getMaterials() {
getTrainingMaterials().then(res => {

View File

@ -61,6 +61,7 @@ export default {
tabVisible: false,
dialogVisible: false,
tableData: [],
roleDeviceCode: '', // code
activeIndexPath: '',
rowIndex: 0,
conditionKey: ''
@ -106,6 +107,7 @@ export default {
}
});
Object.values(this.mapStationDirectionData).forEach(item => {
if (!this.roleDeviceCode || this.roleDeviceCode == item.relativeStationCode) {
let isAuto = true;
if (item.runModel == 'S') {
isAuto = false;
@ -115,6 +117,7 @@ export default {
name: `${item.name}_${item.labelEnum}(${isAuto ? '自动闭塞' : '半自动闭塞'})`,
_type: `${isAuto ? 'StationDirectionAuto' : 'StationDirectionSemi'}`
});
}
});
this.getRouteList.forEach(item => {
list.push({
@ -256,7 +259,10 @@ export default {
this.$emit('backStep');
this.doClose();
},
doShow(data, rowIndex, conditionKey) {
doShow(row, rowIndex, conditionKey) {
const data = row[conditionKey];
const member = this.$store.state.training.memberData[row.memberId];
this.roleDeviceCode = member.deviceCode || '';
this.dialogVisible = true;
this.tabVisible = true;
this.activeIndexPath = '';

View File

@ -268,6 +268,11 @@ export default {
},
handleCondition(index, row, key) {
console.log(key, '条件', index, row);
const member = this.$store.state.training.memberData[row.memberId];
if (!member.userId) {
assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: member.id}], this.$route.query.group).then(resp => {
}).catch(() => { this.$message.error('调整角色失败!'); });
}
this.$emit('handleCondition', index, row, key);
this.doClose();
},