This commit is contained in:
zyy 2020-08-14 10:49:24 +08:00
commit 6a5227353f
2 changed files with 19 additions and 8 deletions

View File

@ -117,9 +117,9 @@ export default {
mounted() { mounted() {
// this.$store.state.training.prdType // this.$store.state.training.prdType
this.isScriptCommand = this.$store.state.scriptRecord.bgSet; this.isScriptCommand = this.$store.state.scriptRecord.bgSet;
if (!this.isScriptCommand) { // if (!this.isScriptCommand) {
this.$store.dispatch('training/setPrdType', '01'); // this.$store.dispatch('training/setPrdType', '02');
} // }
this.$nextTick(() => { this.$nextTick(() => {
this.menuClick(); this.menuClick();
}); });

View File

@ -8,7 +8,7 @@
<div class="panelLeftSelect"> <div class="panelLeftSelect">
<span style="font-size:13px;">当前剧本角色:</span> <span style="font-size:13px;">当前剧本角色:</span>
<!-- :disabled="!backDisabled||isPause" --> <!-- :disabled="!backDisabled||isPause" -->
<el-select v-model="memberId" filterable placeholder="请选择" @change="changeRole"> <el-select ref="changeScriptRole" v-model="memberId" filterable placeholder="请选择" @change="changeRole">
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id" /> <el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id" />
</el-select> </el-select>
</div> </div>
@ -89,9 +89,9 @@ export default {
const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale}; const newMapLocation = {'offsetX': this.mapLocation.x, 'offsetY': this.mapLocation.y, 'scaleRate': this.mapLocation.scale};
Vue.prototype.$jlmap.setOptions(newMapLocation); Vue.prototype.$jlmap.setOptions(newMapLocation);
} }
if (this.$store.state.scriptRecord.bgSet) { // if (this.$store.state.scriptRecord.bgSet) {
this.$store.dispatch('training/setPrdType', null); // this.$store.dispatch('training/setPrdType', null);
} // }
this.initData(); this.initData();
}, },
'$store.state.scriptRecord.bgSet': function (val) { '$store.state.scriptRecord.bgSet': function (val) {
@ -126,6 +126,14 @@ export default {
this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id}); this.$store.dispatch('training/setMemberList', {memberList:resp.data, userId:this.$store.state.user.id});
this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew); this.allMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
this.changeRunPlanStatus(); this.changeRunPlanStatus();
const member = this.memberList.find(mem=>{
return mem.type == '行调';
});
if (member) {
this.memberId = member.id;
}
this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('training/setRoles', 'DISPATCHER');
}).catch(error => { }).catch(error => {
this.$message(error.message); this.$message(error.message);
}); });
@ -160,6 +168,7 @@ export default {
if (member) { if (member) {
// this.$store.dispatch('scriptRecord/updateIsScriptCommand', true); // this.$store.dispatch('scriptRecord/updateIsScriptCommand', true);
this.switchMode(member); this.switchMode(member);
} }
}, },
switchMode(role) { switchMode(role) {
@ -213,8 +222,10 @@ export default {
this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role); this.$store.dispatch('scriptRecord/updateRole', each.value + ':' + role);
} }
}); });
this.$refs.changeScriptRole.blur();
}).catch(()=>{ }).catch(()=>{
this.$messageBox('切换角色失败'); this.$messageBox('切换角色失败');
this.$refs.changeScriptRole.blur();
}); });
}, },
covert(data, roleTypeList) { covert(data, roleTypeList) {
@ -332,7 +343,7 @@ export default {
this.$refs['getAction'].loadInitData(); this.$refs['getAction'].loadInitData();
this.changeRunPlanStatus(); this.changeRunPlanStatus();
this.memberId = ''; this.memberId = '';
this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setPrdType', '02');
this.$store.dispatch('map/resetActiveTrainList'); this.$store.dispatch('map/resetActiveTrainList');
// this.initAutoSaveScript(); // this.initAutoSaveScript();
this.$store.dispatch('scriptRecord/updateRole', ''); this.$store.dispatch('scriptRecord/updateRole', '');