# Conflicts:
#	src/utils/baseUrl.js
This commit is contained in:
zyy 2020-10-27 16:52:51 +08:00
commit 03845f3ed8
29 changed files with 1046 additions and 321 deletions

View File

@ -164,11 +164,3 @@ export function loadDraftScriptNewMode(memberId, group, mode) {
}); });
} }
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}

View File

@ -95,3 +95,10 @@ export function aKeyGeneratingLesson(data) {
data: data data: data
}); });
} }
/** 根据课程ID获取班级 */
export function getExamClassList(lessonId) {
return request({
url: `/api/lesson/${lessonId}/classes`,
method: 'get'
});
}

View File

@ -85,14 +85,14 @@ export function getLessonChapterDetail(data) {
}); });
} }
/** 发布课程*/ // /** 发布课程*/
export function publishLesson(data) { // export function publishLesson(data) {
return request({ // return request({
url: `/api/lessonDraft/${data.id}/publish`, // url: `/api/lessonDraft/${data.id}/publish`,
method: 'post', // method: 'post',
data: data // data: data
}); // });
} // }
/** 课程章节拖拽排序*/ /** 课程章节拖拽排序*/
export function dragSortLessonChapter(data) { export function dragSortLessonChapter(data) {

View File

@ -16,13 +16,13 @@ export function getPublishMapListOnline() {
}); });
} }
/** 根据皮肤获取发布地图列表*/ // /** 根据皮肤获取发布地图列表*/
export function getPublishMapListByLineCode(lineCode) { // export function getPublishMapListByLineCode(lineCode) {
return request({ // return request({
url: `/api/map/${lineCode}/list`, // url: `/api/map/${lineCode}/list`,
method: 'get' // method: 'get'
}); // });
} // }
/** 根据地图id获取地图版本信息*/ /** 根据地图id获取地图版本信息*/
export function getPublishMapVersionById(id) { export function getPublishMapVersionById(id) {
@ -133,13 +133,13 @@ export function getPublishMapDetailList(params, code) {
}); });
} }
/** 获取有屏蔽门的站台列表*/ // /** 获取有屏蔽门的站台列表*/
export function hasDoorStationList(mapId) { // export function hasDoorStationList(mapId) {
return request({ // return request({
url: `/api/map/${mapId}/stand/hasDoor`, // url: `/api/map/${mapId}/stand/hasDoor`,
method: 'get' // method: 'get'
}); // });
} // }
// /** 修改发布地图城市*/ // /** 修改发布地图城市*/
// export function updatePublishMapCity(data) { // export function updatePublishMapCity(data) {
@ -254,3 +254,27 @@ export function getStandListByStationCode(id, stationCode) {
method: 'get' method: 'get'
}); });
} }
/** 获取已发布的有地图的城市列表*/
export function publisMapCityList(data) {
return request({
url: `/api/map/city?dicCode=${data}`,
method: 'get'
});
}
// // 获取所有需要值班员的车站(新版)
// export function getAvailableStaionList(mapId) {
// return request({
// url: `/api/map/${mapId}/station/needSupervisor`,
// method: 'get'
// });
// }
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}

View File

@ -239,11 +239,3 @@ export function realDeviceIsUsedNew(group, projectCode) {
}); });
} }
// 获取所有需要值班员的车站(新版)
export function getAvailableStaionList(mapId) {
return request({
url: `/api/map/${mapId}/station/needSupervisor`,
method: 'get'
});
}

View File

@ -101,11 +101,3 @@ export function getExamParperList(lessonId) {
method: 'get' method: 'get'
}); });
} }
/** 根据课程ID获取班级 */
export function getExamClassList(lessonId) {
return request({
url: `/api/lesson/${lessonId}/classes`,
method: 'get'
});
}

View File

@ -41,3 +41,10 @@ export function importQuestionBand(data, companyId) {
data data
}); });
} }
/** 查询公司下题目类型数量 */
export function selectQuestionTypeNum(companyId) {
return request({
url: `/api/questionBank/type/number?companyId=${companyId}`,
method: 'get'
});
}

View File

