Merge branch 'dev' of https://git.code.tencent.com/lian-cbtc/jl-client into dev
This commit is contained in:
commit
de7a47d0f4
@ -21,6 +21,15 @@ export function getStationList(mapId) {
|
||||
});
|
||||
}
|
||||
|
||||
// 创建通用运行图
|
||||
export function createRunPlan(mapId, data) {
|
||||
return request({
|
||||
url: `/api/runPlan/draft/${mapId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建运行图
|
||||
*/
|
||||
|
@ -97,6 +97,13 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<template v-else-if="checkFieldType(item, 'checkBox')">
|
||||
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
|
||||
<el-radio-group v-model="formModel[item.prop]">
|
||||
<el-radio v-for="item in item.children" :key="item.value" :label="item.value">{{item.name}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else-if="checkFieldType(item, 'radio')">
|
||||
<el-form-item :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
|
||||
<el-radio-group
|
||||
|
@ -8,7 +8,8 @@ export function getBaseUrl() {
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ export default {
|
||||
list.forEach((elem, index) => {
|
||||
elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
|
||||
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? this.$t('planMonitor.default') : '';
|
||||
elem.speedLevel = this.addModel.defaultSpeedLevel == 'level3' ? `${this.$t('planMonitor.default')}(等级三)` : '';
|
||||
elem.stopTime = this.addModel.defaultStopTime != '0' ? 30 : 0;
|
||||
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
|
||||
});
|
||||
|
@ -4,7 +4,7 @@
|
||||
class="planEdit__tool duplicate-train"
|
||||
:title="title"
|
||||
:visible.sync="dialogShow"
|
||||
width="420px"
|
||||
width="500px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
@ -19,37 +19,47 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getStationList, createRunPlan } from '@/api/runplan';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
stationList: [],
|
||||
formModel: {
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
departTime: 180, // 发车时间
|
||||
stopTime: 30, //
|
||||
},
|
||||
form: {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'startTime', label: '开始时间', type: 'timePicker'},
|
||||
{ prop: 'endTime', label: '结束时间', type: 'timePicker'},
|
||||
{ prop: 'departTime', label: '发车间隔', type: 'number'},
|
||||
{ prop: 'stopTime', label: '停站时间', type: 'number'}
|
||||
]
|
||||
stationRunningTime: 60, // 站间运行时间
|
||||
right: 3, // 是否向右发车 不填未同时发车
|
||||
beginTime: '',
|
||||
overTime: '',
|
||||
departureTimeInterval: 180, // 发车间隔时间
|
||||
parkedTime: 30, // 停止时间
|
||||
reentryTime: 60, // 折返时间
|
||||
startStationCode: '',
|
||||
endStationCode: ''
|
||||
},
|
||||
|
||||
rules: {
|
||||
startTime: [
|
||||
beginTime: [
|
||||
{ required: true, message: '请填写开始时间', trigger: 'blur' }
|
||||
],
|
||||
endTime: [
|
||||
overTime: [
|
||||
{ required: true, message: '请填写结束时间', trigger: 'blur' }
|
||||
],
|
||||
departTime: [
|
||||
departureTimeInterval: [
|
||||
{ required: true, message: '请填写发车间隔', trigger: 'blur' }
|
||||
],
|
||||
stopTime: [
|
||||
parkedTime: [
|
||||
{ required: true, message: '请填写停站时间', trigger: 'blur' }
|
||||
],
|
||||
reentryTime: [
|
||||
{ required: true, message: '请填写折返时间', trigger: 'blur' }
|
||||
],
|
||||
startStationCode: [
|
||||
{ required: true, message: '请选择起始站', trigger: 'change' }
|
||||
],
|
||||
endStationCode: [
|
||||
{ required: true, message: '请选择终止站', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -57,18 +67,61 @@ export default {
|
||||
computed: {
|
||||
title() {
|
||||
return '创建运行图';
|
||||
}
|
||||
},
|
||||
},
|
||||
form() {
|
||||
return {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'beginTime', label: '开始时间', type: 'timePicker'},
|
||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker'},
|
||||
{ prop: 'departureTimeInterval', label: '发车间隔', type: 'number'},
|
||||
{ prop: 'parkedTime', label: '停站时间', type: 'number'},
|
||||
{ prop: 'reentryTime', label: '折返时间', type: 'number'},
|
||||
{ prop: 'right', label: '发车类型', type: 'checkBox', children: [
|
||||
{ name: '上行发车', value: 1 },
|
||||
{ name: '下次发车', value: 2 },
|
||||
{ name: '同时发车', value: 3 }
|
||||
] },
|
||||
{ prop: 'startStationCode', label: '起始站', type: 'select', options: this.stationList },
|
||||
{ prop: 'endStationCode', label: '终止站', type: 'select', options: this.stationList }
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const mapId = this.$route.query.mapId;
|
||||
if (mapId) {
|
||||
getStationList(mapId).then(response => {
|
||||
this.stationList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(params) {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleCommit() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
console.log(this.formModel);
|
||||
if (this.formModel.right == 1) {
|
||||
this.formModel.right = true
|
||||
} else if (this.formModel.right == 2) {
|
||||
this.formModel.right = false
|
||||
} else {
|
||||
this.formModel.right = null;
|
||||
}
|
||||
createRunPlan(this.$route.query.mapId, this.formModel).then(res => {
|
||||
console.log(res);
|
||||
this.doClose()
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
})
|
||||
});
|
||||
},
|
||||
// 转换时间格式
|
||||
|
Loading…
Reference in New Issue
Block a user