This commit is contained in:
fan 2022-08-23 18:07:39 +08:00
commit a2e0f543bb
20 changed files with 1194 additions and 273 deletions

View File

@ -27,15 +27,22 @@ export function createTraining(data) {
/** 更新当前用户的某个实训草稿 */
export function updateTraining(data) {
return request({
url: `/api/v2/draft/training`,
url: `/api/v2/draft/training/update/info`,
method: 'post',
data
});
}
/** 查询步骤列表 */
export function getTrainingStepList(trainingId) {
return request({
url: `/api/v2/draft/training/${trainingId}/step/list`,
method: 'get'
});
}
/** 修改实训所有步骤 */
export function updateTrainingStep(id, data) {
return request({
url: ` /api/v2/draft/training/${id}/step/update`,
url: `/api/v2/draft/training/${id}/step/update`,
method: 'put',
data: data
});
@ -71,3 +78,19 @@ export function getTrainingAll(trainingId) {
method: 'get'
});
}
/** 单独更新当前用户的某个实训草稿的初始背景 */
export function updateTrainingBackgroud(data) {
return request({
url: `/api/v2/draft/training/update/content/backgroud`,
method: 'post',
data
});
}
/** 更新当前用户实训草稿定位 */
export function updateTrainingMaplocation(data) {
return request({
url: `/api/v2/draft/training/update/content/maplocation`,
method: 'post',
data
});
}

View File

@ -657,4 +657,7 @@ export default {
margin-left: 8px;
}
.pageContainerView{text-align: center; margin: 10px 0; height: 40px;}
.hideOutContent {
min-height: 12px;
}
</style>

View File

@ -10,5 +10,16 @@ export default {
modify: 'modify',
delete: 'delete',
publish: 'publish',
preview: 'preview'
preview: 'preview',
mapLocation: 'Save map positioning',
saveBackground: 'Save Background',
saveData: 'Save Data',
stepNum: 'Step number',
stepDescription: 'Steps describe',
rulesId: 'Please enter the step number',
rulesDescription: 'Enter the prompt information',
createStepInfo: 'Creating Procedure Information',
editStepInfo: 'Modifying Step Information',
saveStepData: 'Save Step Information',
roleSelect: 'role choices'
};

View File

@ -10,5 +10,16 @@ export default {
modify: '修改',
delete: '删除',
publish: '发布',
preview: '预览'
preview: '预览',
mapLocation: '保存地图定位',
saveBackground: '保存背景',
saveData: '保存数据',
stepNum: '步骤序号',
stepDescription: '步骤描述',
rulesId: '请输入步骤序号',
rulesDescription: '请输入步骤提示信息',
createStepInfo: '创建步骤信息',
editStepInfo: '修改步骤信息',
saveStepData: '保存步骤',
roleSelect: '角色选择'
};

View File

