修改运行图接口

This commit is contained in:
ival 2019-08-29 13:52:34 +08:00
parent 30e590afc7
commit 1616639f6f
20 changed files with 1702 additions and 1515 deletions

View File

@ -277,20 +277,14 @@ export function deleteRunPlanTemplate(planId) {
}
/** 生成通用每日运行图*/
export function generateCommonRunPlanEveryDay(planId) {
export function generateCommonRunPlanEveryDay(planId, params) {
return request({
url: `/api/runPlan/template/generate/${planId}`,
method: 'post'
method: 'post',
params
});
}
/** 生成用户每日运行图*/
export function generateUserRunPlanEveryDay(planId, group) {
return request({
url: `/api/runPlan/daily/privilege/${planId}?group=${group}`,
method: 'post'
});
}
/** 获取运行计划每日列表*/
export function runPlanEveryDayList(params) {
return request({
@ -309,20 +303,12 @@ export function deleteRunPlanEveryDay(planId) {
}
/** 获取地图运行图的车次号*/
export function getPublishMapTrainNos(skinCode) {
return request({
url: `/api/runPlan/daily/${skinCode}/trainNos`,
method: 'get'
});
}
/** 获取服务号、车组号*/
export function getPublishMapTrainServerNos(skinCode) {
return request({
url: `/api/runPlan/daily/${skinCode}/serverNos`,
method: 'get'
});
}
// export function getPublishMapTrainNos(skinCode) {
// return request({
// url: `/api/runPlan/daily/${skinCode}/trainNos`,
// method: 'get'
// });
// }
/** 分页查询加载计划*/
export function getRunPlanLoadList(params) {

View File

@ -239,7 +239,7 @@ export function selectScriptMembers(group, data) {
export function modifyScriptMemberSex(group, playerId, data) {
return request({
url: `/api/simulation/${group}/scriptWrite/player/${playerId}?gender=${data.gender}`,
method: 'put',
method: 'put'
});
}
@ -486,3 +486,11 @@ export function executeScript(group) {
method: 'post'
});
}
/** 生成用户自己的当日运行图*/
export function generateDayRunPlan(planId, group) {
return request({
url: `/api/simulation/${group}/loadRunPlan/${planId}`,
method: 'post'
});
}

View File

@ -1,156 +1,165 @@
<template>
<el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
<el-form-item label="车 组 号:" prop="trainNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="fuzhou_01 stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-form-item label="车 组 号:" prop="trainNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.trainNumber" @change="trainNumberChange" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
formModel: {
trainNumber: '',
},
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
formModel: {
trainNumber: ''
},
rules: {
trainNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
},
title() {
return '删除列车识别号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange() {
let operate = {
type: MapDeviceType.Train.type,
val: `${trainNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
}
rules: {
trainNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
},
title() {
return '删除列车识别号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
// getPublishMapTrainNos(map.skinCode).then(response => {
// this.trainNoList = response.data;
// }).catch(() => {
// this.$messageBox(``);
// });
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange() {
const operate = {
type: MapDeviceType.Train.type,
val: `${this.formModel.trainNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.trainNumber
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.trainNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -1,160 +1,169 @@
<template>
<el-dialog class="beijing-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber" @change="inputGroupNumber" :id="domIdInput"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: '',
},
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
title() {
return '删除车组号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
inputGroupNumber() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.input.operation,
val: this.addModel.groupNumber
}
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.delTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
title() {
return '删除车组号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
// getPublishMapTrainNos(map.skinCode).then(response => {
// this.trainNoList = response.data;
// }).catch(() => {
// this.$messageBox(``);
// });
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
inputGroupNumber() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.addModel.groupNumber
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.addModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -18,9 +18,9 @@
</template>
<script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();

View File

@ -1,116 +1,127 @@
<template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input>
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true" />
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker
v-model="model.dateList"
type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog>
</template>
<script>
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: [],
}
}
},
computed: {
title() {
return '创建一周计划'
},
rules() {
let rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
}
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: []
}
};
},
computed: {
title() {
return '创建一周计划';
},
rules() {
const rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
};
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return this.model.dateList.map(date => {
return {
loadTime: date,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
}
});
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(error => {
this.doClose();
this.$messageBox('创建运行图计划失败');
})
}
});
}
}
}
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return {
planDateList: this.model.dateList,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
};
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(() => {
this.doClose();
this.$messageBox('创建运行图计划失败');
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -124,4 +135,4 @@
margin: 10px;
}
}
</style>
</style>

