From e2d19c2698fdd04053172dce645c5eeeaf49af0b Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Tue, 18 Aug 2020 15:40:01 +0800
Subject: [PATCH] =?UTF-8?q?=E5=89=A7=E6=9C=AC=E5=BD=95=E5=88=B6=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/scriptManage/allScriptRole.vue | 7 +-
src/views/scriptManage/tipScriptRecord.vue | 83 +++++++++++++---------
2 files changed, 51 insertions(+), 39 deletions(-)
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;
}