剧本代码调整

This commit is contained in:
joylink_cuiweidong 2020-05-15 13:16:55 +08:00
parent fab4e149c8
commit d3df0afc94
5 changed files with 64 additions and 42 deletions

View File

@ -195,7 +195,10 @@ export default {
let list = [];
nameList.forEach(item => {
if (item !== 'skinVO') {
list = [...list, ...this.$store.state.map.map[item]];
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
this.$jlmap.updateShowMode(list, showMode);

View File

@ -403,7 +403,10 @@ export default {
let list = [];
nameList.forEach(item => {
if (item !== 'skinVO') {
list = [...list, ...this.$store.state.map.map[item]];
const data = this.$store.state.map.map[item];
if (data && data.constructor === Array) {
list = [...list, ...data];
}
}
});
this.$jlmap.updatePrdType(val, nameList);

View File

@ -173,7 +173,7 @@
import { mapGetters } from 'vuex';
import { setUID } from '@/jmapNew/utils/Uid';
import { addRoutingData, updateRoutingData, gernateRoutingSection } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
// import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
import Sortable from 'sortablejs';
@ -192,16 +192,10 @@ export default {
return null;
}
}
// routeData: {
// type: Object,
// default() {
// return null;
// }
// }
},
data() {
return {
ViewMode: ViewMode,
// ViewMode: ViewMode,
field: '',
allowSelect:false,
isStartSelected:false,
@ -299,12 +293,6 @@ export default {
this.addModel.mapId = val.id;
}
},
// routeData(val, old) {
// debugger;
// if (val) {
// this.addModel = val;
// }
// },
'addModel.parkSectionCodeList':function(val, old) {
this.changeSectionSelected(val, true);
},

View File

@ -233,7 +233,8 @@ export default {
if (this.drawWay) {
getScriptPlayMemberNew(this.group).then(resp => {
this.orginMemberList = resp.data;
this.memberList = resp.data;
const lastData = JSON.stringify(resp.data);
this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
this.resetDisabled();
this.initCommandActionData();
}).catch(error => {
@ -241,22 +242,9 @@ export default {
});
} else {
getScriptPlayMember(this.group).then(resp => {
const roleTypeList = ConstConfig.ConstSelect.roleType;
this.orginMemberList = resp.data;
let lastData = JSON.stringify(resp.data);
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
each.name = each.role + (each.name == undefined ? '' : each.name);
});
this.memberList = lastData;
const lastData = JSON.stringify(resp.data);
this.memberList = this.covert(lastData, ConstConfig.ConstSelect.roleType);
this.resetDisabled();
this.initCommandActionData();
}).catch(error => {
@ -265,6 +253,24 @@ export default {
}
},
covert(data, roleTypeList) {
let lastData = data;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
});
return lastData;
},
hover(field) {
if (this.field == '') {
if (this.isFirstTips) {

View File

@ -20,7 +20,7 @@
</span>
</div>
<div class="btnGroup">
<el-button v-if="actionInfo.visible" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<el-button v-if="actionInfo.visible && !drawWay" type="primary" size="mini" style="margin-left:10px;" @click="modifyAction(actionInfo.row)">{{ $t('scriptRecord.modifyConversitionButton') }}</el-button>
<!-- <el-button type="danger" size="mini" @click="deleteAction(actionInfo.id)">删除</el-button> -->
</div>
</el-card>
@ -29,6 +29,7 @@
</el-scrollbar>
</template>
<script>
import Cookies from 'js-cookie';
import {deleteScriptAction, getAvailableDeviceCommand, getScriptRecord, getScriptAllAction, getScriptPlayMemberNew } from '@/api/simulation';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import CommandHandler from '@/scripts/cmdPlugin/CommandHandler';
@ -49,7 +50,7 @@ export default {
return {
actionInfoList: [],
deviceCommandList: [],
reverse: true,
reverse: false,
loading: true,
// behaviorName:"",
memberName: ''
@ -85,11 +86,30 @@ export default {
this.loadOtherData(this.$route.query);
}
},
covert(data, roleTypeList) {
let lastData = data;
roleTypeList.forEach(function(element) {
const rolename = element.value;
if (Cookies.get('user_lang') == 'en') {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.enLabel);
} else {
lastData = lastData.replace(new RegExp(rolename, 'g'), element.label);
}
});
lastData = JSON.parse(lastData);
lastData.forEach(each=>{
const name = each.name == undefined ? '' : '-' + each.name;
const deviceName = each.deviceName == undefined ? '' : '-' + each.deviceName;
each.name = each.role + deviceName + name;
});
return lastData;
},
loadOtherData(obj) {
const group = obj.group;
if (this.drawWay) {
getScriptPlayMemberNew(this.group).then(response => {
const memberVOList = response.data;
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
getScriptAllAction(group).then(resp=>{
this.actionInfoList = [];
const actionList = resp.data;
@ -128,14 +148,16 @@ export default {
getScriptRecord(group).then(response=>{
this.$store.dispatch('scriptRecord/updateBgSet', response.data.bgSet);
this.actionInfoList = [];
const roleTypeList = ConstConfig.ConstSelect.roleType;
// const roleTypeList = ConstConfig.ConstSelect.roleType;
// let memberVOList = JSON.stringify(response.data.memberVOList);
// roleTypeList.forEach(function(element) {
// const rolename = element.value;
// memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
// });
// memberVOList = JSON.parse(memberVOList);
const lastData = JSON.stringify(response.data);
const memberVOList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
let memberVOList = JSON.stringify(response.data.memberVOList);
roleTypeList.forEach(function(element) {
const rolename = element.value;
memberVOList = memberVOList.replace(new RegExp(rolename, 'g'), element.label);
});
memberVOList = JSON.parse(memberVOList);
const actionList = response.data.actionVOList;
actionList.forEach(element => {