View File

@ -1,122 +1,130 @@
<template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__schedule manage-plan-list"
:title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName',
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
]
},
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName'
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
]
},
currentModel: {}
}
},
computed: {
title() {
return '运行图计划表'
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
currentModel: {}
};
},
computed: {
title() {
return '运行图计划表';
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败')
})
}).catch(() => { })
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload()
}
}
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
});
}).catch(() => { });
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>
</style>

View File

@ -1,143 +1,152 @@
<template>
<el-dialog class="chengdou-03__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="90px" :model="addModel" :rules="rules" ref="form">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="chengdou-03__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="addModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input v-model="addModel.groupNumber" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishMapTrainNos } from '@/api/runplan';
import { mouseCancelState } from '../utils/menuItemStatus';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: '',
},
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
groupNumber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
title() {
return '删除列车识别号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
}
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
title() {
return '删除列车识别号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
// getPublishMapTrainNos(map.skinCode).then(response => {
// this.trainNoList = response.data;
// }).catch(() => {
// this.$messageBox(``);
// });
}
},
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
mouseCancelState(this.selected);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -18,10 +18,9 @@
</template>
<script>
// import { listPublishMap } from '@/api/jmap/mapdraft';
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
@ -101,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();

View File

@ -1,116 +1,127 @@
<template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input>
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true" />
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker
v-model="model.dateList"
type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog>
</template>
<script>
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: [],
}
}
},
computed: {
title() {
return '创建一周计划'
},
rules() {
let rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
}
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: []
}
};
},
computed: {
title() {
return '创建一周计划';
},
rules() {
const rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
};
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return this.model.dateList.map(date => {
return {
loadTime: date,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
}
});
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(error => {
this.doClose();
this.$messageBox('创建运行图计划失败');
})
}
});
}
}
}
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return {
planDateList: this.model.dateList,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
};
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(() => {
this.doClose();
this.$messageBox('创建运行图计划失败');
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -124,4 +135,4 @@
margin: 10px;
}
}
</style>
</style>

View File

@ -1,122 +1,130 @@
<template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__schedule manage-plan-list"
:title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName',
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
]
},
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName'
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
]
},
currentModel: {}
}
},
computed: {
title() {
return '运行图计划表'
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
currentModel: {}
};
},
computed: {
title() {
return '运行图计划表';
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败')
})
}).catch(() => { })
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload()
}
}
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
});
}).catch(() => { });
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>
</style>

View File

