diff --git a/src/views/scriptManage/allScriptRole.vue b/src/views/scriptManage/allScriptRole.vue index d7e2cb9b3..1134ed760 100644 --- a/src/views/scriptManage/allScriptRole.vue +++ b/src/views/scriptManage/allScriptRole.vue @@ -94,19 +94,14 @@ export default { const device = this.$store.getters['map/getDeviceByCode'](member.deviceCode); if (device) { if (device._type == 'Train') { - member.label = member.name; driverList.push(member); } else { - member.label = member.name; if (device._type == 'Station') { stationSupervisorList.push(member); } } - } else { - member.label = member.name; } } else { - member.label = member.name; if (member.type == '行调') { dispatcherList.push(member); } else if (member.type == '通号') { @@ -207,7 +202,7 @@ export default { this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role.id); } }); - this.$emit('setMemberId', role.id); + this.$emit('setMemberId', role); this.$message('切换角色成功'); // this.$refs.changeScriptRole.blur(); }).catch(()=>{ diff --git a/src/views/scriptManage/tipScriptRecord.vue b/src/views/scriptManage/tipScriptRecord.vue index 2dbb2ba6a..e2d8558d7 100644 --- a/src/views/scriptManage/tipScriptRecord.vue +++ b/src/views/scriptManage/tipScriptRecord.vue @@ -7,31 +7,22 @@
- 当前剧本角色: - {{ getRoleName(memberId) }} - - - - - - +
+ 当前剧本角色: + {{ getRoleName(memberId) }} +
+
+ +
+
+ {{ member.label }} + + 设置 + 已设置 + +
+
+
{{ $t('scriptRecord.drivingPause') }} @@ -104,11 +95,7 @@ export default { memberId:'', allMemberList:[], memberList:[], - // defaultProps: { - // children: 'children', - // label: 'label' - // }, - // quickChangeMember:[], + quickChangeMember:[], size: { width: 300, height: 300 @@ -170,7 +157,8 @@ export default { this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'DISPATCHER'); getAllSelectedScriptRole(this.group).then(res=>{ - this.quickChangeMember = res.data; + const lastData = JSON.stringify(res.data); + this.quickChangeMember = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); }); }).catch(error => { this.$message(error.message); @@ -186,9 +174,12 @@ export default { covertmember.forEach(each=>{ this.memberList.push(each); }); + }, - setMemberId(memberId) { - this.memberId = memberId; + setMemberId(member) { + this.memberId = member.id; + const memberdata = this.quickChangeMember.find(mem=>{ return mem.id == member.id; }); + if (!memberdata) { this.quickChangeMember.push(member); } }, addMember() { this.$refs.addScriptMember.doShow(); @@ -212,6 +203,9 @@ export default { }); } }, + changeRole(member) { + this.$refs.allScriptRole.changeRole(member); + }, getRoleName(memberId) { const currentMember = this.memberList.find(member=>{ return member.id == memberId; @@ -255,6 +249,7 @@ export default { } } each.name = each.type + deviceName; + each.label = each.name; }); return lastData; }, @@ -413,5 +408,27 @@ export default { } .scriptPanelRight{ +} +.quickChange{ + width: 300px; +} +.quickChange_head{ + font-size: 14px; + margin-top: 5px; + color: #409eff; +} +.setGroup{ + font-size: 14px; + float: right; + margin-right: 15px; +} +.settingBtn{ + color: #409eff; + cursor: pointer; + padding: 5px 10px; + border-radius: 4px; +} +.setGroupOut{ + margin-bottom: 5px; }