Merge branch 'dev' of https://git.cloud.tencent.com/joylink/jl-nclient into dev
This commit is contained in:
commit
e24a0e1b4d
@ -72,9 +72,24 @@ export function queryRunPlan(planId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// 根据skinCode查询发布运行图列表
|
||||||
* 删除运行图
|
export function queryRunPlanList(skinCode) {
|
||||||
*/
|
return request({
|
||||||
|
url: `/api/runPlan/template/skin/${skinCode}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从发布运行图创建新运行图
|
||||||
|
export function postCreatePlan(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/runPlan/draft/createFrom/${data.templateId}`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除运行图
|
||||||
export function deleteRunPlan(planId) {
|
export function deleteRunPlan(planId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/runPlan/draft/${planId}`,
|
url: `/api/runPlan/draft/${planId}`,
|
||||||
@ -82,6 +97,15 @@ export function deleteRunPlan(planId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改运行图内容
|
||||||
|
export function putRunPlanDetail(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/runPlan/draft/${data.planId}`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布运行图
|
* 发布运行图
|
||||||
*/
|
*/
|
||||||
@ -204,15 +228,6 @@ export function duplicateService(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改计划*/
|
|
||||||
// export function updatePlanService(data) {
|
|
||||||
// return request({
|
|
||||||
// url: `/api/runPlan/draft/${data.planId}/service/${data.serviceNumber}`,
|
|
||||||
// method: 'put',
|
|
||||||
// data: data
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
/** 增加任务*/
|
/** 增加任务*/
|
||||||
export function addPlanTrip(data) {
|
export function addPlanTrip(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -110,8 +110,15 @@ class MouseController extends Eventful {
|
|||||||
this._draggingName='simple';
|
this._draggingName='simple';
|
||||||
} else if (this.isAllowDragging&&e.target.parent.getName()=='group') {
|
} else if (this.isAllowDragging&&e.target.parent.getName()=='group') {
|
||||||
this._draggingName='group';
|
this._draggingName='group';
|
||||||
|
this._offsetX=e.offsetX;
|
||||||
|
this._offsetY=e.offsetY;
|
||||||
|
// debugger;
|
||||||
|
// this._draggingTarget.parent.model.point
|
||||||
|
|
||||||
} else if (this.isAllowDragging&&e.target.parent.getName()=='group_child') {
|
} else if (this.isAllowDragging&&e.target.parent.getName()=='group_child') {
|
||||||
this._draggingName='group_child';
|
this._draggingName='group_child';
|
||||||
|
this._offsetX=e.offsetX;
|
||||||
|
this._offsetY=e.offsetY;
|
||||||
}
|
}
|
||||||
this._draggingTarget = draggingTarget;
|
this._draggingTarget = draggingTarget;
|
||||||
// draggingTarget.dragging = true;
|
// draggingTarget.dragging = true;
|
||||||
@ -157,6 +164,9 @@ class MouseController extends Eventful {
|
|||||||
} else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group'||this._draggingName=='group_child')) {
|
} else if (this.isAllowDragging&&this._draggingTarget&&(this._draggingName=='group'||this._draggingName=='group_child')) {
|
||||||
// debugger;
|
// debugger;
|
||||||
if (this._draggingName=='group') {
|
if (this._draggingName=='group') {
|
||||||
|
// this._draggingTarget.parent.model.point.x+=dx;
|
||||||
|
// this._draggingTarget.parent.model.point.y+=dy;
|
||||||
|
// this._draggingTarget.parent.dirty();
|
||||||
this._draggingTarget.parent.drift(dx, dy, e);
|
this._draggingTarget.parent.drift(dx, dy, e);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -175,6 +185,17 @@ class MouseController extends Eventful {
|
|||||||
// debugger;
|
// debugger;
|
||||||
const draggingTarget = this._draggingTarget;
|
const draggingTarget = this._draggingTarget;
|
||||||
if (!eventTool.notLeftMouse(e)&&draggingTarget) {
|
if (!eventTool.notLeftMouse(e)&&draggingTarget) {
|
||||||
|
if (this._draggingName=='simple') {
|
||||||
|
console.log();
|
||||||
|
} else if (this._draggingName=='group'||this._draggingName=='group_child') {
|
||||||
|
if (this._draggingName=='group') {
|
||||||
|
this._draggingTarget.parent.setModal(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||||
|
this._draggingTarget.parent.dirty();
|
||||||
|
} else {
|
||||||
|
this._draggingTarget.parent.parent.parent.setModal(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||||
|
this._draggingTarget.parent.parent.dirty();
|
||||||
|
}
|
||||||
|
}
|
||||||
this._dragging = false;
|
this._dragging = false;
|
||||||
this._draggingTarget = null;
|
this._draggingTarget = null;
|
||||||
this._draggingName=='';
|
this._draggingName=='';
|
||||||
|
@ -28,6 +28,7 @@ export default class clock extends Group {
|
|||||||
this.initTime = 0;
|
this.initTime = 0;
|
||||||
this.name='group';
|
this.name='group';
|
||||||
this.create();
|
this.create();
|
||||||
|
|
||||||
}
|
}
|
||||||
create() {
|
create() {
|
||||||
this.clockBg = new Image({
|
this.clockBg = new Image({
|
||||||
@ -263,4 +264,18 @@ export default class clock extends Group {
|
|||||||
getName() {
|
getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
setModal(dx, dy) {
|
||||||
|
// debugger;
|
||||||
|
// this.parent.dirty();
|
||||||
|
//
|
||||||
|
// this.model.point.x+=dx;
|
||||||
|
// this.model.point.y+=dy;
|
||||||
|
// this.eachChild(function(child) {
|
||||||
|
// // // debugger;
|
||||||
|
// child.style.x+=dx;
|
||||||
|
// child.style.y+=dy;
|
||||||
|
// // child.dirty();
|
||||||
|
// }, this.parent);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,4 +102,8 @@ export default class elevator extends Group {
|
|||||||
// this.grouper.attr('draggable', true);
|
// this.grouper.attr('draggable', true);
|
||||||
// this.createMouseEvent();
|
// this.createMouseEvent();
|
||||||
}
|
}
|
||||||
|
setModal(dx, dy) {
|
||||||
|
this.model.point.x+=dx;
|
||||||
|
this.model.point.y+=dy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,6 +153,7 @@ class Jlmap {
|
|||||||
const type = elem._type;
|
const type = elem._type;
|
||||||
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
|
||||||
const nDevice = Object.assign(oDevice || {}, elem);
|
const nDevice = Object.assign(oDevice || {}, elem);
|
||||||
|
console.log(oDevice, nDevice, 111);
|
||||||
this.$painter.delete(oDevice);
|
this.$painter.delete(oDevice);
|
||||||
if (!elem._dispose) {
|
if (!elem._dispose) {
|
||||||
this.mapDevice[code] = nDevice;
|
this.mapDevice[code] = nDevice;
|
||||||
|
@ -3,8 +3,8 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
||||||
} else {
|
} else {
|
||||||
|
@ -439,11 +439,24 @@ export default {
|
|||||||
edit() {
|
edit() {
|
||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const model = Object.assign({_type: 'Link'}, this.editModel);
|
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||||
this.$emit('addOrUpdateMapModel', model);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
buildEditModel() {
|
||||||
|
const model = {
|
||||||
|
_type: 'Link',
|
||||||
|
code: this.editModel.code,
|
||||||
|
name: this.editModel.name,
|
||||||
|
color: this.editModel.color == '' ? '#4e8de6' : this.editModel.color,
|
||||||
|
leftFdCode: this.editModel.leftFdCode,
|
||||||
|
leftSdCode: this.editModel.leftSdCode,
|
||||||
|
rightFdCode: this.editModel.rightFdCode,
|
||||||
|
rightSdCode: this.editModel.rightSdCode,
|
||||||
|
lengthFact: this.editModel.lengthFact
|
||||||
|
};
|
||||||
|
return model;
|
||||||
|
},
|
||||||
// 删除对象
|
// 删除对象
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||||
|
@ -312,8 +312,6 @@ export default {
|
|||||||
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
|
{ prop: 'destinationCodePoint.y', firstLevel: 'destinationCodePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px'}
|
||||||
] },
|
] },
|
||||||
{ prop: 'destinationCodeShow', label: this.$t('map.destinationCodeShow'), type: 'checkbox', isHidden: !this.isdestinationCode },
|
{ prop: 'destinationCodeShow', label: this.$t('map.destinationCodeShow'), type: 'checkbox', isHidden: !this.isdestinationCode },
|
||||||
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
|
||||||
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
|
||||||
|
|
||||||
{ prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isSectionType },
|
{ prop: 'isSwitchSection', label: this.$t('map.isSwitchSection'), type: 'checkbox', isHidden: !this.isSectionType },
|
||||||
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true },
|
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true },
|
||||||
@ -340,6 +338,8 @@ export default {
|
|||||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
|
{ prop: 'stationCode', label: this.$t('map.equipmentStation'), type: 'select', mode: true, optionLabel: 'name&&code', optionValue: 'code', disabled: this.isStationCodeDisabled, options: this.stationList },
|
||||||
{ prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
|
{ prop: 'offsetLeft', label: this.$t('map.sectionOffsetLeft'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
|
||||||
{ prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
|
{ prop: 'offsetRight', label: this.$t('map.sectionOffsetRight'), type: 'number', min: 0, placeholder: '米', isHidden: !this.isSectionType },
|
||||||
|
{ prop: 'leftStopPointOffset', label: this.$t('map.leftStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||||
|
{ prop: 'rightStopPointOffset', label: this.$t('map.rightStopPointOffset'), type: 'number', min: 0, isHidden: !this.isStopPointOffset },
|
||||||
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
|
{ prop: 'region', label: this.$t('map.sectionColon'), type: 'select', optionLabel: 'label', optionValue: 'value', options: this.regionList, isHidden: !this.sectionColonShow },
|
||||||
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0 },
|
{ prop: 'kmRangeLeft', label: this.$t('map.leftKilometerMark'), type: 'number', min: 0 },
|
||||||
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 },
|
{ prop: 'kmRangeRight', label: this.$t('map.rightKilometerMark'), type: 'number', min: 0 },
|
||||||
|
@ -366,11 +366,48 @@ export default {
|
|||||||
edit() {
|
edit() {
|
||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const model = Object.assign({_type: 'Signal'}, this.editModel);
|
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||||
this.$emit('addOrUpdateMapModel', model);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
buildEditModel() {
|
||||||
|
const model = {
|
||||||
|
_type: 'Signal',
|
||||||
|
code: this.editModel.code,
|
||||||
|
name: this.editModel.name,
|
||||||
|
uniqueName: this.editModel.uniqueName,
|
||||||
|
useType: this.editModel.useType,
|
||||||
|
lampPostType: this.editModel.lampPostType,
|
||||||
|
lampPositionType: this.editModel.lampPositionType,
|
||||||
|
potLampType: this.editModel.potLampType,
|
||||||
|
positionType: this.editModel.positionType,
|
||||||
|
directionType: this.editModel.directionType,
|
||||||
|
nameShow: this.editModel.nameShow,
|
||||||
|
buttonShow: this.editModel.buttonShow,
|
||||||
|
guideShow: this.editModel.guideShow,
|
||||||
|
offset: this.editModel.offset,
|
||||||
|
rotate: this.editModel.rotate,
|
||||||
|
position: {
|
||||||
|
x: this.editModel.position.x,
|
||||||
|
y: this.editModel.position.y
|
||||||
|
},
|
||||||
|
namePosition: {
|
||||||
|
x: this.editModel.namePosition.x,
|
||||||
|
y: this.editModel.namePosition.y
|
||||||
|
},
|
||||||
|
guidePosition: {
|
||||||
|
x: this.editModel.guidePosition.x,
|
||||||
|
y: this.editModel.guidePosition.y
|
||||||
|
},
|
||||||
|
buttonPosition: {
|
||||||
|
x: this.editModel.buttonPosition.x,
|
||||||
|
y: this.editModel.buttonPosition.y
|
||||||
|
},
|
||||||
|
stationCode: this.editModel.stationCode,
|
||||||
|
linkCode: this.editModel.linkCode
|
||||||
|
};
|
||||||
|
return model;
|
||||||
|
},
|
||||||
// 删除对象
|
// 删除对象
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||||
|
@ -241,11 +241,36 @@ export default {
|
|||||||
edit() {
|
edit() {
|
||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const model = Object.assign({_type: 'Station'}, this.editModel);
|
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||||
this.$emit('addOrUpdateMapModel', model);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
buildEditModel() {
|
||||||
|
var model = {
|
||||||
|
_type: 'Station',
|
||||||
|
code: this.editModel.code,
|
||||||
|
visible: this.editModel.visible,
|
||||||
|
runPlanName: this.editModel.runPlanName,
|
||||||
|
name: this.editModel.name,
|
||||||
|
zcCode: this.editModel.zcCode,
|
||||||
|
nameFont: this.editModel.nameFont,
|
||||||
|
nameFontColor: this.editModel.nameFontColor,
|
||||||
|
kmPostShow: this.editModel.kmPostShow,
|
||||||
|
kmRange: this.editModel.kmRange,
|
||||||
|
kmPost: this.editModel.kmPost,
|
||||||
|
kmPostFontColor: this.editModel.kmPostFontColor,
|
||||||
|
kmPostFont: this.editModel.kmPostFont,
|
||||||
|
isShowControlMode: this.editModel.isShowControlMode,
|
||||||
|
centralized: this.editModel.centralized,
|
||||||
|
concentrateStationCode: this.editModel.concentrateStationCode,
|
||||||
|
position: {
|
||||||
|
x: this.editModel.position.x,
|
||||||
|
y: this.editModel.position.y
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return model;
|
||||||
|
},
|
||||||
// 删除对象
|
// 删除对象
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||||
|
@ -224,11 +224,27 @@ export default {
|
|||||||
edit() {
|
edit() {
|
||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const model = Object.assign({_type: 'StationControl'}, this.editModel);
|
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||||
this.$emit('addOrUpdateMapModel', model);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
buildEditModel() {
|
||||||
|
const model = {
|
||||||
|
_type: 'StationControl',
|
||||||
|
code: this.editModel.code,
|
||||||
|
zokContent: this.editModel.zokContent,
|
||||||
|
zbjkContent: this.editModel.zbjkContent,
|
||||||
|
zakContent: this.editModel.zakContent,
|
||||||
|
jjzkContent: this.editModel.jjzkContent,
|
||||||
|
zzkContent: this.editModel.zzkContent,
|
||||||
|
stationCode: this.editModel.stationCode,
|
||||||
|
position: {
|
||||||
|
x: this.editModel.position.x,
|
||||||
|
y: this.editModel.position.y
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return model;
|
||||||
|
},
|
||||||
// 删除对象
|
// 删除对象
|
||||||
deleteObj() {
|
deleteObj() {
|
||||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||||
|
@ -158,16 +158,8 @@ export default {
|
|||||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isNormal() {
|
|
||||||
return this.activeTab === 'first';
|
|
||||||
},
|
|
||||||
isThird() {
|
|
||||||
return this.activeTab === 'third';
|
|
||||||
},
|
|
||||||
create() {
|
create() {
|
||||||
if (this.isThird()) {
|
if (this.activeTab === 'first') {
|
||||||
this.close();
|
|
||||||
} else if (this.isNormal()) {
|
|
||||||
this.$refs['newForm'].validate((valid) => {
|
this.$refs['newForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="this.$t('map.operationGraphPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
|
<el-dialog :title="this.$t('map.operationGraphPublished')" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
|
||||||
<div>
|
<div>
|
||||||
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" size="mini">
|
<el-form ref="form" label-position="right" :model="editModel" label-width="120px" size="mini" :rules="rules">
|
||||||
<el-form-item :label="this.$t('map.operationGraphName')" prop="name">
|
<el-form-item :label="this.$t('map.operationGraphName')" prop="name">
|
||||||
<el-input v-model="editModel.name" :disabled="true" />
|
<el-input v-model="editModel.name" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -34,6 +34,11 @@ export default {
|
|||||||
editModel: {
|
editModel: {
|
||||||
planId: '',
|
planId: '',
|
||||||
name: ''
|
name: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -150,19 +150,27 @@ export default {
|
|||||||
title: '打开运行图',
|
title: '打开运行图',
|
||||||
click: this.handleOpenRunPlan
|
click: this.handleOpenRunPlan
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
type: 'file',
|
// type: 'file',
|
||||||
title: '导入运行图',
|
// title: '导入运行图',
|
||||||
click: this.handleImportRunPlan
|
// click: this.handleImportRunPlan
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '新建运行图',
|
title: '新建运行图',
|
||||||
click: this.handleCreateEmptyPlan
|
click: this.handleCreateEmptyPlan
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '修改运行图名称',
|
||||||
|
click: this.handleEditPlan
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '修改站间运行时间',
|
title: '修改站间运行时间',
|
||||||
click: this.handleModifyingStationIntervalTime
|
click: this.handleModifyingStationIntervalTime
|
||||||
// disabledCallback: () => { return !this.$route.query.planId },
|
// disabledCallback: () => { return !this.$route.query.planId },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '删除运行图',
|
||||||
|
click: this.handledeleteRunPlan
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -389,7 +397,14 @@ export default {
|
|||||||
},
|
},
|
||||||
// 打开运行图列表
|
// 打开运行图列表
|
||||||
handleOpenRunPlan() {
|
handleOpenRunPlan() {
|
||||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
|
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||||
|
},
|
||||||
|
handledeleteRunPlan() {
|
||||||
|
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'delete'} });
|
||||||
|
},
|
||||||
|
// 修改运行图名称
|
||||||
|
handleEditPlan() {
|
||||||
|
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'edit'} });
|
||||||
},
|
},
|
||||||
loadingScreen() {
|
loadingScreen() {
|
||||||
this.loading = this.$loading({
|
this.loading = this.$loading({
|
||||||
|
@ -4,28 +4,54 @@
|
|||||||
class="planEdit__tool create-empty-plan"
|
class="planEdit__tool create-empty-plan"
|
||||||
:title="title"
|
:title="title"
|
||||||
:visible.sync="dialogShow"
|
:visible.sync="dialogShow"
|
||||||
width="420px"
|
width="30%"
|
||||||
:before-close="doClose"
|
:before-close="doClose"
|
||||||
:z-index="2000"
|
:z-index="2000"
|
||||||
:modal="false"
|
:modal="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
>
|
>
|
||||||
|
<div>
|
||||||
|
<el-tabs v-model="activeTab" type="card">
|
||||||
|
<el-tab-pane label="正常新建" name="first">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form ref="form" :model="addModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
<el-form ref="form" :model="newModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||||
<el-form-item label="运行图名称:" prop="name">
|
<el-form-item label="运行图名称:" prop="name">
|
||||||
<el-input v-model="addModel.name" autofocus />
|
<el-input v-model="newModel.name" autofocus />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row type="flex" justify="center" class="button-group">
|
</el-tab-pane>
|
||||||
<el-button @click="handleCommit">确 定</el-button>
|
<el-tab-pane label="从发布运行图创建" name="second">
|
||||||
<el-button @click="doClose">取 消</el-button>
|
<el-row>
|
||||||
|
<el-form ref="pullForm" :model="pullModel" label-width="140px" size="mini" :rules="pullRules" @submit.native.prevent>
|
||||||
|
<el-form-item label="发布运行图" prop="templateId">
|
||||||
|
<el-select v-model="pullModel.templateId" :placeholder="$t('map.pleaseSelect')">
|
||||||
|
<el-option
|
||||||
|
v-for="item in publishMapList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="运行图名称:" prop="name">
|
||||||
|
<el-input v-model="pullModel.name" autofocus />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleCommit">{{ $t('map.confirm') }}</el-button>
|
||||||
|
<el-button @click="doClose">{{ $t('map.cancel') }}</el-button>
|
||||||
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createEmptyPlan } from '@/api/runplan';
|
import { createEmptyPlan, queryRunPlanList, postCreatePlan } from '@/api/runplan';
|
||||||
|
import { UrlConfig } from '@/router/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CreateEmptyPlan',
|
name: 'CreateEmptyPlan',
|
||||||
@ -33,9 +59,16 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activeTab: 'first',
|
||||||
dialogShow: false,
|
dialogShow: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
addModel: {
|
publishMapList: [],
|
||||||
|
newModel: {
|
||||||
|
name: '',
|
||||||
|
skinCode: this.$route.query.skinCode
|
||||||
|
},
|
||||||
|
pullModel: {
|
||||||
|
templateId: '',
|
||||||
name: '',
|
name: '',
|
||||||
skinCode: this.$route.query.skinCode
|
skinCode: this.$route.query.skinCode
|
||||||
}
|
}
|
||||||
@ -43,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
title() {
|
title() {
|
||||||
return '创建空运行图数据';
|
return '新建运行图';
|
||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
return {
|
return {
|
||||||
@ -51,29 +84,61 @@ export default {
|
|||||||
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
pullRules() {
|
||||||
|
return {
|
||||||
|
templateId: [
|
||||||
|
{ required: true, message: '请选择发布运行图', trigger: 'change' }
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async initLoad() {
|
||||||
|
const res = await queryRunPlanList(this.$route.query.skinCode);
|
||||||
|
if (res.code == 200 && res.data.length) {
|
||||||
|
this.publishMapList = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
|
this.initLoad();
|
||||||
},
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
|
this.newModel.name = '';
|
||||||
|
this.pullModel.templateId = '';
|
||||||
|
this.pullModel.name = '';
|
||||||
|
if (this.$refs.form) {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
}
|
||||||
|
if (this.$refs.pullForm) {
|
||||||
|
this.$refs.pullForm.resetFields();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleCommit() {
|
handleCommit() {
|
||||||
|
if (this.activeTab === 'first') {
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
createEmptyPlan(this.addModel).then(resp => {
|
this.loading = true;
|
||||||
|
createEmptyPlan(this.newModel).then(resp => {
|
||||||
const params = {
|
const params = {
|
||||||
dialogName: 'openRunPlan',
|
dialogName: 'openRunPlan',
|
||||||
operate: 'loadRunPlanData',
|
operate: 'loadRunPlanData',
|
||||||
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.addModel.name, refresh: true }
|
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.newModel.name, refresh: true }
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$emit('dispatchOperate', params);
|
this.$emit('dispatchOperate', params);
|
||||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
|
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||||
this.$message.success('创建空运行图成功!');
|
this.$message.success('创建空运行图成功!');
|
||||||
|
this.jump(resp.data, this.newModel.name);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox('创建空运行图失败');
|
this.$messageBox('创建空运行图失败');
|
||||||
@ -81,6 +146,26 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.$refs['pullForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.loading = true;
|
||||||
|
postCreatePlan(this.pullModel).then(resp => {
|
||||||
|
// this.$emit('dispatchDialog', { name: 'openRunPlan', params: {type: 'add'} });
|
||||||
|
this.$message.success('创建运行图成功!');
|
||||||
|
this.jump(resp.data, this.pullModel.name);
|
||||||
|
this.doClose();
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox('创建运行图失败');
|
||||||
|
this.doClose();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
jump(planId, planName) {
|
||||||
|
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
|
||||||
|
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
116
src/views/planMonitor/editTool/menus/editPlanName.vue
Normal file
116
src/views/planMonitor/editTool/menus/editPlanName.vue
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="planEdit__tool create-empty-plan"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="dialogShow"
|
||||||
|
width="30%"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="3000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-row>
|
||||||
|
<el-form ref="form" :model="editModel" label-width="140px" size="mini" :rules="rules" @submit.native.prevent>
|
||||||
|
<el-form-item label="运行图名称:" prop="name">
|
||||||
|
<el-input v-model="editModel.name" autofocus />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleEdit">修改</el-button>
|
||||||
|
<el-button @click="doClose">{{ $t('map.cancel') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { putRunPlanDetail } from '@/api/runplan';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CreateEmptyPlan',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeTab: 'first',
|
||||||
|
dialogShow: false,
|
||||||
|
loading: false,
|
||||||
|
publishMapList: [],
|
||||||
|
editModel: {
|
||||||
|
planId: '',
|
||||||
|
name: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
title() {
|
||||||
|
return '修改运行图名称';
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
return {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: '请输入运行图名称', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(data) {
|
||||||
|
this.dialogShow = true;
|
||||||
|
if (data && data.name) {
|
||||||
|
this.editModel.name = data.name;
|
||||||
|
this.editModel.planId = data.id;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.loading = false;
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.editModel.name = '';
|
||||||
|
if (this.$refs.form) {
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleEdit() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.loading = true;
|
||||||
|
putRunPlanDetail(this.editModel).then(resp => {
|
||||||
|
const params = {
|
||||||
|
dialogName: 'openRunPlan',
|
||||||
|
operate: 'loadRunPlanData',
|
||||||
|
params: { planId: resp.data, skinCode: this.$route.query.skinCode, planName: this.editModel.name, refresh: true }
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$emit('dispatchOperate', params);
|
||||||
|
this.$message.success('修改运行图名称成功!');
|
||||||
|
this.$emit('renewal');
|
||||||
|
this.doClose();
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox('修改运行图名称失败');
|
||||||
|
this.doClose();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@import "src/styles/mixin.scss";
|
||||||
|
|
||||||
|
/deep/ {
|
||||||
|
.el-input {
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-input-number {
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-dialogDrag
|
v-dialogDrag
|
||||||
class="planEdit__tool open-runplan"
|
class="planEdit__tool open-runplan"
|
||||||
@ -7,7 +8,7 @@
|
|||||||
width="640px"
|
width="640px"
|
||||||
:before-close="doClose"
|
:before-close="doClose"
|
||||||
:z-index="2000"
|
:z-index="2000"
|
||||||
:modal="false"
|
:modal="true"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
>
|
>
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||||
@ -16,27 +17,33 @@
|
|||||||
class="filter-tree"
|
class="filter-tree"
|
||||||
:data="runPlanList"
|
:data="runPlanList"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
default-expand-all
|
default-expand-all
|
||||||
:style="{height: height-20+'px'}"
|
:style="{height: height-20+'px'}"
|
||||||
>
|
@node-click="handleNodeClick"
|
||||||
<span slot-scope="{ node, data }">
|
/>
|
||||||
<el-radio v-model="planId" :label="data.id"><span>{{ data.name }}</span></el-radio>
|
|
||||||
</span>
|
|
||||||
</el-tree>
|
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<el-row type="flex" justify="center" class="button-group">
|
<el-row type="flex" justify="center" class="button-group">
|
||||||
<el-button type="primary" @click="handleConfirm">选择运行图</el-button>
|
<el-button v-if="type == 'add'" type="primary" @click="handleConfirm">选择运行图</el-button>
|
||||||
|
<el-button v-if="type == 'delete'" type="primary" @click="handleDelete">删除</el-button>
|
||||||
|
<el-button v-if="type == 'edit'" type="primary" @click="handleEdit">修改</el-button>
|
||||||
<el-button @click="dialogShow = false">取 消</el-button>
|
<el-button @click="dialogShow = false">取 消</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<edit-plan-name ref="editPlan" @renewal="getRunPlanList" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRpListByMapId } from '@/api/runplan';
|
import { getRpListByMapId, deleteRunPlan } from '@/api/runplan';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
|
import EditPlanName from './editPlanName';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OpenRunPlan',
|
name: 'OpenRunPlan',
|
||||||
|
components: {
|
||||||
|
EditPlanName
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
skinCode: {
|
skinCode: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -49,6 +56,9 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
height: 260,
|
height: 260,
|
||||||
planId: '',
|
planId: '',
|
||||||
|
planName: '',
|
||||||
|
type: 'add',
|
||||||
|
// defaultShowKeys: [],
|
||||||
runPlanList: [],
|
runPlanList: [],
|
||||||
runPlanDict: {},
|
runPlanDict: {},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
@ -72,35 +82,74 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.planId = data.id;
|
||||||
|
this.planName = data.name;
|
||||||
|
},
|
||||||
loadRunPlanData({ refresh, planId, skinCode, planName }) {
|
loadRunPlanData({ refresh, planId, skinCode, planName }) {
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
this.$store.dispatch('runPlan/refresh');
|
this.$store.dispatch('runPlan/refresh');
|
||||||
} else {
|
} else {
|
||||||
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName, try: this.$route.query.try, goodsId: this.$route.query.goodsId };
|
const query = { skinCode: skinCode, mapId: this.$route.query.mapId, planId: planId, planName: planName };
|
||||||
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doShow() {
|
getRunPlanList() {
|
||||||
getRpListByMapId(this.$route.query.mapId).then((resp) => {
|
getRpListByMapId(this.$route.query.mapId).then((resp) => {
|
||||||
this.runPlanList = resp.data;
|
this.runPlanList = resp.data;
|
||||||
this.runPlanList.forEach(elem => {
|
this.runPlanList.forEach(elem => {
|
||||||
this.runPlanDict[elem.id] = elem.name;
|
this.runPlanDict[elem.id] = elem.name;
|
||||||
});
|
});
|
||||||
|
// this.defaultShowKeys = [this.planId];
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox('获取运行图列表失败');
|
this.$messageBox('获取运行图列表失败');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
doShow(data) {
|
||||||
|
this.type = data.type || 'add';
|
||||||
|
this.getRunPlanList();
|
||||||
|
},
|
||||||
doClose() {
|
doClose() {
|
||||||
this.dialogShow = false;
|
this.dialogShow = false;
|
||||||
|
this.planId = '';
|
||||||
|
this.planName = '';
|
||||||
},
|
},
|
||||||
|
// 跳转到对应运行图
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.loadRunPlanData({
|
this.loadRunPlanData({
|
||||||
planId: this.planId,
|
planId: this.planId,
|
||||||
skinCode: this.$route.query.skinCode,
|
skinCode: this.$route.query.skinCode,
|
||||||
planName: this.runPlanDict[this.planId]
|
planName: this.planName
|
||||||
});
|
});
|
||||||
this.doClose();
|
this.doClose();
|
||||||
|
},
|
||||||
|
// 删除运行图
|
||||||
|
handleDelete() {
|
||||||
|
this.$confirm('您确认是否删除此运行图?', this.$t('tip.hint'), {
|
||||||
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
|
cancelButtonText: this.$t('tip.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
deleteRunPlan(this.planId).then(Response => {
|
||||||
|
this.$message.success(`删除成功!`);
|
||||||
|
if (this.planId === this.$route.query.planId) {
|
||||||
|
const query = { skinCode: this.$route.query.skinCode, mapId: this.$route.query.mapId };
|
||||||
|
this.$router.push({ path: `${UrlConfig.plan.tool}`, query: query });
|
||||||
|
}
|
||||||
|
this.doClose();
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
|
||||||
|
});
|
||||||
|
}).catch(() => { });
|
||||||
|
},
|
||||||
|
// 修改运行图名称
|
||||||
|
handleEdit() {
|
||||||
|
if (this.planId && this.planName) {
|
||||||
|
this.$refs.editPlan.doShow({id: this.planId, name: this.planName});
|
||||||
|
} else {
|
||||||
|
this.$message.info('请选择运行图');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -371,6 +371,8 @@ export default {
|
|||||||
this.myChart && this.myChart.hideLoading();
|
this.myChart && this.myChart.hideLoading();
|
||||||
this.$messageBox('获取运行图数据失败');
|
this.$messageBox('获取运行图数据失败');
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.clearCanvas();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -468,6 +470,14 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clearCanvas() {
|
||||||
|
this.option.series = [];
|
||||||
|
this.option.title.text = '';
|
||||||
|
if (this.myChart) {
|
||||||
|
this.myChart.clear();
|
||||||
|
}
|
||||||
|
this.myChart.setOption(this.option);
|
||||||
|
},
|
||||||
xAxisPointFormat(params) {
|
xAxisPointFormat(params) {
|
||||||
return timeFormat(params.value);
|
return timeFormat(params.value);
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 参与人员 -->
|
<!-- 参与人员 -->
|
||||||
<div class="personnel">
|
<div class="personnel">
|
||||||
<div style="height: calc(100% - 20px); overflow-y: scroll;">
|
<div style="height: calc(100% - 20px); overflow-y: scroll; padding: 0px 30px;">
|
||||||
<div style="display: flex; justify-content: space-between;">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<div class="Scheduling">
|
<div class="Scheduling">
|
||||||
<p class="title">调度员</p>
|
<p class="title">调度员</p>
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('dispatch', '增加调度人员')" />
|
<el-button icon="el-icon-plus" circle plain @click="addingRoles('dispatch', '增加调度人员')" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Scheduling bottomNone">
|
<div class="Scheduling">
|
||||||
<p class="title">车站值班员</p>
|
<p class="title">车站值班员</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(nor, index) in equipmentList" :key="index" class="selectPerson">
|
<li v-for="(nor, index) in equipmentList" :key="index" class="selectPerson">
|
||||||
@ -107,7 +107,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex; justify-content: space-between;">
|
<div style="display: flex; justify-content: space-between;">
|
||||||
<div class="Scheduling bottomNone">
|
<div class="Scheduling">
|
||||||
<p class="title">司机</p>
|
<p class="title">司机</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(nor, index) in driverList" :key="index" class="selectPerson">
|
<li v-for="(nor, index) in driverList" :key="index" class="selectPerson">
|
||||||
@ -123,7 +123,7 @@
|
|||||||
<el-button icon="el-icon-plus" circle plain @click="addingRoles('driver', '增加司机')" />
|
<el-button icon="el-icon-plus" circle plain @click="addingRoles('driver', '增加司机')" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="Scheduling bottomNone">
|
<div class="Scheduling">
|
||||||
<p class="title">IBP</p>
|
<p class="title">IBP</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(nor, index) in ibpList" :key="index" class="selectPerson">
|
<li v-for="(nor, index) in ibpList" :key="index" class="selectPerson">
|
||||||
@ -162,53 +162,71 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between;">
|
||||||
|
<div class="Scheduling">
|
||||||
|
<p class="title">大屏</p>
|
||||||
|
<ul>
|
||||||
|
<li v-for="(nor, index) in bigScreenList" :key="index" class="selectPerson">
|
||||||
|
<span>{{ nor.nickName }}</span>
|
||||||
|
<i
|
||||||
|
v-if="userId == roomInfo.creatorId"
|
||||||
|
class="el-icon-close delPerson"
|
||||||
|
@click="handleDelUser(bigScreenList, nor, index)"
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div v-if="userId == roomInfo.creatorId" class="add-box">
|
||||||
|
<el-button icon="el-icon-plus" circle plain @click="addingRoles('bigScreen', '增加大屏')" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="start-box">
|
<div class="start-box">
|
||||||
<div v-if="!starting" style="float: right; margin-left: 10px;">
|
|
||||||
<el-button
|
<el-button
|
||||||
v-if="userId == roomInfo.creatorId"
|
v-if="userId == roomInfo.creatorId"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
type="danger"
|
||||||
|
:loading="loading"
|
||||||
|
@click="exit"
|
||||||
|
>销毁房间
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="userId == roomInfo.creatorId"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
type="success"
|
||||||
|
:loading="loading"
|
||||||
|
@click="postCode"
|
||||||
|
>生成二维码
|
||||||
|
</el-button>
|
||||||
|
<template v-if="!starting">
|
||||||
|
<el-button
|
||||||
|
v-if="userId == roomInfo.creatorId"
|
||||||
|
style="margin-left: 10px"
|
||||||
type="primary"
|
type="primary"
|
||||||
style="float: right;"
|
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="start"
|
@click="start"
|
||||||
>
|
>
|
||||||
开始仿真</el-button>
|
开始仿真</el-button>
|
||||||
</div>
|
</template>
|
||||||
<div v-else>
|
<template v-else>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
style="float: right; margin-right: 10px;"
|
style="margin-left: 10px"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="joinJointTrain"
|
@click="joinJointTrain"
|
||||||
>
|
>
|
||||||
进入仿真</el-button>
|
进入仿真</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="userId == roomInfo.creatorId"
|
v-if="userId == roomInfo.creatorId"
|
||||||
type=""
|
style="margin-left: 10px"
|
||||||
style="float: right; margin-right: 10px;"
|
type="warning"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@click="stop"
|
@click="stop"
|
||||||
>
|
>
|
||||||
结束仿真</el-button>
|
结束仿真</el-button>
|
||||||
</div>
|
</template>
|
||||||
<el-button
|
<el-button type="" @click="backRoom">返回
|
||||||
v-if="userId == roomInfo.creatorId"
|
|
||||||
type=""
|
|
||||||
style="float: right; margin-right: 0px;"
|
|
||||||
:loading="loading"
|
|
||||||
@click="postCode"
|
|
||||||
>生成二维码
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="" style="float: right; margin-right: 10px;" @click="backRoom">返回
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="userId == roomInfo.creatorId"
|
|
||||||
type="danger"
|
|
||||||
style="float: right; margin-right: 0px;"
|
|
||||||
:loading="loading"
|
|
||||||
@click="exit"
|
|
||||||
>销毁房间
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -286,7 +304,8 @@ export default {
|
|||||||
adminList: [],
|
adminList: [],
|
||||||
driverList: [],
|
driverList: [],
|
||||||
signalList: [],
|
signalList: [],
|
||||||
stationList: [], // 车站列表
|
bigScreenList: [],
|
||||||
|
stationList: [],
|
||||||
ibpList: [],
|
ibpList: [],
|
||||||
point: {
|
point: {
|
||||||
x: 0,
|
x: 0,
|
||||||
@ -387,7 +406,8 @@ export default {
|
|||||||
...this.equipmentList,
|
...this.equipmentList,
|
||||||
...this.driverList,
|
...this.driverList,
|
||||||
...this.signalList,
|
...this.signalList,
|
||||||
...this.ibpList
|
...this.ibpList,
|
||||||
|
...this.bigScreenList
|
||||||
].length - 1: 0;
|
].length - 1: 0;
|
||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
@ -483,11 +503,11 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'Attendant':
|
case 'Attendant':
|
||||||
this.equipmentList.forEach((nor, index) => {
|
this.equipmentList.forEach((nor, index) => {
|
||||||
if (nor.id == item.id) { // 修改状态
|
if (nor.id == item.id) {
|
||||||
this.equipmentList.splice(index, 1);
|
this.equipmentList.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.equipmentList.push(item); // 新增
|
this.equipmentList.push(item);
|
||||||
break;
|
break;
|
||||||
case 'Driver':
|
case 'Driver':
|
||||||
this.driverList.push(item);
|
this.driverList.push(item);
|
||||||
@ -497,11 +517,14 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'IBP':
|
case 'IBP':
|
||||||
this.ibpList.forEach((nor, index) => {
|
this.ibpList.forEach((nor, index) => {
|
||||||
if (nor.id == item.id) { // 修改状态
|
if (nor.id == item.id) {
|
||||||
this.ibpList.splice(index, 1);
|
this.ibpList.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.ibpList.push(item); // 新增
|
this.ibpList.push(item);
|
||||||
|
break;
|
||||||
|
case 'BigScreen':
|
||||||
|
this.bigScreenList.push(item);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.dispatchList.forEach((nor, index) => {
|
this.dispatchList.forEach((nor, index) => {
|
||||||
@ -534,6 +557,11 @@ export default {
|
|||||||
this.ibpList.splice(index, 1);
|
this.ibpList.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.bigScreenList.forEach((nor, index) => {
|
||||||
|
if (item.id == nor.id) {
|
||||||
|
this.bigScreenList.splice(index, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -597,6 +625,10 @@ export default {
|
|||||||
item.select = true;
|
item.select = true;
|
||||||
this.ibpList.push(item);
|
this.ibpList.push(item);
|
||||||
break;
|
break;
|
||||||
|
case 'BigScreen':
|
||||||
|
item.select = true;
|
||||||
|
this.bigScreenList.push(item);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
this.treeData.push(item);
|
this.treeData.push(item);
|
||||||
});
|
});
|
||||||
@ -713,6 +745,9 @@ export default {
|
|||||||
case 'ibp': // IBP
|
case 'ibp': // IBP
|
||||||
params.userRole = 'IBP';
|
params.userRole = 'IBP';
|
||||||
break;
|
break;
|
||||||
|
case 'bigScreen': // 大屏
|
||||||
|
params.userRole = 'BigScreen';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
arr.push(params);
|
arr.push(params);
|
||||||
});
|
});
|
||||||
@ -886,15 +921,14 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.personnel {
|
.personnel {
|
||||||
padding: 0px 20px;
|
|
||||||
width: calc(100% - 500px);
|
width: calc(100% - 500px);
|
||||||
height: calc(100% - 60px);
|
height: calc(100% - 120px);
|
||||||
float: left;
|
float: left;
|
||||||
|
|
||||||
.Scheduling {
|
.Scheduling {
|
||||||
width: calc(50% - 10px);
|
width: calc(50% - 10px);
|
||||||
float: left;
|
float: left;
|
||||||
height: 250px;
|
height: 240px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
@ -915,10 +949,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottomNone {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selectPerson {
|
.selectPerson {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
@ -941,8 +971,10 @@ export default {
|
|||||||
|
|
||||||
.start-box {
|
.start-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
display: flex;
|
||||||
margin-top: 20px;
|
justify-content: center;
|
||||||
|
background: #f1f1f1;
|
||||||
|
padding: 20px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1325px) {
|
@media screen and (max-width: 1325px) {
|
||||||
|
Loading…
Reference in New Issue
Block a user