调度大赛调整
This commit is contained in:
parent
56aefdb207
commit
a28f7a3975
@ -6,7 +6,7 @@ NODE_ENV = 'development'
|
||||
# VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
# VUE_APP_BASE_API = 'http://192.168.3.4:9000'
|
||||
VUE_APP_BASE_API = 'http://192.168.3.6:9000'
|
||||
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud/'
|
||||
|
||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||
|
@ -4,4 +4,4 @@ VUE_APP_PRO = 'local'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud/'
|
||||
|
@ -3,4 +3,4 @@ NODE_ENV = 'production'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://joylink.club/jlcloud/'
|
||||
|
@ -3,4 +3,4 @@ NODE_ENV = 'production'
|
||||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud'
|
||||
VUE_APP_VOICE_API = 'https://test.joylink.club/jlcloud/'
|
||||
|
@ -947,7 +947,7 @@ export default {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
max-height: 550px;
|
||||
overflow-y: scroll;
|
||||
/*overflow-y: scroll;*/
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
@ -972,10 +972,13 @@ export default {
|
||||
line-height: $menuItemHeight;
|
||||
width: $menuItemWidth;
|
||||
bottom: $menuItemHeight;
|
||||
position: relative;
|
||||
left: 180px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.active {
|
||||
position: absolute;
|
||||
/*position: absolute;*/
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
|
@ -27,43 +27,11 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="$t('display.script.roleSelect')"
|
||||
:visible.sync="roleShow"
|
||||
top="50px"
|
||||
width="350px"
|
||||
:before-do-close="roleDoClose"
|
||||
:close-on-click-modal="false"
|
||||
:z-index="5000"
|
||||
>
|
||||
<div>
|
||||
<el-form ref="ruleForm" :model="form" label-width="50px">
|
||||
<el-form-item :label="$t('display.script.role')" prop="role">
|
||||
<el-select v-model="form.type" :placeholder="$t('display.script.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in memberList"
|
||||
:key="item.id"
|
||||
:label="(roleConfig[item.type]?roleConfig[item.type]: '')+(item.name?item.name: '')"
|
||||
:value="item.id"
|
||||
:disabled="item.disabled"
|
||||
/>
|
||||
<!-- checkDisabled(item.type) -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="roleDoClose">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="confirm">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getScriptByIdNew } from '@/api/script';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
export default {
|
||||
@ -72,7 +40,6 @@ export default {
|
||||
return {
|
||||
projectMapList:[],
|
||||
dialogVisible: false,
|
||||
roleShow: false,
|
||||
selectMapId:'',
|
||||
form: {
|
||||
type: ''
|
||||
@ -80,6 +47,7 @@ export default {
|
||||
row: '',
|
||||
activeName: 'first',
|
||||
memberList: [],
|
||||
memberId:'',
|
||||
selectMapLineCode:'',
|
||||
mainSceneData: [
|
||||
{type: '车辆故障', scene: '列车救援'},
|
||||
@ -98,17 +66,7 @@ export default {
|
||||
{ scene: '站台门关不上(单个或多个)' },
|
||||
{ scene: '客流激增行车处置' },
|
||||
{ scene: '路网协调请求(限流、换乘站通过)' }
|
||||
],
|
||||
roleConfig: {
|
||||
'Admin': this.$t('display.script.admin'),
|
||||
'Instructor': this.$t('display.script.instructor'),
|
||||
'Dispatcher': this.$t('display.script.dispatcher'),
|
||||
'Attendant': this.$t('display.script.attendant'),
|
||||
'Audience': this.$t('display.script.audience'),
|
||||
'Driver': this.$t('display.script.driver'),
|
||||
'Repair':this.$t('display.script.repair'),
|
||||
'no': ''
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -117,59 +75,16 @@ export default {
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
roleDoClose() {
|
||||
this.$refs['ruleForm'].resetFields();
|
||||
this.roleShow = false;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
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.type + deviceName + name;
|
||||
each.disabled = false;
|
||||
const prdType = this.$store.state.training.prdType;
|
||||
if ( prdType == '01') {
|
||||
if (each.type !== '行值' && each.type !== 'no') { each.disabled = true; }
|
||||
} else if (prdType == '02') {
|
||||
if (each.type !== '行调' && each.type !== 'no') { each.disabled = true; }
|
||||
} else if (prdType == '04') {
|
||||
if (each.type !== '司机' && each.type !== 'no') { each.disabled = true; }
|
||||
}
|
||||
});
|
||||
return lastData;
|
||||
},
|
||||
async handleLoad(row) {
|
||||
this.row = row;
|
||||
const res = await getScriptByIdNew(row.id);
|
||||
let newMemberList = [];
|
||||
this.memberId = '';
|
||||
if (res.code == 200) {
|
||||
EventBus.$emit('clearRunSeries');
|
||||
if (res.data.memberList && res.data.memberList.length > 0) {
|
||||
// newMemberList
|
||||
// const playerList = res.data.memberList.filter(item => item.hasPlay === true);
|
||||
// playerList.map(each=>{
|
||||
// if (!each.deviceName && each.deviceCode) {
|
||||
// const device = this.$store.getters['map/getDeviceByCode'](each.deviceCode);
|
||||
// if (device.name) {
|
||||
// each.deviceName = device.name;
|
||||
// } else {
|
||||
// each.deviceName = each.deviceCode;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
this.form.type = '';
|
||||
this.$store.dispatch('training/setMemberList', {memberList:res.data.memberList, userId:this.$store.state.user.id});
|
||||
const activeMemberList = [];
|
||||
@ -190,23 +105,20 @@ export default {
|
||||
member.deviceName = member.deviceCode;
|
||||
}
|
||||
}
|
||||
if (member.type === 'DISPATCHER') {
|
||||
this.memberId = member.id;
|
||||
}
|
||||
});
|
||||
const lastData = JSON.stringify(playerList);
|
||||
newMemberList = this.covert(lastData, ConstConfig.ConstSelect.roleTypeNew);
|
||||
}
|
||||
if (res.data.mapLocation) {
|
||||
this.mapLocation = res.data.mapLocation;
|
||||
}
|
||||
this.memberList = newMemberList || [];
|
||||
this.memberList.unshift({ id: '', name: this.$t('display.script.none'), role: 'no' });
|
||||
}
|
||||
this.roleShow = true;
|
||||
this.confirm();
|
||||
},
|
||||
confirm() {
|
||||
const roleName = this.memberList.find(elem=>{ return elem.id == this.form.type; });
|
||||
this.$emit('selectQuest', {row:this.row, id:this.form.type, mapLocation:this.mapLocation, roleName:roleName.type});
|
||||
this.$emit('selectQuest', {row:this.row, id:this.memberId, mapLocation:this.mapLocation});
|
||||
this.doClose();
|
||||
this.roleDoClose();
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
if (rowIndex === 1 && columnIndex === 1) {
|
||||
|
@ -3,6 +3,8 @@
|
||||
</template>
|
||||
<script>
|
||||
import {covertOperate} from './covertOperation.js';
|
||||
import LangStorage from '@/utils/lang';
|
||||
|
||||
export default {
|
||||
name:'ScriptTip',
|
||||
props: {
|
||||
@ -61,11 +63,22 @@ export default {
|
||||
'$store.state.socket.simulationScriptTipFinish':function(val, old) {
|
||||
// 剧本某一步骤完成消息推送
|
||||
this.scriptTipMessage = '';
|
||||
this.tipInfo({ message: LangStorage.getLang() == 'en' ? "Correct operation! That's great!" : '操作正确!真棒!', color: 'green' });
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
resetScriptTip() {
|
||||
this.scriptTipMessage = '';
|
||||
},
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
const h = this.$createElement;
|
||||
this.$notify({
|
||||
title: this.$t('global.tips'),
|
||||
|
||||
message: h('i', { style: 'color:' + opt.color }, opt.message)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user