Merge remote-tracking branch 'origin/test' into test
# Conflicts: # src/views/newMap/displayNew/demonMenu.vue # src/views/newMap/displayNew/dispatherContest/sceneList.vue
This commit is contained in:
commit
2c54e68928
@ -56,6 +56,7 @@ export default {
|
||||
threeDimensionalStation: 'Three-Dimensional Station',
|
||||
passengerflow: 'CCTV View',
|
||||
trafficplantext:'Passer Planing',
|
||||
traffictraintext:'Trunk View',
|
||||
maintainer: 'Maintainer View',
|
||||
deviceView: 'DeviceView',
|
||||
taskOperateSuccess: 'Task Operate success',
|
||||
|
@ -55,7 +55,8 @@ export default {
|
||||
threeDimensionalView: '数字沙盘',
|
||||
threeDimensionalStation: '三维车站',
|
||||
passengerflow: 'cctv视图',
|
||||
trafficplantext:'客流规划',
|
||||
trafficplantext:'车站视角',
|
||||
traffictraintext:'车厢视角',
|
||||
maintainer: '设备故障视图',
|
||||
deviceView: '设备视图',
|
||||
taskOperateSuccess: '任务操作成功',
|
||||
|
@ -38,8 +38,8 @@ export function PasserRender(mapmode) {
|
||||
freeViewRender.initRender(renderer,dom,scene,camerass);
|
||||
//
|
||||
|
||||
scope.state = "4views";
|
||||
scope.nowrender = fourViewRender;
|
||||
scope.state = "freeview";
|
||||
scope.nowrender = freeViewRender;
|
||||
}
|
||||
|
||||
this.changeRenderMode = function(mode){
|
||||
|
@ -16,11 +16,11 @@
|
||||
<Station-Data>
|
||||
</Station-Data>
|
||||
|
||||
<div class="menutop">
|
||||
<!-- <div class="menutop">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="switchauto">列车车厢视角</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="menudown">
|
||||
<el-button-group>
|
||||
@ -108,19 +108,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
switchauto() {
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/traffictrain',
|
||||
query:{
|
||||
mapid:this.$route.query.mapid,
|
||||
group:this.group,
|
||||
project: this.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.lineCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
updatestationlist(list) {
|
||||
// console.log(list);
|
||||
this.value = list[0].name;
|
||||
|
@ -12,6 +12,8 @@
|
||||
<el-button v-if="cctvShow && !isContest && project !== 'bjd'" size="small" @click="jumpjl3dpassflow">{{ jl3dpassflow }}</el-button>
|
||||
<!-- 客流规划视图 -->
|
||||
<el-button v-if="trafficplanShow && !isContest" size="small" @click="jumpjl3dtrafficplan">{{ jl3dtrafficplan }}</el-button>
|
||||
<el-button v-if="trafficplanShow && !isContest" size="small" @click="jumpjl3dtraffictrain">{{ $t('display.demon.traffictraintext') }}</el-button>
|
||||
|
||||
<!-- 故障设备视图 -->
|
||||
<el-button v-if="jlmap3dFaultShow" size="small" @click="jumpjlmap3dFault">故障设备</el-button>
|
||||
<!-- 司机视角 -->
|
||||
@ -23,7 +25,7 @@
|
||||
<!-- <el-button v-if="isContest" size="small" @click=" fieldTeach">实操教学</el-button> -->
|
||||
<!-- <el-button v-if="isContest" size="small" @click=" fieldExam">实操测验</el-button> -->
|
||||
<el-button v-if="isContest" size="small" @click="goTheoryQuiz">理论考试</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="viewChangeMap">切换地图</el-button>
|
||||
<el-button v-if="isContest" size="small" @click="contectUs">联系方式</el-button>
|
||||
<el-button size="small" @click="messageBoardShow">留言板</el-button>
|
||||
<template v-if="project === 'bjd'">
|
||||
<el-button v-if="running" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||
@ -42,16 +44,15 @@
|
||||
<Jl3d-Drive v-show="drivingShow" ref="Jl3dDrive" :panel-show="drivingShow" @showdriving="showdriving" />
|
||||
<scheduling v-if="scheduleLoadShow" ref="scheduling" :group="group" />
|
||||
<scheduling-view v-if="schedulePreviewShow" ref="schedulingView" :group="group" />
|
||||
<change-map v-if="isContest" ref="changeMap" @changeMap="changeMap" />
|
||||
<qr-code ref="qrCode" />
|
||||
<message-board ref="messageBoard" />
|
||||
<contect-us ref="contectUs" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||
import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import ChangeMap from './dispatherContest/changeMap';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import Scheduling from '@/views/newMap/displayNew/demon/scheduling';
|
||||
import SchedulingView from '@/views/newMap/displayNew/demon/schedulingView';
|
||||
@ -59,6 +60,7 @@ import { EventBus } from '@/scripts/event-bus';
|
||||
import DistributeDraft from '@/views/components/limits/distribute';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import MessageBoard from './demon/messageBoard';
|
||||
import ContectUs from '@/views/newMap/displayNew/dispatherContest/contectUs';
|
||||
export default {
|
||||
name:'DemonMenu',
|
||||
components:{
|
||||
@ -66,9 +68,9 @@ export default {
|
||||
Jl3dDrive,
|
||||
Scheduling,
|
||||
SchedulingView,
|
||||
ChangeMap,
|
||||
DistributeDraft,
|
||||
QrCode,
|
||||
ContectUs,
|
||||
MessageBoard
|
||||
},
|
||||
props:{
|
||||
@ -221,6 +223,19 @@ export default {
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
jumpjl3dtraffictrain(){
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/traffictrain',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
project: this.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.lineCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
jumpjlmap3dFault() {
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/maintainer',
|
||||
@ -252,12 +267,6 @@ export default {
|
||||
this.$refs.schedulingView && this.$refs.schedulingView.doClose();
|
||||
}
|
||||
},
|
||||
viewChangeMap() {
|
||||
this.$refs.changeMap.doShow();
|
||||
},
|
||||
changeMap(query) {
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
fieldPractice() {
|
||||
this.$emit('fieldPractice');
|
||||
},
|
||||
@ -293,7 +302,10 @@ export default {
|
||||
},
|
||||
messageBoardShow() {
|
||||
this.$refs.messageBoard.doShow();
|
||||
}
|
||||
},
|
||||
contectUs() {
|
||||
this.$refs.contectUs.doShow();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,62 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag title="切换地图" :visible.sync="dialogVisible" width="20%" center>
|
||||
<el-select v-model="selectMapId" placeholder="请选择地图" style="width: 60%; position: relative; left: 20%;" @change="changeMap">
|
||||
<el-option
|
||||
v-for="item in projectMapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="confirm">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getMapListByProjectCode } from '@/api/jmap/map';
|
||||
export default {
|
||||
name:'ChangeMap',
|
||||
data() {
|
||||
return {
|
||||
projectMapList:[],
|
||||
dialogVisible: false,
|
||||
selectMapId:'',
|
||||
selectMapLineCode:''
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
const projectCode = 'DRTS';
|
||||
getMapListByProjectCode(projectCode).then(res =>{
|
||||
if (res.code === 200) {
|
||||
const projectMapList = res.data;
|
||||
projectMapList.forEach(element => {
|
||||
this.projectMapList.push({id:element.id, lineCode:element.lineCode, name:element.name});
|
||||
});
|
||||
this.selectMapId = this.$route.query.mapId;
|
||||
this.selectMapLineCode = this.$route.query.lineCode;
|
||||
}
|
||||
}).catch(error => { this.$message.error(error.msg); });
|
||||
},
|
||||
methods:{
|
||||
doShow(row) {
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
confirm() {
|
||||
this.dialogVisible = false;
|
||||
const query = Object.assign({}, this.$route.query);
|
||||
query.lineCode = this.selectMapLineCode;
|
||||
query.mapId = this.selectMapId;
|
||||
this.$emit('changeMap', query);
|
||||
},
|
||||
changeMap(mapId) {
|
||||
const map = this.projectMapList.find(map=>{ return map.id == mapId; });
|
||||
if (map) {
|
||||
this.selectMapId = map.id;
|
||||
this.selectMapLineCode = map.lineCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
45
src/views/newMap/displayNew/dispatherContest/contectUs.vue
Normal file
45
src/views/newMap/displayNew/dispatherContest/contectUs.vue
Normal file
@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="联系方式"
|
||||
:visible.sync="dialogVisible"
|
||||
width="400px"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div><span class="el-icon-user" style="font-size:15px;margin-right:8px;" />联系人:小九</div>
|
||||
<div class="eachInfo"><span class="el-icon-mobile-phone" style="font-size:15px;margin-right:7px;" />手 机:13289398171</div>
|
||||
<div class="eachInfo"><span class="el-icon-message" style="font-size:15px;margin-right:7px;" />邮 箱:ServiceEmail@joylink.club</div>
|
||||
<div class="eachInfo">
|
||||
<span class="el-icon-chat-round" style="font-size:15px;margin-right:3px;vertical-align:top;" />
|
||||
<span style="vertical-align: top;">微 信:</span>
|
||||
<img :src="wchatImg" width="80" height="80">
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import wchat from '@/assets/wchat.png';
|
||||
export default {
|
||||
name:'',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible:false,
|
||||
wchatImg: wchat
|
||||
};
|
||||
},
|
||||
methods:{
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.eachInfo{
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
@ -12,7 +12,6 @@
|
||||
:jlmap3d-fault-show="false"
|
||||
:driver-show="isDrive"
|
||||
:all-style="'top:'+(offset+textStatusHeight)+'px'"
|
||||
@changeMap="changeMap"
|
||||
@fieldPractice="fieldPractice"
|
||||
@goTheoryQuiz="goTheoryQuiz"
|
||||
/>
|
||||
@ -24,7 +23,6 @@
|
||||
<el-radio-button :label="scriptModeList.PRACTICE" :disabled="isScriptRun">{{ $t('display.lesson.practiceMode') }}</el-radio-button>
|
||||
<el-radio-button :label="scriptModeList.TEST" :disabled="isScriptRun">{{ $t('display.lesson.testMode') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<!-- <span v-if="scriptMode === scriptModeList.TEST" class="display-score">{{ $t('display.lesson.score') }}{{ formatScore }}</span> -->
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
@ -66,8 +64,6 @@
|
||||
<scene-list ref="sceneList" @selectScript="selectScript" />
|
||||
<theory-exam-select ref="theoryExamSelect" @startTheoryExam="startTheoryExam" />
|
||||
<theory-exam ref="theoryExam" />
|
||||
<!-- <theory-quiz ref="theoryQuiz" @commitResult="commitResult" />
|
||||
<throry-result ref="theoryResult" @restart="goTheoryQuiz" /> -->
|
||||
<select-role ref="selectRole" :member-list="currentPlayList" @selectRole="selectRole" />
|
||||
|
||||
<operational-statistic ref="operationalStatistic" @finishTraining="finishTraining" />
|
||||
@ -87,10 +83,8 @@ import SceneList from './sceneList';
|
||||
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
||||
import TheoryExamSelect from './theoryExamSelect';
|
||||
import TheoryExam from './theoryExam';
|
||||
// import TheoryQuiz from './quiz';
|
||||
// import ThroryResult from './result';
|
||||
// import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
import {clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
// import { PermissionType } from '@/scripts/ConstDic';
|
||||
// import { getCountTime } from '@/utils/index';
|
||||
import { prefixIntrger } from '@/utils/date';
|
||||
@ -99,9 +93,7 @@ import SelectRole from '@/views/newMap/displayNew/scriptDisplay/component/select
|
||||
// import { setGoodsTryUse } from '@/api/management/goods';
|
||||
|
||||
import {competitionPracticalSceneStart, competitionPracticalSceneExit, competitionPracticalSceneFinish, getEmptyOperationalStatistics} from '@/api/competition';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { createSimulationNew } from '@/api/simulation';
|
||||
import OperationalStatistic from './operationalStatistic.vue';
|
||||
import TestResult from './testResult.vue';
|
||||
import Vue from 'vue';
|
||||
@ -119,8 +111,6 @@ export default {
|
||||
TheoryExam,
|
||||
OperationalStatistic,
|
||||
TestResult,
|
||||
// TheoryQuiz,
|
||||
// ThroryResult,
|
||||
SelectRole
|
||||
},
|
||||
props: {
|
||||
@ -159,7 +149,6 @@ export default {
|
||||
mapLocation: {},
|
||||
playerList: [],
|
||||
currentPlayList: [],
|
||||
// formatScore: 0,
|
||||
isGoback: false,
|
||||
runing: false,
|
||||
prdTypeMap: {
|
||||
@ -267,76 +256,15 @@ export default {
|
||||
selectBeginTime() {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
changeMap(query) {
|
||||
clearSimulation(this.group).then(res=>{
|
||||
const data = { mapId: query.mapId, prdType: query.prdType };
|
||||
createSimulationNew(data).then(resp => {
|
||||
this.$store.dispatch('training/over');
|
||||
this.$store.dispatch('training/reset');
|
||||
this.$store.dispatch('map/mapClear');
|
||||
this.$store.dispatch('training/setPrdType', this.currentPrdType); // 改变prdType
|
||||
query.group = resp.data;
|
||||
const newQuery = Object.assign({}, query);
|
||||
newQuery.noFirst = true;
|
||||
this.$router.replace({query: newQuery});
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||
this.disabled = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
start(model) { // 开始仿真
|
||||
const data = {
|
||||
time: model.initTime
|
||||
};
|
||||
if (this.$route.query.prdType === '04') {
|
||||
data.loadNumber = model.loadNum;
|
||||
}
|
||||
ranAsPlan(data, this.group).then(res => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
|
||||
}).catch(error => {
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5004') {
|
||||
this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5000') {
|
||||
this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4000') {
|
||||
this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4001') {
|
||||
this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4002') {
|
||||
this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4003') {
|
||||
this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4004') {
|
||||
this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else {
|
||||
this.$messageBox('按计划行车异常,请退出重试!');
|
||||
}
|
||||
});
|
||||
this.$emit('start', model);
|
||||
},
|
||||
setRuning(run) {
|
||||
this.runing = run;
|
||||
this.$refs.demonMenu.hideScheduling(run);
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
this.$emit('end');
|
||||
},
|
||||
handleQuitQuest() {
|
||||
competitionPracticalSceneExit(this.group).then(resp => {
|
||||
@ -414,7 +342,10 @@ export default {
|
||||
this.runScriptMode(memberId);
|
||||
},
|
||||
handleExplain() {
|
||||
const name = this.$store.state.training.notifySelected.title;
|
||||
let name = this.$store.state.training.notifySelected.title;
|
||||
if (name.includes('—')) {
|
||||
name = name.split('—')[0];
|
||||
}
|
||||
const ossData = ConstConfig.ConstSelect.ossList.find(ele => { return ele.name == name; });
|
||||
const href = `https://joylink.club/oss/cbtc/race/${ossData.url}`;
|
||||
window.open(href, '_blank');
|
||||
@ -430,10 +361,8 @@ export default {
|
||||
competitionPracticalSceneFinish(this.group, {operationStatisticVO:{}}).then(res=>{
|
||||
this.isScriptRun = false;
|
||||
// if (this.scriptMode == ScriptMode.TEST) {
|
||||
// this.formatScore = res.data;
|
||||
this.showResultData(res.data);
|
||||
// this.$store.dispatch('scriptRecord/updateAudioPlay', false);
|
||||
// this.$messageBox('得分:' + this.formatScore);
|
||||
// }
|
||||
// this.userRole = 'AUDIENCE';
|
||||
// this.$store.dispatch('training/setRoles', 'AUDIENCE');
|
||||
@ -564,9 +493,6 @@ export default {
|
||||
this.$refs.operationalStatistic.doShow(res.data);
|
||||
});
|
||||
}
|
||||
// commitResult(result) {
|
||||
// this.$refs.theoryResult.doShow(result);
|
||||
// }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,116 +0,0 @@
|
||||
<template>
|
||||
<div class="question">
|
||||
<div class="ql-editor" v-html="appendIndex($escapeHTML(`${option.topic}`), $vnode.key, option)" />
|
||||
<template v-if="checkType(option, 'judge')">
|
||||
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: inline">
|
||||
<span>{{ el.content }}</span>
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
<template v-else-if="checkType(option, 'select')">
|
||||
<el-radio-group v-model="answer" disabled :class="{'select-box': option.rightAnswer != option.answer}" @change="onChnage">
|
||||
<el-radio v-for="(el,i) in option.optionList" :key="i" :label="$str2number(el.id)" style="display: block">
|
||||
<span>{{ $asc2chart(i+65) }}. </span>
|
||||
<div class="ql-editor" style="display: inline; padding: 0" v-html="$escapeHTML(el.content)" />
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
option: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
answer: 0
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.changeValue();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.changeValue();
|
||||
},
|
||||
methods: {
|
||||
changeValue() {
|
||||
this.answer = parseInt(this.value);
|
||||
},
|
||||
checkType(option, type) {
|
||||
return option.type == type;
|
||||
},
|
||||
appendIndex(str, index, option) {
|
||||
let result = '';
|
||||
const i = option.optionList.findIndex(ele => ele.correct);
|
||||
if (option.type === 'select') {
|
||||
if (option.answer == option.optionList[i].id) {
|
||||
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
||||
} else {
|
||||
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${this.$asc2chart(i + 65)})</span>`;
|
||||
}
|
||||
} else if (option.type === 'judge') {
|
||||
if (option.answer == option.optionList[i].id) {
|
||||
result = `<span style="color: green;margin-left: 10px;">(正确 得分: ${option.score})</span>`;
|
||||
} else {
|
||||
result = `<span style="color: red;margin-left: 10px;">(错误 正确答案: ${option.optionList[i].content})</span>`;
|
||||
}
|
||||
}
|
||||
this.$set(option, 'rightAnswer', option.optionList[i].id);
|
||||
// 判断是否选择正确 来显示不同内容
|
||||
return `${index + 1}. ${str} ${result}`;
|
||||
},
|
||||
onChnage(e) {
|
||||
const answer = `${e}`;
|
||||
this.$emit('input', answer);
|
||||
this.$emit('save', {userExamQuestionId: this.option.id, answer: answer});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.rich-text {
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.question {
|
||||
/deep/ {
|
||||
.ql-editor {
|
||||
line-height: 26px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-radio {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.el-radio__label {
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.el-radio-group .is-disabled .el-radio__label{
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.select-box.el-radio-group .is-checked.is-disabled .el-radio__label{
|
||||
color: red;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="1150px" center>
|
||||
<el-dialog v-dialogDrag title="场景列表" :visible.sync="dialogVisible" width="920px" center>
|
||||
<el-tabs v-model="activeName" type="card" style="height:500px">
|
||||
<!-- style="height: 500px;" -->
|
||||
<el-tab-pane label="主场景列表" name="first">
|
||||
@ -8,18 +8,18 @@
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column prop="type" width="200" label="类别" />
|
||||
<el-table-column prop="scene" width="350" label="场景" />
|
||||
<el-table-column label="操作" width="240">
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.result">
|
||||
<template v-for="(each,index) in scope.row.result">
|
||||
<!-- <el-tooltip :key="index" class="item" effect="dark" :content="'场景描述: '+ each.description + '\n' + '处置流程: ' +each.disposalProcesses" popper-class="tooltip-box" placement="top"> -->
|
||||
<el-button :key="index" type="primary" size="small" @click="handleLoad(each)">{{ each.name }}</el-button>
|
||||
<!-- </el-tooltip> -->
|
||||
<el-tooltip :key="index" class="item" effect="dark" :content="'场景描述: '+ each.description + '\n' + '处置流程: ' +each.disposalProcesses" popper-class="tooltip-box" placement="top">
|
||||
<el-button type="primary" size="small" style="margin-right: 8px;margin-left: 0;margin-bottom: 5px" @click="handleLoad(each)">{{ each.name }}</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="说明" width="240">
|
||||
<!-- <el-table-column label="说明" width="240">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.result">
|
||||
<template v-for="(each,index) in scope.row.result">
|
||||
@ -27,10 +27,10 @@
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="副场景列表" name="second">
|
||||
<!-- <el-tab-pane label="副场景列表" name="second">
|
||||
<el-table :data="deputySceneData" border stripe>
|
||||
<el-table-column type="index" width="50" label="序号" />
|
||||
<el-table-column prop="scene" width="550" label="场景" />
|
||||
@ -40,7 +40,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -78,16 +78,17 @@ export default {
|
||||
// {type: '车站机电设备故障', scene: '车站照明故障', result:[]},
|
||||
{type: '限速', scene: '列车限速', result:[]},
|
||||
{type: '轨道故障', scene: '线路故障影响列车运行', result:[]},
|
||||
{type: '轨道故障', scene: '计轴故障', result:[]}
|
||||
],
|
||||
deputySceneData: [
|
||||
{ scene: '列车在站停车超时' },
|
||||
{ scene: '列车无移动授权(站间区间或车站)' },
|
||||
{ scene: '信号机故障(防护、分界点、出站等)' },
|
||||
{ scene: '站台门关不上(单个或多个)' },
|
||||
{ scene: '客流激增行车处置' },
|
||||
{ scene: '路网协调请求(限流、换乘站通过)' }
|
||||
{type: '轨道故障', scene: '计轴故障', result:[]},
|
||||
// {type: '在区域控制器故障', scene: '线路故障多车降级', result:[]}
|
||||
]
|
||||
// deputySceneData: [
|
||||
// { scene: '列车在站停车超时' },
|
||||
// { scene: '列车无移动授权(站间区间或车站)' },
|
||||
// { scene: '信号机故障(防护、分界点、出站等)' },
|
||||
// { scene: '站台门关不上(单个或多个)' },
|
||||
// { scene: '客流激增行车处置' },
|
||||
// { scene: '路网协调请求(限流、换乘站通过)' }
|
||||
// ]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -153,7 +154,6 @@ export default {
|
||||
message: `
|
||||
<p><span style="color: #000;font-weight: bold;">场景描述:</span>${row.description}</p>`,
|
||||
customClass: 'notify_box',
|
||||
// position: 'top-left',
|
||||
showClose: false,
|
||||
offset: 75,
|
||||
duration: 0
|
||||
|
@ -4,11 +4,11 @@
|
||||
<transition name="el-zoom-in-bottom">
|
||||
<map-system-draft ref="mapCanvas" @back="back" />
|
||||
</transition>
|
||||
<menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
|
||||
<menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
|
||||
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom" />
|
||||
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" />
|
||||
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" />
|
||||
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
|
||||
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" @start="start" @end="end" />
|
||||
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" @start="start" @end="end" />
|
||||
</template>
|
||||
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" />
|
||||
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
|
||||
@ -19,7 +19,6 @@ import { getSessionStorage } from '@/utils/auth';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
import MapSystemDraft from '@/views/newMap/mapsystemNew/index';
|
||||
import MenuLesson from './lesson/index';
|
||||
import MenuDemon from './menuDemon';
|
||||
@ -30,7 +29,7 @@ import MenuDispatherContest from './dispatherContest/index';
|
||||
import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
|
||||
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
||||
|
||||
import { clearSimulation, getSimulationInfoNew } from '@/api/simulation';
|
||||
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
@ -238,6 +237,69 @@ export default {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
start(model) { // 开始仿真
|
||||
const data = {
|
||||
time: model.initTime
|
||||
};
|
||||
if (this.$route.query.prdType === '04') {
|
||||
data.loadNumber = model.loadNum;
|
||||
}
|
||||
ranAsPlan(data, this.group).then(res => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
|
||||
}).catch(error => {
|
||||
let message = '';
|
||||
switch (error.code) {
|
||||
case '5001':
|
||||
message = this.$t('error.mapDataError');
|
||||
break;
|
||||
case '5002':
|
||||
message = this.$t('error.runningChartDataError');
|
||||
break;
|
||||
case '5003':
|
||||
message = this.$t('error.runningChartIsNotLoaded');
|
||||
break;
|
||||
case '5004':
|
||||
message = this.$t('error.runningDataError');
|
||||
break;
|
||||
case '5000':
|
||||
message = this.$t('error.systemError');
|
||||
break;
|
||||
case '4000':
|
||||
message = this.$t('error.simulationDoesNotExist');
|
||||
break;
|
||||
case '4001':
|
||||
message = this.$t('error.simulationOperationIsNotDefined');
|
||||
break;
|
||||
case '4002':
|
||||
message = this.$t('error.simulationOperationProcessingMethodNotFound');
|
||||
break;
|
||||
case '4003':
|
||||
message = this.$t('error.simulationOperationFailed');
|
||||
break;
|
||||
case '4004':
|
||||
message = this.$t('error.operationConflict');
|
||||
break;
|
||||
default:
|
||||
message = '按计划行车异常,请退出重试!';
|
||||
// this.$messageBox('按计划行车异常,请退出重试!');
|
||||
break;
|
||||
}
|
||||
this.$messageBox(message + ',' + this.$t('error.startSimulationFailed'));
|
||||
});
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ import DemonChat from './demonChat';
|
||||
import { Notification } from 'element-ui';
|
||||
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { ranAsPlan, exitRunPlan, getSimulationInfoNew } from '@/api/simulation';
|
||||
import {getSimulationInfoNew } from '@/api/simulation';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { getCountTime } from '@/utils/index';
|
||||
import { TrainingMode } from '@/scripts/ConstDic';
|
||||
@ -247,56 +247,14 @@ export default {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) { // 开始仿真
|
||||
const data = {
|
||||
time: model.initTime
|
||||
};
|
||||
if (this.$route.query.prdType === '04') {
|
||||
data.loadNumber = model.loadNum;
|
||||
}
|
||||
ranAsPlan(data, this.group).then(res => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
|
||||
}).catch(error => {
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5004') {
|
||||
this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5000') {
|
||||
this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4000') {
|
||||
this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4001') {
|
||||
this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4002') {
|
||||
this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4003') {
|
||||
this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4004') {
|
||||
this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else {
|
||||
this.$messageBox('按计划行车异常,请退出重试!');
|
||||
}
|
||||
});
|
||||
this.$emit('start', model);
|
||||
},
|
||||
setRuning(run) {
|
||||
this.runing = run;
|
||||
this.$refs.demonMenu.hideScheduling(run);
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
this.$emit('end');
|
||||
},
|
||||
handleQuitQuest() {
|
||||
quitScriptNew(this.group).then(resp => {
|
||||
|
@ -55,7 +55,6 @@ import DemonMenu from '@/views/newMap/displayNew/demonMenu';
|
||||
import TipScriptRecordNew from '@/views/scriptManage/tipScriptRecord';
|
||||
import SetTime from '@/views/newMap/displayNew/demon/setTime';
|
||||
import { Notification } from 'element-ui';
|
||||
import { ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { getSimulationMemberList} from '@/api/simulation';
|
||||
import ChatBox from '@/views/newMap/chatView/chatBox.vue';
|
||||
|
||||
@ -179,47 +178,10 @@ export default {
|
||||
this.$refs.setTime.doShow();
|
||||
},
|
||||
start(model) {
|
||||
const data = {
|
||||
time: model.initTime
|
||||
};
|
||||
ranAsPlan(data, this.group).then(res => {
|
||||
this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${model.initTime}`));
|
||||
}).catch((error) => {
|
||||
if (error.code == '5001') {
|
||||
this.$messageBox(this.$t('error.mapDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5002') {
|
||||
this.$messageBox(this.$t('error.runningChartDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5003') {
|
||||
this.$messageBox(this.$t('error.runningChartIsNotLoaded') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5004') {
|
||||
this.$messageBox(this.$t('error.runningDataError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '5000') {
|
||||
this.$messageBox(this.$t('error.systemError') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4000') {
|
||||
this.$messageBox(this.$t('error.simulationDoesNotExist') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4001') {
|
||||
this.$messageBox(this.$t('error.simulationOperationIsNotDefined') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4002') {
|
||||
this.$messageBox(this.$t('error.simulationOperationProcessingMethodNotFound') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4003') {
|
||||
this.$messageBox(this.$t('error.simulationOperationFailed') + ',' + this.$t('error.startSimulationFailed'));
|
||||
} else if (error.code == '4004') {
|
||||
this.$messageBox(this.$t('error.operationConflict') + ',' + this.$t('error.startSimulationFailed'));
|
||||
}
|
||||
});
|
||||
this.$emit('start', model);
|
||||
},
|
||||
end() {
|
||||
exitRunPlan(this.group).then(() => {
|
||||
this.$store.dispatch('training/over').then(() => {
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
this.$store.dispatch('map/clearJlmapTrainView');
|
||||
this.$store.dispatch('map/resetActiveTrainList', false);
|
||||
this.$store.dispatch('map/setTrainWindowShow', false);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('display.demon.endSimulationFail'));
|
||||
});
|
||||
this.$emit('end');
|
||||
},
|
||||
back() {
|
||||
history.go(-1);
|
||||
|
@ -14,6 +14,7 @@
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
|
||||
<!-- 客流规划视图 -->
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dtrafficplan">{{ $t('display.demon.trafficplantext') }}</el-button>
|
||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dtraffictrain">{{ $t('display.demon.traffictraintext') }}</el-button>
|
||||
|
||||
<el-button v-if="(isShowScheduling || isStationSupervisor)&&project !== 'bjd'" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
|
||||
<!-- <el-button v-if="isAdmin" size="small" @click="otherVrView">VR第三人称视角</el-button> -->
|
||||
@ -374,17 +375,30 @@ export default {
|
||||
this.$emit('passflow');
|
||||
},
|
||||
jumpjl3dtrafficplan() {
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/trafficplan',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
project: this.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.lineCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/trafficplan',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
project: this.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.lineCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
jumpjl3dtraffictrain() {
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/jlmap3d/traffictrain',
|
||||
query:{
|
||||
mapid:this.mapId,
|
||||
group:this.group,
|
||||
project: this.project,
|
||||
noPreLogout: true,
|
||||
lineCode:this.lineCode
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank', 'noopener noreferrer');
|
||||
},
|
||||
jumpjl3dfaultdevice() {
|
||||
this.$emit('faultdevice');
|
||||
|
@ -3,22 +3,16 @@
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary';
|
||||
import { create, checkDicCodeExist, update } from '@/api/management/dictionary';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@ -27,16 +21,17 @@ export default {
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
},
|
||||
title:'',
|
||||
isAdd:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !this.isAdd },
|
||||
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
@ -58,8 +53,9 @@ export default {
|
||||
remarks: [
|
||||
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
|
||||
]
|
||||
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
if (this.isAdd) {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
|
||||
@ -70,13 +66,6 @@ export default {
|
||||
} else {
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return this.$t('system.createDirectory');
|
||||
} else {
|
||||
return this.$t('system.editDictionary');
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -95,19 +84,30 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(id).then(response => {
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
doShow(row) {
|
||||
if (row) {
|
||||
this.title = this.$t('system.editDictionary');
|
||||
this.isAdd = false;
|
||||
this.formModel = row;
|
||||
} else {
|
||||
this.title = this.$t('system.createDirectory');
|
||||
this.isAdd = true;
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
};
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.dataform.clearValidate();
|
||||
});
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
if (self.isAdd) {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
@ -134,19 +134,8 @@ export default {
|
||||
self.$message.error(`${this.$t('error.updateDictionaryFailed')}:${error.message}`);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
||||
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
<dictionary-edit ref="edit" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -104,11 +103,11 @@ export default {
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id);
|
||||
this.$refs.edit.doShow(row);
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show();
|
||||
this.$refs.edit.doShow();
|
||||
},
|
||||
|
||||
handleBatchDelete() {
|
||||
|
Loading…
Reference in New Issue
Block a user