Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
3636bd06b4
File diff suppressed because it is too large
Load Diff
@ -4,8 +4,8 @@ export function getBaseUrl() {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://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.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||
} else {
|
||||
BASE_API = process.env.VUE_APP_BASE_API;
|
||||
|
@ -118,6 +118,7 @@ export default {
|
||||
this.refresh(data);
|
||||
} else {
|
||||
this.courseModel.skinCode = this.$route.query.skinCode;
|
||||
this.courseModel.mapId = this.$route.query.mapId;
|
||||
}
|
||||
getCommodityMapProduct(this.$route.query.mapId).then(response => {
|
||||
this.productList = response.data || [];
|
||||
@ -136,6 +137,7 @@ export default {
|
||||
skinCode: this.courseModel.skinCode,
|
||||
prdCode: this.courseModel.prdCode,
|
||||
name: this.courseModel.name,
|
||||
mapId: this.courseModel.mapId,
|
||||
remarks: this.courseModel.remarks
|
||||
};
|
||||
createLesson(model).then(response => {
|
||||
@ -156,6 +158,7 @@ export default {
|
||||
skinCode: this.courseModel.skinCode,
|
||||
prdCode: this.courseModel.prdCode,
|
||||
name: this.courseModel.name,
|
||||
mapId: this.courseModel.mapId,
|
||||
remarks: this.courseModel.remarks
|
||||
};
|
||||
updateLesson(model).then(response => {
|
||||
|
@ -10,17 +10,17 @@
|
||||
|
||||
<script>
|
||||
import { addAutoGenerateTask } from '@/api/management/task';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
name: 'CreateTask',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
skinCodeList: [],
|
||||
mapIdList: [],
|
||||
taskStatusList: [],
|
||||
formModel: {
|
||||
parameter: this.$route.query.skinCode,
|
||||
parameter: this.$route.query.mapId,
|
||||
type: '01'
|
||||
},
|
||||
isShow: false
|
||||
@ -32,7 +32,7 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'parameter', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true }
|
||||
{ prop: 'parameter', label: this.$t('lesson.mapName'), type: 'select', required: true, options: this.mapIdList, disabled: true }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -54,11 +54,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapIdList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
});
|
||||
|
||||
this.taskStatusList = [];
|
||||
this.$Dictionary.taskStatus().then(list => {
|
||||
this.taskStatusList = list.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
@ -75,7 +74,7 @@ export default {
|
||||
},
|
||||
doClose() {
|
||||
this.formModel = {
|
||||
parameter: this.$route.query.skinCode,
|
||||
parameter: this.$route.query.mapId,
|
||||
type: '01'
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<script>
|
||||
import { getTaskList, postTask, postTaskCancel } from '@/api/management/task';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import CreateTask from './createTask';
|
||||
|
||||
export default {
|
||||
@ -22,7 +22,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
skinCodeList: [],
|
||||
mapIdList: [],
|
||||
taskList: [],
|
||||
taskStatusList: [],
|
||||
pagerConfig: {
|
||||
@ -47,10 +47,10 @@ export default {
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('lesson.skinType'),
|
||||
title: this.$t('lesson.mapName'),
|
||||
prop: 'parameter',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.parameter, this.skinCodeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.parameter, this.mapIdList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -116,11 +116,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
|
||||
this.taskStatusList = [];
|
||||
this.$Dictionary.taskStatus().then(list => {
|
||||
this.taskStatusList = list;
|
||||
|
@ -232,6 +232,7 @@ export default {
|
||||
importRunPlan({ mapId: that.$route.params.mapId || '02', runPlanList: jsonData }).then(response => {
|
||||
that.loadingDig.close();
|
||||
that.$message.success(that.$t('tip.importOperationGraphSuccessfully'));
|
||||
that.$emit('refresh');
|
||||
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||
}).catch(error => {
|
||||
that.loadingDig.close();
|
||||
|
@ -225,201 +225,201 @@ import { getRoutingBySDTNumber, querySectionListByRouting, getStationRunning, up
|
||||
import { formatTime, formatName } from '@/utils/runPlan';
|
||||
|
||||
export default {
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
isPlan: false,
|
||||
PlanConvert: {},
|
||||
stopStationMap: {},
|
||||
editModel: {
|
||||
taskIndex: '',
|
||||
routingCode: '',
|
||||
defaultStopTime: '',
|
||||
defaultSpeedLevel: '',
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
startTime: '00:00:00',
|
||||
endTime: '',
|
||||
routingList: [],
|
||||
arriveConfigList: [],
|
||||
name: 'ModifyingTask',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
isPlan: false,
|
||||
PlanConvert: {},
|
||||
stopStationMap: {},
|
||||
editModel: {
|
||||
taskIndex: '',
|
||||
routingCode: '',
|
||||
defaultStopTime: '',
|
||||
defaultSpeedLevel: '',
|
||||
tripNumber: '',
|
||||
serviceNumber: '',
|
||||
startTime: '00:00:00',
|
||||
endTime: '',
|
||||
routingList: [],
|
||||
arriveConfigList: [],
|
||||
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false
|
||||
},
|
||||
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
|
||||
defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyTask');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'editModel.startTime': function () {
|
||||
this.computedDetailList();
|
||||
},
|
||||
'editModel.defaultStopTime': function () {
|
||||
this.computedDetailList();
|
||||
},
|
||||
'editModel.defaultSpeedLevel': function () {
|
||||
this.computedDetailList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
computedTimeByString(timeStr) {
|
||||
const bTime = +new Date(`2019-01-01 00:00:00`);
|
||||
const eTime = +new Date(`2019-01-01 ${timeStr}`);
|
||||
return Number(eTime) - Number(bTime);
|
||||
},
|
||||
compuntedRunTime(list, index, runLevel) {
|
||||
let runTime = 0;
|
||||
if (index < list.length - 1) {
|
||||
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
|
||||
if (stopStationObj) {
|
||||
if (stopStationObj.runPlanLevelVO) {
|
||||
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
|
||||
} else {
|
||||
// this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
|
||||
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
serialNumber: '',
|
||||
trainManual: false,
|
||||
serialManual: false,
|
||||
clearGuest: false,
|
||||
continuationPlan: false,
|
||||
firstTrain: false,
|
||||
lastTrain: false,
|
||||
inStock: false,
|
||||
outStock: false
|
||||
},
|
||||
tripNumberList: [{ value: '', label: this.$t('planMonitor.modifying.automatic') }],
|
||||
defaultStopTimeList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
defaultSpeedLevelList: [{ value: '', label: this.$t('planMonitor.modifying.default') }],
|
||||
serialNumberList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('planMonitor.modifying.modifyTask');
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'editModel.startTime': function () {
|
||||
this.computedDetailList();
|
||||
},
|
||||
'editModel.defaultStopTime': function () {
|
||||
this.computedDetailList();
|
||||
},
|
||||
'editModel.defaultSpeedLevel': function () {
|
||||
this.computedDetailList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatTime(time) {
|
||||
return formatTime(time);
|
||||
},
|
||||
formatName(code) {
|
||||
return formatName(code);
|
||||
},
|
||||
computedTimeByString(timeStr) {
|
||||
const bTime = +new Date(`2019-01-01 00:00:00`);
|
||||
const eTime = +new Date(`2019-01-01 ${timeStr}`);
|
||||
return Number(eTime) - Number(bTime);
|
||||
},
|
||||
compuntedRunTime(list, index, runLevel) {
|
||||
let runTime = 0;
|
||||
if (index < list.length - 1) {
|
||||
const stopStationObj = this.stopStationMap[[list[index].sectionCode, list[index + 1].sectionCode].toString()];
|
||||
if (stopStationObj) {
|
||||
if (stopStationObj.runPlanLevelVO) {
|
||||
runTime = parseInt(stopStationObj.runPlanLevelVO[runLevel]);
|
||||
} else {
|
||||
// this.$messageBox(`${this.$t('planMonitor.modifying.setMessageTip1')} ${stopStationObj.startSectionCode} ${this.$t('planMonitor.modifying.setMessageTip2')} ${stopStationObj.endSectionCode} ${this.$t('planMonitor.modifying.setMessageTip3')}`);
|
||||
this.$alert(`${this.$t('planMonitor.tipOperationTime')}`, {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
callback: action => {
|
||||
this.doClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return runTime;
|
||||
},
|
||||
computedDetailList() {
|
||||
this.editModel.arriveConfigList = [];
|
||||
if (this.editModel.routingCode) {
|
||||
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.editModel.routingCode }).then(rest => {
|
||||
const list = rest.data;
|
||||
const waitTime = this.editModel.defaultStopTime || 30; // 默认三十秒
|
||||
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000 - 30;
|
||||
const runLevel = this.editModel.defaultSpeedLevel || 'level3'; // 默认等级三
|
||||
list.forEach((elem, index) => {
|
||||
elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
|
||||
elem.stopTime = this.editModel.defaultSpeedLevel || this.$t('planMonitor.modifying.default');
|
||||
elem.speedLevel = this.editModel.defaultStopTime || this.$t('planMonitor.modifying.default');
|
||||
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
|
||||
});
|
||||
return runTime;
|
||||
},
|
||||
computedDetailList() {
|
||||
this.editModel.arriveConfigList = [];
|
||||
if (this.editModel.routingCode) {
|
||||
querySectionListByRouting({ planId: this.$route.query.planId, routingCode: this.editModel.routingCode }).then(rest => {
|
||||
const list = rest.data;
|
||||
const waitTime = this.editModel.defaultStopTime || 30; // 默认三十秒
|
||||
let tempTime = this.computedTimeByString(this.editModel.startTime) / 1000 - 30;
|
||||
const runLevel = this.editModel.defaultSpeedLevel || 'level3'; // 默认等级三
|
||||
list.forEach((elem, index) => {
|
||||
elem.arriveTime = index ? formatTime(tempTime) : '';
|
||||
elem.departureTime = index == list.length - 1 ? '' : formatTime(tempTime + waitTime);
|
||||
elem.stopTime = this.editModel.defaultSpeedLevel || this.$t('planMonitor.modifying.default');
|
||||
elem.speedLevel = this.editModel.defaultStopTime || this.$t('planMonitor.modifying.default');
|
||||
tempTime = tempTime + waitTime + this.compuntedRunTime(list, index, runLevel);
|
||||
});
|
||||
|
||||
if (this.editModel.routingList && this.editModel.routingList.length > 0) {
|
||||
const row = this.editModel.routingList[0];
|
||||
const startSection = this.$store.getters['map/getDeviceByCode'](row.startSectionCode);
|
||||
if (startSection && startSection.isReentryTrack) {
|
||||
list.shift();
|
||||
}
|
||||
if (this.editModel.routingList && this.editModel.routingList.length > 0) {
|
||||
const row = this.editModel.routingList[0];
|
||||
const startSection = this.$store.getters['map/getDeviceByCode'](row.startSectionCode);
|
||||
if (startSection && startSection.isReentryTrack) {
|
||||
list.shift();
|
||||
}
|
||||
|
||||
const endSection = this.$store.getters['map/getDeviceByCode'](row.endSectionCode);
|
||||
if (endSection && endSection.isReentryTrack) {
|
||||
list.pop();
|
||||
}
|
||||
}
|
||||
const endSection = this.$store.getters['map/getDeviceByCode'](row.endSectionCode);
|
||||
if (endSection && endSection.isReentryTrack) {
|
||||
list.pop();
|
||||
}
|
||||
}
|
||||
|
||||
this.editModel.arriveConfigList = list;
|
||||
this.editModel.endTime = formatTime(tempTime - waitTime);
|
||||
});
|
||||
}
|
||||
},
|
||||
loadInitData(params) {
|
||||
const skinCode = this.$route.query.skinCode;
|
||||
const mapId = this.$route.query.mapId;
|
||||
this.isPlan = params.isPlan;
|
||||
this.editModel.taskIndex = params.taskIndex;
|
||||
this.editModel.serviceNumber = params.serviceNumber;
|
||||
this.editModel.tripNumber = params.tripNumber;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
|
||||
this.editModel.arriveConfigList = list;
|
||||
this.editModel.endTime = formatTime(tempTime - waitTime);
|
||||
});
|
||||
}
|
||||
},
|
||||
loadInitData(params) {
|
||||
const skinCode = this.$route.query.skinCode;
|
||||
const mapId = this.$route.query.mapId;
|
||||
this.isPlan = params.isPlan;
|
||||
this.editModel.taskIndex = params.taskIndex;
|
||||
this.editModel.serviceNumber = params.serviceNumber;
|
||||
this.editModel.tripNumber = params.tripNumber;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinCode);
|
||||
|
||||
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
||||
if (editData) {
|
||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||
const trainInfo = editData.trainMap[tripNumberList[0]];
|
||||
this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime);
|
||||
}
|
||||
const editData = this.$store.state.runPlan.editData[this.editModel.serviceNumber];
|
||||
if (editData) {
|
||||
const tripNumberList = Object.keys(editData.trainMap).sort((a, b) => { return editData.trainMap[a].oldIndex - editData.trainMap[b].oldIndex; });
|
||||
const trainInfo = editData.trainMap[tripNumberList[0]];
|
||||
this.editModel.startTime = formatTime(trainInfo.stationTimeList[0].secondTime + this.PlanConvert.TranslationTime);
|
||||
}
|
||||
|
||||
if (mapId) {
|
||||
getStationRunning(mapId).then(resp => {
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
|
||||
});
|
||||
});
|
||||
}
|
||||
if (mapId) {
|
||||
getStationRunning(mapId).then(resp => {
|
||||
const list = resp.data;
|
||||
list.forEach(elem => {
|
||||
this.stopStationMap[[elem.startSectionCode, elem.endSectionCode].toString()] = elem;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const model = {
|
||||
planId: this.$route.query.planId,
|
||||
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
|
||||
};
|
||||
const model = {
|
||||
planId: this.$route.query.planId,
|
||||
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
|
||||
};
|
||||
|
||||
this.editModel.routingList = [];
|
||||
getRoutingBySDTNumber(model).then(resp => { // 根据车次号查询交路
|
||||
const routingObj = resp.data;
|
||||
this.editModel.routingCode = routingObj.code;
|
||||
this.editModel.routingList.push(routingObj);
|
||||
this.computedDetailList();
|
||||
});
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planId: this.$route.query.planId,
|
||||
routingCode: this.editModel.routingCode,
|
||||
tripNumber: this.editModel.tripNumber,
|
||||
startTime: this.editModel.startTime,
|
||||
endTime: this.editModel.endTime,
|
||||
arriveConfigList: this.editModel.arriveConfigList,
|
||||
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
|
||||
};
|
||||
},
|
||||
handleCommit() {
|
||||
if (this.isPlan) {
|
||||
// 计划修改任务
|
||||
} else {
|
||||
// 直接修改
|
||||
updatePlanTrip(this.buildModel()).then(resp => {
|
||||
this.$emit('dispatchOperate', {
|
||||
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
});
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('planMonitor.modifying.modifyTaskFailed'));
|
||||
});
|
||||
}
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
this.editModel.routingList = [];
|
||||
getRoutingBySDTNumber(model).then(resp => { // 根据车次号查询交路
|
||||
const routingObj = resp.data;
|
||||
this.editModel.routingCode = routingObj.code;
|
||||
this.editModel.routingList.push(routingObj);
|
||||
this.computedDetailList();
|
||||
});
|
||||
},
|
||||
doShow(params) {
|
||||
this.loadInitData(params);
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
buildModel() {
|
||||
return {
|
||||
planId: this.$route.query.planId,
|
||||
routingCode: this.editModel.routingCode,
|
||||
tripNumber: this.editModel.tripNumber,
|
||||
startTime: this.editModel.startTime,
|
||||
endTime: this.editModel.endTime,
|
||||
arriveConfigList: this.editModel.arriveConfigList,
|
||||
SDTNumber: `${this.editModel.serviceNumber}${this.editModel.tripNumber}`
|
||||
};
|
||||
},
|
||||
handleCommit() {
|
||||
if (this.isPlan) {
|
||||
// 计划修改任务
|
||||
} else {
|
||||
// 直接修改
|
||||
updatePlanTrip(this.buildModel()).then(resp => {
|
||||
this.$emit('dispatchOperate', {
|
||||
dialogName: 'openRunPlan', operate: 'loadRunPlanData', params: Object.assign({refresh: true}, this.$route.query)
|
||||
});
|
||||
this.$message.success(this.$t('planMonitor.modifying.modifyTaskSuccess'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('planMonitor.modifying.modifyTaskFailed'));
|
||||
});
|
||||
}
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="30%" :before-close="doClose">
|
||||
<el-form ref="form" :model="formMdoel" :rules="rules" label-width="140px">
|
||||
<el-form-item :label="$t('publish.selectSkinCode')" prop="skinCode">
|
||||
<el-select v-model="formMdoel.skinCode">
|
||||
<el-form-item :label="$t('publish.selectMap')" prop="mapId">
|
||||
<el-select v-model="formMdoel.mapId">
|
||||
<el-option
|
||||
v-for="item in skinCodeList"
|
||||
:key="item.code"
|
||||
v-for="item in mapIdList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:value="item.id"
|
||||
:disabled="item.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
@ -24,16 +24,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
skinCodeList: [],
|
||||
mapIdList: [],
|
||||
formMdoel: {
|
||||
id: 0,
|
||||
skinCode: '',
|
||||
name: '',
|
||||
mapId: ''
|
||||
}
|
||||
@ -45,8 +44,8 @@ export default {
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
skinCode: [
|
||||
{ required: true, message: this.$t('publish.selectSkinCode'), trigger: 'change' }
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('publish.selectMap'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('publish.enterRunPlanName'), trigger: 'blur' }
|
||||
@ -57,16 +56,15 @@ export default {
|
||||
methods: {
|
||||
doShow(row) {
|
||||
this.formMdoel.id = row.id;
|
||||
this.formMdoel.skinCode = '';
|
||||
this.formMdoel.name = row.name;
|
||||
this.formMdoel.mapId = row.mapId;
|
||||
this.formMdoel.mapId = '';
|
||||
this.show = true;
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
if (this.skinCodeList.length) {
|
||||
this.skinCodeList.forEach(item => {
|
||||
listPublishMap().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
if (this.mapIdList.length) {
|
||||
this.mapIdList.forEach(item => {
|
||||
item.disabled = false;
|
||||
if (item.code == row.skinCode) {
|
||||
if (item.id === row.mapId) {
|
||||
item.disabled = true;
|
||||
}
|
||||
});
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<script>
|
||||
import { superAdmin } from '@/router';
|
||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import MapSelect from './mapSelect';
|
||||
@ -35,9 +35,9 @@ export default {
|
||||
type: 'text',
|
||||
label: this.$t('publish.runPlanName')
|
||||
},
|
||||
skinCode: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('publish.skinType'),
|
||||
label: this.$t('publish.mapName'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
@ -54,11 +54,11 @@ export default {
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.skinType'),
|
||||
prop: 'skinCode',
|
||||
title: this.$t('publish.mapName'),
|
||||
prop: 'mapId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
return this.$convertField(row.mapId, this.mapIdList, ['id', 'name']);
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
@ -96,8 +96,8 @@ export default {
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
currentModel: {},
|
||||
mapIdList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -105,11 +105,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
this.mapIdList = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.skinCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
});
|
||||
},
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user