@ -754,8 +754,14 @@ export const menuOperate = {
// 增加列车固定径路
addTrainFixedPath:{
operation: OperationEvent.CTCCommand.addTrainFixedPath.menu.operation,
cmdType: CMD.CTC.CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA
cmdType: CMD.CTC.CTC_REGULAR_TRAIN_LINE_EDIT
},
// 批量增加列车固定径路
batchTrainFixedPath:{
operation: OperationEvent.CTCCommand.batchTrainFixedPath.menu.operation,
cmdType: CMD.CTC.CTC_REGULAR_TRAIN_LINE_BATCH
},
// 导入列车固定径路
importTrainFixedPath:{
operation: OperationEvent.CTCCommand.importTrainFixedPath.menu.operation,
@ -796,6 +802,16 @@ export const menuOperate = {
operation: OperationEvent.CTCCommand.getTrainFixedPath.menu.operation,
cmdType: CMD.CTC.CTC_REGULAR_TRAIN_LINE_LIST
},
// 获取出入口列表
getStationDirection:{
operation: OperationEvent.CTCCommand.getStationDirection.menu.operation,
cmdType: CMD.CTC.CTC_STATION_IO_GATE_LIST
},
// 修改出入口
modifyStationDirection:{
operation: OperationEvent.CTCCommand.modifyStationDirection.menu.operation,
cmdType: CMD.CTC.CTC_STATION_IO_GATE_EDIT
},
// 出入口发布生效区
releaseStationDirection:{
operation: OperationEvent.CTCCommand.releaseStationDirection.menu.operation,

View File

@ -255,8 +255,8 @@ export default {
{ label: 'SD', value: 'SD' }
],
trainingType: [ // 实训类型
{ enlabel: 'single operation', label: '单操', value: 'single'},
{ enlabel: 'scene operation', label: '场景', value: 'scene'}
{ enlabel: 'single operation', label: '单操', value: 'SINGLE'},
{ enlabel: 'scene operation', label: '场景', value: 'SCENE'}
],
ioDirectionList:[ // 出入口类型
{value:'DOWN_IN_STATION', label:'下行进站'},

View File

@ -442,7 +442,7 @@ export default {
CTC_LOG_SET_TRANSFINITE:{value: 'CTC_LOG_SET_TRANSFINITE', label: '设置超限'},
CTC_LOG_SAVE_RUN_PLAN:{value: 'CTC_LOG_SAVE_RUN_PLAN', label: '保存运行计划'},
CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA:{value: 'CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA', label: '增加列车固定径路'},
// CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA:{value: 'CTC_ADD_RUN_PLAN_LIST_TO_EDIT_AREA', label: '增加列车固定径路'},
CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA:{value: 'CTC_COVER_RUN_PLAN_LIST_TO_EDIT_AREA', label: '导入列车固定径路'},
CTC_REGULAR_TRAIN_LINE_CLEAR:{value: 'REGULAR_TRAIN_LINE_CLEAR', label: '清空列车固定径路'},
CTC_REGULAR_TRAIN_LINE_DELETE:{value: 'REGULAR_TRAIN_LINE_DELETE', label: '删除列车固定径路'},
@ -453,6 +453,10 @@ export default {
CTC_REGULAR_TRAIN_LINE_LIST:{value: 'REGULAR_TRAIN_LINE_LIST', label: ' 获取固定列车径路'},
CTC_STATION_DETAIL_EDIT:{value: 'STATION_DETAIL_EDIT', label: '修改股道信息'},
CTC_STATION_IO_GATE_PUBLISH:{value: 'STATION_IO_GATE_PUBLISH', label: '出入口发布生效区'},
CTC_STATION_IO_GATE_LIST:{value: 'STATION_IO_GATE_LIST', label: '获取出入口列表'},
CTC_STATION_IO_GATE_EDIT:{value: 'STATION_IO_GATE_EDIT', label: '修改出入口'},
CTC_REGULAR_TRAIN_LINE_EDIT:{value: 'REGULAR_TRAIN_LINE_EDIT', label: '增加列车固定径路'},
CTC_REGULAR_TRAIN_LINE_BATCH:{value: 'REGULAR_TRAIN_LINE_BATCH', label: '批量增加列车固定径路'},
CTC_SET_ROUTE:{value: 'CTC_SET_ROUTE', label: 'CTC办理进路'},

View File

@ -4000,6 +4000,27 @@ export const OperationEvent = {
operation: '1155',
domId: '_Tips-CTC-releaseStationDirection-Menu{TOP}'
}
},
// 获取出入口列表
getStationDirection:{
menu: {
operation: '1156',
domId: '_Tips-CTC-getStationDirection-Menu{TOP}'
}
},
// 修改出入口
modifyStationDirection:{
menu: {
operation: '1157',
domId: '_Tips-CTC-modifyStationDirection-Menu{TOP}'
}
},
// 批量增加列车固定径路
batchTrainFixedPath:{
menu: {
operation: '1158',
domId: '_Tips-CTC-batchTrainFixedPath-Menu{TOP}'
}
}
// CTC_ZONE_SAVE_TRIP_NUMBER
// CTC_ZONE_SAVE_STATION

View File

@ -22,8 +22,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="股道:" prop="trackSectionCode">
<el-select v-model="addModel.trackSectionCode" placeholder="" style="width:145px">
<el-form-item label="股道:" prop="masterCode">
<el-select v-model="addModel.masterCode" placeholder="" style="width:145px">
<el-option
v-for="item in filterSectionList"
:key="item.code"
@ -32,30 +32,30 @@
/>
</el-select>
</el-form-item>
<el-form-item label="到达车次:" prop="arriveTripNumber">
<el-input v-model="addModel.arriveTripNumber" style="width:145px" />
<el-form-item label="到达车次:" prop="arriveTipNum">
<el-input v-model="addModel.arriveTipNum" style="width:145px" />
</el-form-item>
<el-form-item label="到达时间:" prop="arriveTime">
<el-time-picker v-model="addModel.arriveTime" value-format="HH:mm" format="HH:mm" style="width:145px" />
</el-form-item>
<el-form-item label="出发车次:" prop="departTripNumber">
<el-input v-model="addModel.departTripNumber" style="width:145px" />
<el-form-item label="出发车次:" prop="leaveTipNum">
<el-input v-model="addModel.leaveTipNum" style="width:145px" />
</el-form-item>
<el-form-item label="出发时间:" prop="departTime">
<el-time-picker v-model="addModel.departTime" value-format="HH:mm" format="HH:mm" style="width:145px" />
<el-form-item label="出发时间:" prop="leaveTime">
<el-time-picker v-model="addModel.leaveTime" value-format="HH:mm" format="HH:mm" style="width:145px" />
</el-form-item>
<el-form-item label="入口:" prop="arriveDirectionCode">
<el-select v-model="addModel.arriveDirectionCode" placeholder="" style="width:145px">
<el-form-item label="入口:" prop="enterDirCode">
<el-select v-model="addModel.enterDirCode" placeholder="" style="width:145px" @change="changeEnterDirCode">
<el-option
v-for="item in mapStationDirectionList"
v-for="item in enterDirList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="后方车站:" prop="arriveStationCode">
<el-select v-model="addModel.arriveStationCode" placeholder="" style="width:145px">
<el-form-item label="后方车站:" prop="backStationCode">
<el-select v-model="addModel.backStationCode" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
@ -64,18 +64,18 @@
/>
</el-select>
</el-form-item>
<el-form-item label="出口:" prop="departDirectionCode">
<el-select v-model="addModel.departDirectionCode" placeholder="" style="width:145px">
<el-form-item label="出口:" prop="outDirCode">
<el-select v-model="addModel.outDirCode" placeholder="" style="width:145px" @change="changeOutDirCode">
<el-option
v-for="item in mapStationDirectionList"
v-for="item in outDirList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="前方车站:" prop="departStationCode">
<el-select v-model="addModel.departStationCode" placeholder="" style="width:145px">
<el-form-item label="前方车站:" prop="fontStationCode">
<el-select v-model="addModel.fontStationCode" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
@ -142,19 +142,24 @@ export default {
return {
dialogShow: false,
loading: false,
mapStationDirectionList:[],
title:'',
// mapStationDirectionList:[],
mapStationDirectionMap:{},
enterDirList:[], //
outDirList:[],
filterSectionList:[],
addModel:{
stationCode:'', //
trackSectionCode:'', //
arriveTripNumber:'', //
departTripNumber:'', //
code:'', //
stationCode:'', // code
masterCode:'', // code
arriveTipNum:'', //
leaveTipNum:'', //
arriveTime:'', //
departTime:'', //
arriveDirectionCode:'', //
departDirectionCode:'', //
arriveStationCode:'', //
departStationCode:'', //
leaveTime:'', //
enterDirCode:'', //
outDirCode:'', //
fontStationCode:'', //
backStationCode:'', //
appendData:{ //
ZHUANGXIE:false, //
LIEJIAN:false, //
@ -180,11 +185,11 @@ export default {
// { required: true, message: '', trigger: 'blur' },
// { required: true, message: '', trigger: 'change' }
// ],
arriveTripNumber:[
arriveTipNum:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
// message: ''
],
departTripNumber:[
leaveTipNum:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
]
// message: ''
@ -227,35 +232,57 @@ export default {
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.CTCCommand.addTrainFixedPath.menu.domId : '';
},
title() {
return '列车固定径路';
}
},
methods:{
doShow({stationCode, filterSectionMap, mapStationDirectionMap}) {
this.mapStationDirectionList = Object.values(mapStationDirectionMap);
doShow({stationCode, filterSectionMap, mapStationDirectionMap, row}) {
this.mapStationDirectionMap = mapStationDirectionMap;
const mapStationDirectionList = Object.values(mapStationDirectionMap);
this.enterDirList = mapStationDirectionList.filter(stationDirection=>{
return stationDirection.runStatus == 'R';
});
this.outDirList = mapStationDirectionList.filter(stationDirection=>{
return stationDirection.runStatus == 'D';
});
if (row) {
this.addModel = Object.assign({}, row);
this.title = '修改列车固定径路';
} else {
this.title = '增加列车固定径路';
this.addModel.stationCode = stationCode;
}
this.filterSectionList = Object.values(filterSectionMap);
this.dialogShow = true;
this.addModel.stationCode = stationCode;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
changeEnterDirCode(code) {
const mapStationDirection = this.mapStationDirectionMap[code];
this.addModel.backStationCode = mapStationDirection.relativeStationCode;
},
changeOutDirCode(code) {
const mapStationDirection = this.mapStationDirectionMap[code];
this.addModel.fontStationCode = mapStationDirection.relativeStationCode;
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.addModel = {
stationCode:'', //
trackSectionCode:'', //
arriveTripNumber:'', //
departTripNumber:'', //
code:'', //
stationCode:'', // code
masterCode:'', // code
arriveTipNum:'', //
leaveTipNum:'', //
arriveTime:'', //
departTime:'', //
arriveDirectionCode:'', //
departDirectionCode:'', //
arriveStationCode:'', //
departStationCode:'', //
leaveTime:'', //
enterDirCode:'', //
outDirCode:'', //
fontStationCode:'', //
backStationCode:'', //
// 使logicDataNewDraftMapStationDirectionList
// 1.runStatus R=D=,NO=2.relativeStationCode
// codecodecode
appendData:{ //
ZHUANGXIE:false, //
LIEJIAN:false, //
@ -283,10 +310,12 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const param = {stationCode:this.addModel.stationCode, runPlanParamList:[this.addModel]};
const param = Object.assign({}, this.addModel);
if (this.title == '增加列车固定径路') { delete param.code; }
commitOperate(menuOperate.CTC.addTrainFixedPath, param, 3).then(({valid})=>{
if (valid) {
this.doClose();
this.$emit('refresh');
}
}).catch(() => {
this.doClose();

View File

@ -0,0 +1,306 @@
<template>
<el-dialog
v-dialogDrag
class="datie-02__systerm"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="BatchTrainFxPath">
<el-form ref="form" :model="addModel" label-width="80px" :rules="rules">
<el-form-item label="车站:" prop="stationCode">
<el-select v-model="addModel.stationCode" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="股道:" prop="masterCode">
<el-select v-model="addModel.masterCode" placeholder="" style="width:145px">
<el-option
v-for="item in filterSectionList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="车次前缀:" prop="prefixTrain">
<el-input v-model="addModel.prefixTrain" style="width:145px" />
</el-form-item>
<el-form-item label="开始车次:" prop="startTipNum">
<el-input v-model="addModel.startTipNum" style="width:145px;" />
</el-form-item>
<el-form-item label="结束车次:" prop="endTipNum" style="margin-left:230px">
<el-input v-model="addModel.endTipNum" style="width:145px;" />
</el-form-item>
<el-form-item label="入口:" prop="enterDirCode">
<el-select v-model="addModel.enterDirCode" placeholder="" style="width:145px" @change="changeEnterDirCode">
<el-option
v-for="item in enterDirList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="后方车站:" prop="backStationCode">
<el-select v-model="addModel.backStationCode" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="出口:" prop="outDirCode">
<el-select v-model="addModel.outDirCode" placeholder="" style="width:145px" @change="changeOutDirCode">
<el-option
v-for="item in outDirList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="前方车站:" prop="fontStationCode">
<el-select v-model="addModel.fontStationCode" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in stationList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="appendData" style="width:100%">
<el-checkbox v-model="addModel.appendData.JISHU_STOP" class="eachAppendData" style="margin-right:34px">技术停点</el-checkbox>
<el-checkbox v-model="addModel.appendData.JIAO_LING" class="eachAppendData" style="margin-right:35px">交令</el-checkbox>
<el-checkbox v-model="addModel.appendData.JICHE" class="eachAppendData" style="margin-right:3px">机车</el-checkbox>
<el-checkbox v-model="addModel.appendData.HUOJIAN" class="eachAppendData" style="margin-right:3px">货检</el-checkbox>
<el-checkbox v-model="addModel.appendData.CHENGJIANG" class="eachAppendData">乘降</el-checkbox>
<el-checkbox v-model="addModel.appendData.ZHAIGUA" class="eachAppendData" style="margin-right:3px">摘挂</el-checkbox>
<el-checkbox v-model="addModel.appendData.HUANCHENG" class="eachAppendData" style="margin-right:3px">换乘</el-checkbox>
<el-checkbox v-model="addModel.appendData.ZHUANGXIE" class="eachAppendData" style="margin-right: 35px;">装卸</el-checkbox>
<el-checkbox v-model="addModel.appendData.XIWU" class="eachAppendData" style="margin-right:3px">吸污</el-checkbox>
<el-checkbox v-model="addModel.appendData.DAOKOU" class="eachAppendData" style="margin-right:3px">道口</el-checkbox>
<el-checkbox v-model="addModel.appendData.CHEHAO" class="eachAppendData">车号</el-checkbox>
<el-checkbox v-model="addModel.appendData.SHANGSHUI" class="eachAppendData" style="margin-right:3px">上水</el-checkbox>
<el-checkbox v-model="addModel.appendData.LIEJIAN" class="eachAppendData" style="margin-right:3px">列检</el-checkbox>
<el-checkbox v-model="addModel.appendData.ZONGKONG" class="eachAppendData" style="margin-right: 35px;">综控</el-checkbox>
<el-checkbox v-model="addModel.appendData.ZHANWU" class="eachAppendData" style="margin-right:3px">站务</el-checkbox>
<el-checkbox v-model="addModel.appendData.JIAOPIAO" class="eachAppendData" style="margin-right:3px">交票</el-checkbox>
<el-checkbox v-model="addModel.appendData.LIEWEI" class="eachAppendData">列尾</el-checkbox>
</el-form-item>
</el-form>
</div>
<el-row justify="center" class="button-group">
<el-col :span="6" :offset="7">
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
</el-col>
<el-col :span="8" :offset="0">
<el-button :id="domIdConfirm " type="primary" :loading="loading" @click="commit">确定 </el-button>
</el-col>
</el-row>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'BatchTrainFxPath',
data() {
var validateTripNumber = (rule, value, callback) => {
if (value) {
const judge = /^[a-zA-Z0-9]*[\d]$/.test(value);
if (judge) {
if (value.toString().length > 6 || value.toString().length < 2) {
callback('车次长度2-6位');
} else {
callback();
}
} else {
callback('字母+数字,最后一位数字');
}
} else {
// callback('');
callback();
}
};
return {
dialogShow: false,
loading: false,
mapStationDirectionMap:{},
enterDirList:[], //
outDirList:[],
filterSectionList:[],
addModel:{
stationCode:'', // code
masterCode:'', // code
prefixTrain:'', //
startTipNum:'', //
endTipNum:'', //
enterDirCode:'', //
outDirCode:'', //
fontStationCode:'', //
backStationCode:'', //
appendData:{ //
ZHUANGXIE:false, //
LIEJIAN:false, //
JIAO_LING:false, //
ZONGKONG:false, //
XIWU:false, //
HUOJIAN:false, //
CHENGJIANG:false, //
JISHU_STOP:false, //
JIAOPIAO:false, //
HUANCHENG:false, //
SHANGSHUI:false, //
ZHANWU:false, //
ZHAIGUA:false, //
LIEWEI:false, //
DAOKOU:false, //
JICHE:false, //
CHEHAO:false //
}
},
rules: {
startTipNum:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
// message: ''
],
endTipNum:[
{ required: true, validator: validateTripNumber, trigger: 'blur' }
]
}
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.CTCCommand.batchTrainFixedPath.menu.domId : '';
},
title() {
return '批量增加列车固定径路';
}
},
methods:{
doShow({stationCode, filterSectionMap, mapStationDirectionMap}) {
this.mapStationDirectionMap = mapStationDirectionMap;
const mapStationDirectionList = Object.values(mapStationDirectionMap);
this.enterDirList = mapStationDirectionList.filter(stationDirection=>{
return stationDirection.runStatus == 'R';
});
this.outDirList = mapStationDirectionList.filter(stationDirection=>{
return stationDirection.runStatus == 'D';
});
this.addModel.stationCode = stationCode;
this.filterSectionList = Object.values(filterSectionMap);
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
changeEnterDirCode(code) {
const mapStationDirection = this.mapStationDirectionMap[code];
this.addModel.backStationCode = mapStationDirection.relativeStationCode;
},
changeOutDirCode(code) {
const mapStationDirection = this.mapStationDirectionMap[code];
this.addModel.fontStationCode = mapStationDirection.relativeStationCode;
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.addModel = {
stationCode:'', // code
masterCode:'', // code
prefixTrain:'', //
startTipNum:'', //
endTipNum:'', //
enterDirCode:'', //
outDirCode:'', //
fontStationCode:'', //
backStationCode:'', //
appendData:{ //
ZHUANGXIE:false, //
LIEJIAN:false, //
JIAO_LING:false, //
ZONGKONG:false, //
XIWU:false, //
HUOJIAN:false, //
CHENGJIANG:false, //
JISHU_STOP:false, //
JIAOPIAO:false, //
HUANCHENG:false, //
SHANGSHUI:false, //
ZHANWU:false, //
ZHAIGUA:false, //
LIEWEI:false, //
DAOKOU:false, //
JICHE:false, //
CHEHAO:false //
}
};
},
commit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
const param = Object.assign({}, this.addModel);
commitOperate(menuOperate.CTC.batchTrainFixedPath, param, 3).then(({valid})=>{
if (valid) {
this.doClose();
this.$emit('refresh');
}
}).catch(() => {
this.doClose();
this.$emit('noticeInfo');
});
}
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style lang="scss">
.BatchTrainFxPath{margin-bottom: 15px;}
.BatchTrainFxPath .el-form-item{
display:inline-block;
// width:210px;
margin-bottom:20px;
}
.BatchTrainFxPath .el-form-item__content{
line-height:30px;
}
.eachAppendData{
display:inline-block;
}
</style>

View File

@ -0,0 +1,170 @@
<template>
<el-dialog
v-dialogDrag
class="datie-02__systerm"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div class="DirectionInformation">
<el-form ref="form" :model="model" label-width="125px">
<el-form-item label="出入口名称:" prop="ioName">
<el-input v-model="model.ioName" style="width:185px" disabled />
</el-form-item>
<el-form-item label="出入口方向:" prop="ioDirection">
<el-select v-model="model.ioDirection" placeholder="" style="width:145px" disabled>
<el-option
v-for="item in ioDirectionList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="允许超限列车:" prop="allowOverrun">
<el-select v-model="model.allowOverrun" placeholder="" style="width:145px">
<el-option
v-for="item in selectList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="允许旅客列车:" prop="travelTrain">
<el-select v-model="model.travelTrain" placeholder="" style="width:145px">
<el-option
v-for="item in selectList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="允许货物列车:" prop="goodsTrain">
<el-select v-model="model.goodsTrain" placeholder="" style="width:145px">
<el-option
v-for="item in selectList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<div style="text-align:right;display:inline-block;width:100%;">
<div class="directionBtn">
<el-button :id="domIdCancel" @click="cancel">取消</el-button>
</div>
<div class="directionBtn">
<el-button :id="domIdConfirm " type="primary" :loading="loading" @click="commit">确定 </el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'DirectionInformation',
data() {
return {
dialogShow: false,
loading: false,
stationCode:'', // code
ioDirectionList:[
{label:'下行进站', value:'DOWN _IN_STATION'},
{label:'上行进站', value:'UP_IN_STATION'},
{label:'下行出站', value:'DOWN_OUT_STATION'},
{label:'上行出站', value:'UP_OUT_STATION'},
{label:'双向', value:'BOTH_WAY_STATION'}
],
selectList:[
{label:'是', value:true},
{label:'否', value:false}
],
model:{
code:'', // code
ioName:'', //
allowOverrun:false, //
travelTrain:false, //
goodsTrain:false, //
ioDirection:'' //
}
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.CTCCommand.modifyStationDirection.menu.domId : '';
},
title() {
return '出入口信息';
}
},
methods:{
doShow({row, stationCode}) {
this.model = Object.assign({}, row);
this.stationCode = stationCode;
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
commit() {
this.loading = true;
const param = Object.assign({stationCode:this.stationCode}, this.model);
delete param.ioName;
delete param.ioDirection;
commitOperate(menuOperate.CTC.modifyStationDirection, param, 3).then(({valid})=>{
if (valid) {
this.$message.success('更新成功!');
this.$emit('refresh');
this.doClose();
}
}).catch(() => {
this.doClose();
this.$emit('noticeInfo');
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>
<style lang="scss" scoped>
.directionBtn{display:inline-block;margin-right: 10px;}
.DirectionInformation .el-form-item{
display:inline-block;
margin-bottom:20px;
}
.DirectionInformation{margin-bottom: 15px;}
</style>
<style lang="scss">
.DirectionInformation .el-form-item__content {
line-height: 30px;
}
</style>

View File

@ -19,24 +19,99 @@
</div>
</div>
<div class="stationDirectionRTable" :style="{ height: (height-40)+'px' }">
{{ '' }}
<el-table
id="stationDirectionTableIn"
ref="stationDirectionTableIn"
:data="tableData"
border
height="600px"
highlight-current-row
style="border:1px #ccc solid;width:1103px"
@row-click="selectedSection"
@row-dblclick="rowDbClick"
>
<el-table-column
prop="ioName"
label="出入口名称"
width="300"
/>
<el-table-column
prop="ioDirection"
label="方向"
width="200"
>
<template slot-scope="scope">
{{ ioDirectionMap[scope.row.ioDirection] }}
</template>
</el-table-column>
<el-table-column
prop="allowOverrun"
label="允许超限列车"
width="200"
>
<template slot-scope="scope">
{{ allowOverrunMap[scope.row.allowOverrun] }}
</template>
</el-table-column>
<el-table-column
prop="travelTrain"
label="允许旅客列车"
width="200"
>
<template slot-scope="scope">
{{ travelTrainMap[scope.row.travelTrain] }}
</template>
</el-table-column>
<el-table-column
prop="goodsTrain"
label="允许货车"
width="200"
>
<template slot-scope="scope">
{{ goodsTrainMap[scope.row.goodsTrain] }}
</template>
</el-table-column>
</el-table>
</div>
</div>
<direction-information ref="directionInformation" @noticeInfo="noticeInfo" @refresh="handleData" />
</div>
</template>
<script>
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
import TerminalStationList from './terminalStationList';
import DirectionInformation from './directionInformation';
export default {
name:'StationDirection',
components: {
TerminalStationList
TerminalStationList,
DirectionInformation
},
data() {
return {
height: this.$store.state.app.height - 61,
currentStationCode:'',
currentRow:null
currentRow:null,
tableData:[],
ioDirectionMap:{
'DOWN_IN_STATION':'下行进站',
'UP_IN_STATION':'上行进站',
'DOWN_OUT_STATION':'下行出站',
'UP_OUT_STATION':'上行出站',
'BOTH_WAY_STATION':'双向'
},
travelTrainMap:{
true:'是',
false:'否'
},
allowOverrunMap:{
true:'是',
false:'否'
},
goodsTrainMap:{
true:'是',
false:'否'
}
};
},
methods:{
@ -45,15 +120,34 @@ export default {
},
loadStationData(stationCode) {
this.currentStationCode = stationCode;
this.handleData(stationCode);
this.handleData();
},
handleData(stationCode) {
handleData() {
commitOperate(menuOperate.CTC.getStationDirection, { stationCode: this.currentStationCode }, 3).then(({valid, response}) => {
if (valid) {
this.tableData = response.data;
}
});
},
modifySection() {
rowDbClick(row, column, event) {
this.currentRow = row;
this.modifyDirection();
},
selectedSection(row, column, event) {
this.currentRow = row;
},
//
modifyDirection() {
if (this.currentRow) {
this.$refs.directionInformation.doShow({
row:this.currentRow,
stationCode:this.currentStationCode
});
}
},
noticeInfo() {
this.$emit('noticeInfo');
},
//
releaseStationDirection() {
const that = this;
@ -107,4 +201,21 @@ export default {
padding: 5px 10px;
border: 1px #737373 solid;
}
.stationDirectionButton:hover{
background-image: linear-gradient(#efffff,#a8daf3);
}
</style>
<style lang="scss">
#stationDirectionTableIn.el-table td, #stationDirectionTableIn.el-table th{
padding-top: 5px;
padding-bottom: 5px;
border-color: #a5a5a5;
}
// .el-table__body tr.current-row>td
// .el-table__body tr.current-row>td
// #runplanContentTable .el-table__body tr.current-row>td .el-input--mini .el-input__inner{
#stationDirectionTableIn .el-table__body tr.current-row>td{
background-color: #6aa8ec;
color: #fff;
}
</style>

View File

@ -145,7 +145,7 @@ waterSupply: false -->
</div>
</div>
<!-- -->
<track-information ref="trackInformation" @noticeInfo="noticeInfo" />
<track-information ref="trackInformation" @noticeInfo="noticeInfo" @refresh="handleData" />
</div>
</template>
<script>
@ -227,10 +227,10 @@ export default {
this.filterSectionMap[section.code] = {code:section.code, name:section.name};
}
});
this.handleData(stationCode);
this.handleData();
},
handleData(stationCode) {
commitOperate(menuOperate.CTC.getStationTrack, { stationCode: stationCode }, 3).then(({valid, response}) => {
handleData() {
commitOperate(menuOperate.CTC.getStationTrack, { stationCode: this.currentStationCode }, 3).then(({valid, response}) => {
if (valid) {
this.tableData = response.data;
}

View File

@ -249,6 +249,8 @@ export default {
this.loading = true;
commitOperate(menuOperate.CTC.modifyStationTrack, Object.assign({stationCode:this.stationCode}, this.model), 3).then(({valid})=>{
if (valid) {
this.$message.success('更新成功!');
this.$emit('refresh');
this.doClose();
}
}).catch(() => {

View File

@ -7,14 +7,14 @@
<div class="trainFixedPathR">
<div class="trainFixedPathRMenu">
<div class="trainFixedPathRMenuL">
<el-button class="trainFixedPathButton" size="small" @click="addRunplan">增加</el-button>
<el-button class="trainFixedPathButton" size="small">批量增加</el-button>
<el-button class="trainFixedPathButton" size="small" @click="addTrainFxPath">增加</el-button>
<el-button class="trainFixedPathButton" size="small" @click="batchTrainFxPath">批量增加</el-button>
<el-button class="trainFixedPathButton" size="small">基本图导入</el-button>
<el-button class="trainFixedPathButton" size="small">基本图申请</el-button>
<el-button class="trainFixedPathButton" size="small">其他站导入</el-button>
<el-button class="trainFixedPathButton" size="small" @click="deleteRunplan">删除</el-button>
<el-button class="trainFixedPathButton" size="small" @click="clearRunplan">全部清空</el-button>
<el-button class="trainFixedPathButton" size="small">修改</el-button>
<el-button class="trainFixedPathButton" size="small" @click="deleteTrainFxPath">删除</el-button>
<el-button class="trainFixedPathButton" size="small" @click="clearTrainFxPath">全部清空</el-button>
<el-button class="trainFixedPathButton" size="small" @click="modifyTrainFxPath">修改</el-button>
<el-button class="trainFixedPathButton" size="small">查找</el-button>
<el-button class="trainFixedPathButton" size="small">导出excel</el-button>
<el-button class="trainFixedPathButton" size="small">流程批量设置</el-button>
@ -92,8 +92,8 @@
width="75"
>
<template slot-scope="scope">
<div v-if="scope.row.trackSectionCode">
{{ filterSectionMap[scope.row.trackSectionCode].name }}
<div v-if="scope.row.masterCode">
{{ filterSectionMap[scope.row.masterCode].name }}
</div>
</template>
</el-table-column>
@ -104,8 +104,8 @@
width="110"
>
<template slot-scope="scope">
<div v-if="scope.row.departStationCode">
{{ stationMap[scope.row.departStationCode].name }}
<div v-if="scope.row.backStationCode">
{{ stationMap[scope.row.backStationCode].name }}
</div>
</template>
</el-table-column>
@ -116,8 +116,8 @@
width="155"
>
<template slot-scope="scope">
<div v-if="scope.row.arriveDirectionCode">
{{ mapStationDirectionData[scope.row.arriveDirectionCode].name }}
<div v-if="scope.row.enterDirCode">
{{ mapStationDirectionData[scope.row.enterDirCode].name }}
</div>
</template>
</el-table-column>
@ -128,8 +128,8 @@
width="155"
>
<template slot-scope="scope">
<div v-if="scope.row.departDirectionCode">
{{ mapStationDirectionData[scope.row.departDirectionCode].name }}
<div v-if="scope.row.outDirCode">
{{ mapStationDirectionData[scope.row.outDirCode].name }}
</div>
</template>
</el-table-column>
@ -140,8 +140,8 @@
width="110"
>
<template slot-scope="scope">
<div v-if="scope.row.arriveStationCode">
{{ stationMap[scope.row.arriveStationCode].name }}
<div v-if="scope.row.fontStationCode">
{{ stationMap[scope.row.fontStationCode].name }}
</div>
</template>
</el-table-column>
@ -211,7 +211,7 @@
width="40"
>
<template slot-scope="scope">
<el-checkbox v-model="scope.row.appendData.appendData.HUOJIAN" />
<el-checkbox v-model="scope.row.appendData.HUOJIAN" />
</template>
</el-table-column>
<!-- multiplyDown -->
@ -316,7 +316,8 @@
</el-table>
</div>
</div>
<add-runplan ref="addRunplan" @noticeInfo="noticeInfo" />
<add-runplan ref="trainFxPath" @noticeInfo="noticeInfo" @refresh="handleData" />
<batchTrainFxPath ref="batchTrainFxPath" @noticeInfo="noticeInfo" @refresh="handleData" />
</div>
</template>
<script>
@ -324,12 +325,14 @@ import { mapGetters } from 'vuex';
import { now} from '@/utils/date';
import TerminalStationList from './terminalStationList';
import AddRunplan from './addRunplan';
import BatchTrainFxPath from './batchTrainFxPath';
import { copyAssign } from '@/utils/index';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name:'TrainFixedPath',
components: {
TerminalStationList,
BatchTrainFxPath,
AddRunplan
},
data() {
@ -377,16 +380,33 @@ export default {
this.filterSectionMap[section.code] = {code:section.code, name:section.name};
}
});
this.handleData(stationCode);
this.handleData();
},
addRunplan() {
this.$refs.addRunplan.doShow({
addTrainFxPath() {
this.$refs.trainFxPath.doShow({
stationCode:this.currentStationCode,
filterSectionMap:this.filterSectionMap,
mapStationDirectionMap:this.mapStationDirectionData
});
},
deleteRunplan() {
batchTrainFxPath() {
this.$refs.batchTrainFxPath.doShow({
stationCode:this.currentStationCode,
filterSectionMap:this.filterSectionMap,
mapStationDirectionMap:this.mapStationDirectionData
});
},
modifyTrainFxPath() {
if (this.currentRow) {
this.$refs.trainFxPath.doShow({
stationCode:this.currentStationCode,
filterSectionMap:this.filterSectionMap,
mapStationDirectionMap:this.mapStationDirectionData,
row:this.currentRow
});
}
},
deleteTrainFxPath() {
if (this.currentRow) {
const that = this;
this.$confirm('确定删除该条列车路径数据?', '警告', {
@ -407,7 +427,7 @@ export default {
}).catch(e => {});
}
},
clearRunplan() {
clearTrainFxPath() {
const that = this;
this.$confirm('确定清空该站的所有列车路径数据?', '警告', {
confirmButtonText: '确定',
@ -500,9 +520,10 @@ export default {
coverTime(time) {
return time ? time.split(':').splice(0, 2).join(':') : '';
},
handleData(stationCode) {
commitOperate(menuOperate.CTC.getTrainFixedPath, { stationCode: stationCode }, 3).then(({valid, response}) => {
handleData() {
commitOperate(menuOperate.CTC.getTrainFixedPath, { stationCode: this.currentStationCode }, 3).then(({valid, response}) => {
if (valid) {
debugger;
this.tableData = response.data;
}
});

View File

@ -1,157 +0,0 @@
<template>
<div>
<div class="editContentTab">
<div v-if="tabVisible" class="editContentTabLable" @click="minisize">
<span class="titleStyle">{{ $t('trainingManage.editTagTitle') }}</span>
</div>
</div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :modal="false" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { updateTrainingContent, getTrainingAll } from '@/api/trainingManage';
import Vue from 'vue';
export default {
name: 'EditContent',
props: {},
data() {
return {
tabVisible: false,
dialogVisible: false,
editData: {
id: '',
mapId: '',
mapLocation: '',
bgScene: '',
runPlanId:'',
operaList: '',
stepList: '',
scoringRuleList: '',
memberList: '',
playerIdList: '',
failureCondition: ''
},
formModel: {
id: '',
mapId: '',
mapLocationJson: '',
bgSceneJson: '',
runPlanId:'',
operaJson: '',
stepJson: '',
scoringRuleJson: '',
memberJson: '',
playerIdJson: '',
failureConditionJson: ''
}
};
},
computed: {
title() {
const t = '更新实训信息';
return t;
},
form() {
const form = {
labelWidth: '80px',
items: [
{ prop: 'mapLocationJson', label: '地图定位', type: 'text' },
{ prop: 'bgSceneJson', label: '初始背景', type: 'text' },
{ prop: 'runPlanId', label: '运行图', type: 'text' },
{ prop: 'operaJson', label: '操作列表', type: 'text' },
{ prop: 'stepJson', label: '步骤列表', type: 'text' },
{ prop: 'scoringRuleJson', label: '打分规则', type: 'text' },
{ prop: 'memberJson', label: '仿真成员', type: 'text' },
{ prop: 'playerIdJson', label: '参演成员', type: 'text' },
{ prop: 'failureConditionJson', label: '失败判定', type: 'text' }
]
};
return form;
},
rules() {
const crules = {
type: [
{ required: true, message: '请选择实训类型', trigger: 'blur' }
]
};
return crules;
}
},
methods: {
minisize() {
this.dialogVisible = true;
},
doShow(data) {
this.getTrainingAll(data);
this.dialogVisible = true;
this.tabVisible = true;
},
doCreate() {
this.$refs.dataform.validateForm(async() => {
console.log(this.formModel, '---this.formModel---');
updateTrainingContent(this.formModel).then(res => {
console.log('更新大数据成功', res);
this.doClose();
}).catch(err => {
console.log('更新大数据错误', err);
});
});
},
doClose() {
// this.$refs.dataform.resetForm();
this.dialogVisible = false;
},
getTrainingAll(data) {
getTrainingAll(data.id).then(res => {
Object.keys(this.formModel).forEach(key => {
this.formModel[key] = res.data[key] || '';
});
console.log(res, this.formModel, '获取详细信息成功');
}).catch(err => {
console.log(err, '获取详细信息失败');
Object.keys(this.formModel).forEach(key => {
this.formModel[key] = '';
});
this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
});
},
saveScenesStage() {
const data = Vue.prototype.$jlmap.$options;
return {scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 25px 65px 30px 10px;
}
.editContentTab{
position: absolute;
z-index: 10;
right: 12px;
top: calc(45% + 100px);
}
.editContentTabLable{
position: absolute;
background: #fff;
border-radius: 5px 0px 0px 5px ;
padding: 5px 0px;
width: 23px;
text-align: center;
left: 50%;
transform: translateX(-50%);
cursor: pointer;
top:-28px;
}
</style>

View File

@ -1,6 +1,30 @@
<template>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :modal="false" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<el-form ref="form" :model="tagForm" label-width="60px">
<el-form-item label="标签">
<el-tag
v-for="tag in tagForm.dynamicTags"
:key="tag"
closable
:disable-transitions="false"
@close="handleClose(tag)"
>
{{ tag }}
</el-tag>
<el-input
v-if="inputVisible"
ref="saveTagInput"
v-model="inputValue"
autofocus
class="input-new-tag"
size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
/>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
@ -23,8 +47,13 @@ export default {
name: '',
mapId: '',
description:'',
type: '',
labelJson: ''
type: ''
// labelJson: ''
},
inputVisible: false,
inputValue: '',
tagForm: {
dynamicTags: []
}
};
},
@ -42,8 +71,8 @@ export default {
items: [
{ prop: 'name', label: '名称', type: 'text' },
{ prop: 'description', label: '描述', type: 'textarea' },
{ prop: 'type', label: '类型', type: 'select', options: ConstConfig.ConstSelect.trainingType },
{ prop: 'labelJson', label: '标签', type: 'text' }
{ prop: 'type', label: '类型', type: 'select', options: ConstConfig.ConstSelect.trainingType }
// { prop: 'labelJson', label: '', type: 'text', placeholder: '' }
]
};
@ -65,6 +94,20 @@ export default {
}
},
methods: {
handleClose(tag) {
this.tagForm.dynamicTags.splice(this.tagForm.dynamicTags.indexOf(tag), 1);
},
showInput() {
this.inputVisible = true;
},
handleInputConfirm() {
const inputValue = this.inputValue;
if (inputValue) {
this.tagForm.dynamicTags.push(inputValue);
}
this.inputVisible = false;
this.inputValue = '';
},
validateName(rule, value, callback) {
if (value.trim().length == 0) {
this.formModel.name = this.formModel.name.replace(/\s/g, '');
@ -85,24 +128,31 @@ export default {
if (data) {
this.isCreate = false;
this.formModel = {...data};
Object.keys(this.formModel).forEach(key => {
this.formModel[key] = data[key];
});
this.tagForm.dynamicTags = data.labelJson ? JSON.parse(data.labelJson) : [];
} else {
this.isCreate = true;
this.formModel = {
name: '',
mapId: this.$route.query.mapId,
description:'',
type: '',
labelJson: ''
type: ''
// labelJson: ''
};
this.tagForm.dynamicTags = [];
}
this.dialogVisible = true;
},
doCreate() {
this.$refs.dataform.validateForm(async() => {
const cpData = Object.assign({}, this.formModel);
cpData.labelJson = JSON.stringify(this.tagForm.dynamicTags);
if (this.isCreate) {
await createTraining(this.formModel);
await createTraining(cpData);
} else {
await updateTraining(this.formModel);
await updateTraining(cpData);
}
this.$emit('edit');
this.doClose();
@ -119,4 +169,19 @@ export default {
/deep/ .el-dialog--center .el-dialog__body{
padding: 25px 65px 30px 10px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
</style>

View File

@ -6,25 +6,27 @@
<el-button size="small" @click="showList">实训列表</el-button>
</el-button-group>
</div>
<TrainingList ref="trainingList" @editBlob="editBlob" />
<EditContent ref="EditBlob" v-dialogDrag />
<TrainingList ref="trainingList" @updateDetails="updateDetails" />
<EditDetails ref="editDetails" v-dialogDrag :edit-data="editData" />
</div>
</template>
<script>
import TrainingList from './trainingList.vue';
import EditContent from './EditContent.vue';
import EditDetails from './editDetails.vue';
export default {
name:'DemonMenu',
components:{
TrainingList,
EditContent
EditDetails
},
props:{
},
data() {
return {
hoverBtn: false,
btnWidth: -600
btnWidth: -600,
editData: {}
};
},
computed:{
@ -52,14 +54,18 @@ export default {
showList() {
this.$refs.trainingList.doShow();
},
editBlob(data) {
this.$refs.EditBlob.doShow(data);
updateDetails(data) {
this.editData = data;
this.$refs.editDetails.doShow(data);
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog__wrapper{
overflow: hidden;
}
.display_top_draft{
position: absolute;
left: 5px;

View File

@ -0,0 +1,262 @@
<template>
<div>
<div class="editContentTab">
<div v-if="tabVisible" class="editContentTabLable" @click="minisize">
<span class="titleStyle">{{ $t('trainingManage.editTagTitle') }}</span>
</div>
</div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="800px" :modal="false" :before-close="doClose" center>
<div class="stepListBox">
<el-button size="small" type="primary" @click="addStep">新增步骤</el-button>
<QueryListPage ref="queryListPage" :query-form="queryForm" :query-list="queryList" />
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="updateMapLocation">{{ $t('trainingManage.mapLocation') }}</el-button>
<el-button size="small" type="primary" @click="saveScenesStage">{{ $t('trainingManage.saveBackground') }}</el-button>
<el-button size="small" type="success" @click="saveStepData">{{ $t('trainingManage.saveStepData') }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { updateTrainingStep, getTrainingAll, updateTrainingBackgroud, getTrainingStepList, updateTrainingMaplocation } from '@/api/trainingManage';
import Vue from 'vue';
import {covertMemberData} from '@/views/newMap/displayNew/utils';
export default {
name: 'EditDetails',
components:{},
props: {
editData: {
type: Object,
default() {
return {};
}
}
},
data() {
return {
tabVisible: false,
dialogVisible: false,
formModel: {
mapLocationJson: '',
// runPlanId:'',
// operaJson: '',
stepJson: '',
scoringRuleJson: '',
// memberJson: '',
// playerIdJson: '',
failureConditionJson: ''
},
queryForm: {
show: false
},
queryList: {
height: '500px',
paginationHiden: true,
selectCheckShow: false,
data: [],
columns: [
{
title: this.$t('trainingManage.stepNum'),
width: '80',
prop: 'id',
type: 'basic',
edit: true
},
{
title: this.$t('trainingManage.roleSelect'),
width: '200',
prop: 'memberId',
type: 'select',
options: []
},
{
title: this.$t('trainingManage.stepDescription'),
prop: 'description',
type: 'basic',
edit: true
},
{
type: 'button',
title: this.$t('global.operate'),
width: '100',
buttons: [
{
name: this.$t('global.delete'),
type: 'danger',
handleClick: this.handleDelete
}
]
}
]
}
};
},
computed: {
title() {
const t = this.$t('trainingManage.editTagTitle');
return t;
},
group() {
return this.$route.query.group;
}
},
watch: {
'$store.state.training.memberList': function (val) {
if (val && val.length) {
const memberData = this.$store.state.training.memberData;
let activeTrainList = [];
if (this.$store.state.training.started) {
activeTrainList = this.$store.state.map.activeTrainList;
}
// 仿
const result = covertMemberData(activeTrainList, Object.values(memberData));
let list = [];
result.deviceListData.forEach(item => {
list = list.concat(item);
});
list.forEach(every => {
every.code = every.id;
every.name = `${every.label}(${every.type})`;
});
const colObj = this.queryList.columns.find(item => {
return item.prop == 'memberId';
});
if (colObj) {
colObj.options = list;
}
}
}
},
methods: {
addStep() {
const lastIndex = this.queryList.data.length - 1;
let mId = '';
if (this.queryList.data[lastIndex]) {
mId = this.queryList.data[lastIndex].memberId || '';
}
const obj = {
id: lastIndex + 2 + '',
memberId: mId,
description: ''
// triggerCondition: [],
// completionCondition:[],
// failureCondition: [],
// operations: []
};
this.queryList.data.push(obj);
},
handleDelete(index, row) {
console.log('删除', index, row);
this.$confirm('确定删除该条步骤数据?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.queryList.data.splice(index, 1);
}).catch(e => {});
},
minisize() {
this.dialogVisible = true;
},
doShow(data) {
// this.getTrainingAllInfo(data);
this.getStepList(data);
this.dialogVisible = true;
this.tabVisible = true;
},
saveStepData() {
const list = [];
this.queryList.data.forEach(item => {
const obj = {
...item
};
delete obj.isEdit;
list.push(obj);
});
updateTrainingStep(this.editData.id, list).then(res => {
console.log('保存步骤成功!', res);
this.$message.success('保存步骤成功!');
this.doClose();
}).catch(err => {
console.log('保存步骤失败', err);
this.$message.error('保存步骤失败');
});
},
doClose() {
this.dialogVisible = false;
},
getStepList(data) { //
getTrainingStepList(data.id).then(res => {
console.log(res, '获取步骤成功');
this.queryList.data = res.data;
}).catch(err => {
console.log(err, '获取步骤失败');
this.queryList.data = [];
});
},
getTrainingAllInfo(data) {
getTrainingAll(data.id).then(res => {
Object.keys(this.formModel).forEach(key => {
this.formModel[key] = res.data[key] || '';
if (key == 'stepJson') {
const sList = res.data[key] ? JSON.parse(res.data[key]) : [];
this.queryList.data = Object.prototype.toString.call(sList) === '[object Array]' ? sList : [];
}
});
console.log(res, this.formModel, '获取详细信息成功');
}).catch(err => {
console.log(err, '获取详细信息失败');
Object.keys(this.formModel).forEach(key => {
this.formModel[key] = '';
});
this.queryList.data = [];
});
},
updateMapLocation() {
const data = Vue.prototype.$jlmap.$options;
const params = {scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
updateTrainingMaplocation({id: this.editData.id, mapLocationJson: JSON.stringify(params)}).then(res => {
console.log('保存地图定位成功!', res);
this.$message.success('保存地图定位成功!');
this.formModel.mapLocationJson = JSON.stringify(params);
}).catch(err => {
console.log('保存地图定位失败', err);
this.$message.error('保存地图定位失败');
});
},
saveScenesStage() {
updateTrainingBackgroud({id: this.editData.id, groupId: this.group}).then(res => {
console.log('保存背景', res);
this.$message.success('保存背景成功!');
}).catch(err => {
console.log('保存背景失败', err);
this.$message.error('保存背景失败');
});
}
}
};
</script>
<style lang="scss" scoped>
.editContentTab{
position: absolute;
z-index: 10;
right: 12px;
top: calc(45% + 100px);
}
.editContentTabLable{
position: absolute;
background: #fff;
border-radius: 5px 0px 0px 5px ;
padding: 5px 0px;
width: 23px;
text-align: center;
left: 50%;
transform: translateX(-50%);
cursor: pointer;
top:-28px;
}
</style>

View File

@ -8,7 +8,6 @@
</div>
<QueryListPage ref="queryListPage" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<Create ref="create" v-dialogDrag @edit="getListData" />
</div>
</el-dialog>
</template>
@ -54,6 +53,7 @@ export default {
},
{
title: this.$t('trainingManage.type'),
width: '70',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.covertData(row); },
@ -61,12 +61,16 @@ export default {
},
{
title: this.$t('trainingManage.labelJson'),
prop: 'labelJson'
width: '200',
prop: 'labelJson',
type: 'tagMore',
columnValue: (row) => { return this.labelJsonData(row); },
tagType: (row) => { return ''; }
},
{
type: 'button',
title: this.$t('trainingManage.operate'),
width: '450',
width: '360',
buttons: [
{
name: this.$t('trainingManage.record'),
@ -140,9 +144,14 @@ export default {
}
return lastData.type;
},
labelJsonData(row) {
const sList = row.labelJson ? JSON.parse(row.labelJson) : [];
const list = Object.prototype.toString.call(sList) === '[object Array]' ? sList : [sList];
return list;
},
drawUp(index, row) {
console.log('编辑', index, row);
this.$emit('editBlob', row);
this.$emit('updateDetails', row);
this.doClose();
},
handleModify(index, row) {
@ -152,22 +161,30 @@ export default {
},
deleteScript(index, row) {
console.log('删除', index, row);
if (!row.id) { return; }
deleteTraining([row.id]).then(res => {
console.log('删除实训成功', res);
this.getListData();
}).catch(err => {
console.log('删除实训失败', err);
this.getListData();
});
this.$confirm('确定删除该条实训数据?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (!row.id) { return; }
deleteTraining([row.id]).then(res => {
console.log('删除实训成功', res);
this.getListData();
}).catch(err => {
console.log('删除实训失败', err);
this.getListData();
});
}).catch(e => {});
},
publishScript(index, row) {
console.log('发布', index, row);
if (!row.id) { return; }
publishTraining({draftId: row.id}).then(res => {
console.log('发布实训成功', res);
this.$message.success('发布实训成功!');
}).catch(err => {
console.log('发布实训失败', err);
this.$message.error('发布实训失败');
});
},
previewScript(index, row) {