@ -1,140 +1,147 @@
<template>
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%"
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<el-row type="flex" justify="center" class="button-group">
<el-button type="primary" @click="handleConfirm" :loading="loading"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row>
</el-dialog>
<el-dialog
v-dialogDrag
:title="title"
class="beijing-01__schedule reload-today-plan"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<el-row type="flex" justify="center" class="button-group">
<el-button type="primary" :loading="loading" @click="handleConfirm"> </el-button>
<el-button @click="dialogShow = false"> </el-button>
</el-row>
</el-dialog>
</template>
<script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin'
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name'])
},
tagType: (row) => { return 'success' }
}
]
},
export default {
name: 'ReloadTodayPlan',
data() {
return {
dialogShow: false,
loading: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
reset: true,
labelWidth: '100px',
queryObject: {
name: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
radioShow: true,
columns: [
{
title: '运行图名称',
prop: 'name'
},
{
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => {
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
},
tagType: (row) => { return 'success'; }
}
]
},
currentModel: {}
}
},
computed: {
title() {
return '加载当天计划'
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
})
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable()
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(error => {
this.loading = false;
this.reloadTable()
this.$messageBox(`生成用户每日运行图失败`);
})
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
let skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
let stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(error => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
})
})
}).catch(error => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload()
}
}
}
currentModel: {}
};
},
computed: {
title() {
return '加载当天计划';
}
},
methods: {
loadInitData() {
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
doShow() {
this.loading = false;
this.dialogShow = true;
this.loadInitData();
},
doClose() {
this.dialogShow = false;
},
queryFunction(params) {
if (this.$store.state.map && this.$store.state.map.map) {
params['skinCode'] = this.$store.getters['map/skinCode'];
}
return runPlanTemplateList(params);
},
//
handleConfirm() {
if (this.$refs && this.$refs.pageRules) {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();
this.doClose();
this.$message.success(`生成用户每日运行图成功`);
}).catch(() => {
this.loading = false;
this.reloadTable();
this.$messageBox(`生成用户每日运行图失败`);
});
} else {
this.$messageBox(`请选择需要加载的运行图`);
}
}
},
loadRunData() {
const skinCode = this.$route.query.skinCode;
this.$store.dispatch('runPlan/clear');
if (skinCode) {
getStationListBySkinCode(skinCode).then(response => {
const stations = response.data;
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
this.$store.dispatch('runPlan/setStations', stations).then(() => {
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
});
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>
</style>

View File

@ -1,116 +1,127 @@
<template>
<el-dialog class="beijing-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input>
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
</el-dialog>
<el-dialog
v-dialogDrag
class="beijing-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true" />
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker
v-model="model.dateList"
type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog>
</template>
<script>
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: [],
}
}
},
computed: {
title() {
return '创建一周计划'
},
rules() {
let rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
}
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: []
}
};
},
computed: {
title() {
return '创建一周计划';
},
rules() {
const rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
};
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return this.model.dateList.map(date => {
return {
loadTime: date,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
}
});
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(error => {
this.doClose();
this.$messageBox('创建运行图计划失败');
})
}
});
}
}
}
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return {
planDateList: this.model.dateList,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
};
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(() => {
this.doClose();
this.$messageBox('创建运行图计划失败');
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -124,4 +135,4 @@
margin: 10px;
}
}
</style>
</style>

View File