@ -1,11 +1,42 @@
import request from '@/utils/request'; import request from '@/utils/request';
/**
* 查询运行图列表
*/
export function listRps() {
return request({
url: `/api/rpTools`,
method: 'get'
})
}
/**
* 创建运行图
*/
export function createRp(data) {
return request({
url: `/api/rpTools`,
method: 'post',
data
})
}
/**
* 删除运行图
*/
export function deleteRp(planId) {
return request({
url: `/api/rpTools/${planId}`,
method: 'delete'
})
}
/** /**
* 获取运行图配置 * 获取运行图配置
*/ */
export function getRpConfig() { export function getRpConfig(planId) {
return request({ return request({
url: `/api/rpTools/config`, url: `/api/rpTools/${planId}/config`,
method: 'get' method: 'get'
}) })
} }
@ -13,9 +44,9 @@ export function getRpConfig() {
/** /**
* 修改运行图配置 * 修改运行图配置
*/ */
export function modifyRpConfig(data) { export function modifyRpConfig(planId, data) {
return request({ return request({
url: `/api/rpTools/config`, url: `/api/rpTools/${planId}/config`,
method: 'put', method: 'put',
data data
}) })
@ -24,9 +55,9 @@ export function modifyRpConfig(data) {
/** /**
* 获取运行图数据 * 获取运行图数据
*/ */
export function getRpTools() { export function getRpTools(planId) {
return request({ return request({
url: '/api/rpTools', url: `/api/rpTools/${planId}`,
method: 'get' method: 'get'
}); });
} }
@ -34,9 +65,9 @@ export function getRpTools() {
/** /**
* 清除运行图 * 清除运行图
*/ */
export function clearRpPlan() { export function clearRpPlan(planId) {
return request({ return request({
url: `/api/rpTools/clear`, url: `/api/rpTools/${planId}/clear`,
method: 'put' method: 'put'
}) })
} }
@ -44,9 +75,9 @@ export function clearRpPlan() {
/** /**
* 添加车次 * 添加车次
*/ */
export function addRpTrip(data) { export function addRpTrip(planId, data) {
return request({ return request({
url: '/api/rpTools/trip', url: `/api/rpTools/${planId}/trip`,
method: 'post', method: 'post',
data data
}); });
@ -55,9 +86,9 @@ export function addRpTrip(data) {
/** /**
* 删除车次 * 删除车次
*/ */
export function delRpTrip(tripNo) { export function delRpTrip(planId, tripNo) {
return request({ return request({
url: `/api/rpTools/${tripNo}/trip`, url: `/api/rpTools/${planId}/${tripNo}/trip`,
method: 'delete' method: 'delete'
}) })
} }
@ -66,9 +97,9 @@ export function delRpTrip(tripNo) {
/** /**
* 平移服务 * 平移服务
*/ */
export function translateRpService(serviceNo, data) { export function translateRpService(planId, serviceNo, data) {
return request({ return request({
url: `/api/rpTools/${serviceNo}/service`, url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'put', method: 'put',
data data
}) })
@ -77,9 +108,9 @@ export function translateRpService(serviceNo, data) {
/** /**
* 删除服务 * 删除服务
*/ */
export function delRpService(serviceNo) { export function delRpService(planId, serviceNo) {
return request({ return request({
url: `/api/rpTools/${serviceNo}/service`, url: `/api/rpTools/${planId}/${serviceNo}/service`,
method: 'delete' method: 'delete'
}) })
} }
@ -88,9 +119,9 @@ export function delRpService(serviceNo) {
/** /**
* 添加区域 * 添加区域
*/ */
export function createRpArea(data) { export function createRpArea(planId, data) {
return request({ return request({
url: `/api/rpTools/area`, url: `/api/rpTools/${planId}/area`,
method: 'post', method: 'post',
data data
}) })
@ -99,9 +130,9 @@ export function createRpArea(data) {
/** /**
* 修改区域 * 修改区域
*/ */
export function modifyRpArea(areaNo, data) { export function modifyRpArea(planId, areaNo, data) {
return request({ return request({
url: `/api/rpTools/${areaNo}/area`, url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'put', method: 'put',
data data
}) })
@ -110,9 +141,9 @@ export function modifyRpArea(areaNo, data) {
/** /**
* 修改区域文字 * 修改区域文字
*/ */
export function modifyAreaNote(areaNo, data) { export function modifyAreaNote(planId,areaNo, data) {
return request({ return request({
url: `/api/rpTools/${areaNo}/text`, url: `/api/rpTools/${planId}/${areaNo}/text`,
method: 'put', method: 'put',
data data
}) })
@ -120,9 +151,9 @@ export function modifyAreaNote(areaNo, data) {
/** /**
* 删除区域 * 删除区域
*/ */
export function delRpArea(areaNo) { export function delRpArea(planId, areaNo) {
return request({ return request({
url: `/api/rpTools/${areaNo}/area`, url: `/api/rpTools/${planId}/${areaNo}/area`,
method: 'delete' method: 'delete'
}) })
} }
@ -130,9 +161,9 @@ export function delRpArea(areaNo) {
/** /**
* 修改运行时间 * 修改运行时间
*/ */
export function justTripNoRunning(tripNo, data) { export function justTripNoRunning(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/running`, url: `/api/rpTools/${planId}/${tripNo}/running`,
method: 'put', method: 'put',
data data
}) })
@ -141,9 +172,9 @@ export function justTripNoRunning(tripNo, data) {
/** /**
* 修改停站时间 * 修改停站时间
*/ */
export function justTripNoStop(tripNo, data) { export function justTripNoStop(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/stop`, url: `/api/rpTools/${planId}/${tripNo}/stop`,
method: 'put', method: 'put',
data data
}) })
@ -152,9 +183,9 @@ export function justTripNoStop(tripNo, data) {
/** /**
* 修改折返时间 * 修改折返时间
*/ */
export function justTripTurnback(tripNo, data) { export function justTripTurnBack(planId, tripNo, data) {
return request({ return request({
url: `/api/rpTools/${tripNo}/turnBack`, url: `/api/rpTools/${planId}/${tripNo}/turnBack`,
method: 'put', method: 'put',
data data
}) })

View File

@ -673,14 +673,6 @@ export function getNewMapDataByGroup(group) {
}); });
} }
/** 新版地图根据仿真mapId获取仿真地图数据 */
export function getNewMapDataByMapId(mapId) {
return request({
url: `/api/map/${mapId}/mapData`,
method: 'get'
});
}
/** 新版地图指令操作定义 */ /** 新版地图指令操作定义 */
export function newMapOperate(group, operationId, data) { export function newMapOperate(group, operationId, data) {
return request({ return request({

View File

@ -363,9 +363,6 @@ class SkinCode extends defaultStyle {
fontWeight: 'normal', // 字体粗细 fontWeight: 'normal', // 字体粗细
distance: 5 // 灯跟文字距离 distance: 5 // 灯跟文字距离
} }
// trainStop: {}, // 停车标志
// trainDepart: {}, // 停车计时
}; };
this[deviceType.StationCounter] = { this[deviceType.StationCounter] = {

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class ECancelStopJumpLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.cancelStopJumpLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.cancelStopJumpLampPoint.x,
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'CancelStopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.cancelStopJumpLampPoint.x,
y: model.cancelStopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '取消跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.cancelStopJumpLamp);
}
}
export default ECancelStopJumpLamp;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EDownDetainLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.downDetainLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.downDetainLampPoint.x,
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'DownDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.downDetainLampPoint.x,
y: model.downDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '下行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.downDetainLamp);
}
}
export default EDownDetainLamp;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EStopJumpLampButton extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.stopJumpLampButton = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.stopJumpLampPoint.x,
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'StopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.stopJumpLampPoint.x,
y: model.stopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.stopJumpLampButton);
}
}
export default EStopJumpLampButton;

View File

@ -0,0 +1,45 @@
import Group from 'zrender/src/container/Group';
import EControl from '../../element/EControl';
class EUpDetainLamp extends Group {
constructor(model) {
super();
this.model = model;
this.create();
}
create() {
const model = this.model.modelData;
const style = this.model.style;
this.upDetainLamp = new EControl({
zlevel: this.model.zlevel,
z: this.model.z,
arc: {
shape: {
cx: model.upDetainLampPoint.x,
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'UpDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.upDetainLampPoint.x,
y: model.upDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: style
});
this.add(this.upDetainLamp);
}
}
export default EUpDetainLamp;

View File

@ -26,11 +26,15 @@ import EMouse from './EMouse';
import EHighlight from '../element/EHighlight'; import EHighlight from '../element/EHighlight';
import ETrainStop from './ETrainStop'; import ETrainStop from './ETrainStop';
import ETrainDepart from './ETrainDepart'; import ETrainDepart from './ETrainDepart';
import EControl from '../element/EControl';
import EPatternFilter from './EPatternFilter'; import EPatternFilter from './EPatternFilter';
import EStopJumpLamp from './functionButton/EStopJumpLamp';
import ECancelStopJumpLamp from './functionButton/ECancelStopJumpLamp';
import EUpDetainLamp from './functionButton/EUpDetainLamp';
import EDownDetainLamp from './functionButton/EDownDetainLamp';
import {isShowThePrdType} from '../../utils/handlePath'; import {isShowThePrdType} from '../../utils/handlePath';
import {traverseLineElements} from '../utils/ShapeStatusCovert'; import {traverseLineElements, traverseStatusElements} from '../utils/ShapeStatusCovert';
class StationStand extends Group { class StationStand extends Group {
constructor(model, style) { constructor(model, style) {
@ -44,17 +48,17 @@ class StationStand extends Group {
this.isShowShape = true; this.isShowShape = true;
this.create(); this.create();
this.createMouseEvent(); this.createMouseEvent();
if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) { // if (isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow) || model.previewOrMapDraw) {
this.createFunctionButton(); // this.createFunctionButton();
} // }
if (model.previewOrMapDraw) { // if (model.previewOrMapDraw) {
this.setShowMode(); // this.setShowMode();
} // }
this.setVisible(model.visible); this.setVisible(model.visible);
this.setState(model); this.setState(model);
this.checkIsDrawMap();
} }
create() { create() {
// 加载皮肤控制的元素
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
// // 站台所有的绘图元素 // // 站台所有的绘图元素
@ -85,9 +89,28 @@ class StationStand extends Group {
}; };
// 遍历当前线路下的绘图元素 组合模式 // 遍历当前线路下的绘图元素 组合模式
traverseLineElements(style.StationStand, elementTypeList, model, style, this); traverseLineElements(style.StationStand, elementTypeList, model, style, this);
// 加载后端返回的状态控制的绘图
const statusElementList = {
'stopJumpLamp':EStopJumpLamp,
'cancelStopJumpLamp':ECancelStopJumpLamp,
'upDetainLamp':EUpDetainLamp,
'downDetainLamp':EDownDetainLamp
};
// 遍历后端返回的状态控制的绘图
if (model.previewOrMapDraw || isShowThePrdType(model.prdType, style.StationStand.common.functionButtonShow)) {
traverseStatusElements(statusElementList, model, style, this);
}
} }
createMouseEvent() { createMouseEvent() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
} else {
if (this.style.StationStand.mouseOverStyle) { if (this.style.StationStand.mouseOverStyle) {
this.mouseEvent = new EMouse(this); this.mouseEvent = new EMouse(this);
this.add(this.mouseEvent); this.add(this.mouseEvent);
@ -95,130 +118,6 @@ class StationStand extends Group {
this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); }); this.on('mouseover', (e) => { this.mouseEvent.mouseover(e); });
} }
} }
createFunctionButton() {
const model = this.model;
const style = this.style;
if (model.stopJumpLamp) {
this.stopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.stopJumpLampPoint.x,
cy: model.stopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'StopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.stopJumpLampPoint.x,
y: model.stopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.stopJumpLampButton);
}
if (model.cancelStopJumpLamp) {
this.cancelStopJumpLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.cancelStopJumpLampPoint.x,
cy: model.cancelStopJumpLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'CancelStopJumpLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.cancelStopJumpLampPoint.x,
y: model.cancelStopJumpLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '取消跳停',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.cancelStopJumpLampButton);
}
if (model.upDetainLamp) {
this.upDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.upDetainLampPoint.x,
cy: model.upDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'UpDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.upDetainLampPoint.x,
y: model.upDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '上行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.upDetainLampButton);
}
if (model.downDetainLamp) {
this.downDetainLampButton = new EControl({
zlevel: this.zlevel,
z: this.z,
arc: {
shape: {
cx: model.downDetainLampPoint.x,
cy: model.downDetainLampPoint.y,
r: style.Station.lamp.radiusR
},
subType: 'DownDetainLamp',
lineWidth: 0,
fill: style.StationStand.lamp.lampColor
},
text: {
position: [0, 0],
x: model.downDetainLampPoint.x,
y: model.downDetainLampPoint.y + style.StationStand.lamp.radiusR + style.StationStand.text.distance,
fontWeight: style.StationStand.text.fontWeight,
fontSize: style.StationStand.text.fontSize,
fontFamily: style.fontFamily,
text: '下行扣车',
textFill: '#fff',
textAlign: 'middle',
textVerticalAlign: 'top'
},
style: this.style
});
this.add(this.downDetainLampButton);
}
} }
setVisible(visible) { setVisible(visible) {
@ -266,19 +165,19 @@ class StationStand extends Group {
} }
switch (opts.subDeviceType) { switch (opts.subDeviceType) {
case 'StopJumpLamp': { case 'StopJumpLamp': {
rect = this.stopJumpLampButton.getBoundingRect(); rect = this.stopJumpLamp.getBoundingRect();
break; break;
} }
case 'CancelStopJumpLamp': { case 'CancelStopJumpLamp': {
rect = this.cancelStopJumpLampButton.getBoundingRect(); rect = this.cancelStopJumpLamp.getBoundingRect();
break; break;
} }
case 'UpDetainLamp': { case 'UpDetainLamp': {
rect = this.upDetainLampButton.getBoundingRect(); rect = this.upDetainLamp.getBoundingRect();
break; break;
} }
case 'DownDetainLamp': { case 'DownDetainLamp': {
rect = this.downDetainLampButton.getBoundingRect(); rect = this.downDetainLamp.getBoundingRect();
break; break;
} }
default: { default: {
@ -299,31 +198,18 @@ class StationStand extends Group {
this.highlight && this.highlight.drawSelected(selected); this.highlight && this.highlight.drawSelected(selected);
} }
checkIsDrawMap() {
const path = window.location.href;
if (path.includes('/map/draw')) {
this.highlight = new EHighlight(this);
this.add(this.highlight);
this.on('mouseout', () => { this.highlight.mouseout(); });
this.on('mouseover', () => { this.highlight.mouseover(); });
}
}
// 设置显示模式 // 设置显示模式
setShowMode() { setShowMode() {
const showMode = this.model.showMode; const showMode = this.model.showMode;
const showConditions = this.style.StationStand.common.functionButtonShow; const showConditions = this.style.StationStand.common.functionButtonShow;
if (!showConditions || showConditions === '01' || showMode === showConditions) { if (!showConditions || showConditions === '01' || showMode === showConditions) {
this.stopJumpLampButton && this.stopJumpLampButton.show(); this.stopJumpLamp && this.stopJumpLamp.show();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.show(); this.cancelStopJumpLamp && this.cancelStopJumpLamp.show();
this.upDetainLampButton && this.upDetainLampButton.show();
this.downDetainLampButton && this.downDetainLampButton.show();
this.upDetainLamp && this.upDetainLamp.show(); this.upDetainLamp && this.upDetainLamp.show();
this.downDetainLamp && this.downDetainLamp.show(); this.downDetainLamp && this.downDetainLamp.show();
} else { } else {
this.stopJumpLampButton && this.stopJumpLampButton.hide(); this.stopJumpLamp && this.stopJumpLamp.hide();
this.cancelStopJumpLampButton && this.cancelStopJumpLampButton.hide(); this.cancelStopJumpLamp && this.cancelStopJumpLamp.hide();
this.upDetainLampButton && this.upDetainLampButton.hide();
this.downDetainLampButton && this.downDetainLampButton.hide();
this.upDetainLamp && this.upDetainLamp.hide(); this.upDetainLamp && this.upDetainLamp.hide();
this.downDetainLamp && this.downDetainLamp.hide(); this.downDetainLamp && this.downDetainLamp.hide();
} }

View File

@ -14,3 +14,20 @@ export function traverseLineElements(currentType, elementTypeList, model, style,
obj.add(obj[element]); obj.add(obj[element]);
}); });
} }
// 遍历后端返回的状态控制的绘图
export function traverseStatusElements(statusElementList, model, style, obj) {
// if (model.showMode == undefined || model.showMode) {
Object.keys(statusElementList).forEach(element => {
const ClassName = statusElementList[element];
if (model[element]) {
obj[element] = new ClassName({
zlevel: model.zlevel,
z: 1,
style: style,
modelData:model
});
obj.add(obj[element]);
}
});
// }
}

View File

@ -242,7 +242,7 @@ export function parser(data, skinCode, showConfig) {
zrUtil.each(elem.sectionPathList || [], item => { zrUtil.each(elem.sectionPathList || [], item => {
zrUtil.each(item.sectionList || [], section => { zrUtil.each(item.sectionList || [], section => {
if (mapDevice[section] && mapDevice[section].parentCode) { if (mapDevice[section] && mapDevice[section].parentCode) {
mapDevice[mapDevice[section].parentCode].approach = true; (mapDevice[mapDevice[section].parentCode] || {}).approach = true;
} else if (mapDevice[section]) { } else if (mapDevice[section]) {
mapDevice[section].approach = true; mapDevice[section].approach = true;
} }

View File

@ -3,6 +3,7 @@ export function getBaseUrl() {
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.8.107:9000'; // 袁琪
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.169:9000'; // 旭强 // BASE_API = 'http://192.168.3.169:9000'; // 旭强
// BASE_API = 'http://192.168.3.175:9000'; // 张赛 // BASE_API = 'http://192.168.3.175:9000'; // 张赛

View File

@ -1,6 +1,6 @@
import store from '@/store/index_APP_TARGET'; import store from '@/store/index_APP_TARGET';
import { getPublishMapVersionById, getPublishMapDetailById} from '@/api/jmap/map'; import { getPublishMapVersionById, getPublishMapDetailById, getNewMapDataByMapId} from '@/api/jmap/map';
import { getNewMapDataByGroup, getNewMapDataByMapId } from '@/api/simulation'; import { getNewMapDataByGroup } from '@/api/simulation';
// 获取地图版本数据和store里面的map版本做比较如果不同 // 获取地图版本数据和store里面的map版本做比较如果不同
// 获取发布的地图数据 // 获取发布的地图数据

View File

@ -9,7 +9,7 @@
</template> </template>
<script> <script>
import { publisMapCityList} from '@/api/designPlatform'; import { publisMapCityList} from '@/api/jmap/map';
import localStore from 'storejs'; import localStore from 'storejs';

View File

@ -0,0 +1,56 @@
<template>
<el-dialog v-dialogDrag append-to-body title="Create Run Plan" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
<el-form ref="form" label-width="100px" :model="formModel" :rules="rules">
<el-form-item label="Name" prop="name">
<el-input v-model="formModel.name" placeholder="Please Input Run Plan Name." />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
<el-button type="primary" @click="doConfirm">{{ $t('map.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { MenuEnum } from '../utils.js';
export default {
data() {
return {
dialogShow: false,
formModel: {
name: '',
},
rules: {
name: [
{
required: true, message: 'Please Input Run Plan Name.', trigger: 'blur'
}
]
}
};
},
watch: {
selected: function(val) {
}
},
methods: {
doShow() {
this.formModel.name = '';
this.dialogShow = true;
},
doClose() {
this.dialogShow = false;
},
doConfirm() {
this.$refs.form.validate((valid) => {
if(valid) {
this.$emit('createPlan', this.formModel);
this.doClose();
}
});
}
}
};
</script>

View File

@ -0,0 +1,138 @@
<template>
<div class="drawer" :class="{visible}" tabindex="-1">
<div class="drawer__wrapper" tabindex="-1">
<div class="layer" :class="[direction]" :style="{width: width+'px'}" tabindex="-1">
<div class="title">
<span>
<slot name="title" />
</span>
<i class="el-icon-close" @click.stop="doClose" />
</div>
<div class="container">
<slot />
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
direction: {
type: String,
default: 'ltr'
},
title: {
type: String,
default: ''
},
width: {
type: Number,
default: 600
},
visible: {
type: Boolean,
default: false
}
},
data() {
return {
}
},
methods: {
doClose() {
this.$emit('before-close');
}
}
}
</script>
<style lang="scss" scoped>
.visible {
visibility: visible !important;
.ltr {
transform: translateX(0) !important;
}
}
.ltr {
transition: all .3s cubic-bezier(.7, .3, .1, 1);
position: absolute;
height: 100%;
top: 0;
left: 0;
transform: translateX(-100%);
}
.drawer {
position: fixed;
z-index: 2001;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
margin: 0;
visibility: hidden;
&__wrapper {
position: relative;
left: 0;
right: 0;
top: 0;
bottom: 0;
height: 100%;
width: 100%;
background: rgba(0,0,0,0.5);
.layer {
background: #fff;
border: 1px solid #eee;
box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
overflow: hidden;
position: relative;
.title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
width: 100%;
padding: 0 10px;
height: 40px;
background: rgba(240,240, 240, 0.4);
i {
cursor: pointer;
padding: 3px;
}
}
.container {
overflow-y: auto;
width: 100%;
height: calc(100% - 40px);
&::-webkit-scrollbar {
width: 5px;
height: 5px;
}
&::-webkit-scrollbar-track {
background: rgb(239, 239, 239);
border-radius: 2px;
}
&::-webkit-scrollbar-thumb {
background: #bfbfbf;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb:hover {
background: #666;
}
&::-webkit-scrollbar-corner {
background: #fff;
}
}
}
}
}
</style>

View File

@ -0,0 +1,268 @@
<template>
<el-dialog title="Export" fullscreen append-to-body :visible.sync="show" :before-close="doClose">
<div class="export">
<div :id="canvasId" />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="doClose"> </el-button>
<el-button type="primary" @click="doExport"> </el-button>
</span>
</el-dialog>
</template>
<script>
import * as utils from './utils'
import echarts from 'echarts';
import { timeFormat } from '@/utils/date';
export default {
props: {
planUtil: {
type: Object,
required: true
},
width: {
type: Number,
default: 5000,
},
height: {
type: Number,
default: 800
},
title: {
type: String,
default: ''
},
canvasId: {
type: String,
default: 'canvas-export'
}
},
data() {
return {
myChart: null,
planData: {},
show: false
}
},
computed: {
option() {
return {
title: {
text: this.title,
left: 'center',
top: '10px'
},
grid: {
top: '60px',
left: '160px',
right: '100px',
bottom: '60px',
containLabel: true,
backgroundColor: 'floralwhite'
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: [],
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
formatter: (value, index) => { return timeFormat(value); },
textStyle: {
color: '#333'
}
}
}
],
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisTick: {
inside: true,
show: false
},
axisLine: {
onZero: false,
lineStyle: {
width: 1
}
},
axisLabel: {
show:true,
inside:true,
formatter: (value, index) => { return '' }
},
minInterval: 0.1,
maxInterval: 1,
min: 0,
max: 0
},
graphic: [{
id: 'shape',
elements: []
}],
series: [],
dataZoom: [
{
show: false,
fiterMode: 'filter',
handleSize: '80%',
handleStyle: {
color: '#fff',
shadowBlur: 3,
shadowColor: 'rgba(0, 0, 0, 0.6)',
shadowOffsetX: 2,
shadowOffsetY: 2
}
}
]
}
}
},
methods: {
loadInitChart() {
return new Promise((resolve, reject) => {
try {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear();
}
this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, {notMerge: true});
this.reSize({ width: this.width, height: this.height });
resolve(true);
} catch (error) {
reject(error);
}
});
},
loadChartPage(stations) {
try {
if (this.myChart) {
this.stations = stations;
this.xAxisInit(stations);
this.yAxisInit(stations);
this.myChart.setOption(this.option, {notMerge: true});
}
} catch (error) {
this.$message.info(error.message);
}
},
loadChartData(planData) {
try {
const option = this.myChart.getOption();
option.title.text = this.title;
option.series = [];
option.graphic[0].elements = [];
this.planData = planData;
this.pushModels(option.series, [this.planUtil.initializeYaxis(this.stations)]);
this.pushModels(option.series, this.planUtil.parseDataToSeries(this.myChart, planData, this.stations));
this.pushModels(option.graphic[0].elements, this.planUtil.parseDataToGraph(this.myChart, planData, this.stations));
this.myChart.setOption(option, {notMerge: true});
} catch (error) {
this.$messageBox(error.message);
}
},
xAxisInit(stations) {
const option = this.option;
const list = [];
for (var time = 0 + this.planUtil.TranslationTime; time < 3600 * 24 + this.planUtil.TranslationTime; time++) {
list.push(time);
}
option.xAxis[0].data = list;
option.dataZoom[0].startValue = 0 + this.planUtil.TranslationTime;
option.dataZoom[0].endValue = 3600 * 24 + this.planUtil.TranslationTime;
},
yAxisInit(stations) {
const option = this.option;
if (Object.keys(this.planUtil).length) {
this.pushModels(option.series, [this.planUtil.initializeYaxis(stations)]);
option.yAxis.min = this.planUtil.computedYaxisMinValue(stations);
option.yAxis.max = this.planUtil.computedYaxisMaxValue(stations);
}
},
reSize({width, height}) {
if (this.myChart) {
this.myChart.resize({ width, height, silent: false });
}
},
destroy() {
if (this.myChart && this.myChart.isDisposed) {
this.myChart.dispose();
this.myChart = null;
}
},
pushModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
if (elem) {
series.push(elem);
}
});
}
return series;
},
popModels(series, models) {
if (models && models.length) {
models.forEach(elem => {
const index = series.indexOf(elem);
if (index >= 0) {
series.split(index, 1);
}
});
}
return series;
},
doShow(stations, planData) {
this.show = true;
this.$nextTick(() => {
this.loadInitChart().then(resp => {
this.loadChartPage(stations);
this.loadChartData(planData);
});
})
},
doClose() {
this.show = false;
this.destroy();
},
doExport() {
const urlObject = window.URL || window.webkitURL || window;
const export_blob = utils.dataURItoBlob(this.myChart.getDataURL({
pixelRatio: 1,
backgroundColor: '#fff'
}), 'png');
const save_link = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
save_link.href = urlObject.createObjectURL(export_blob);
save_link.download = 'plan.png';
save_link.click();
}
}
}
</script>
<style lang="scss" scoped>
.export {
width: 100%;
overflow-y: auto;
background: #fff;
}
</style>

View File

@ -19,8 +19,10 @@
<template slot="header"> <template slot="header">
<div class="header"> <div class="header">
<div class="menus-left"> <div class="menus-left">
<el-button type="primary" @click="drawer=true">Open</el-button>
<el-button type="primary" @click="doNewPlan">New</el-button> <el-button type="primary" @click="doNewPlan">New</el-button>
<el-button type="primary" @click="onDialog(MenuEnum.planSetParams)">Set Param</el-button> <el-button type="primary" :disabled="disabled" @click="onDialog(MenuEnum.planSetParams)">Set Param</el-button>
<el-button type="primary" @click="doExport" :disabled="disabled"> Export </el-button>
</div> </div>
<div class="menus-right"> <div class="menus-right">
<span style="font-size:22px;padding:0 17px;">Plan</span> <span style="font-size:22px;padding:0 17px;">Plan</span>
@ -28,6 +30,7 @@
:model="model" :model="model"
:selected="selected" :selected="selected"
:target="target" :target="target"
:disabled="disabled"
@remove="onRemove" @remove="onRemove"
@clear="onClear" @clear="onClear"
/> />
@ -35,15 +38,36 @@
</div> </div>
</template> </template>
</schedule> </schedule>
<drawer :visible.sync="drawer" @before-close="e => drawer=false">
<template slot="title">Run Plan List</template>
<el-tree style="padding-right: 20px" :data="planList" :props="defaultProps" @node-click="onSelectPlan">
<template slot-scope="{data}">
<span class="flex" >
<span><i class="el-icon-document"/>&ensp;{{data.name}}</span>
<el-button
type="text"
style="color:red"
size="mini"
@click="doDeletePlan(data)">
Delete
</el-button>
</span>
</template>
</el-tree>
</drawer>
<plan-just-running :config="config" :selected="selected" :stations="stations" @justRunning="doJustRunning" /> <plan-just-running :config="config" :selected="selected" :stations="stations" @justRunning="doJustRunning" />
<plan-just-stop :config="config" :selected="selected" @justStop="doJustStop"/> <plan-just-stop :config="config" :selected="selected" @justStop="doJustStop"/>
<plan-just-turnback :config="config" :selected="selected" @justTurnBack="doJustTurnback"/> <plan-just-turnback :config="config" :selected="selected" @justTurnBack="doJustTurnback"/>
<plan-set-params :config="config" @setParams="doSetPlanParams" /> <plan-set-params :config="config" @setParams="doSetPlanParams" />
<plan-create ref="create" @createPlan="doCreatePlan" />
<div class="fixed" v-show="show"> <div class="fixed" v-show="show">
<textarea :auto-focus="true" v-if="textareaModel.show" v-focus v-model="textareaModel.text" class="fixed-textarea" <textarea :auto-focus="true" v-if="textareaModel.show" v-focus v-model="textareaModel.text" class="fixed-textarea"
:style="{ left: rect.x+'px', top: rect.y+'px', width: rect.width+'px', height: rect.height+'px', }"/> :style="{ left: rect.x+'px', top: rect.y+'px', width: rect.width+'px', height: rect.height+'px', }"/>
</div> </div>
<export ref="export" :planUtil="planUtil" :title="title" :width="5000" :height="height-160" />
</div> </div>
</template> </template>
@ -53,15 +77,18 @@ import PlanJustRunning from './dialog/planJustRunning.vue';
import PlanJustStop from './dialog/planJustStop.vue'; import PlanJustStop from './dialog/planJustStop.vue';
import PlanJustTurnback from './dialog/planJustTurnback.vue'; import PlanJustTurnback from './dialog/planJustTurnback.vue';
import PlanSetParams from './dialog/planSetParams.vue'; import PlanSetParams from './dialog/planSetParams.vue';
import PlanCreate from './dialog/planCreate.vue';
import Drawer from './drawer.vue';
import Menus from './menus.vue'; import Menus from './menus.vue';
import Export from './export.vue';
import { MenuEnum } from './utils.js'; import { MenuEnum } from './utils.js';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getStationList } from '@/api/runplan'; import { getStationList } from '@/api/runplan';
import { import {
listRps, createRp, deleteRp,
getRpTools, clearRpPlan, addRpTrip, delRpTrip, getRpTools, clearRpPlan, addRpTrip, delRpTrip,
justTripNoRunning, justTripNoStop, justTripTurnback, justTripNoRunning, justTripNoStop, justTripTurnBack,
translateRpService, delRpService, translateRpService, delRpService,
getRpConfig, modifyRpConfig, getRpConfig, modifyRpConfig,
createRpArea, modifyRpArea, modifyAreaNote, delRpArea createRpArea, modifyRpArea, modifyAreaNote, delRpArea
@ -74,14 +101,21 @@ export default {
PlanJustStop, PlanJustStop,
PlanJustTurnback, PlanJustTurnback,
PlanSetParams, PlanSetParams,
Menus PlanCreate,
Menus,
Drawer,
Export
}, },
data() { data() {
return { return {
title: 'XXX', defaultProps: {
canvasId: 'canvas-plan', children: 'children',
label: 'name'
},
drawer: false,
planList: [],
stations: [], stations: [],
planData: [], planData: {},
selected: null, selected: null,
target: null, target: null,
textareaModel: { textareaModel: {
@ -111,6 +145,9 @@ export default {
} }
}, },
computed: { computed: {
disabled() {
return !this.planId;
},
show() { show() {
return this.textareaModel.show; return this.textareaModel.show;
}, },
@ -123,6 +160,9 @@ export default {
planId() { planId() {
return this.$route.query.planId; return this.$route.query.planId;
}, },
title() {
return this.$route.query.title||'';
},
mapId() { mapId() {
return 9; return 9;
}, },
@ -140,13 +180,17 @@ export default {
height() { height() {
this.setPosition(); this.setPosition();
}, },
$route() {
this.loadPlanData();
}
}, },
created() { created() {
this.planUtil = this.$theme.loadPlanConvert(this.lineCode); this.planUtil = this.$theme.loadPlanConvert(this.lineCode);
}, },
mounted() { mounted() {
this.setPosition(); this.setPosition();
this.loadInitData(); this.loadPlanList();
this.loadPlanData();
}, },
methods: { methods: {
setPosition() { setPosition() {
@ -154,19 +198,26 @@ export default {
this.$store.dispatch('rpTools/resize', { width: this.width, height: this.height }); this.$store.dispatch('rpTools/resize', { width: this.width, height: this.height });
}); });
}, },
loadInitData() { loadPlanList() {
listRps().then(resp => {
this.planList = resp.data;
})
},
loadPlanData() {
getStationList(this.mapId).then(resp => { getStationList(this.mapId).then(resp => {
const stations = this.stations = resp.data.filter(el => { const stations = this.stations = resp.data.filter(el => {
return ['车辆段', '停车场'].findIndex(it => { return el.name.includes(it) }) < 0; return ['车辆段', '停车场'].findIndex(it => { return el.name.includes(it) }) < 0;
}); });
this.$store.commit('rpTools/setStations', stations); this.$store.commit('rpTools/setStations', stations);
this.$refs.schedule.loadChartPage(stations); this.$refs.schedule.loadChartPage(stations);
getRpTools().then(rest => { if (this.planId) {
const planData = rest.data; getRpTools(this.planId).then(rest => {
const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData); this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData); this.$refs.schedule.loadChartData(planData);
getRpConfig().then(resm => { getRpConfig(this.planId).then(resm => {
const data = resm.data; const data = resm.data;
this.config = { this.config = {
averageSpeed: data.averageSpeed, averageSpeed: data.averageSpeed,
@ -177,9 +228,16 @@ export default {
turnBackTime: data.turnBackTime turnBackTime: data.turnBackTime
} }
}).catch(error => { }).catch(error => {
this.$message.info(error.message) this.$message.info(error.message);
}) })
}); }).catch(error => {
this.$message.info(error.message);
})
} else {
const planData = {}
this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData);
}
}).catch(error => { }).catch(error => {
this.$messageBox(error.message); this.$messageBox(error.message);
}) })
@ -272,16 +330,48 @@ export default {
break; break;
} }
}, },
onSelectPlan(el) {
this.$router.replace({ path: 'AUStool', query: { planId: el.id, title: el.name }});
},
doExport() {
this.$refs.export.doShow(this.stations, this.planData);
},
doNewPlan() { doNewPlan() {
clearRpPlan().then(resp => { this.$refs.create.doShow();
this.refresh(); this.$nextTick(e => {
if (this.$refs.tree) {
this.$refs.tree.setCurrentKey(this.planId);
}
})
},
doCreatePlan(model) {
createRp(model).then(resp => {
this.loadPlanList();
this.onSelectPlan({id: resp.data, name: model.name});
}).catch(error => { }).catch(error => {
this.refresh();
this.$message.info(error.message); this.$message.info(error.message);
}) })
}, },
doDeletePlan(el) {
this.$confirm('This operation will permanently delete the data. Do you want to continue?', 'Tips', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
deleteRp(el.id).then(resp => {
this.loadPlanList();
this.planId == el.id
? this.$router.replace({ path: 'AUStool'})
: this.loadPlanData();
}).catch(error => {
this.$message.info(error.message);
})
}).catch(() => {
this.$message({ type: 'info', message: 'Deletion cancelled.' });
});
},
doSetPlanParams(data) { doSetPlanParams(data) {
modifyRpConfig(data).then(resp => { modifyRpConfig(this.planId, data).then(resp => {
this.config = data; this.config = data;
this.$message.success('Parameters of plan were modified successfully.'); this.$message.success('Parameters of plan were modified successfully.');
}).catch(error => { }).catch(error => {
@ -293,7 +383,7 @@ export default {
text: data.text text: data.text
} }
modifyAreaNote(data.id, model).then(resp => { modifyAreaNote(this.planId, data.id, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -307,7 +397,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripNoRunning(this.selected.tripNo, model).then(resp => { justTripNoRunning(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -322,7 +412,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripNoStop(this.selected.tripNo, model).then(resp => { justTripNoStop(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -337,7 +427,7 @@ export default {
stationCode: this.selected.stationCode stationCode: this.selected.stationCode
} }
justTripTurnback(this.selected.tripNo, model).then(resp => { justTripTurnBack(this.planId, this.selected.tripNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -353,7 +443,7 @@ export default {
endTime: timeFormat(data.endTime) endTime: timeFormat(data.endTime)
} }
addRpTrip(model).then(resp => { addRpTrip(this.planId, model).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -374,7 +464,7 @@ export default {
endTime: endTime < startTime? timeFormat(data.startTime): timeFormat(data.endTime) endTime: endTime < startTime? timeFormat(data.startTime): timeFormat(data.endTime)
} }
createRpArea(model).then(resp => { createRpArea(this.planId, model).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.$message.info(error.message); this.$message.info(error.message);
@ -388,7 +478,7 @@ export default {
seconds : this.selected.time seconds : this.selected.time
} }
translateRpService(this.selected.serviceNo, model).then(resp => { translateRpService(this.planId, this.selected.serviceNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.refresh(false); this.refresh(false);
@ -407,7 +497,7 @@ export default {
text: data.text text: data.text
} }
modifyRpArea(data.areaNo, model).then(resp => { modifyRpArea(this.planId, data.areaNo, model).then(resp => {
this.refresh(false); this.refresh(false);
}).catch(error => { }).catch(error => {
this.refresh(false); this.refresh(false);
@ -422,7 +512,7 @@ export default {
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRpService(this.selected.serviceNo).then(resp => { delRpService(this.planId, this.selected.serviceNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -441,7 +531,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRpTrip(this.selected.tripNo).then(resp => { delRpTrip(this.planId, this.selected.tripNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -460,7 +550,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const data = this.target.model; const data = this.target.model;
delRpArea(data.areaNo).then(resp => { delRpArea(this.planId, data.areaNo).then(resp => {
this.refresh(); this.refresh();
}).catch(error => { }).catch(error => {
this.refresh(); this.refresh();
@ -472,8 +562,8 @@ export default {
} }
}, },
refresh(cls=true) { refresh(cls=true) {
getRpTools().then(rest => { getRpTools(this.planId).then(rest => {
const planData = rest.data; const planData = this.planData = rest.data;
this.$store.commit('rpTools/setPlanData', planData); this.$store.commit('rpTools/setPlanData', planData);
this.$refs.schedule.loadChartData(planData); this.$refs.schedule.loadChartData(planData);
if (cls) { if (cls) {
@ -524,4 +614,11 @@ export default {
} }
} }
} }
.flex {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
</style> </style>

View File

@ -5,7 +5,7 @@
</el-select> </el-select>
<div v-if="option"> <div v-if="option">
<el-button-group v-if="option.radioList" v-model="model.action"> <el-button-group v-if="option.radioList" v-model="model.action">
<el-button v-for="(el,i) in option.radioList" <el-button v-for="(el,i) in option.radioList" :disabled="disabled"
:key="i" :key="i"
:type="el.value == model.action? 'primary':''" :type="el.value == model.action? 'primary':''"
@click="doBtnSelect(el, i)"> @click="doBtnSelect(el, i)">
@ -13,7 +13,7 @@
</el-button> </el-button>
</el-button-group> </el-button-group>
<el-button-group v-if="option.buttonList" style="margin-left: 20px"> <el-button-group v-if="option.buttonList" style="margin-left: 20px">
<el-button v-for="(el,i) in option.buttonList" <el-button v-for="(el,i) in option.buttonList" :disabled="disabled"
:key="i" :key="i"
:type="execProp('type', el, i)" :type="execProp('type', el, i)"
:icon="execProp('icon', el, i)" :icon="execProp('icon', el, i)"
@ -43,6 +43,10 @@ export default {
default() { default() {
return null return null
} }
},
disabled: {
type: Boolean,
default: false
} }
}, },
data() { data() {

View File

@ -41,7 +41,7 @@ export default {
}, },
canvasId: { canvasId: {
type: String, type: String,
default: 'service-tool' default: 'canvas-plan'
} }
}, },
data() { data() {
@ -55,7 +55,7 @@ export default {
option() { option() {
return { return {
title: { title: {
text: '', text: this.title,
left: 'center', left: 'center',
top: '10px' top: '10px'
}, },
@ -95,14 +95,11 @@ export default {
} }
}, },
axisLabel: { axisLabel: {
formatter: this.xAxisLableFormat, formatter: this.xAxisLabelFormat,
textStyle: { textStyle: {
color: '#333' color: '#333'
} }
}, },
axisTick: {
inside: true
},
axisPointer: { axisPointer: {
snap: true, snap: true,
label: { label: {
@ -131,7 +128,7 @@ export default {
axisLabel: { axisLabel: {
show:true, show:true,
inside:true, inside:true,
formatter: this.yAxisLableFormat formatter: this.yAxisLabelFormat
}, },
axisPointer: { axisPointer: {
xAxisIndex: 'all', xAxisIndex: 'all',
@ -158,7 +155,7 @@ export default {
moveOnMouseMove : 'ctrl', moveOnMouseMove : 'ctrl',
}, },
{ {
fiterMode: 'slider', fiterMode: 'filter',
handleSize: '80%', handleSize: '80%',
handleStyle: { handleStyle: {
color: '#fff', color: '#fff',
@ -194,10 +191,10 @@ export default {
yAxisPointFormat(params) { yAxisPointFormat(params) {
return this.planUtil.computedFormatYAxis(this.stations, params); return this.planUtil.computedFormatYAxis(this.stations, params);
}, },
xAxisLableFormat(value, index) { xAxisLabelFormat(value, index) {
return timeFormat(value); return timeFormat(value);
}, },
yAxisLableFormat(value, index) { yAxisLabelFormat(value, index) {
return ''; return '';
}, },
axisTooltip(param) { axisTooltip(param) {
@ -227,9 +224,6 @@ export default {
if (this.myChart && this.myChart.isDisposed) { if (this.myChart && this.myChart.isDisposed) {
this.myChart.clear(); this.myChart.clear();
} }
if (this.$route.query.planName || this.$route.query.prdType === '05') {
this.option.title.text = this.this.title;
}
this.myChart = echarts.init(document.getElementById(this.canvasId)); this.myChart = echarts.init(document.getElementById(this.canvasId));
this.myChart.setOption(this.option, {notMerge: true}); this.myChart.setOption(this.option, {notMerge: true});
@ -260,6 +254,7 @@ export default {
try { try {
const option = this.myChart.getOption(); const option = this.myChart.getOption();
option.title.text = this.title;
option.series = []; option.series = [];
option.graphic[0].elements = []; option.graphic[0].elements = [];

View File

@ -105,3 +105,10 @@ export function findPrev(list, idx, cb) {
} }
return null; return null;
} }
export function dataURItoBlob(dataURI, dataTYPE) {
var binary = atob(dataURI.split(',')[1]), array = [];
for(var i = 0; i < binary.length; i++) array.push(binary.charCodeAt(i));
return new Blob([new Uint8Array(array)], {type: dataTYPE});
}

View File

@ -72,8 +72,8 @@
</template> </template>
<script> <script>
import { getPublishLessonList } from '@/api/jmap/lesson'; import { getPublishLessonList, getExamClassList } from '@/api/jmap/lesson';
import { getExamLessonDetail, updateExamRules, getExamClassList } from '@/api/management/exam'; import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
export default { export default {

View File

@ -1,6 +1,48 @@
<template> <template>
<el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="640px" :before-close="handleClose" center :close-on-click-modal="false"> <el-dialog v-dialogDrag title="添加出题规则" :visible.sync="dialogVisible" width="640px" :before-close="handleClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" :inline="true" /> <!--<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" :inline="true" />-->
<el-form ref="form" :model="formModel" label-width="80px" :inline="true">
<el-form-item label="单位">
<el-select v-model="formModel.companyId" placeholder="请选择单位" clearable size="small">
<el-option
v-for="item in options"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="判断题数量">
<el-input-number v-model="formModel.judgeNum" :min="0" :max="10" />
</el-form-item>
<el-form-item label="判断题分数">
<el-input-number v-model="formModel.judgePoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="单选题数量">
<el-input-number v-model="formModel.selectNum" :min="0" :max="10" />
</el-form-item>
<el-form-item label="单选题分数">
<el-input-number v-model="formModel.selectPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="多选题数量">
<el-input-number v-model="formModel.multiNum" :min="0" :max="10" />
</el-form-item>
<el-form-item label="多选题分数">
<el-input-number v-model="formModel.multiPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题数量">
<el-input-number v-model="formModel.fillNum" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题分数">
<el-input-number v-model="formModel.fillPoint" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题数量">
<el-input-number v-model="formModel.answerNum" :min="0" :max="10" />
</el-form-item>
<el-form-item label="填空题分数">
<el-input-number v-model="formModel.answerPoint" :min="0" :max="10" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button> <el-button type="primary" @click="doSave">{{ update? '修改' : $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>