修改页面不刷新的问题

This commit is contained in:
ival 2019-08-09 18:29:08 +08:00
parent bfddddf7e6
commit 763cff0a7c
15 changed files with 1418 additions and 1292 deletions

View File

@ -27,7 +27,7 @@ Vue.use(VueI18n);
Vue.config.productionTip = false; Vue.config.productionTip = false;
export const i18n = new VueI18n({ export const i18n = new VueI18n({
locale: LangStorage.getLang('en'), locale: LangStorage.getLang('zh'),
messages messages
}); });

View File

@ -11,7 +11,8 @@ const runPlan = {
planUpdateCount: 0, // 运行图更新标识 planUpdateCount: 0, // 运行图更新标识
selected: {}, // 选择的对象 selected: {}, // 选择的对象
width: 800, // 运行图canvas 容器 宽度 width: 800, // 运行图canvas 容器 宽度
height: 600 // 运行图canvas 容器 高度 height: 600, // 运行图canvas 容器 高度
refreshCount: 0 // 刷新页面重新加载
}, },
getters: { getters: {
stations: (state) => { stations: (state) => {
@ -95,6 +96,9 @@ const runPlan = {
state.planData = {}; state.planData = {};
state.editData = {}; state.editData = {};
state.selected = {}; state.selected = {};
},
refresh: (state) => {
state.refreshCount++;
} }
}, },
actions: { actions: {
@ -130,6 +134,10 @@ const runPlan = {
/** 清空数据*/ /** 清空数据*/
clear: ({ commit }) => { clear: ({ commit }) => {
commit('clear'); commit('clear');
},
/** 刷新页面*/
refresh: ({commit}) => {
commit('refresh');
} }
} }
}; };

View File