@ -1,156 +1,165 @@
<template>
<el-dialog class="fuzhou-01__systerm stand-stop-time" :title="title" :visible.sync="show" width="320px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-form size="small" label-width="90px" :model="formModel" :rules="rules" ref="form">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange"></el-input>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl"></confirm-control>
<notice-info ref="noticeInfo"></notice-info>
</el-dialog>
<el-dialog
v-dialogDrag
class="fuzhou-01__systerm stand-stop-time"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="90px" :model="formModel" :rules="rules">
<el-form-item label="车 组 号:" prop="groupNumber">
<el-input :id="domIdTrainNumber" v-model="formModel.groupNumber" @change="trainNumberChange" />
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<confirm-control ref="confirmControl" />
<notice-info ref="noticeInfo" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo'
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
// import { getPublishMapTrainNos } from '@/api/runplan';
import ConfirmControl from './childDialog/confirmControl';
import NoticeInfo from './childDialog/childDialog/noticeInfo';
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
formModel: {
groupNumber: '',
},
export default {
name: 'TrainDelete',
components: {
ConfirmControl,
NoticeInfo
},
data() {
return {
trainNoList: [],
formModel: {
groupNumber: ''
},
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
],
},
operation: null,
dialogShow: false,
loading: false,
}
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
},
title() {
return '删除列车识别号'
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
})
},
methods: {
loadInitData(map) {
if (map) {
getPublishMapTrainNos(map.skinCode).then(response => {
this.trainNoList = response.data;
}).catch(error => {
this.$messageBox(`获取列车车组号失败`);
});
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange() {
let operate = {
type: MapDeviceType.Train.type,
val: `${groupNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
}
rules: {
groupNumber: [
{ required: true, message: '请输入车组号', trigger: 'blur' }
]
},
operation: null,
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'map'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.delTrainId.menu.domId : '';
},
domIdTrainNumber() {
return this.dialogShow ? OperationEvent.Train.delTrainId.trainNumberChange.domId : '';
},
title() {
return '删除列车识别号';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
loadInitData(map) {
if (map) {
// getPublishMapTrainNos(map.skinCode).then(response => {
// this.trainNoList = response.data;
// }).catch(() => {
// this.$messageBox(``);
// });
}
},
doShow(operate, selected) {
//
if (!this.dialogShow) {
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
this.$store.dispatch('map/setTrainWindowShow', false);
},
trainNumberChange() {
const operate = {
type: MapDeviceType.Train.type,
val: `${this.formModel.groupNumber}`,
operation: OperationEvent.Train.delTrainId.trainNumberChange.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
})
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
let operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.groupNumber
}
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.delTrainId.menu.operation,
val: this.formModel.groupNumber
};
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(error => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
})
} else {
return false;
}
});
},
cancel() {
let operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation,
}
this.loading = true;
this.$store.dispatch('training/next', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow(operate);
});
} else {
return false;
}
});
},
cancel() {
const operate = {
type: MapDeviceType.Train.type,
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(error => { this.doClose(); });
}
}
}
</script>
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => { this.doClose(); });
}
}
};
</script>

View File

@ -18,9 +18,9 @@
</template>
<script>
import { runPlanTemplateList, generateUserRunPlanEveryDay } from '@/api/runplan';
import { runPlanTemplateList } from '@/api/runplan';
import { getStationListBySkinCode } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import { getEveryDayRunPlanData, generateDayRunPlan } from '@/api/simulation';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
@ -100,7 +100,7 @@ export default {
const choose = this.$refs.pageRules.currentChoose();
if (choose && choose.id) {
this.loading = true;
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
generateDayRunPlan(choose.id, this.$route.query.group).then(response => {
this.loading = false;
this.reloadTable();
this.loadRunData();

View File

@ -1,116 +1,127 @@
<template>
<el-dialog class="fuzhou-01__schedule create-week-plan" :title="title" :visible.sync="dialogShow" width="800px"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true"></el-input>
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker type="dates" v-model="model.dateList" :clearable="false" placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm"></choose-template-plan>
</el-dialog>
<el-dialog
v-dialogDrag
class="fuzhou-01__schedule create-week-plan"
:title="title"
:visible.sync="dialogShow"
width="800px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-form ref="form" :model="model" :rules="rules" label-width="140px" size="small">
<el-form-item label="运行图名称:" prop="planId">
<el-row>
<el-col :span="19">
<el-input v-model="model.planName" :readonly="true" />
</el-col>
<el-col :span="4" :offset="1">
<el-button @click="handleChoose">选择 </el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="计划日期范围:" prop="dateList">
<el-row>
<el-date-picker
v-model="model.dateList"
type="dates"
:clearable="false"
placeholder="选择一个或多个日期"
value-format="yyyy-MM-dd"
/>
</el-row>
</el-form-item>
</el-form>
</el-row>
<el-row type="flex" justify="center" class="button-group">
<el-button @click="create"> </el-button>
<el-button @click="doClose"> </el-button>
</el-row>
<choose-template-plan ref="choose" @chooseConfirm="chooseConfirm" />
</el-dialog>
</template>
<script>
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
import { createRunPlanLoad } from '@/api/runplan';
import ChooseTemplatePlan from './chooseTemplatePlan';
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: [],
}
}
},
computed: {
title() {
return '创建一周计划'
},
rules() {
let rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
}
export default {
name: 'CreateWeekPlan',
components: {
ChooseTemplatePlan
},
data() {
return {
dialogShow: false,
loading: false,
model: {
planId: '',
planName: '',
dateList: []
}
};
},
computed: {
title() {
return '创建一周计划';
},
rules() {
const rules = {
planId: [
{ required: true, message: '请选择模板运行图', trigger: 'blur' }
],
dateList: [
{ required: true, message: '请选择计划日期范围', trigger: 'change' }
]
};
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return this.model.dateList.map(date => {
return {
loadTime: date,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
}
});
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(error => {
this.doClose();
this.$messageBox('创建运行图计划失败');
})
}
});
}
}
}
return rules;
}
},
mounted() {
},
methods: {
doShow(params) {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
handleChoose() {
this.$refs.choose.doShow();
},
chooseConfirm(choose) {
if (choose) {
this.model.planId = choose.id;
this.model.planName = choose.name;
}
},
buildModel() {
return {
planDateList: this.model.dateList,
mapId: this.$route.query.mapId,
templatePlanId: this.model.planId
};
},
create() {
this.$refs['form'].validate((valid) => {
if (valid) {
createRunPlanLoad(this.buildModel()).then(response => {
this.$message.success('创建运行图计划成功');
this.$emit('reloadTable', { name: 'managePlanList' });
this.doClose();
}).catch(() => {
this.doClose();
this.$messageBox('创建运行图计划失败');
});
}
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
@ -124,4 +135,4 @@
margin: 10px;
}
}
</style>
</style>

View File

@ -1,122 +1,130 @@
<template>
<el-dialog class="fuzhou-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</el-dialog>
<el-dialog
v-dialogDrag
class="fuzhou-01__schedule manage-plan-list"
:title="title"
:visible.sync="dialogShow"
width="80%"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName',
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
]
},
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName'
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan }
]
},
currentModel: {}
}
},
computed: {
title() {
return '运行图计划表'
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
currentModel: {}
};
},
computed: {
title() {
return '运行图计划表';
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败')
})
}).catch(() => { })
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload()
}
}
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox('删除失败');
});
}).catch(() => { });
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>
</style>

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// 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.6:9000'; // 旭强
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.4:9000' // 琰培
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -1,6 +1,7 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<map-select ref="map" @confirm="handleGenerateEveryDay" />
</div>
</template>
@ -9,9 +10,13 @@ import { superAdmin } from '@/router';
import { getSkinCodeList } from '@/api/management/mapskin';
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
import MapSelect from './mapSelect';
export default {
name: 'RunPlanTemplate',
components: {
MapSelect
},
data() {
return {
skinCodeList: [],
@ -71,7 +76,7 @@ export default {
},
{
name: this.$t('publish.generateRunPlan'),
handleClick: this.handleGenerateEveryDay,
handleClick: this.handleMapSelect,
type: ''
},
{
@ -120,15 +125,20 @@ export default {
});
}).catch(() => { });
},
//
handleMapSelect(index, row) {
this.$refs.map.doShow(row);
},
//
handleGenerateEveryDay(index, row) {
handleGenerateEveryDay({planId, mapId}) {
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
generateCommonRunPlanEveryDay(row.id).then(response => {
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
this.reloadTable();
this.$refs.map.doClose();
this.$message.success(this.$t('publish.createCommonSuccess'));
}).catch(() => {
this.reloadTable();

View File

@ -0,0 +1,73 @@
<template>
<el-dialog
:title="title"
:visible.sync="show"
width="30%"
:before-close="doClose"
>
<el-form ref="form" :model="formMdoel" :rules="rules" label-width="80px">
<el-form-item :label="$t('publish.selectMap')" prop="mapId">
<el-select v-model="formMdoel.mapId" :placeholder="$t('rules.mapInput')">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="handleCofirm">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPublishMapListBySkinCode } from '@/api/jmap/map';
export default {
data() {
return {
show: false,
mapList: [],
formMdoel: {
planId: 0,
mapId: ''
}
};
},
computed: {
title() {
return this.$t('publish.selectMap');
},
rules() {
return {
mapId: [
{ required: true, message: this.$t('rules.mapInput'), trigger: 'blur' }
]
};
}
},
methods: {
doShow(row) {
this.formMdoel.planId = row.id;
this.show = true;
getPublishMapListBySkinCode(row.skinCode).then(resp => {
this.mapList = resp.data;
});
},
doClose(done) {
this.show = false;
},
handleCofirm() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.$emit('confirm', this.formMdoel);
}
});
}
}
};
</script>