This commit is contained in:
joylink_cuiweidong 2020-08-17 18:48:46 +08:00
commit cb916647c5
50 changed files with 4056 additions and 4898 deletions

View File

@ -100,6 +100,13 @@ export function publishRunPlan(planId, data) {
data: data
});
}
/** 发布运行图(所有权限用户) */
export function publishRunPlanAllUser(planId, runPlanName) {
return request({
url: `/api/review/${planId}/directPublishRunPlan?runPlanName=${runPlanName}`,
method: 'post'
});
}
/** 普通用户申请或撤销运行图发布 */
export function releaseOrCancelRunPlan(planId, status) {
return request({

View File

@ -66,10 +66,20 @@ export function getPublishMapExport(mapId) {
}
/** 发布地图数据导出*/
export function getPublishMapExportNew(mapId, list) {
export function getPublishMapExportNew(mapId, params) {
return request({
url: `/api/map/${mapId}/export/new?configs=${list}`,
method: 'get'
url: `/api/map/${mapId}/export/new`,
method: 'get',
params
});
}
/** 发布地图数据导出*/
export function getPublishMapImportNew(mapId, data) {
return request({
url: `/api/map/${mapId}/import/new`,
method: 'put',
data
});
}

View File

@ -134,6 +134,21 @@
>
<template slot-scope="scope">
<template v-for="(button, idx) in column.buttons">
<template v-if="button.type == 'file'">
<el-button
v-if="button.show === undefined ? ((button.showControl === undefined) ? true: button.showControl(scope.row)): button.show"
:key="idx"
:type="button.type ? button.type: 'primary'"
size="mini"
class="button_style uploadDemo"
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
:loading="scope.row['loading'+idx]"
>
<input :id="button.id" type="file" class="file_box" accept=".json, application/json" @change="button.handleClick(scope.$index, scope.row, idx)">
{{ getTableBtnName(button.name, scope.$index, scope.row) }}
</el-button>
</template>
<template v-else>
<el-button
v-if="button.show === undefined ? ((button.showControl === undefined) ? true: button.showControl(scope.row)): button.show"
:key="idx"
@ -146,6 +161,7 @@
>{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button>
</template>
</template>
</template>
</el-table-column>
</template>
</el-table>
@ -530,3 +546,24 @@ export default {
};
</script>
<style lang="scss" scoped>
.uploadDemo {
position: relative;
overflow: hidden;
margin-right: 3px;
cursor: pointer;
padding: 0 15px;
height: 32px;
.file_box {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
z-index: 100;
}
}
</style>

View File

@ -231,8 +231,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
vrwebworker.postMessage(connectmsg);
vrwebworker.onmessage = function (event) {
console.log(event.data.type);
console.log(event.data);
if(event.data.type == "Device_Fault_Set_3D"){
let newfault = {
code:event.data.body.code,
@ -409,7 +408,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
if(scope.stationtexture["stationlist"]){
vrPlane.setStationPlane(stationList,scope.stationtexture);
console.log(scope.nowStationModel.getObjectByName("zhantailiebiao"));
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map =scope.stationtexture["stationlist"];
scope.nowStationModel.getObjectByName("zhantailiebiao").material.map.needsUpdate = true;
if(scope.nowStationModel.getObjectByName("menkuangyanse")){
@ -420,7 +418,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
scope.nowStationModel.getObjectByName("zhantaiming").material.map.needsUpdate = true;
}
trainControl.inittrain(scope.scene,scope.modelmanager.train.mesh,mixers);
trainControl.inittrain(scope.scene,scope.modelmanager.train.mesh,scope.modelmanager.train.animations,mixers);
scope.scene.add(scope.modelmanager.otherDevice.mesh);
scope.scene.add( vrPlane.group );
vrwebworker.postMessage("connect");
@ -443,7 +441,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
let intersects = raycaster.intersectObjects( vrPlane.group.children,true);
if(intersects[0]){
console.log(intersects[0]);
var object = intersects[0].object;
if(object.name == "buttonHome"){
@ -744,9 +741,9 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
var intersections = getIntersections( controller );
// console.log(intersections);
if ( intersections.length > 0 ) {
console.log(intersections);
// console.log(intersections);
var intersection = intersections[ 0 ];
console.log(intersection);
// console.log(intersection);
var object = intersection.object;
// object.matrix.premultiply( tempMatrix );
@ -809,7 +806,6 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
function squeezeStart(){
console.log("squeez");
scope.modelmanager.otherDevice.action.play();
if(vrPlaneStatus){
vrPlaneStatus = false;
@ -1029,7 +1025,7 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
}
scope.nowstation = stationList[0];
console.log(scope.nowstation);
}

View File

@ -3,14 +3,14 @@ export function TrainControl(){
this.toptrain = null;
this.downtrain = null;
this.inittrain = function(scene,object,mixers){
this.inittrain = function(scene,object,animations,mixers){
let ntracks1,ntracks2,tclip,fclip;
console.log(object);
ntracks1 = object.animations.slice(16,27);
ntracks1 = animations.slice(16,27);
tclip = new THREE.AnimationClip("three",2,ntracks1);
ntracks2 = object.animations.slice(0,15);
ntracks2 = animations.slice(0,15);
fclip = new THREE.AnimationClip("four",2,ntracks2);
@ -45,16 +45,17 @@ export function TrainControl(){
inittrainanimation(scope.downtrain,tclip,fclip,mixers);
scope.toptrain.position.z = -20;
scope.toptrain.position.y = -20000;
scope.toptrain.position.z = 8.8;
// scope.toptrain.position.y = -20000;
scope.toptrain.rotation.y = Math.PI;
scope.downtrain.position.z = 40;
scope.downtrain.position.y = -20000;
scope.downtrain.position.z = -8.3;
// scope.downtrain.position.y = -20000;
scene.add(scope.toptrain);
scene.add(scope.downtrain);
}
function inittrainanimation(train,tclip,fclip,mixers){
for(let j=0;j<train.children.length;j++){
if(train.children[j].name == "c1" || train.children[j].name == "c6"){
for(let n=0,lenn = train.children[j].children.length;n<lenn;n++){
@ -97,6 +98,7 @@ export function TrainControl(){
if(train.children[j].children[n].name == "down"){
train.children[j].children[n].animations = [];
train.children[j].children[n].animations.push(fclip.clone());
let mixer = new THREE.AnimationMixer( train.children[j].children[n] );
mixers.push(mixer);
let action = mixer.clipAction( train.children[j].children[n].animations[ 0 ] );

View File

@ -287,7 +287,7 @@ export function VrGui(){
}
posY = Math.floor(i/4)*0.16;
console.log(posY);
setTextStation(stations[i],scope.stationListGroup,posX-0.5,0.6-posY,"stationList");
}
setTextMsg(stations[0],scope.homeGroup,0,0,"stationMsg");
@ -363,7 +363,6 @@ export function VrGui(){
nowGroupComponent = scope.faultListGroup;
plane.add(nowGroupComponent);
console.log(scope.faultListGroup.children);
}
this.updataDeviceFaultMsg = function(faultData){

View File

@ -20,7 +20,7 @@ export function ModelManagerVR(){
code:"stationOut",
locateType:"2",
mesh:null,
url:"../../static/vrtest/stationOut.FBX"
url:"../../static/vrtest/stationIn.FBX"
};
this.otherDevice = {
@ -71,16 +71,39 @@ function fbxpromise(mixers,model){
let mixer = new THREE.AnimationMixer( object );
object.animacode = model.code;
model.mesh = object;
if(object.animations.length>0 && model.code != "train"){
// model.mesh = object;
if(model.code == "train"){
let realtrain = new THREE.Group();
for(let j=6;j>0;j--){
let name = "c"+j;
for(let i=0;i<object.children.length;i++){
if(object.children[i].name == name){
object.children[i].position.x = object.children[i].position.x;
//object.children[i].position.y = j*10;
realtrain.add(object.children[i]);
i--;
}
}
}
model.mesh = realtrain;
model.animations = object.animations[0].tracks;
}else{
model.mesh = object;
model.action = mixer.clipAction( object.animations[ 0 ] );
model.action.setLoop(THREE.LoopOnce);
model.action.clampWhenFinished = true;
mixers.push(mixer);
//model.action.play();
}
// if(object.animations.length>0 && model.code != "train"){
//
//
// //model.action.play();
// }
resolve(model.locateType);
} );

View File

@ -278,6 +278,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 8, // 站台默认字体大小

View File

@ -387,6 +387,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -207,6 +207,10 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationStand] = {
common: { // 通用属性
textFontSize: 10, // 站台默认字体大小

View File

@ -408,6 +408,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -441,6 +441,11 @@ class SkinCode extends defaultStyle {
extendLength: 8 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.LcControl] = {
text: {
fontSize: 10, // 灯字体大小

View File

@ -420,6 +420,10 @@ class SkinCode extends defaultStyle {
strokeColor: 'red', // 线条颜色
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: true
};
this[deviceType.Switch] = {
text: {

View File

@ -458,6 +458,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.StationDelayUnlock] = {
text: {
distance: 3, // 延迟解锁和设备之间的距离

View File

@ -411,6 +411,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.Switch] = {
text: {
show: true, // 道岔名称显示

View File

@ -534,6 +534,11 @@ class SkinCode extends defaultStyle {
extendLength: 10 // 延伸长度
};
// 延续保护计时
this[deviceType.OverAp] = {
show: false
};
this[deviceType.AutomaticRoute] = {
// 是否显示
displayCondition: '03', // 显示条件 prdType

View File

@ -103,6 +103,12 @@ class Status {
fault: device.fault /** 非故障*/
};
}
handleOverAp(device) {
this.statusObj = {
remainTime: device.remainTime
};
}
handleZcControl(device) {
this.statusObj = { };
}

View File

@ -444,6 +444,7 @@ class Jlmap {
overlapRoute['points'] = { x: model.points[model.points.length - 1].x, y: model.points[model.points.length - 1].y };
}
overlapRoute['offsetRight'] = overlapRoute.pathList[0].right;
overlapRoute['sectionName'] = model.name;
this.$painter.update(overlapRoute);
} else if (elem.deviceType === 'CYCLE') {
store.dispatch('map/updateAutoReentryState', elem);

View File

@ -164,6 +164,7 @@ class MouseController extends Eventful {
click(e) {
var em = this.checkEvent(e);
// console.log(e, em, '====');
this.trigger(this.events.Selected, em);
}

View File

@ -43,13 +43,13 @@ export default class OverAp extends Group {
setState(model) {
this.text && this.text.hide();
if (model.remainTime) {
if (model.remainTime && this.style.OverAp.show) { // 目前哈尔滨线路显示
// console.log(model, model.remainTime, model.sectionName, '=====');
this.text && this.text.show();
let offset = 40;
if (!model.offsetRight) {
offset = -40;
}
// console.log(model.offsetRight, 'model');
this.text && this.text.attr({
style: {
text: model.remainTime,

View File

@ -795,7 +795,6 @@ export default class Section extends Group {
showRemainTime(number) { // 区段延时保护倒计时显示
this.releaseName && this.releaseName.show();
// this.releaseName && this.releaseName.setStyle({ text: number });
console.log(number, this.model.name, '====');
let pointX = this.model.points[0].x + 45;
let pointY = this.model.points[0].y;
if (!this.model.timeRight) {
@ -884,9 +883,12 @@ export default class Section extends Group {
getBoundingRect() {
if (this.section) {
return this.section.getBoundingRect();
// if (this.model.code == 'T197' || this.model.code == 'T189') {
// console.log(this.section.getBoundingRect().clone(), this.model, this.model.name);
// }
return this.section.getBoundingRect().clone();
} else if (this.name) {
return this.name.getBoundingRect();
return this.name.getBoundingRect().clone();
}
}

View File

@ -1,129 +0,0 @@
<template>
<el-dialog v-dialogDrag class="ningbo-01__systerm switch-control" :title="title" :visible.sync="show" width="300px" :before-close="doClose" :z-index="2000" :modal="false" :close-on-click-modal="false">
<el-row class="header">
<el-col :span="11"><span>设备:</span></el-col>
<el-col :span="11" :offset="2"><span>故障类型:</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="deviceName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-select v-model="faultType" style="height: 32px;" placeholder="请选择">
<el-option
v-for="item in faultList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
<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>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import { commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
import { deviceFaultType, deviceType} from '@/scripts/cmdPlugin/Config';
export default {
name: 'SwitchControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
operation: '',
stationName: '',
switchName: '',
activeShow: false,
deviceName: '',
faultType: '',
faultList: []
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
return '设置故障';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
if (!this.dialogShow) {
this.switchName = '';
this.stationName = '';
this.operation = operate.operation;
this.deviceName = deviceType[selected._type] + '-' + selected.name;
this.faultList = deviceFaultType[selected._type];
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
},
sendCommand(operate) { //
this.loading = true;
commitOperate(operate, {}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch((error) => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow({}, error.message);
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -17,12 +17,10 @@
:default-expand-all="true"
style="background: #f0f0f0;"
>
<div slot-scope="{ node, data }" style="height: 24px; width: 100%;">
<div slot-scope="{ data }" style="height: 24px; width: 100%;">
<div v-if="data.level == 1" style="line-height: 26px;">{{ data.name }}</div>
<div v-if="data.level == 2" style="background: lightgray; overflow: hidden; height: 100%;">
<div
style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;"
>
<div style="width: 46%;float: left; height: 24px; line-height: 24px; padding-left: 5px; border-right: 1px solid #f0f0f0;">
{{ data.name }}</div>
<div style="width: 54%;float: left; height: 24px; line-height: 24px; padding-left: 5px;">
{{ data.value }}</div>
@ -108,11 +106,6 @@ export default {
},
{
children: [
// {
// name: '',
// value: '',
// level: 2
// },
{
name: '站台',
value: '',
@ -179,19 +172,15 @@ export default {
//
this.treeData[1].children[1].value = selected.stationHoldTrain ? '已设置' : '未设置';
//
this.treeData[0].children[2].value = selected.parkingTime == 0 ? '自动' : `${selected.parkingTime}`;
this.treeData[0].children[2].value = selected.parkingTime >= 0 ? `${selected.parkingTime}` : '自动';
//
this.treeData[0].children[3].value = selected.allSkip || selected.assignSkip ? '已设置' : '未设置';
// if (selected.direction == '01') {
//
// }
if (!stationStand || !station) {
this.treeData[2].children[0].value = `自动`;
} else {
this.treeData[2].children[0].value = selected.runLevelTime > 0 ? `${station.name}${stationStand.name}:人工` : `${station.name}${stationStand.name}:自动`;
}
//
// this.tempData.push({ item: '', status: this.strategyMap[selected.reentryStrategy] ? this.strategyMap[selected.reentryStrategy] : '' });
},
doShow(operate, selected) {
this.selected = selected;

View File

@ -15,8 +15,8 @@
<template slot-scope="scope">
<span v-if="scope.row.controlMode == 'Center'">遥控</span>
<span v-else-if="scope.row.controlMode == 'Local'">站控</span>
<span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span>
<!-- <span v-else-if="scope.row.controlMode == 'Local' && $route.query.prdType == '02'">中心请求站控</span>
<span v-else-if="scope.row.controlMode == 'Center' && $route.query.prdType == '01'">现地请求遥控</span> -->
<span v-else>获取状态中...</span>
</template>
</el-table-column>

View File

@ -1,169 +0,0 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="380px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<div style="overflow: hidden;">
<div style="width: 98%; float: left; padding: 10px 15px; margin: 20px 0px; height: 120px;">
<!-- <span class="base-label">目的</span> -->
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal" style="width:280px">
<el-input v-model="addModel.trainGoal" />
</el-form-item>
</div>
</div>
</div>
</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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: ''
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '删除计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
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);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.deletePlanTrainId.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();
});
} 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(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,181 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-edit"
:title="title"
:visible.sync="show"
width="360px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">新车组号</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input :id="domIdInput" v-model="addModel.groupNumber" @change="inputGroupNumber" />
</el-col>
</el-row>
<el-row>
<el-col :span="12">车站</el-col>
<el-col :span="11" :offset="1">车次窗</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.stationName" :disabled="true" />
</el-col>
<el-col :span="11" :offset="1">
<el-input v-model="addModel.trainWindowCode" :disabled="true" />
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainEdit',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
stationName: '',
trainWindowCode: '',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdInput() {
return this.dialogShow ? OperationEvent.Train.editTrainId.input.domId : '';
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return '修改计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
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.editTrainId.input.operation,
val: this.addModel.groupNumber
};
this.$store.dispatch('training/next', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
commit() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.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(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
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(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,160 +0,0 @@
<template>
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-flag"
:title="title"
:visible.sync="show"
width="320px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">车组号:</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-input v-model="addModel.groupNumber" />
</el-col>
</el-row>
<el-row style="margin-top: 15px; margin-bottom: 30px">
<el-col :span="24">
<el-radio-group v-model="addModel.type" :disabled="true">
<el-radio label="01">备选项</el-radio>
<el-radio label="02">备选项</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10">
<el-button :id="domIdConfirm" type="primary" :loading="loading" @click="commit">确定</el-button>
</el-col>
<el-col :span="8" :offset="5">
<el-button :id="domIdCancel" @click="cancel"> </el-button>
</el-col>
</el-row>
<notice-info ref="noticeInfo" pop-class="ningbo-01__systerm" />
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {mouseCancelState} from '@/jmapNew/theme/components/utils/menuItemStatus';
export default {
name: 'TrainFlag',
components: {
NoticeInfo
},
data() {
return {
trainNoList: [],
selected: null,
addModel: {
type: '01',
groupNumber: ''
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.editTrainId.menu.domId : '';
},
title() {
return 'ATP切除功能';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
this.selected = selected;
//
if (!this.dialogShow) {
const section = this.$store.getters['map/getDeviceByCode'](selected.sectionCode);
if (section) {
const station = this.$store.getters['map/getDeviceByCode'](section.stationCode);
if (station) {
this.addModel.stationName = station.name;
}
}
this.addModel.trainWindowCode = selected.code;
}
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() {
const operate = {
send: true,
type: MapDeviceType.Train.type,
operation: OperationEvent.Train.editTrainId.menu.operation,
val: this.addModel.tripNumber
};
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();
});
},
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(() => { this.doClose(); });
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
/deep/ .el-row {
margin: 10px
}
.ningbo-01__systerm .el-dialog .base-label {
// background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -1,189 +0,0 @@
<template>
<!-- <el-dialog class="fuzhou_01 stand-stop-time" :title="title" :visible.sync="show" width="640px" :before-close="doClose" :zIndex="2000" -->
<el-dialog
v-dialogDrag
class="ningbo-01__systerm train-set-plan"
:title="title"
:visible.sync="show"
width="640px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form ref="form" size="small" label-width="80px" :model="addModel" :rules="rules">
<!-- <div style="width: 46%;">
<el-form-item label="车 组 号:" label-width="95px" prop="trainNo">
<el-input v-model="addModel.trainNo" disabled></el-input>
</el-form-item>
</div> -->
<div style="overflow: hidden;">
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px; margin-right: 4%;">
<span class="base-label"></span>
<div style="position: relative; top:-10px;">
<!-- <el-form-item prop="stationStandSource">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandSource" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code">
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="车 次 号:" prop="trainSource">
<el-input v-model="addModel.trainSource" />
</el-form-item>
</div>
</div>
<div style="width: 48%; float: left; padding: 10px 15px; border: 1px double lightgray; margin: 20px 0px; height: 120px;">
<span class="base-label">目的</span>
<div style="position: relative; top:-10px;">
<el-form-item prop="stationStandGoal">
<span slot="label">&emsp; :</span>
<el-select v-model="addModel.stationStandGoal" filterable placeholder="请选择">
<el-option v-for="item in stationStandList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item label="车 次 号:" prop="trainGoal">
<el-input v-model="addModel.trainGoal" />
</el-form-item>
</div>
</div>
</div>
</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>
</el-dialog>
</template>
<script>
import { mapGetters } from 'vuex';
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
export default {
name: 'TrainMove',
components: {
},
data() {
return {
trainNoList: [],
addModel: {
// trainNo: '',
trainSource: '',
// stationStandSource: '',
trainGoal: '',
stationStandGoal: ''
},
rules: {
// trainNo: [
// { required: true, message: '', trigger: 'blur' }
// ],
trainSource: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
// stationStandSource: [
// { required: true, message: '', trigger: 'change' }
// ],
trainGoal: [
{ required: true, message: '请输入车次号', trigger: 'blur' }
],
stationStandGoal: [
{ required: true, message: '请选择车站', trigger: 'change' }
]
},
dialogShow: false,
loading: false
};
},
computed: {
...mapGetters('map', [
'stationStandList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Train.moveTrainId.menu.domId : '';
},
title() {
return '平移计划车';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected) {
//
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);
},
commit() {
this.$refs['form'].validate((valid) => {
if (valid) {
const operate = {
send: true,
type: MapDeviceType.Train.type,
// operation: OperationEvent.Train.moveTrainId.menu.operation,
operation: OperationEvent.Train.moveEventlyTrainId.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();
});
} 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(() => { this.doClose(); });
}
}
};
</script>
<style scoped>
.fuzhou_01 .el-dialog .base-label {
background: rgba(0, 0, 0, x);
position: relative;
left: -5px;
top: -18px;
padding: 0 5px;
background-color: #F0F0F0;
}
</style>

View File

@ -5,10 +5,7 @@
<train-delete ref="trainDelete" />
<train-define ref="trainDefine" />
<train-move ref="trainMove" />
<!-- <train-edit ref="trainEdit" /> -->
<train-set-plan ref="trainSetPlan" />
<!-- <train-move-evently ref="trainMoveEvently" /> -->
<!-- <train-delete-plan ref="trainDeletePlan" /> -->
<train-set-head ref="trainSetHead" />
<train-set-work ref="trainSetWork" />
<trainSetWorkATP ref="trainSetWorkATP" />

View File

@ -1,162 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="xian-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="340px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="10"><span>车站</span></el-col>
<el-col :span="10" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="10">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="10" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<span>进路列表</span>
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="进路">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="控制状态" width="180">
<template slot-scope="scope">
{{ scope.row.atsControl == '0' ? '人工' : '自动' }}
</template>
</el-table-column>
</el-table>
</div>
<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>
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
export default {
name: 'RouteDetail',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
stationName: '',
signalName: ''
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdConfirm() {
return this.dialogShow ? OperationEvent.Signal.detail.menu.domId : '';
},
title() {
return '查询进路状态';
}
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
this.tempData = tempData || [];
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
commit() {
const operate = {
send: true,
operation: OperationEvent.Signal.detail.menu.operation
};
this.loading = true;
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,335 +0,0 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="xian-01__systerm route-hand-control"
:title="title"
:visible.sync="show"
width="300px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-row class="header">
<el-col :span="11"><span>集中站</span></el-col>
<el-col :span="11" :offset="2"><span>始端信号机</span></el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-input v-model="stationName" size="small" disabled />
</el-col>
<el-col :span="11" :offset="2">
<el-input v-model="signalName" size="small" disabled />
</el-col>
</el-row>
<div class="table">
<el-table
ref="tempTable"
:data="tempData"
border
style="width: 100%"
size="mini"
highlight-current-row
:height="140"
>
<el-table-column label="选择" width="55" style="margin-left:50px; text-align: right;">
<template slot-scope="scope">
<el-checkbox
v-model="changeList[scope.$index]"
style="text-align: center; display: block;"
:disabled="scope.row.disabled"
@change="changeCheck(changeList[scope.$index],scope.row.code)"
/>
</template>
</el-table-column>
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px">
<template slot-scope="scope">
<span :style="{color: scope.row.disabled ? '#CBCBCB':'unset'}">{{ scope.row.name }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-row>
<el-col :span="22" :offset="1">
<el-checkbox v-model="allSelect" size="small" @change="allSelectChange">全选</el-checkbox>
</el-col>
</el-row>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button
:id="domIdConfirm"
type="primary"
:disabled="commitDisabled"
: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>
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
import OperationHandler from '@/scripts/cmdPlugin/OperationHandler';
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
export default {
name: 'RouteHandControl',
components: {
NoticeInfo
},
data() {
return {
dialogShow: false,
loading: false,
selected: null,
tempData: [],
operation: null,
selection: [],
stationName: '',
signalName: '',
allSelect: false,
changeList:[],
commitDisabled: true,
disabledLength: 0
};
},
computed: {
...mapGetters('map', [
'signalList'
]),
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
domIdCancel() {
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
},
domIdChoose() {
if (this.dialogShow) {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return OperationEvent.Signal.humanControl.choose.domId;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return OperationEvent.Signal.atsAutoControl.choose.domId;
} else {
return '';
}
} else {
return '';
}
},
domIdConfirm() {
return this.dialogShow ? OperationHandler.getDomIdByOperation(this.operation) : '';
},
title() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
return '进路交人工控';
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
return '进路交自动控';
} else {
return '';
}
}
},
watch: {
},
mounted() {
this.$nextTick(() => {
this.$store.dispatch('training/tipReload');
});
},
methods: {
doShow(operate, selected, tempData) {
this.selected = selected;
this.allSelect = false;
this.changeList = [];
this.commitDisabled = true;
this.selection = [];
this.disabledLength = 0;
//
if (!this.dialogShow) {
this.signalName = '';
this.stationName = '';
if (selected && selected._type.toUpperCase() === 'Signal'.toUpperCase()) {
this.signalName = selected.name;
const station = this.$store.getters['map/getDeviceByCode'](selected.stationCode);
if (station) {
this.stationName = station.name;
}
}
if (tempData && tempData.length > 0) {
tempData.forEach(elem => {
this.changeList.push(false);
elem.disabled = false;
//
if (operate.operation == OperationEvent.Signal.humanControl.menu.operation &&
(elem.atsControl == 0)) {
elem.disabled = true;
this.disabledLength++;
} if (operate.operation == OperationEvent.Signal.atsAutoControl.menu.operation &&
(elem.atsControl != 0)) {
elem.disabled = true;
this.disabledLength++;
}
});
}
this.tempData = tempData || [];
this.operation = operate.operation;
}
this.dialogShow = true;
this.$nextTick(function () {
this.$store.dispatch('training/emitTipFresh');
});
},
doClose() {
this.loading = false;
this.dialogShow = false;
this.$refs.tempTable.setCurrentRow();
this.$store.dispatch('training/emitTipFresh');
},
changeCheck(check, code) {
if (check) {
this.selection.push(code);
} else {
this.selection.splice(this.selection.indexOf(code), 1);
}
if (this.selection.length >= (this.tempData.length - this.disabledLength) ) {
this.allSelect = true;
} else {
this.allSelect = false;
}
if (this.selection.length > 0) {
this.commitDisabled = false;
} else {
this.commitDisabled = true;
}
const operate = {val:code};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
},
allSelectChange() {
this.changeList = [];
if (this.allSelect) {
this.tempData.forEach((item, index)=> {
if (!item.disabled) {
this.changeList.push(true);
this.selection.push(item.code);
} else {
this.changeList.push('');
}
});
this.allSelect = true;
if (this.selection.length > 0) {
this.commitDisabled = false;
}
} else {
this.tempData.forEach((item, index) => {
if (!item.disabled) {
this.changeList.push(false);
this.selection.splice(this.selection.indexOf(item.code), 1);
}
});
this.allSelect = false;
this.commitDisabled = true;
}
},
handleChooseChange(selection) {
this.selection = selection;
if (selection && selection.length) {
const operate = {
repeat: true,
operation: '',
selection: selection
};
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
operate.operation = OperationEvent.Signal.humanControl.choose.operation;
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
operate.operation = OperationEvent.Signal.atsAutoControl.choose.operation;
}
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
}
});
} else if (!selection) {
this.$messageBox(`请选择一条数据`);
}
},
commit() {
if (this.operation == OperationEvent.Signal.humanControl.menu.operation) {
/** 进路交人工控*/
this.humanControl();
} else if (this.operation == OperationEvent.Signal.atsAutoControl.menu.operation) {
/** 进路交自动控*/
this.atsAutoControl();
}
},
//
humanControl() {
this.loading = true;
commitOperate(menuOperate.Signal.humanControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
//
atsAutoControl() {
this.loading = true;
commitOperate(menuOperate.Signal.atsAutoControl, {routeCodeList:this.selection}, 2).then(({valid})=>{
this.loading = false;
if (valid) {
this.doClose();
}
}).catch(() => {
this.loading = false;
this.doClose();
this.$refs.noticeInfo.doShow();
});
},
cancel() {
const operate = {
operation: OperationEvent.Command.cancel.menu.operation
};
this.$store.dispatch('training/nextNew', operate).then(({ valid }) => {
if (valid) {
this.doClose();
}
}).catch(() => {
this.doClose();
});
}
}
};
</script>

View File

@ -1,14 +1,14 @@
<template>
<div>
<pop-menu ref="popMenu" :menu="menu" :pop-menu-class="systemName" />
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="xian-01__systerm" />
<route-selection ref="routeSelection" />
<route-lock ref="routeLock" />
<route-control ref="routeControl" :pop-class="systemName" />
<route-control ref="routeControl" pop-class="xian-01__systerm" />
<route-cmd-control ref="routeCmdControl" />
<notice-info ref="noticeInfo" pop-class="xian-01__systerm" />
<route-hand-control ref="routeHandControl" :system-name="systemName" />
<route-detail ref="routeDetail" :system-name="systemName" />
<set-fault ref="setFault" :pop-class="systemName" />
<route-hand-control ref="routeHandControl" system-name="xian-01__systerm" />
<route-detail ref="routeDetail" system-name="xian-01__systerm" />
<set-fault ref="setFault" pop-class="xian-01__systerm" />
</div>
</template>
@ -52,7 +52,6 @@ export default {
data() {
return {
menu: [],
systemName:'xian-01__systerm',
menuNormal: {
Local: [
{

View File

@ -276,6 +276,36 @@ export const publicAsyncRoute = [
hidden: true
}
]
},
{
path: '/device/teachDetail',
component: TeachDetail,
hidden: true
},
{
path: '/device/course',
component: ExamCourseDetail,
hidden: true
},
{
path: '/device/examRule/manage',
component: PublishExamRule,
hidden: true
},
{
path: '/device/examRule/draft/:mode/:ruleId/:lessonId',
component: PublishExamRuleDraft,
hidden: true
},
{ // 试卷详情
path: '/device/exam/:examId',
component: ExamDetail,
hidden: true
},
{ // 考试结果
path: '/device/result/:userExamId',
component: ExamResult,
hidden: true
}
];
export const asyncRouter = [

View File

@ -20,6 +20,9 @@ const runPlan = {
stations: (state) => {
return state.stations || [];
},
draftStations: (state) => {
return state.draftStations || [];
},
convertPlanData: (state) => () => {
const data = { serviceNumberDataList: [] };
const serviceNumberList = Object.keys(state.editData).sort((a, b) => {

View File

@ -3,7 +3,7 @@ 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'; // 袁.el-button+.el-button
// BASE_API = 'http://192.168.3.5:9000'; // 袁
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康

View File

@ -457,6 +457,8 @@ export default {
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
} else {
this.$message.error('暂无教学系统数据!');
}
}).catch(() => {
this.$message.error('获取课程ID失败');
@ -487,21 +489,13 @@ export default {
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
} else {
this.$message.error('暂无考试系统数据!');
}
}).catch(() => {
this.$message.error('获取课程ID失败');
});
}
},
handleRunPlan() {
const routeData = this.$router.resolve({
path:`/device/runPlan/${this.mapId}`,
query:{
lineCode:this.lineCode,
noPreLogout: true
}
});
window.open(routeData.href, '_blank', 'noopener noreferrer');
}
}
};

View File

@ -78,7 +78,6 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
delete this.editModel.children;
this.verifyMapName();
}
});
@ -93,12 +92,13 @@ export default {
}
} catch (error) {
console.log(error);
this.loading = false;
}
},
confirmPublish() {
this.$confirm(this.$t('map.verifyMapName'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
this.$confirm('地图名称重复,您确认发布此地图将会覆盖公共地图?', '提示', {
confirmButtonText: '确 定',
cancelButtonText: '取 消',
type: 'warning'
}).then(() => {
this.publishMap();

View File

@ -347,19 +347,7 @@ export default {
return menus;
},
initMenu() {
const menuLoading = [];
const menuDelete = [];
const menuPublish = [];
this.runPlanList.forEach(item => {
menuLoading.push({title: item.name, planId:item.id, planName: item.name, click: this.loadingRunPlan});
menuDelete.push({title: item.name, planId:item.id, planName: item.name, click: this.deleteRunPlanOperate});
menuPublish.push({title: item.name, planId:item.id, planName: item.name, click: this.publishRunPlan});
});
if (this.runPlanList.length) {
this.menus = this.menuConvert([...this.menuBase, {title: '加载', children: menuLoading}, {title: '删除', children: menuDelete}, {title: '发布', children:menuPublish}]);
} else {
this.menus = this.menuConvert(this.menuBase);
}
this.clickEvent();
this.closeMenu();
},
@ -387,7 +375,6 @@ export default {
},
hookClick(item, event) {
this.closeMenu();
// launchFullscreen();
if (!item.disabled) {
setTimeout(() => {
if (item && typeof item.click == 'function') {
@ -590,7 +577,9 @@ export default {
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
}).catch(() => {
this.$message.error('删除运行图失败!');
});
},
publishRunPlan(param) {
this.$confirm(this.$t('tip.publishRunPlanTips'), this.$t('tip.hint'), {

View File

@ -5,10 +5,11 @@
:plan-convert="PlanConvert"
:run-plan-list="runPlanList"
:load-run-plan-id="loadRunPlanId"
:load-run-plan-name="loadRunPlanName"
@doClose="doClose"
@dispatchDialog="dispatchDialog"
@loadingRunPlan="loadingRunPlan"
@checkIsLoadRunPlan="checkIsLoadRunPlan"
@refresh="refreshRunPlanList"
@modifyRunPlanName="modifyRunPlanName"
/>
<schedule
@ -179,12 +180,19 @@ export default {
refresh() {
this.$store.dispatch('runPlan/refresh');
},
refreshRunPlanList(firstLoad) {
refreshRunPlanList(planId) {
getRpListByMapId(this.$route.query.mapId).then(resp => {
this.runPlanList = resp.data || [];
if (firstLoad && this.runPlanList.length) {
this.loadRunPlanId = this.runPlanList[0].id;
this.loadRunPlanName = this.runPlanList[0].name;
if (planId && this.runPlanList.length) {
this.runPlanList.forEach(item => {
if (item.id === planId) {
this.loadRunPlanId = item.id;
this.loadRunPlanName = item.name;
}
});
} else {
this.loadRunPlanId = '';
this.loadRunPlanName = '';
}
}).catch(() => {
this.$message.error('获取草稿运行图列表失败');
@ -197,9 +205,6 @@ export default {
this.loadRunPlanId = param.planId;
this.loadRunPlanName = param.planName;
},
checkIsLoadRunPlan(planId) {
this.refreshRunPlanList(planId === this.loadRunPlanId);
},
modifyRunPlanName() {
if (this.loadRunPlanId && this.loadRunPlanName) {
this.$refs.editPlan.doShow({id: this.loadRunPlanId, name: this.loadRunPlanName});

View File

@ -37,9 +37,11 @@
<div class="menu-li-block" :disabled="child.disabled">
<span class="menu-li-text">
<span class="label">{{ child.title }}</span>
<i v-if="j!==classB" class="el-icon-arrow-right" style="float: right;height: 30px;line-height: 30px;" />
<i v-if="j===classB" class="el-icon-arrow-left" style="float: right;height: 30px;line-height: 30px;" />
</span>
</div>
<ul class="menu-ul" :class="{'active' :j==classB}">
<ul class="menu-ul" :class="{'children-active' :j==classB}" style="padding-left: 2px;">
<template v-for="(grandchild,k) in child.children">
<li v-if="grandchild.type === 'separator'" :key="k" class="menu-separator">
<span class="separator">&ensp;</span>
@ -110,13 +112,27 @@
<span class="nav-li-text">{{ dispaly?'关闭':$t('global.back') }}</span>
</div>
</div>
<el-dialog
title="运行图发布"
:visible.sync="publishVisible"
width="30%"
center
:modal="false"
:before-close="handleClose"
>
<el-input v-model="publishName"><template slot="prepend">运行图名称:</template></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="publishVisible = false"> </el-button>
<el-button type="primary" @click="confirmPublish"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { planEffectiveCheck } from '@/api/runplan';
import { EventBus } from '@/scripts/event-bus';
import { publishRunPlan } from '@/api/designPlatform';
import { publishRunPlanAllUser } from '@/api/designPlatform';
import { deleteRunPlan } from '@/api/runplan';
export default {
@ -139,6 +155,12 @@ export default {
default: function() {
return '';
}
},
loadRunPlanName: {
type: String,
default: function() {
return '';
}
}
},
data() {
@ -150,14 +172,16 @@ export default {
tempClassB: -1,
menus: [],
loading: null,
publishName: '',
publishVisible: false,
menuBase: [
{
title: this.$t('planMonitor.file'),
children: [
{
title: '查看站间运行等级',
click: this.handleModifyingStationIntervalTime
},
// {
// title: '',
// click: this.handleModifyingStationIntervalTime
// },
{
title: '填充通用数据',
click: this.populatingGenericData
@ -165,14 +189,26 @@ export default {
{
title: '创建运行图',
click: this.newRunPlan
},
{
title: '打开',
children: []
},
{
title: '删除',
click: this.deleteRunPlanOperate
},
{
title: '发布',
click: this.publishRunPlan
}
]
},
{
title: this.$t('planMonitor.view'),
children: [
]
},
// {
// title: this.$t('planMonitor.view'),
// children: [
// ]
// },
{
title: this.$t('planMonitor.tool'),
children: [
@ -290,18 +326,19 @@ export default {
},
initMenu() {
const menuLoading = [];
const menuDelete = [];
const menuPublish = [];
this.runPlanList.forEach(item => {
menuLoading.push({title: item.name, planId:item.id, planName: item.name, click: this.loadingRunPlan});
menuDelete.push({title: item.name, planId:item.id, planName: item.name, click: this.deleteRunPlanOperate});
menuPublish.push({title: item.name, planId:item.id, planName: item.name, click: this.publishRunPlan});
});
if (this.runPlanList.length) {
this.menus = this.menuConvert([...this.menuBase, {title: '加载', children: menuLoading}, {title: '删除', children: menuDelete}, {title: '发布', children:menuPublish}]);
} else {
this.menus = this.menuConvert(this.menuBase);
this.menuBase.forEach(item => {
if (item.title === this.$t('planMonitor.file')) {
item.children.forEach(elem => {
if (elem.title === '打开') {
elem.children = menuLoading;
}
});
}
});
this.menus = this.menuConvert(this.menuBase);
this.clickEvent();
this.closeMenu();
},
@ -504,32 +541,43 @@ export default {
loadingRunPlan(param) {
this.$emit('loadingRunPlan', param);
},
deleteRunPlanOperate(param) {
deleteRunPlanOperate() {
//
if (this.loadRunPlanId) {
this.$confirm(this.$t('planMonitor.openRunPlan.confirmDeleteRunPlan'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
deleteRunPlan(param.planId).then(Response => {
deleteRunPlan(this.loadRunPlanId).then(Response => {
this.$message.success(this.$t('planMonitor.openRunPlan.deleteSuccess'));
this.$emit('checkIsLoadRunPlan', param.planId);
this.$emit('refresh');
}).catch(() => {
this.$messageBox(this.$t('tip.deleteOperationGraphFailed'));
});
}).catch(() => { });
} else {
this.$message.error('请先打开运行图!');
}
},
publishRunPlan(param) {
this.$confirm(this.$t('tip.publishRunPlanTips'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
publishRunPlan(param.planId, {runPlanName: param.planName}).then(resp => {
publishRunPlan() {
if (this.loadRunPlanId) {
this.publishVisible = true;
this.publishName = this.loadRunPlanName;
} else {
this.$message.error('请先打开运行图!');
}
},
handleClose() {
this.publishVisible = false;
},
confirmPublish() {
publishRunPlanAllUser(this.loadRunPlanId, this.publishName || this.loadRunPlanName).then(resp => {
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
this.publishVisible = false;
}).catch(() => {
this.$messageBox(this.$t('tip.publishRunPlanFail'));
});
this.publishVisible = false;
});
}
}
@ -621,7 +669,11 @@ export default {
left: 0;
display: block !important;
}
.children-active {
position: relative;
left: 160px;
display: block !important;
}
.menu-ul-text {
font-size: 14px;
letter-spacing: 0;

View File

@ -40,7 +40,7 @@
</el-form>
</el-row>
</el-tab-pane>
<el-tab-pane label="导入运行图" name="three">
<el-tab-pane v-if="$route.path.includes('device')" label="导入运行图" name="three">
<el-row>
<el-button type="text" class="uploadDemo">
<input
@ -152,7 +152,7 @@ export default {
if (valid) {
this.loading = true;
createEmptyPlan(this.newModel).then(resp => {
this.$emit('refresh');
this.$emit('refresh', resp.data);
this.$message.success(this.$t('tip.createAnEmptyRunGraphSuccessfully'));
this.doClose();
}).catch((error) => {
@ -167,7 +167,7 @@ export default {
this.loading = true;
postCreatePlan(this.pullModel).then(resp => {
this.$message.success(this.$t('tip.createARunGraphSuccessfully'));
this.$emit('refresh');
this.$emit('refresh', resp.data);
this.doClose();
}).catch((error) => {
this.$messageBox(this.$t('error.createOperationGraphFailed') + this.$t('global.colon') + error.message);

View File

@ -24,7 +24,6 @@
import { mapGetters } from 'vuex';
import { timeFormat } from '@/utils/date';
import { getStationList, queryRunPlan } from '@/api/runplan';
import { getPublishMapInfo } from '@/api/jmap/map';
import DataTable from './menus/components/dataTable';
import echarts from 'echarts';
@ -63,7 +62,6 @@ export default {
return {
top: 0,
height: 0,
mapName: '',
runPlanId: 'plan-tool',
myChart: null,
showTrain: false,
@ -223,7 +221,7 @@ export default {
},
computed: {
...mapGetters('runPlan', [
'stations'
'draftStations'
])
},
watch: {
@ -365,7 +363,7 @@ export default {
}
height = height - top;
this.$store.dispatch('runPlan/resize', { width, height });
this.$store.dispatch('runPlan/resize', { width, height:height - 20 });
if (this.top != top) {
this.top = top;
@ -378,9 +376,6 @@ export default {
},
async loadChartPage() {
try {
getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = `${resp.data.name} (${this.$route.query.planName || this.loadRunPlanName || ''})`;
});
this.$store.dispatch('runPlan/draftClear').then(() => {
// this.loadInitChart().then(() => {
if (this.$route.query.mapId) {
@ -399,9 +394,13 @@ export default {
this.myChart && this.myChart.hideLoading();
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
});
} else {
this.clearCanvas();
// this.clearCanvas();
this.$store.dispatch('runPlan/setDraftPlanData', {serviceNumberDataList: []}).then(()=> {
this.analyticalServiceNumber(this.$store.state.runPlan.draftEditData);
this.loadChartData();
this.myChart && this.myChart.hideLoading();
});
}
});
}).catch(() => {
@ -428,7 +427,7 @@ export default {
this.option.series = [];
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.draftStations)]);
this.pushModels(this.option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
await this.loadInitChart();
@ -472,7 +471,7 @@ export default {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
this.option.title.text = this.mapName;
this.option.title.text = this.loadRunPlanName;
this.myChart = echarts.init(document.getElementById(this.runPlanId));
this.myChart.setOption(this.option);
this.reSize({ width: this.$store.state.runPlan.width, height: this.$store.state.runPlan.height });
@ -482,31 +481,19 @@ export default {
}
});
},
refreshRunPlanName(name) {
getPublishMapInfo(this.$route.query.mapId).then(resp => {
this.mapName = `${resp.data.name} (${name})`;
this.myChart.setOption({
title: {
text: this.mapName,
left: 'center', //
top: '10px'
}
});
});
},
clearCanvas() {
this.option.series = [];
this.option.title.text = '';
if (this.myChart) {
this.myChart.clear();
}
this.myChart.setOption(this.option);
this.myChart && this.myChart.setOption(this.option);
},
xAxisPointFormat(params) {
return timeFormat(params.value);
},
yAxisPointFormat(params) {
return this.planConvert.computedFormatYAxis(this.stations, params);
return this.planConvert.computedFormatYAxis(this.draftStations, params);
},
xAxisLableFormat(value, index) {
if (value % 60 === 0) {
@ -536,9 +523,9 @@ export default {
},
yAxisInit() {
if (Object.keys(this.planConvert).length) {
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.stations)]);
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.stations);
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.stations);
this.pushModels(this.option.series, [this.planConvert.initializeYaxis(this.draftStations)]);
this.option.yAxis.min = this.planConvert.computedYaxisMinValue(this.draftStations);
this.option.yAxis.max = this.planConvert.computedYaxisMaxValue(this.draftStations);
}
},
axisTooltip(param) {

View File

@ -32,27 +32,6 @@ export default {
pageIndex: 'pageNum'
},
lessonName: '',
queryForm: {
labelWidth: '160px',
queryObject: {
'lessonId': {
type: this.$route.query.lessonId ? '' : 'select',
label: this.$t('publish.lessonName'),
config: {
data: []
}
},
'name': {
type: 'text',
label: this.$t('publish.paperName')
},
'creatorName': {
type: 'text',
label: this.$t('publish.creator')
}
},
reset: !this.$route.query.lessonId
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
@ -163,11 +142,52 @@ export default {
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleNormalAdd },
{ text: this.$t('global.back'), btnCode: 'employee_back', handler: this.handlerBack }
{ text: this.$t('global.back'), show: !this.$route.path.includes('device'), btnCode: 'employee_back', handler: this.handlerBack }
]
}
};
},
computed: {
queryForm() {
return this.$route.path.includes('device') ? {
labelWidth: '160px',
queryObject: {
'lessonId': {
type: this.$route.query.lessonId ? '' : 'select',
label: this.$t('publish.lessonName'),
config: {
data: []
}
},
'name': {
type: 'text',
label: this.$t('publish.paperName')
}
},
reset: !this.$route.query.lessonId
} : {
labelWidth: '160px',
queryObject: {
'lessonId': {
type: this.$route.query.lessonId ? '' : 'select',
label: this.$t('publish.lessonName'),
config: {
data: []
}
},
'name': {
type: 'text',
label: this.$t('publish.paperName')
},
'creatorName': {
type: 'text',
label: this.$t('publish.creator')
}
},
reset: !this.$route.query.lessonId
};
}
},
created() {
this.loadInitData();
},
@ -184,7 +204,13 @@ export default {
if (elem.id == this.$route.query.lessonId) {
this.lessonName = elem.name;
}
if (this.$route.path.includes('device')) {
if (elem.mapId === this.$route.query.mapId) {
this.queryForm.queryObject.lessonId.config.data.push({ value: elem.id, label: elem.name });
}
} else {
this.queryForm.queryObject.lessonId.config.data.push({ value: elem.id, label: elem.name });
}
});
});
@ -203,6 +229,8 @@ export default {
queryFunction(params) {
if (this.$route.query.lessonId) {
params.lessonId = this.$route.query.lessonId;
} else if (this.$route.path.includes('device')) {
params.mapId = this.$route.query.mapId;
}
return getExamList(params);
},

View File

@ -45,7 +45,15 @@ export default {
this.dialogVisible = false;
this.$set(this.row, 'loading' + this.idx, true);
try {
const res = await getPublishMapExportNew(this.row.id, this.checkList);
const data = {
mapData: this.checkList.includes('MAP_DATA'),
runPlan: this.checkList.includes('RUN_PLAN'),
map3dData: this.checkList.includes('MAP_3D_DATA'),
map3dModel: this.checkList.includes('MAP_3D_MODEL'),
commandDefinition: this.checkList.includes('COMMAND_DEFINITION'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG')
};
const res = await getPublishMapExportNew(this.row.id, data);
const resultData = res.data;
if (resultData === false) {
return;

View File

@ -12,7 +12,7 @@
<script>
// getPublishMapExport
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, getPublishMapExport } from '@/api/jmap/map';
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo, getPublishMapExport, getPublishMapImportNew } from '@/api/jmap/map';
import { getLineCodeList } from '@/api/management/mapline';
import localStore from 'storejs';
import UpdateOperate from './draft.vue';
@ -133,8 +133,9 @@ export default {
},
{
name: '导入',
handleClick: this.handleExportMap,
type: 'default'
handleClick: this.handleImportMap,
type: 'file',
id: 'queryPagesFilesInput'
},
{
name: '导出',
@ -354,42 +355,64 @@ export default {
formatJson(filterVal, jsonData) {
return jsonData.map(v => filterVal.map(j => v[j]));
},
//
queryExportData(data) {
return new Promise((resolve, reject) => {
const result = {
base: []
};
const obj = {};
const list = ['graphData', 'logicData'];
for (const i in data) {
if (list.includes(i)) {
for (const v in data[i]) {
if (data[i][v].length) {
result[v] = [...data[i][v]];
} else if (v == 'skinVO') {
result[v] = [data[i][v]];
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
// //
// queryExportData(data) {
// return new Promise((resolve, reject) => {
// const result = {
// base: []
// };
// const obj = {};
// const list = ['graphData', 'logicData'];
// for (const i in data) {
// if (list.includes(i)) {
// for (const v in data[i]) {
// if (data[i][v].length) {
// result[v] = [...data[i][v]];
// } else if (v == 'skinVO') {
// result[v] = [data[i][v]];
// }
// }
// } else if (data[i] instanceof Object || typeof data[i] != 'object') {
// obj[i] = data[i];
// } else if (data[i] instanceof Array) {
// if (data[i].length) {
// obj[i] = [...data[i]];
// }
// }
// }
result.base.push(obj);
resolve(result);
});
},
// result.base.push(obj);
// resolve(result);
// });
// },
mapSort() {
this.$router.push({ path: `/publish/mapSort`});
},
localExport() {
this.$refs['localMap'].doShow();
},
handleImportMap(index, row, idx) {
setTimeout(() => {
this.$set(row, 'loading' + idx, true);
const obj = document.getElementById('queryPagesFilesInput');
if (!obj.files) return;
const f = obj.files[0];
const reader = new FileReader();
const that = this;
reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result;
getPublishMapImportNew(row.id, JSON.parse(data)).then(res => {
that.$message.success('导入成功!');
that.$set(row, 'loading' + idx, false);
}).catch(error => {
that.$message.error('导入失败' + error.message);
that.$set(row, 'loading' + idx, false);
});
obj.value = '';
};
});
},
localImport() {
const loading = this.$loading({
lock: true,
@ -417,124 +440,124 @@ export default {
obj.value = '';
};
});
},
//
queryExportDataSame(data) {
const mapProps = {};
}
// //
// queryExportDataSame(data) {
// const mapProps = {};
mapProps['stationStandList'] = {
filter: item => { return true; },
propList: {
'direction': item => {
switch (item.direction) {
case '01': return '下行';
case '02': return '上行';
default: return '未知';
}
},
'name': (item, devices) =>{
let name = '';
if (item.stationCode) {
const stationList = devices['stationList'];
const station = stationList.find(elem => { return item.stationCode == elem.code; });
if (station) {
name = station.name;
}
}
return name;
},
'code': item => {
return item.code;
}
}
};
mapProps['switchList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['signalList'] = {
filter: item => { return true; },
propList: {
'name': item =>{
return item.name;
},
'code': item => {
return item.code;
}
}
};
mapProps['sectionList'] = {
filter: item => { return item.type == '01'; },
propList: {
'name': (item, devices) =>{
let name = item.name;
if (item.isSwitchSection) {
const swchList = devices['switchList'];
const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
if (swch) {
if (item.code == swch.sectionACode) {
name = `${name} (${swch.name}-A)`;
} else if (item.code == swch.sectionBCode) {
name = `${name} (${swch.name}-B)`;
} else if (item.code == swch.sectionCCode) {
name = `${name} (${swch.name}-C)`;
}
}
}
// mapProps['stationStandList'] = {
// filter: item => { return true; },
// propList: {
// 'direction': item => {
// switch (item.direction) {
// case '01': return '';
// case '02': return '';
// default: return '';
// }
// },
// 'name': (item, devices) =>{
// let name = '';
// if (item.stationCode) {
// const stationList = devices['stationList'];
// const station = stationList.find(elem => { return item.stationCode == elem.code; });
// if (station) {
// name = station.name;
// }
// }
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['switchList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['signalList'] = {
// filter: item => { return true; },
// propList: {
// 'name': item =>{
// return item.name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
// mapProps['sectionList'] = {
// filter: item => { return item.type == '01'; },
// propList: {
// 'name': (item, devices) =>{
// let name = item.name;
// if (item.isSwitchSection) {
// const swchList = devices['switchList'];
// const swch = swchList.find(elem => { return item.relSwitchCode == elem.code; });
// if (swch) {
// if (item.code == swch.sectionACode) {
// name = `${name} (${swch.name}-A)`;
// } else if (item.code == swch.sectionBCode) {
// name = `${name} (${swch.name}-B)`;
// } else if (item.code == swch.sectionCCode) {
// name = `${name} (${swch.name}-C)`;
// }
// }
// }
return name;
},
'code': item => {
return item.code;
}
}
};
// return name;
// },
// 'code': item => {
// return item.code;
// }
// }
// };
return new Promise((resolve, reject) => {
const result = {
base: []
};
const obj = {};
const list = ['graphData', 'logicData'];
for (const i in data) {
if (list.includes(i)) {
for (const v in data[i]) {
if (data[i][v].length) {
if (mapProps[v]) {
const list = [];
data[i][v].forEach(device => {
if (mapProps[v].filter(device)) {
const obj = {};
Object.keys(mapProps[v].propList || []).forEach(key => {
obj[key] = mapProps[v].propList[key](device, data[i]);
});
list.push(obj);
}
});
result[v] = list;
}
}
}
} else if (data[i] instanceof Object || typeof data[i] != 'object') {
obj[i] = data[i];
} else if (data[i] instanceof Array) {
if (data[i].length) {
obj[i] = [...data[i]];
}
}
}
// return new Promise((resolve, reject) => {
// const result = {
// base: []
// };
// const obj = {};
// const list = ['graphData', 'logicData'];
// for (const i in data) {
// if (list.includes(i)) {
// for (const v in data[i]) {
// if (data[i][v].length) {
// if (mapProps[v]) {
// const list = [];
// data[i][v].forEach(device => {
// if (mapProps[v].filter(device)) {
// const obj = {};
// Object.keys(mapProps[v].propList || []).forEach(key => {
// obj[key] = mapProps[v].propList[key](device, data[i]);
// });
// list.push(obj);
// }
// });
// result[v] = list;
// }
// }
// }
// } else if (data[i] instanceof Object || typeof data[i] != 'object') {
// obj[i] = data[i];
// } else if (data[i] instanceof Array) {
// if (data[i].length) {
// obj[i] = [...data[i]];
// }
// }
// }
result.base.push(obj);
resolve(result);
});
}
// result.base.push(obj);
// resolve(result);
// });
// }
}
};
</script>

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.