@ -3,8 +3,8 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培 // BASE_API = 'http://192.168.3.4:9000' // 琰培
} else { } else {

View File

@ -145,7 +145,7 @@ export default {
deletePlanService(model).then(resp => { deletePlanService(model).then(resp => {
this.$message.success('删除计划成功'); this.$message.success('删除计划成功');
this.$store.dispatch('runPlan/setSelected', {}); this.$store.dispatch('runPlan/setSelected', {});
this.$refs.openRunPlan.loadRunPlanData(this.$route.query); this.$refs.openRunPlan.loadRunPlanData(Object.assign({refresh: true}, this.$route.query));
}).catch(() => { }).catch(() => {
this.$messageBox('删除计划失败'); this.$messageBox('删除计划失败');
}); });

View File

@ -518,7 +518,8 @@ export default {
width: 260, width: 260,
message: `真的要删除列车 ${serviceNumber} 吗?`, message: `真的要删除列车 ${serviceNumber} 吗?`,
operate: 'DeletePlanningTrain', operate: 'DeletePlanningTrain',
serviceNumber: serviceNumber serviceNumber: serviceNumber,
refresh: true
} }
}); });
} else { } else {

View File

@ -1,10 +1,19 @@
<template> <template>
<el-dialog class="planEdit__tool add-planning-train" :title="title" :visible.sync="dialogShow" width="260px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool add-planning-train"
:title="title"
:visible.sync="dialogShow"
width="260px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-col :span="6" :offset="3" style="height: 30px; line-height: 30px;">服务号</el-col> <el-col :span="6" :offset="3" style="height: 30px; line-height: 30px;">服务号</el-col>
<el-col :span="10" :offset="1"> <el-col :span="10" :offset="1">
<el-input v-model="serviceNumber" size="mini"></el-input> <el-input v-model="serviceNumber" size="mini" />
</el-col> </el-col>
</el-row> </el-row>
<el-row type="flex" justify="center" style="margin-top: 20px"> <el-row type="flex" justify="center" style="margin-top: 20px">
@ -23,12 +32,12 @@
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
serviceNumber: '', serviceNumber: ''
} };
}, },
computed: { computed: {
title() { title() {
return '添加计划车' return '添加计划车';
} }
}, },
mounted() { mounted() {
@ -52,15 +61,15 @@
type: 'warning', type: 'warning',
operate: 'AddPlanningTrain', operate: 'AddPlanningTrain',
width: 460, width: 460,
message: '本表号已存在,是否强制设置?(强制设置程序可能会出现异常)', message: '本表号已存在,是否强制设置?(强制设置程序可能会出现异常)'
} }
}) });
this.doClose(); this.doClose();
} else { } else {
this.handleConfirm(); this.handleConfirm();
} }
}) });
} else { } else {
this.$messageBox('长度应该为两位数'); this.$messageBox('长度应该为两位数');
} }
@ -71,10 +80,10 @@
handleConfirm() { handleConfirm() {
this.doClose(); this.doClose();
this.$store.dispatch('runPlan/addserviceNumber', this.serviceNumber); this.$store.dispatch('runPlan/addserviceNumber', this.serviceNumber);
this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber: this.serviceNumber } }) this.$emit('dispatchDialog', { name: 'editPlanningTrain', params: { serviceNumber: this.serviceNumber } });
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,6 +1,15 @@
<template> <template>
<el-dialog class="planEdit__tool add-task" :title="title" :visible.sync="dialogShow" width="780px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool add-task"
:title="title"
:visible.sync="dialogShow"
width="780px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="margin: 10px"> <div style="margin: 10px">
<el-row> <el-row>
<el-col :span="3"> <el-col :span="3">
@ -11,17 +20,19 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-select v-model="addModel.tripNumber" placeholder="请选择"> <el-select v-model="addModel.tripNumber" placeholder="请选择">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-option
:value="item.value"> v-for="item in tripNumberList"
</el-option> :key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4" style="margin-left: 20px"> <el-col :span="4" style="margin-left: 20px">
<span>开始时间</span> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-time-picker v-model="addModel.startTime" value-format="HH:mm:ss" :clearable="false"> <el-time-picker v-model="addModel.startTime" value-format="HH:mm:ss" :clearable="false" />
</el-time-picker>
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-top: 5px"> <el-row style="margin-top: 5px">
@ -33,9 +44,12 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-select v-model="addModel.defaultStopTime" placeholder="请选择"> <el-select v-model="addModel.defaultStopTime" placeholder="请选择">
<el-option v-for="item in defaultStopTimeList" :key="item.value" :label="item.label" <el-option
:value="item.value"> v-for="item in defaultStopTimeList"
</el-option> :key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4" style="margin-left: 20px"> <el-col :span="4" style="margin-left: 20px">
@ -43,9 +57,12 @@
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-select v-model="addModel.defaultSpeedLevel" placeholder="请选择"> <el-select v-model="addModel.defaultSpeedLevel" placeholder="请选择">
<el-option v-for="item in defaultSpeedLevelList" :key="item.value" :label="item.label" <el-option
:value="item.value"> v-for="item in defaultSpeedLevelList"
</el-option> :key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
@ -54,8 +71,13 @@
交路 交路
</el-row> </el-row>
<el-row> <el-row>
<el-table :data="addModel.routingList" border highlight-current-row @row-click="handleClick" <el-table
:height="180"> :data="addModel.routingList"
border
highlight-current-row
:height="180"
@row-click="handleClick"
>
<el-table-column prop="startStationCode" label="起始站"> <el-table-column prop="startStationCode" label="起始站">
<template slot-scope="scope"> <template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }} {{ formatName(scope.row.startStationCode) }}
@ -76,8 +98,7 @@
{{ formatName(scope.row.endSectionCode) }} {{ formatName(scope.row.endSectionCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remarks" label="描述"> <el-table-column prop="remarks" label="描述" />
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
@ -95,14 +116,10 @@
{{ formatName(scope.row.sectionCode) }} {{ formatName(scope.row.sectionCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="arriveTime" label="到点"> <el-table-column prop="arriveTime" label="到点" />
</el-table-column> <el-table-column prop="stopTime" label="停站时间" />
<el-table-column prop="stopTime" label="停站时间"> <el-table-column prop="departureTime" label="发点" />
</el-table-column> <el-table-column prop="speedLevel" label="运行等级" />
<el-table-column prop="departureTime" label="发点">
</el-table-column>
<el-table-column prop="speedLevel" label="运行等级">
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row> <el-row>
@ -111,7 +128,7 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<el-row addToFront="flex" justify="center" class="button-group"> <el-row add-to-front="flex" justify="center" class="button-group">
<el-button @click="handleCommit"> </el-button> <el-button @click="handleCommit"> </el-button>
<el-button @click="doClose"> </el-button> <el-button @click="doClose"> </el-button>
</el-row> </el-row>
@ -155,13 +172,13 @@
}, },
tripNumberList: [{ value: '', label: '自动' }], tripNumberList: [{ value: '', label: '自动' }],
defaultStopTimeList: [{ value: '', label: '默认' }], defaultStopTimeList: [{ value: '', label: '默认' }],
defaultSpeedLevelList: [{ value: '', label: '默认' }], defaultSpeedLevelList: [{ value: '', label: '默认' }]
} };
}, },
computed: { computed: {
title() { title() {
return '添加任务' return '添加任务';
}, }
}, },
watch: { watch: {
'addModel.routingCode': function () { 'addModel.routingCode': function () {
@ -184,21 +201,21 @@
this.addModel.serviceNumber = params.serviceNumber; this.addModel.serviceNumber = params.serviceNumber;
this.addModel.planId = this.$route.query.planId; this.addModel.planId = this.$route.query.planId;
let planId = this.$route.query.planId; const planId = this.$route.query.planId;
if (planId) { if (planId) {
getRoutingList(planId).then(resp => { getRoutingList(planId).then(resp => {
this.addModel.routingList = resp.data; this.addModel.routingList = resp.data;
}) });
} }
let skinStyle = this.$route.query.skinStyle; const skinStyle = this.$route.query.skinStyle;
if (skinStyle) { if (skinStyle) {
getStationRunning(skinStyle).then(resp => { getStationRunning(skinStyle).then(resp => {
let list = resp.data; const list = resp.data;
list.forEach(elem => { list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem; this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
}); });
}) });
} }
}, },
doShow(params) { doShow(params) {
@ -213,14 +230,14 @@
return formatName(code); return formatName(code);
}, },
computedTimeByString(timeStr) { computedTimeByString(timeStr) {
let bTime = +new Date(`2019-01-01 00:00:00`); const bTime = +new Date(`2019-01-01 00:00:00`);
let eTime = +new Date(`2019-01-01 ${timeStr}`); const eTime = +new Date(`2019-01-01 ${timeStr}`);
return Number(eTime) - Number(bTime); return Number(eTime) - Number(bTime);
}, },
compuntedRunTime(list, index, runLevel) { compuntedRunTime(list, index, runLevel) {
let runTime = 0; let runTime = 0;
if (index < list.length - 1) { if (index < list.length - 1) {
let stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()]; const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
if (stopStationObj) { if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) { if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]); runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
@ -235,10 +252,10 @@
computedDetailList() { computedDetailList() {
if (this.addModel.routingCode) { if (this.addModel.routingCode) {
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.addModel.routingCode }).then(resp => { querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.addModel.routingCode }).then(resp => {
let list = resp.data; const list = resp.data;
let waitTime = this.addModel.defaultStopTime || 30; // const waitTime = this.addModel.defaultStopTime || 30; //
let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30; let tempTime = this.computedTimeByString(this.addModel.startTime) / 1000 - 30;
let runLevel = this.addModel.defaultSpeedLevel || 'level3'; // const runLevel = this.addModel.defaultSpeedLevel || 'level3'; //
list.forEach((elem, index) => { list.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : ''; elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime); elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
@ -259,7 +276,7 @@
this.addModel.arriveConfigList = list; this.addModel.arriveConfigList = list;
this.addModel.endTime = formatTime(tempTime - waitTime); this.addModel.endTime = formatTime(tempTime - waitTime);
}) });
} }
}, },
handleClick(row, column, event) { handleClick(row, column, event) {
@ -272,23 +289,23 @@
handleCommit() { handleCommit() {
if (this.isPlan) { if (this.isPlan) {
// //
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) }) this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmAddTask', params: Object.assign({}, this.addModel) });
} else { } else {
// //
addPlanTrip(this.addModel).then(resp => { addPlanTrip(this.addModel).then(resp => {
this.$emit('dispatchOperate', { this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: this.$route.query dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
}); });
this.$message.success('添加任务成功!'); this.$message.success('添加任务成功!');
}).catch(error => { }).catch(() => {
this.$messageBox('添加任务失败'); this.$messageBox('添加任务失败');
}) });
} }
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,10 +1,19 @@
<template> <template>
<el-dialog class="planEdit__tool create-empty-plan" :title="title" :visible.sync="dialogShow" width="420px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool create-empty-plan"
:title="title"
:visible.sync="dialogShow"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-form ref="form" :model="addModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent> <el-form ref="form" :model="addModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
<el-form-item label="运行图名称:" prop="name"> <el-form-item label="运行图名称:" prop="name">
<el-input autofocus v-model="addModel.name"></el-input> <el-input v-model="addModel.name" autofocus />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
@ -28,20 +37,20 @@
loading: false, loading: false,
addModel: { addModel: {
name: '', name: '',
skinStyle: this.$route.query.skinStyle, skinStyle: this.$route.query.skinStyle
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '创建空运行图数据' return '创建空运行图数据';
}, },
rules() { rules() {
return { return {
name: [ name: [
{ required: true, message: '请输入运行图名称', trigger: 'blur' } { required: true, message: '请输入运行图名称', trigger: 'blur' }
] ]
} };
} }
}, },
methods: { methods: {
@ -56,24 +65,24 @@
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
createEmptyPlan(this.addModel).then(resp => { createEmptyPlan(this.addModel).then(resp => {
let params = { const params = {
dialogName: 'openRunPlan', dialogName: 'openRunPlan',
operate: 'loadRunPlanData', operate: 'loadRunPlanData',
params: { planId: resp.data, skinStyle: this.$route.query.skinStyle, planName: this.addModel.name } params: { planId: resp.data, skinStyle: this.$route.query.skinStyle, planName: this.addModel.name, refresh: true }
} };
this.$emit('dispatchOperate', params) this.$emit('dispatchOperate', params);
this.$message.success('创建空运行图成功!'); this.$message.success('创建空运行图成功!');
this.doClose(); this.doClose();
}).catch(error => { }).catch(() => {
this.$messageBox('创建空运行图失败'); this.$messageBox('创建空运行图失败');
this.doClose(); this.doClose();
}) });
} }
}); });
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,6 +1,15 @@
<template> <template>
<el-dialog class="planEdit__tool delete-task" :title="title" :visible.sync="dialogShow" width="400px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool delete-task"
:title="title"
:visible.sync="dialogShow"
width="400px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-radio v-model="model.deleteBefore" :label="true">删除以前所有任务包含本任务</el-radio> <el-radio v-model="model.deleteBefore" :label="true">删除以前所有任务包含本任务</el-radio>
</el-row> </el-row>
@ -30,13 +39,13 @@
taskIndex: '', taskIndex: '',
deleteBefore: false, deleteBefore: false,
tripNumber: '', tripNumber: '',
serviceNumber: '', serviceNumber: ''
},
} }
};
}, },
computed: { computed: {
title() { title() {
return '删除任务' return '删除任务';
} }
}, },
mounted() { mounted() {
@ -56,29 +65,29 @@
handleCommit() { handleCommit() {
if (this.isPlan) { if (this.isPlan) {
// //
this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmDeleteTask', params: this.model }) this.$emit('dispatchOperate', { dialogName: 'editPlanningTrain', operate: 'handleConfirmDeleteTask', params: this.model });
} else { } else {
// //
let model = { const model = {
planId: this.$route.query.planId, planId: this.$route.query.planId,
SDTNumber: `${this.model.serviceNumber}${this.model.tripNumber}`, SDTNumber: `${this.model.serviceNumber}${this.model.tripNumber}`,
deleteBefore: this.model.deleteBefore deleteBefore: this.model.deleteBefore
} };
deletePlanTrip(model).then(resp => { deletePlanTrip(model).then(resp => {
this.$store.dispatch('runPlan/setSelected', {}); this.$store.dispatch('runPlan/setSelected', {});
this.$emit('dispatchOperate', { this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: this.$route.query dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
}); });
this.$message.success('删除任务成功!'); this.$message.success('删除任务成功!');
}).catch(error => { }).catch(() => {
this.$messageBox('删除任务失败'); this.$messageBox('删除任务失败');
}) });
} }
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,6 +1,15 @@
<template> <template>
<el-dialog class="planEdit__tool duplicate-train" :title="title" :visible.sync="dialogShow" width="420px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool duplicate-train"
:title="title"
:visible.sync="dialogShow"
width="420px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row type="flex" justify="center"> <el-row type="flex" justify="center">
<el-radio-group v-model="model.forward"> <el-radio-group v-model="model.forward">
<el-radio :label="true">向前</el-radio> <el-radio :label="true">向前</el-radio>
@ -10,13 +19,13 @@
<el-row style="margin-top: 20px"> <el-row style="margin-top: 20px">
<el-col :span="5" :offset="4">次数</el-col> <el-col :span="5" :offset="4">次数</el-col>
<el-col :span="10"> <el-col :span="10">
<el-input-number v-model="model.times" size="mini" controls-position="right"></el-input-number> <el-input-number v-model="model.times" size="mini" controls-position="right" />
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin: 10px 0px"> <el-row style="margin: 10px 0px">
<el-col :span="5" :offset="4">间隔时间</el-col> <el-col :span="5" :offset="4">间隔时间</el-col>
<el-col :span="10"> <el-col :span="10">
<el-input-number v-model="model.intervals" size="mini" controls-position="right"></el-input-number> <el-input-number v-model="model.intervals" size="mini" controls-position="right" />
<span></span> <span></span>
</el-col> </el-col>
</el-row> </el-row>
@ -42,13 +51,13 @@
serviceNumber: '', serviceNumber: '',
forward: false, forward: false,
times: 0, times: 0,
intervals: 0, intervals: 0
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '复制列车' return '复制列车';
} }
}, },
mounted() { mounted() {
@ -68,15 +77,15 @@
this.doClose(); this.doClose();
duplicateService(this.model).then(resp => { duplicateService(this.model).then(resp => {
this.$emit('dispatchOperate', { this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: this.$route.query dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
}); });
this.$message.success('复制计划成功!'); this.$message.success('复制计划成功!');
}).catch(error => { }).catch(() => {
this.$messageBox('复制计划失败'); this.$messageBox('复制计划失败');
}) });
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,10 +1,19 @@
<template> <template>
<el-dialog class="planEdit__tool edit-planning-train" :title="title" :visible.sync="dialogShow" width="800px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool edit-planning-train"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row> <el-row>
<el-col :span="3"> 表号 </el-col> <el-col :span="3"> 表号 </el-col>
<el-col :span="4"> <el-col :span="4">
<el-input v-model="model.serviceNumber" disabled size="mini"></el-input> <el-input v-model="model.serviceNumber" disabled size="mini" />
</el-col> </el-col>
<el-col :span="4" :offset="1"> <el-col :span="4" :offset="1">
<el-checkbox v-model="model.debugTrain">调试车</el-checkbox> <el-checkbox v-model="model.debugTrain">调试车</el-checkbox>
@ -15,8 +24,13 @@
</el-row> </el-row>
<el-row> <el-row>
<div style=" float: left; width: 78%"> <div style=" float: left; width: 78%">
<el-table :data="model.tripConfigList" highlight-current-row @current-change="handleCurrentChange" <el-table
border :height="380"> :data="model.tripConfigList"
highlight-current-row
border
:height="380"
@current-change="handleCurrentChange"
>
<el-table-column prop="beginStationCode" label="起始站"> <el-table-column prop="beginStationCode" label="起始站">
<template slot-scope="scope"> <template slot-scope="scope">
{{ formatName(scope.row.startStationCode) }} {{ formatName(scope.row.startStationCode) }}
@ -37,8 +51,7 @@
{{ scope.row.endTime }} {{ scope.row.endTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="20"> <el-table-column width="20" />
</el-table-column>
</el-table> </el-table>
</div> </div>
<div style="float: right; width: 22%"> <div style="float: right; width: 22%">
@ -68,13 +81,13 @@
model: { model: {
serviceNumber: '', serviceNumber: '',
debugTrain: false, debugTrain: false,
tripConfigList: [], tripConfigList: []
}
} }
};
}, },
computed: { computed: {
title() { title() {
return '编辑计划车' return '编辑计划车';
}, },
disabled() { disabled() {
return !this.model.serviceNumber; return !this.model.serviceNumber;
@ -91,13 +104,13 @@
this.model.planId = this.$route.query.planId; this.model.planId = this.$route.query.planId;
this.model.serviceNumber = params.serviceNumber; this.model.serviceNumber = params.serviceNumber;
this.model.tripConfigList = []; this.model.tripConfigList = [];
let editData = this.$store.state.runPlan.editData[params.serviceNumber] const editData = this.$store.state.runPlan.editData[params.serviceNumber];
if (editData) { if (editData) {
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex }); const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
tripNumberList.forEach(tripNumber => { tripNumberList.forEach(tripNumber => {
let trainInfo = editData.trainMap[tripNumber]; const trainInfo = editData.trainMap[tripNumber];
let lastIndex = trainInfo.stationTimeList.length - 1; const lastIndex = trainInfo.stationTimeList.length - 1;
let taskObj = { const taskObj = {
taskIndex: getUID('task_'), taskIndex: getUID('task_'),
tripNumber: tripNumber, tripNumber: tripNumber,
startStationCode: trainInfo.stationTimeList[0].stationCode, startStationCode: trainInfo.stationTimeList[0].stationCode,
@ -105,10 +118,10 @@
endStationCode: trainInfo.stationTimeList[lastIndex].stationCode, endStationCode: trainInfo.stationTimeList[lastIndex].stationCode,
endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime), endTime: formatTime(trainInfo.stationTimeList[lastIndex].secondTime),
arriveConfigList: [] arriveConfigList: []
} };
// console.log(editData.trainMap[tripNumber]); // console.log(editData.trainMap[tripNumber]);
this.model.tripConfigList.push(taskObj); this.model.tripConfigList.push(taskObj);
}) });
} }
}, },
doShow(params) { doShow(params) {
@ -130,7 +143,7 @@
serviceNumber: this.model.serviceNumber, serviceNumber: this.model.serviceNumber,
tripNumber: this.currentRow.tripNumber tripNumber: this.currentRow.tripNumber
} }
}) });
}, },
handleEditTask() { handleEditTask() {
if (this.currentRow.taskIndex) { if (this.currentRow.taskIndex) {
@ -140,7 +153,7 @@
serviceNumber: this.model.serviceNumber, serviceNumber: this.model.serviceNumber,
tripNumber: this.currentRow.tripNumber tripNumber: this.currentRow.tripNumber
} }
}) });
} else { } else {
this.$messageBox('请选择一条数据'); this.$messageBox('请选择一条数据');
} }
@ -154,7 +167,7 @@
serviceNumber: this.model.serviceNumber, serviceNumber: this.model.serviceNumber,
tripNumber: this.currentRow.tripNumber tripNumber: this.currentRow.tripNumber
} }
}) });
} else { } else {
this.$messageBox('请选择一条数据'); this.$messageBox('请选择一条数据');
} }
@ -181,8 +194,8 @@
} }
}, },
handleConfirmDeleteTask(model) { handleConfirmDeleteTask(model) {
let index = this.model.tripConfigList.findIndex( const index = this.model.tripConfigList.findIndex(
elem => { return elem.taskIndex == this.currentRow.taskIndex } elem => { return elem.taskIndex == this.currentRow.taskIndex; }
); );
if (index >= 0) { if (index >= 0) {
@ -197,15 +210,15 @@
this.doClose(); this.doClose();
addPlanService(this.model).then(() => { addPlanService(this.model).then(() => {
this.$emit('dispatchOperate', { this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: this.$route.query dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
}); });
this.$message.success('创建计划成功'); this.$message.success('创建计划成功');
}).catch(error => { }).catch(() => {
this.$messageBox('创建计划失败'); this.$messageBox('创建计划失败');
}) });
}
} }
} }
};
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,6 +1,15 @@
<template> <template>
<el-dialog class="planEdit__tool add-task" :title="title" :visible.sync="dialogShow" width="1000px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
class="planEdit__tool add-task"
:title="title"
:visible.sync="dialogShow"
width="1000px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<div style="margin: 10px"> <div style="margin: 10px">
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
@ -9,10 +18,13 @@
<span>车次号</span> <span>车次号</span>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-select style="display: inline-black" v-model="editModel.tripNumber" placeholder="请选择"> <el-select v-model="editModel.tripNumber" style="display: inline-black" placeholder="请选择">
<el-option v-for="item in tripNumberList" :key="item.value" :label="item.label" <el-option
:value="item.value"> v-for="item in tripNumberList"
</el-option> :key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
@ -30,11 +42,17 @@
<span>缺省停站时间</span> <span>缺省停站时间</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-select style="display: inline-black" v-model="editModel.defaultStopTime" <el-select
placeholder="请选择"> v-model="editModel.defaultStopTime"
<el-option v-for="item in defaultStopTimeList" :key="item.value" :label="item.label" style="display: inline-black"
:value="item.value"> placeholder="请选择"
</el-option> >
<el-option
v-for="item in defaultStopTimeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
@ -45,7 +63,7 @@
<span>表号</span> <span>表号</span>
</el-col> </el-col>
<el-col :span="13"> <el-col :span="13">
<el-input v-model="editModel.serviceNumber"></el-input> <el-input v-model="editModel.serviceNumber" />
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
@ -74,10 +92,13 @@
<span>序列号</span> <span>序列号</span>
</el-col> </el-col>
<el-col :span="15"> <el-col :span="15">
<el-select style="display: inline-black" v-model="editModel.serialNumber" placeholder="请选择"> <el-select v-model="editModel.serialNumber" style="display: inline-black" placeholder="请选择">
<el-option v-for="item in serialNumberList" :key="item.value" :label="item.label" <el-option
:value="editModel.value"> v-for="item in serialNumberList"
</el-option> :key="item.value"
:label="item.label"
:value="editModel.value"
/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
@ -95,11 +116,17 @@
<span>缺省运行等级</span> <span>缺省运行等级</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-select style="display: inline-black" v-model="editModel.defaultSpeedLevel" <el-select
placeholder="请选择"> v-model="editModel.defaultSpeedLevel"
<el-option v-for="item in defaultSpeedLevelList" :key="item.value" :label="item.label" style="display: inline-black"
:value="item.value"> placeholder="请选择"
</el-option> >
<el-option
v-for="item in defaultSpeedLevelList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-col> </el-col>
</el-row> </el-row>
@ -110,9 +137,12 @@
<span>开始时间</span> <span>开始时间</span>
</el-col> </el-col>
<el-col :span="13"> <el-col :span="13">
<el-time-picker v-model="editModel.startTime" placeholder="选择时间" value-format="HH:mm:ss" <el-time-picker
:clearable="false"> v-model="editModel.startTime"
</el-time-picker> placeholder="选择时间"
value-format="HH:mm:ss"
:clearable="false"
/>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
@ -144,19 +174,15 @@
{{ formatName(scope.row.startStationCode) }} {{ formatName(scope.row.startStationCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="startSectionCode" label="起始区段"> <el-table-column prop="startSectionCode" label="起始区段" />
</el-table-column>
<el-table-column prop="endStationCode" label="终到站"> <el-table-column prop="endStationCode" label="终到站">
<template slot-scope="scope"> <template slot-scope="scope">
{{ formatName(scope.row.endStationCode) }} {{ formatName(scope.row.endStationCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="endSectionCode" label="终到区段"> <el-table-column prop="endSectionCode" label="终到区段" />
</el-table-column> <el-table-column prop="remarks" label="描述" :width="280" />
<el-table-column prop="remarks" label="描述" :width="280"> <el-table-column :width="40" />
</el-table-column>
<el-table-column :width="40">
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row style=" margin-bottom: 5px;margin-top: 10px;"> <el-row style=" margin-bottom: 5px;margin-top: 10px;">
@ -174,14 +200,10 @@
{{ formatName(scope.row.sectionCode) }} {{ formatName(scope.row.sectionCode) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="arriveTime" label="到点"> <el-table-column prop="arriveTime" label="到点" />
</el-table-column> <el-table-column prop="stopTime" label="停站时间" />
<el-table-column prop="stopTime" label="停站时间"> <el-table-column prop="departureTime" label="发点" />
</el-table-column> <el-table-column prop="speedLevel" label="运行等级" />
<el-table-column prop="departureTime" label="发点">
</el-table-column>
<el-table-column prop="speedLevel" label="运行等级">
</el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-row> <el-row>
@ -198,7 +220,7 @@
</template> </template>
<script> <script>
import { getRoutingBySDTNumber, querySectionListByRouting, getRoutingList, getStationRunning, updatePlanTrip } from '@/api/runplan'; import { getRoutingBySDTNumber, querySectionListByRouting, getStationRunning, updatePlanTrip } from '@/api/runplan';
import { formatTime, formatName } from '@/utils/runPlan'; import { formatTime, formatName } from '@/utils/runPlan';
export default { export default {
@ -232,17 +254,17 @@
firstTrain: false, firstTrain: false,
lastTrain: false, lastTrain: false,
inStock: false, inStock: false,
outStock: false, outStock: false
}, },
tripNumberList: [{ value: '', label: '自动' }], tripNumberList: [{ value: '', label: '自动' }],
defaultStopTimeList: [{ value: '', label: '默认' }], defaultStopTimeList: [{ value: '', label: '默认' }],
defaultSpeedLevelList: [{ value: '', label: '默认' }], defaultSpeedLevelList: [{ value: '', label: '默认' }],
serialNumberList: [], serialNumberList: []
} };
}, },
computed: { computed: {
title() { title() {
return '修改任务' return '修改任务';
} }
}, },
watch: { watch: {
@ -264,14 +286,14 @@
return formatName(code); return formatName(code);
}, },
computedTimeByString(timeStr) { computedTimeByString(timeStr) {
let bTime = +new Date(`2019-01-01 00:00:00`); const bTime = +new Date(`2019-01-01 00:00:00`);
let eTime = +new Date(`2019-01-01 ${timeStr}`); const eTime = +new Date(`2019-01-01 ${timeStr}`);
return Number(eTime) - Number(bTime); return Number(eTime) - Number(bTime);
}, },
compuntedRunTime(list, index, runLevel) { compuntedRunTime(list, index, runLevel) {
let runTime = 0; let runTime = 0;
if (index < list.length - 1) { if (index < list.length - 1) {
let stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()]; const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
if (stopStationObj) { if (stopStationObj) {
if (stopStationObj.runPlanLevelVO) { if (stopStationObj.runPlanLevelVO) {
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]); runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
@ -287,10 +309,10 @@
this.editModel.arriveConfigList = []; this.editModel.arriveConfigList = [];
if (this.editModel.routingCode) { if (this.editModel.routingCode) {
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.editModel.routingCode }).then(rest => { querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.editModel.routingCode }).then(rest => {
let list = rest.data; const list = rest.data;
let waitTime = this.editModel.defaultStopTime || 30; // const waitTime = this.editModel.defaultStopTime || 30; //
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000 - 30; let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000 - 30;
let runLevel = this.editModel.defaultSpeedLevel || 'level3'; // const runLevel = this.editModel.defaultSpeedLevel || 'level3'; //
list.forEach((elem, index) => { list.forEach((elem, index) => {
elem.arriveTime = index ? formatTime(tempTime) : ''; elem.arriveTime = index ? formatTime(tempTime) : '';
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime); elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
@ -300,13 +322,13 @@
}); });
if (this.editModel.routingList && this.editModel.routingList.length > 0) { if (this.editModel.routingList && this.editModel.routingList.length > 0) {
let row = this.editModel.routingList[0]; const row = this.editModel.routingList[0];
let startSection = this.$store.getters['map/getDeviceByCode'](row.startSectionCode); const startSection = this.$store.getters['map/getDeviceByCode'](row.startSectionCode);
if (startSection && startSection.isReentryTrack) { if (startSection && startSection.isReentryTrack) {
list.shift(); list.shift();
} }
let endSection = this.$store.getters['map/getDeviceByCode'](row.endSectionCode); const endSection = this.$store.getters['map/getDeviceByCode'](row.endSectionCode);
if (endSection && endSection.isReentryTrack) { if (endSection && endSection.isReentryTrack) {
list.pop(); list.pop();
} }
@ -314,41 +336,41 @@
this.editModel.arriveConfigList = list; this.editModel.arriveConfigList = list;
this.editModel.endTime = formatTime(tempTime - waitTime); this.editModel.endTime = formatTime(tempTime - waitTime);
}) });
} }
}, },
loadInitData(params) { loadInitData(params) {
let skinStyle = this.$route.query.skinStyle; const skinStyle = this.$route.query.skinStyle;
this.isPlan = params.isPlan; this.isPlan = params.isPlan;
this.editModel.taskIndex = params.taskIndex; this.editModel.taskIndex = params.taskIndex;
this.editModel.serviceNumber = params.serviceNumber; this.editModel.serviceNumber = params.serviceNumber;
this.editModel.tripNumber = params.tripNumber; this.editModel.tripNumber = params.tripNumber;
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle); this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
let editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber] const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
if (editData) { if (editData) {
let tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex }); const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
let trainInfo = editData.trainMap[tripNumberList[0]]; const trainInfo = editData.trainMap[tripNumberList[0]];
this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime); this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime);
} }
if (skinStyle) { if (skinStyle) {
getStationRunning(skinStyle).then(resp => { getStationRunning(skinStyle).then(resp => {
let list = resp.data; const list = resp.data;
list.forEach(elem => { list.forEach(elem => {
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem; this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
}); });
}) });
} }
let model = { const model = {
planId: this.$route.query.planId, planId: this.$route.query.planId,
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}` SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
} };
this.editModel.routingList = []; this.editModel.routingList = [];
getRoutingBySDTNumber(model).then(resp => { getRoutingBySDTNumber(model).then(resp => {
let routingObj = resp.data; const routingObj = resp.data;
this.editModel.routingCode = routingObj.code; this.editModel.routingCode = routingObj.code;
this.editModel.routingList.push(routingObj); this.editModel.routingList.push(routingObj);
this.computedDetailList(); this.computedDetailList();
@ -371,7 +393,7 @@
endTime: this.editModel.endTime, endTime: this.editModel.endTime,
arriveConfigList: this.editModel.arriveConfigList, arriveConfigList: this.editModel.arriveConfigList,
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}` SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
} };
}, },
handleCommit() { handleCommit() {
if (this.isPlan) { if (this.isPlan) {
@ -380,17 +402,17 @@
// //
updatePlanTrip(this.buildModel()).then(resp => { updatePlanTrip(this.buildModel()).then(resp => {
this.$emit('dispatchOperate', { this.$emit('dispatchOperate', {
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: this.$route.query dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
}); });
this.$message.success('修改任务成功!'); this.$message.success('修改任务成功!');
}).catch(error => { }).catch(() => {
this.$messageBox('修改任务失败'); this.$messageBox('修改任务失败');
}); });
} }
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,9 +1,19 @@
<template> <template>
<el-dialog class="planEdit__tool add-planning-train" :title="title" :visible.sync="dialogShow" :width="width + 'px'" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" append-to-body v-dialogDrag> v-dialogDrag
class="planEdit__tool add-planning-train"
:title="title"
:visible.sync="dialogShow"
:width="width + 'px'"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
append-to-body
>
<el-row> <el-row>
<el-col :span="24" :offset="1"> <el-col :span="24" :offset="1">
<i class="el-icon-warning"></i> <i class="el-icon-warning" />
{{ params.message }} {{ params.message }}
</el-col> </el-col>
</el-row> </el-row>
@ -24,12 +34,12 @@
return { return {
dialogShow: false, dialogShow: false,
loading: false, loading: false,
params: {}, params: {}
} };
}, },
computed: { computed: {
title() { title() {
return 'offline' return 'offline';
}, },
width() { width() {
if (this.params.width) { if (this.params.width) {
@ -55,7 +65,7 @@
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";

View File

@ -1,9 +1,24 @@
<template> <template>
<el-dialog class="planEdit__tool open-runplan" :title="title" :visible.sync="show" width="640px" <el-dialog
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag> v-dialogDrag
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height: height+'px'}"> class="planEdit__tool open-runplan"
<el-tree ref="tree" class="filter-tree" :data="runPlanList" :props="defaultProps" default-expand-all :title="title"
:style="{height: height-20+'px'}"> :visible.sync="show"
width="640px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
<el-tree
ref="tree"
class="filter-tree"
:data="runPlanList"
:props="defaultProps"
default-expand-all
:style="{height: height-20+'px'}"
>
<span slot-scope="{ node, data }"> <span slot-scope="{ node, data }">
<el-radio v-model="planId" :label="data.id"><span>{{ data.name }}</span></el-radio> <el-radio v-model="planId" :label="data.id"><span>{{ data.name }}</span></el-radio>
</span> </span>
@ -17,10 +32,7 @@
</template> </template>
<script> <script>
import { getjointTraining, putJointTrainingSimulationEntrance } from '@/api/chat'; import { getRpListByMapId } from '@/api/runplan';
import { getPublishMapInfo } from '@/api/jmap/map';
import { launchFullscreen } from '@/utils/screen';
import { getStationListBySkinStyle, queryRunPlan, getRpListByMapId } from '@/api/runplan';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
@ -40,9 +52,9 @@
runPlanList: [], runPlanList: [],
runPlanDict: {}, runPlanDict: {},
defaultProps: { defaultProps: {
label: 'name', label: 'name'
}
} }
};
}, },
computed: { computed: {
show() { show() {
@ -50,7 +62,7 @@
}, },
title() { title() {
return '运行图列表'; return '运行图列表';
}, }
}, },
mounted() { mounted() {
this.loadRunPlanData({ this.loadRunPlanData({
@ -60,9 +72,13 @@
}); });
}, },
methods: { methods: {
loadRunPlanData({ planId, skinStyle, planName }) { loadRunPlanData({ refresh, planId, skinStyle, planName }) {
let query = { skinStyle: skinStyle, mapId: this.$route.query.mapId, planId: planId, planName, try: this.$route.query.try, goodsId: this.$route.query.goodsId } if (refresh) {
this.$store.dispatch('runPlan/refresh');
} else {
const query = { skinStyle: skinStyle, mapId: this.$route.query.mapId, planId: planId, planName, try: this.$route.query.try, goodsId: this.$route.query.goodsId };
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query }); this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
}
}, },
doShow() { doShow() {
getRpListByMapId(this.$route.query.mapId).then((resp) => { getRpListByMapId(this.$route.query.mapId).then((resp) => {
@ -71,9 +87,9 @@
this.runPlanDict[elem.id] = elem.name; this.runPlanDict[elem.id] = elem.name;
}); });
this.dialogShow = true; this.dialogShow = true;
}).catch(error => { }).catch(() => {
this.$messageBox('获取运行图列表失败'); this.$messageBox('获取运行图列表失败');
}) });
}, },
doClose() { doClose() {
this.dialogShow = false; this.dialogShow = false;
@ -87,7 +103,7 @@
this.doClose(); this.doClose();
} }
} }
} };
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>

View File

@ -235,6 +235,9 @@ export default {
}); });
this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]); this.$refs.tripTable.setCurrentRow(this.tripNumberConfig.data[index]);
}, },
'$store.state.runPlan.refreshCount': function() {
this.loadChartPage();
},
$route() { $route() {
this.loadChartPage(); this.loadChartPage();
} }