Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
c000d35911
@ -22,11 +22,21 @@ export function addRpTrip(data) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改到站时间
|
||||
* 删除车次
|
||||
*/
|
||||
export function justTripNoArrival(tripNo, data) {
|
||||
export function delRpTrip(tripNo) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/arrival`,
|
||||
url: `/api/rpTools/${tripNo}/trip`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运行时间
|
||||
*/
|
||||
export function justTripNoRunning(tripNo, data) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/running`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
@ -34,11 +44,11 @@ export function justTripNoArrival(tripNo, data) {
|
||||
|
||||
|
||||
/**
|
||||
* 修改发车时间
|
||||
* 修改停站时间
|
||||
*/
|
||||
export function justTripNoDeparture(tripNo, data) {
|
||||
export function justTripNoStop(tripNo, data) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/departure`,
|
||||
url: `/api/rpTools/${tripNo}/stop`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
@ -56,12 +66,3 @@ export function translateTripNo(tripNo, data) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除车次
|
||||
*/
|
||||
export function deleteTripNo(tripNo) {
|
||||
return request({
|
||||
url: `/api/rpTools/${tripNo}/trip`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ export function JLmapDriving(dom,data,mapId,storemod,translation,routegroup,proj
|
||||
rails = loadrails;
|
||||
|
||||
console.log(trainlisttest.group.children[0]);
|
||||
trainlisttest.group.children[0].getObjectByName("c1").add(cameracctv);
|
||||
trainlisttest.group.children[0].getObjectByName("c3").add(cameracctv);
|
||||
}
|
||||
|
||||
this.eventon = function() {
|
||||
|
@ -306,15 +306,19 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
|
||||
|
||||
if(event.data.type == "topTrain"){
|
||||
if(trainControl.toptrain.status != 1){
|
||||
if(event.data.offset>=0.0360){
|
||||
trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(event.data.offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(event.data.type == "downTrain"){
|
||||
if(trainControl.downtrain.status != 1){
|
||||
if(event.data.offset<=0.965){
|
||||
trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(event.data.offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
//上行列车车门控制
|
||||
if(event.data.type == "topTrainDoor"){
|
||||
|
||||
@ -322,6 +326,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
|
||||
trainControl.closetraindoor(trainControl.toptrain,event.data.doorCode,positionStatus,"top");
|
||||
// trainLeaveStation("top");
|
||||
}else{
|
||||
trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(0.0365));
|
||||
trainControl.opentraindoor(trainControl.toptrain,event.data.doorCode,"top");
|
||||
trainControl.toptrain.status = 1;
|
||||
}
|
||||
@ -333,6 +338,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
|
||||
trainControl.closetraindoor(trainControl.downtrain,event.data.doorCode,positionStatus,"down");
|
||||
// trainLeaveStation("down");
|
||||
}else{
|
||||
trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(0.961));
|
||||
trainControl.opentraindoor(trainControl.downtrain,event.data.doorCode,"down");
|
||||
trainControl.downtrain.status = 1;
|
||||
}
|
||||
|
@ -16,22 +16,23 @@ export default {
|
||||
/** 按车次遍历数据*/
|
||||
if (tripList && tripList.length) {
|
||||
tripList.forEach(trip => {
|
||||
const opt = { name: `run-${trip.tripNo}`, type: 'line', markPoint: { data: [] }, data: []};
|
||||
const opt = { name: `run-${trip.tripNo}`, type: 'line', showAllSymbol:true, symbolKeepAspect: false, symbolSize: 6, markPoint: { data: [] }, data: []};
|
||||
|
||||
if (trip.tripNo &&
|
||||
trip.stationTimeList.length) {
|
||||
opt.markPoint.data.push(createMartPointReverse({
|
||||
name: `${trip.tripNo}`,
|
||||
color: '#000' || lineStyle.color,
|
||||
coord: [
|
||||
trip.stationTimeList[0].arrivalTime,
|
||||
this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
|
||||
]
|
||||
}));
|
||||
}
|
||||
// const length = trip.stationTimeList.length;
|
||||
// if (trip.tripNo &&
|
||||
// trip.stationTimeList.length) {
|
||||
// opt.markPoint.data.push(createMartPointReverse({
|
||||
// name: `${trip.tripNo}`,
|
||||
// color: '#000' || lineStyle.color,
|
||||
// coord: [
|
||||
// trip.stationTimeList[0].arrivalTime,
|
||||
// this.getCoordYByElem(stations, kmRangeCoordMap, trip.stationTimeList[0])
|
||||
// ]
|
||||
// }));
|
||||
// }
|
||||
|
||||
/** 计算停站点坐标集合*/
|
||||
trip.stationTimeList.forEach(elem => {
|
||||
trip.stationTimeList.forEach((elem,idx) => {
|
||||
if (elem.arrivalTime) {
|
||||
opt.data.push([elem.arrivalTime, this.getCoordYByElem(stations, kmRangeCoordMap, elem), elem.stationCode, trip.tripNo]);
|
||||
}
|
||||
@ -45,8 +46,6 @@ export default {
|
||||
});
|
||||
}
|
||||
|
||||
console.log(models);
|
||||
|
||||
return models;
|
||||
},
|
||||
|
||||
|
@ -130,7 +130,8 @@ export const DeviceMenu = {
|
||||
IscsSystem: '108',
|
||||
IscsInterface: '109',
|
||||
|
||||
planAusContextMenu: '200'
|
||||
planJustArrival: '200',
|
||||
planJustDeparture: '201'
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -70,6 +70,7 @@ export function createMarkLineModels(stations, computedYaxis) {
|
||||
markLineModel.markLine.data = [];
|
||||
markLineModel.markLine.lineStyle = { color: '#B0C4DE', width: 0.5 };
|
||||
markLineModel.markLine.symbol = 'none';
|
||||
markLineModel.elements = []
|
||||
stations.forEach((elem, index) => {
|
||||
markLineModel.markLine.data.push(
|
||||
{
|
||||
|
@ -19,6 +19,11 @@ export default {
|
||||
components:{
|
||||
iscsSystem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
scaleRate:window.innerWidth / 1950
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
stationName() {
|
||||
return this.$route.query.stationName;
|
||||
@ -37,10 +42,11 @@ export default {
|
||||
system: 'psdSystem',
|
||||
userInterface: 'psdOne'
|
||||
};
|
||||
this.$refs.iscsPlate.show({}, this.width, this.height, this.scaleRate);
|
||||
getIscsData(params).then(resp=>{
|
||||
if (resp.data) {
|
||||
const data = JSON.parse(resp.data.graphData);
|
||||
this.$refs.iscsPlate.show(data);
|
||||
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1,90 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" pop-menu-class="popMenuClass" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import { Notification } from 'element-ui';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { deleteTripNo, justTripNoArrival, justTripNoDeparture} from '@/api/rpTools';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
tripNo: {
|
||||
type: [String, Number]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PopMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [
|
||||
{
|
||||
label: '调整起始时间',
|
||||
handler: this.doJustBeginTime,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: '调整停站时间',
|
||||
handler: this.doJustStopTime,
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
handler: this.doDeleteTrip,
|
||||
disabled: false
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planAusContextMenu)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
doDeleteTrip() {
|
||||
if (this.tripNo) {
|
||||
deleteTripNo(this.tripNo).then(resp => {
|
||||
this.$emit('reload')
|
||||
}).catch(error => {
|
||||
this.$message.error('delete error');
|
||||
})
|
||||
}
|
||||
},
|
||||
doJustBeginTime() {
|
||||
},
|
||||
doJustStopTime() {
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.popMenuClass{
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
66
src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue
Normal file
66
src/views/planMonitor/editToolAUS/dialog/planJustRunning.vue
Normal file
@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag append-to-body title="Modify run time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
|
||||
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="Running time" prop="time">
|
||||
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
|
||||
<span style="padding-left: 10px">s</span>
|
||||
</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 { DeviceMenu } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
formModel: {
|
||||
time: 0,
|
||||
},
|
||||
rules: {
|
||||
time: { required: true, message: 'Please select the arrival time.', trigger: 'change' },
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustArrival)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
selected: function(val) {
|
||||
if (val) this.formModel.time = val.runTime;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
doConfirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$emit('justRunning', this.formModel.time);
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
66
src/views/planMonitor/editToolAUS/dialog/planJustStop.vue
Normal file
66
src/views/planMonitor/editToolAUS/dialog/planJustStop.vue
Normal file
@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag append-to-body title="Modify stop time" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="doClose">
|
||||
<el-form ref="form" label-width="160px" :model="formModel" :rules="rules">
|
||||
<el-form-item label="Stop time" prop="time">
|
||||
<el-input-number v-model="formModel.time" controls-position="right" :min="0" :max="3600"/>
|
||||
<span style="padding-left: 10px">s</span>
|
||||
</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 { DeviceMenu } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default() {
|
||||
return null
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
formModel: {
|
||||
time: 0
|
||||
},
|
||||
rules: {
|
||||
time: { required: true, message: 'Please select the stop time.', trigger: 'change' },
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.planJustDeparture)) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
},
|
||||
selected: function(val) {
|
||||
if (val) this.formModel.time = val.depTime;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
doConfirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
this.$emit('justStop', this.formModel.time);
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -27,10 +27,10 @@ export default {
|
||||
return '00';
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
return this.$store.state.app.width - 2;
|
||||
},
|
||||
height() {
|
||||
return this.$store.state.app.height - 60;
|
||||
return this.$store.state.app.height - 72;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -96,297 +96,4 @@ export default {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
/* .planEdit__tool .el-dialog {
|
||||
overflow: hidden !important;
|
||||
background: rgba(202, 221, 253, 0.88);;
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
border: 2px solid #727375;
|
||||
border-radius: 4px;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__header {
|
||||
height: 30px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__footer {
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin: 0px 3px 3px 3px;
|
||||
border: 2px solid rgba(120, 121, 123, 0.5);
|
||||
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__title {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn {
|
||||
background: -webkit-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -o-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: -moz-linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
|
||||
border: 1px solid white;
|
||||
border-radius: 4px;
|
||||
top: 0px;
|
||||
right: 3px;
|
||||
line-height: 26px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-icon-close:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-dialog__headerbtn .el-dialog__close {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--top {
|
||||
border: 2px outset #FEFEFD;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs__item {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
text-align: center;
|
||||
color: #000 !important;
|
||||
border-right: 2px outset #fff;
|
||||
padding-left: 10px !important;
|
||||
padding-right: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tab-pane {
|
||||
margin: 10px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
|
||||
border-bottom: none
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tabs--card>.el-tabs__header .el-tabs__item:not(.is-active) {
|
||||
border-bottom: 2px inset #fff
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-card {
|
||||
background: #ECE9D8 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
padding: 0px;
|
||||
width: 80px;
|
||||
border: 2px outset #E2E2E2;
|
||||
border-radius: 0px !important;
|
||||
color: #000;
|
||||
background: #ECE9D8;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .expand {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:focus span {
|
||||
border: 1px dashed gray;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:active {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled {
|
||||
border: 2px inset #E2E2E2;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-button:disabled span {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input {
|
||||
border: 2px inset #E9E9E9;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input .el-input__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-input.is-disabled .el-input__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea {
|
||||
border: 2px inset #E9E9E9;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea .el-textarea__inner {
|
||||
color: #000;
|
||||
background: #fff !important;
|
||||
border: 0px;
|
||||
border-radius: 0px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-textarea.is-disabled .el-textarea__inner {
|
||||
background: #F0F0F0 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table {
|
||||
border: 2px inset #E9E9E9;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .cell {
|
||||
line-height: unset !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table th.is-leaf {
|
||||
background: #ECE9D8 !important;
|
||||
border-right: 1px solid #BDBDBD !important;
|
||||
border-bottom: 1px solid #BDBDBD !important;
|
||||
color: #000 !important;
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table tr td {
|
||||
height: 20px !important;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-table .el-table__empty-text {
|
||||
top: 15px !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .current-row>td {
|
||||
background: #316AC5 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox.is-disabled .el-checkbox__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-checkbox__input.is-checked .el-checkbox__inner::after {
|
||||
position: absolute;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
content: "";
|
||||
border: 1px solid #000;
|
||||
border-left: 0;
|
||||
border-top: 0;
|
||||
height: 7px;
|
||||
left: 4px;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__inner {
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__label {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner {
|
||||
background: #fff !important;
|
||||
border: 1px inset #dcdfe6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio__input.is-checked .el-radio__inner::after {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: 100%;
|
||||
background-color: #000 !important;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__inner {
|
||||
background: #E6E6E6 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-radio.is-disabled .el-radio__label {
|
||||
color: #C5C9CC !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .base-label {
|
||||
background: rgba(0, 0, 0, x);
|
||||
position: relative;
|
||||
left: -15px;
|
||||
top: -18px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-form-item label {
|
||||
font-weight: normal !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .context {
|
||||
height: 100px;
|
||||
border: 2px inset #E2E2E2;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .notice {
|
||||
margin-left: 62px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .button-group {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.planEdit__tool .el-dialog .el-tree__empty-block {
|
||||
background: #E9E9E9 !important;
|
||||
color: #000 !important;
|
||||
} */
|
||||
</style>
|
||||
|
@ -1,19 +1,17 @@
|
||||
import echarts from 'echarts';
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isDragging: false,
|
||||
createModel: {
|
||||
endStationCode: '',
|
||||
startStationCode: '',
|
||||
startTime: {
|
||||
hour: '',
|
||||
minute: '',
|
||||
second: ''
|
||||
}
|
||||
}
|
||||
startTime: ''
|
||||
},
|
||||
selected: null,
|
||||
dragging: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -54,89 +52,214 @@ export default {
|
||||
listenersBind() {
|
||||
if (this.myChart) {
|
||||
const zr = this.myChart.getZr();
|
||||
|
||||
zr.on('click', this.onClick, this)
|
||||
zr.on('contextmenu', this.onContextMenu, this);
|
||||
this.myChart.on('mousedown', this.onDragStart);
|
||||
this.myChart.on('mouseup', this.onDragEnd);
|
||||
this.myChart.on('click', 'series', this.onSelect);
|
||||
this.myChart.on('datazoom', this.onClearMarks);
|
||||
this.myChart.on('contextmenu', this.onContextMenu);
|
||||
this.myChart.on('mousedown', this.onMouseDown);
|
||||
this.myChart.on('datazoom', this.onUpdateZoom);
|
||||
window.addEventListener('resize', this.onUpdatePosition);
|
||||
}
|
||||
},
|
||||
listenersOff() {
|
||||
if (this.myChart) {
|
||||
const zr = this.myChart.getZr();
|
||||
|
||||
zr.off('click', this.onClick);
|
||||
zr.off('contextmenu', this.onContextMenu);
|
||||
this.myChart.off('mousedown', this.onDragStart);
|
||||
this.myChart.off('mouseup', this.onDragEnd);
|
||||
this.myChart.off('click', 'series', this.onSelect);
|
||||
this.myChart.off('datazoom', this.onClearMarks);
|
||||
this.myChart.off('contextmenu', this.onContextMenu)
|
||||
this.myChart.off('mousedown', this.onMouseDown);
|
||||
this.myChart.off('datazoom', this.onUpdateZoom);
|
||||
window.removeEventListener('resize', this.onUpdatePosition);
|
||||
}
|
||||
},
|
||||
loadInitGraphic() {
|
||||
const option = this.myChart.getOption();
|
||||
const graphic = option.series.map((el,i) => {
|
||||
return {
|
||||
id: el.name,
|
||||
elements: echarts.util.map(el.data||[], (el, dataIndex) => {
|
||||
return {
|
||||
type: 'circle',
|
||||
position: this.myChart.convertToPixel('grid', el),
|
||||
shape: {
|
||||
cx: 0,
|
||||
cy: 0,
|
||||
r: 10
|
||||
},
|
||||
invisible: true,
|
||||
draggable: true,
|
||||
ondrag: echarts.util.curry(this.onPointDragging, dataIndex),
|
||||
onmousemove: echarts.util.curry(this.onShowTooltip, dataIndex),
|
||||
onmouseout: echarts.util.curry(this.onHideTooltip, dataIndex),
|
||||
z: 100
|
||||
};
|
||||
})
|
||||
}
|
||||
})
|
||||
graphic.push({ id: 'operate', elements: [] })
|
||||
this.myChart.setOption({ graphic });
|
||||
},
|
||||
onPointDragging(dataIndex, dx, dy) {
|
||||
//
|
||||
},
|
||||
onShowTooltip(dataIndex) {
|
||||
this.myChart.dispatchAction({
|
||||
type: 'showTip',
|
||||
seriesIndex: 0,
|
||||
dataIndex: dataIndex
|
||||
});
|
||||
},
|
||||
onHideTooltip(dataIndex) {
|
||||
this.myChart.dispatchAction({type: 'hideTip'});
|
||||
},
|
||||
onUpdatePosition(e) {
|
||||
const option = this.myChart.getOption();
|
||||
const shapes = option.graphic;
|
||||
// const graphic = shapes.map(el => {
|
||||
// return echarts.util.map(el.elements||[], function (item, dataIndex) {
|
||||
// console.log(item, this.myChart.convertToPixel('grid', item.point))
|
||||
// return {
|
||||
// position: this.myChart.convertToPixel('grid', item.point)
|
||||
// };
|
||||
// })
|
||||
// })
|
||||
// this.myChart.setOption({graphic});
|
||||
},
|
||||
onUpdateZoom(e) {;
|
||||
const option = this.myChart.getOption();
|
||||
const shapes = option.graphic;
|
||||
|
||||
// const graphic = shapes.map(el => {
|
||||
// console.log(el)
|
||||
// const points = (el.elements||[]).map(el => { return el.point; });
|
||||
// return echarts.util.map(points, function (point, dataIndex) {
|
||||
// console.log(point, this.myChart.convertToPixel('grid', point))
|
||||
// return {
|
||||
// position: this.myChart.convertToPixel('grid', point)
|
||||
// };
|
||||
// })
|
||||
// })
|
||||
// this.myChart.setOption({graphic});
|
||||
},
|
||||
onClick(e) {
|
||||
this.pixelExecCb(e, this.handleMarkPoint)
|
||||
switch(this.action) {
|
||||
case 'Plan':
|
||||
this.pixelExecCb(e, this.handleMarkPoint);
|
||||
break;
|
||||
}
|
||||
},
|
||||
onContextMenu(e) {
|
||||
console.log(e, 'onContextMenu');
|
||||
this.onClearMarks();
|
||||
if(e.target) {
|
||||
const event = e.event;
|
||||
const point = {
|
||||
x: event.clientX,
|
||||
y: event.clientY
|
||||
}
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planAusContextMenu });
|
||||
} else {
|
||||
this.$message.info('No train number selected')
|
||||
|
||||
if (e.componentType == "series" &&
|
||||
e.componentSubType == "line" &&
|
||||
e.seriesName.includes('run-')) {
|
||||
|
||||
const value = e.value;
|
||||
const option = this.myChart.getOption();
|
||||
const dataList = option.series[e.seriesIndex].data;
|
||||
const length = dataList.length;
|
||||
const nxt = dataList[e.dataIndex+1];
|
||||
const pre = dataList[e.dataIndex-1];
|
||||
|
||||
this.selected = {
|
||||
seriesId: e.seriesName.replace('run-', ''),
|
||||
depTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
|
||||
runTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
|
||||
stationCode: value[2]
|
||||
}
|
||||
|
||||
if (e.dataIndex == length - 1 ||
|
||||
e.dataIndex < length - 1 && value[1] == nxt[1]) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustDeparture });
|
||||
} else if (e.dataIndex == 0 ||
|
||||
e.dataIndex > 0 && value[1] == pre[1]) {
|
||||
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: DeviceMenu.planJustArrival });
|
||||
}
|
||||
}
|
||||
},
|
||||
onClearMarks() {
|
||||
if (this.myChart) {
|
||||
let op = this.myChart.getOption();
|
||||
op.graphic[0].elements = [];
|
||||
this.myChart.setOption(op, {notMerge: true})
|
||||
onMouseDown(e) {
|
||||
if (e.componentType == "series" &&
|
||||
e.componentSubType == "line" &&
|
||||
e.seriesName.includes('run-')) {
|
||||
|
||||
const value = e.value;
|
||||
const option = this.myChart.getOption();
|
||||
const dataList = option.series[e.seriesIndex].data;
|
||||
const length = dataList.length;
|
||||
const nxt = dataList[e.dataIndex+1];
|
||||
const pre = dataList[e.dataIndex-1];
|
||||
|
||||
this.selected = {
|
||||
seriesId: e.seriesName.replace('run-', ''),
|
||||
depTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
|
||||
runTime: e.dataIndex < length - 1? nxt[0] - value[0]: 0,
|
||||
stationCode: value[2]
|
||||
}
|
||||
|
||||
this.dragging = true;
|
||||
}
|
||||
},
|
||||
onSelect(e) {
|
||||
console.log(e, 'select')
|
||||
},
|
||||
onDragStart(e) {
|
||||
console.log(e, 'dragStart');
|
||||
},
|
||||
onDragEnd(e) {
|
||||
console.log(e, 'dragEnd');
|
||||
clearMarks() {
|
||||
const option = this.myChart.getOption();
|
||||
const graphic = option.graphic;
|
||||
const index = graphic.findIndex(el => { return el.id == 'operate'});
|
||||
if (index >= 0) {
|
||||
graphic[index].elements = [];
|
||||
}
|
||||
this.myChart.setOption(option, {notMerge: true});
|
||||
},
|
||||
createMarkPoint(point, text) {
|
||||
return {
|
||||
type: 'group',
|
||||
z: 100,
|
||||
children: [
|
||||
{
|
||||
type: 'circle',
|
||||
z: 100,
|
||||
position: point,
|
||||
point,
|
||||
shape: {
|
||||
cx: point[0],
|
||||
cy: point[1],
|
||||
r: 5
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0,0,0,0.3)'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'circle',
|
||||
z: 100,
|
||||
shape: {
|
||||
cx: point[0],
|
||||
cy: point[1],
|
||||
cx: 0,
|
||||
cy: 0,
|
||||
r: 10
|
||||
},
|
||||
style: {
|
||||
fill: 'rgba(0,0,0,0.3)'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// return {
|
||||
// type: 'group',
|
||||
// z: 100,
|
||||
// position: point,
|
||||
// point,
|
||||
// children: [
|
||||
// {
|
||||
// type: 'circle',
|
||||
// z: 100,
|
||||
// shape: {
|
||||
// cx: 0,
|
||||
// cy: 0,
|
||||
// r: 5
|
||||
// },
|
||||
// style: {
|
||||
// fill: 'rgba(0,0,0,0.3)'
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// type: 'circle',
|
||||
// z: 100,
|
||||
// shape: {
|
||||
// cx: 0,
|
||||
// cy: 0,
|
||||
// r: 10
|
||||
// },
|
||||
// style: {
|
||||
// fill: 'rgba(0,0,0,0.3)'
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
},
|
||||
handleMarkPoint(yObj, xVal, pointInPixel) {
|
||||
let myChart = this.myChart;
|
||||
@ -151,7 +274,7 @@ export default {
|
||||
this.createModel.startTime = timeFormat(xVal);
|
||||
} else if (graphic.elements.length >= 2) {
|
||||
this.createModel.endStationCode = yObj.code;
|
||||
this.createRpTrip(this.createModel);
|
||||
this.handleCreate(this.createModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,24 +1,43 @@
|
||||
<template>
|
||||
<div id="PlanSchedule">
|
||||
<div class="left">
|
||||
<div :id="runPlanId" />
|
||||
<context-menu :tripNo="tripNo" />
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="menus">
|
||||
<el-button-group v-model="active">
|
||||
<el-button v-for="(el,i) in buttonList"
|
||||
:type="active == i? 'primary':''"
|
||||
:key="i" @click="handleBtnSelect(el,i)">{{el.name}}</el-button>
|
||||
</el-button-group>
|
||||
<el-button @click="handleCancle">Reset</el-button>
|
||||
<el-button-group style="margin-left: 20px">
|
||||
<el-button :type="selected?'danger':'info'" icon="el-icon-delete" @click="handleRemove" />
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
<div :id="runPlanId" />
|
||||
</el-card>
|
||||
<plan-just-running :selected="selected" @justRunning="handleJustRunning" />
|
||||
<plan-just-stop :selected="selected" @justStop="handleJustStop"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import echarts from 'echarts';
|
||||
import PlanJustRunning from './dialog/planJustRunning.vue';
|
||||
import PlanJustStop from './dialog/planJustStop.vue';
|
||||
import Monitor from './monitor.js';
|
||||
import ContextMenu from './contextMenu.vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { getRpTools, addRpTrip } from '@/api/rpTools';
|
||||
import { getRpTools, addRpTrip, delRpTrip, justTripNoRunning, justTripNoStop} from '@/api/rpTools';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PlanJustRunning,
|
||||
PlanJustStop
|
||||
},
|
||||
props: {
|
||||
planConvert: {
|
||||
type: Object,
|
||||
@ -46,49 +65,35 @@ export default {
|
||||
}
|
||||
},
|
||||
mixins: [Monitor],
|
||||
components: {
|
||||
ContextMenu
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
top: 0,
|
||||
height: 0,
|
||||
mapName: 'XXX',
|
||||
runPlanId: 'plan-tool',
|
||||
myChart: null,
|
||||
showTrain: false,
|
||||
tripNo: '',
|
||||
serviceNumberConfig: {
|
||||
data: [],
|
||||
title: this.$t('planMonitor.serviceNumber'),
|
||||
showHeader: false,
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.serviceNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'serviceNumber',
|
||||
label: this.$t('planMonitor.serviceNumber')
|
||||
}
|
||||
]
|
||||
},
|
||||
tripNumberConfig: {
|
||||
data: [],
|
||||
title: this.$t('planMonitor.tripNumber'),
|
||||
showHeader: false,
|
||||
highlightCurrentRow: true,
|
||||
handleChange: this.tripNumberChange,
|
||||
showClose: false,
|
||||
columns: [
|
||||
{
|
||||
prop: 'tripNumber',
|
||||
label: this.$t('planMonitor.tripNumber')
|
||||
}
|
||||
]
|
||||
},
|
||||
realData: {},
|
||||
kmRangeCoordMap: {},
|
||||
option: {
|
||||
stationsObj: {},
|
||||
active: -1,
|
||||
action: '',
|
||||
buttonList: [
|
||||
{
|
||||
name: 'Plan',
|
||||
type: 'Plan'
|
||||
} ]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('rpTools', [
|
||||
'stations'
|
||||
]),
|
||||
planId() {
|
||||
return this.$route.query.planId;
|
||||
},
|
||||
mapId() {
|
||||
return 9;
|
||||
},
|
||||
option() {
|
||||
return {
|
||||
title: {
|
||||
text: '',
|
||||
left: 'center',
|
||||
@ -175,13 +180,9 @@ export default {
|
||||
max: 0
|
||||
},
|
||||
graphic: [{
|
||||
id: 'static',
|
||||
id: 'operate',
|
||||
elements: []
|
||||
}],
|
||||
markPoint: [{
|
||||
id: 'mark',
|
||||
data: []
|
||||
}],
|
||||
series: [],
|
||||
dataZoom: [
|
||||
{
|
||||
@ -191,34 +192,12 @@ export default {
|
||||
moveOnMouseWheel: 'ctrl'
|
||||
},
|
||||
{
|
||||
fiterMode: 'filter',
|
||||
handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
|
||||
handleSize: '80%',
|
||||
handleStyle: {
|
||||
color: '#fff',
|
||||
shadowBlur: 3,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.6)',
|
||||
shadowOffsetX: 2,
|
||||
shadowOffsetY: 2
|
||||
},
|
||||
type: 'slider',
|
||||
filterMode: 'empty',
|
||||
bottom: '20px'
|
||||
}
|
||||
]
|
||||
},
|
||||
absoluteTime: 2 * 3600,
|
||||
indexKmRangeMap: {},
|
||||
stationsObj: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('rpTools', [
|
||||
'stations'
|
||||
]),
|
||||
planId() {
|
||||
return this.$route.query.planId;
|
||||
},
|
||||
mapId() {
|
||||
return 9;
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -251,120 +230,28 @@ export default {
|
||||
this.destroy();
|
||||
},
|
||||
methods: {
|
||||
displayTrain() {
|
||||
this.showTrain = !this.showTrain;
|
||||
},
|
||||
serviceNumberChange(row) {
|
||||
let serviceNumber = null;
|
||||
let serviceObj = {};
|
||||
if (row) {
|
||||
serviceNumber = row.serviceNumber;
|
||||
serviceObj = this.$store.state.rpTools.editData[row.serviceNumber] || {};
|
||||
|
||||
const op = this.myChart.getOption();
|
||||
op.series.forEach((item, index) => {
|
||||
item.lineStyle.color = '#000';
|
||||
switch (item.name) {
|
||||
case serviceNumber: {
|
||||
item.lineStyle.color = 'red';
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
op.series.pop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.myChart.setOption(op, true);
|
||||
}
|
||||
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: null });
|
||||
this.analyticalTripNumber(serviceObj.trainMap || {});
|
||||
},
|
||||
tripNumberChange(row) {
|
||||
const serviceNumber = this.$store.state.rpTools.selected.serviceNumber;
|
||||
let tripNumber = null;
|
||||
if (row) {
|
||||
const data = [];
|
||||
tripNumber = row.tripNumber;
|
||||
const op = this.myChart.getOption();
|
||||
op.series.forEach((item, index) => {
|
||||
switch (item.name) {
|
||||
case serviceNumber: {
|
||||
item.data.forEach(nor => {
|
||||
if (nor[3] == tripNumber) {
|
||||
data.push(nor);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'trainLabel': {
|
||||
op.series.pop();
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
op.series.push({
|
||||
name: 'trainLabel',
|
||||
lineStyle: {
|
||||
color: 'green'
|
||||
},
|
||||
type: 'line',
|
||||
data: data
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.myChart && this.myChart.setOption(op, true);
|
||||
}, 50);
|
||||
|
||||
}
|
||||
this.$store.dispatch('rpTools/setSelected', { serviceNumber: serviceNumber, tripNumber: tripNumber });
|
||||
},
|
||||
async analyticalServiceNumber(data) {
|
||||
this.serviceNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.map(serviceNumber => { return { serviceNumber }; });
|
||||
},
|
||||
async analyticalTripNumber(data) {
|
||||
this.tripNumberConfig.data = Object.keys(data || {})
|
||||
.sort((a, b) => { return data[a].oldIndex - data[b].oldIndex; })
|
||||
.map(tripNumber => { return { tripNumber }; });
|
||||
},
|
||||
async setPosition() {
|
||||
setPosition() {
|
||||
this.$nextTick(() => {
|
||||
let top = 3;
|
||||
const width = this.maxWidth;
|
||||
let height = this.maxHeight;
|
||||
|
||||
const titleBar = document.getElementById('PlanTitleBar');
|
||||
const menuBar = document.getElementById('PlanMenuBar');
|
||||
const menuTool = document.getElementById('PlanMenuTool');
|
||||
const statusBar = document.getElementById('PlanStatusBar');
|
||||
|
||||
if (titleBar) {
|
||||
top += (titleBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (menuBar) {
|
||||
top += (menuBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (menuTool) {
|
||||
top += (menuTool.offsetHeight || 0);
|
||||
}
|
||||
|
||||
if (statusBar) {
|
||||
height -= (statusBar.offsetHeight || 0);
|
||||
}
|
||||
|
||||
height = height - top;
|
||||
const height = this.maxHeight;
|
||||
this.$store.dispatch('rpTools/resize', { width, height });
|
||||
|
||||
if (this.top != top) {
|
||||
this.top = top;
|
||||
});
|
||||
},
|
||||
loadInitChart() {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
|
||||
if (this.height != height) {
|
||||
this.height = height - 20 * 2;
|
||||
if (this.$route.query.planName || this.$route.query.prdType === '05') {
|
||||
this.option.title.text = this.mapName;
|
||||
}
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
this.myChart.setOption(this.option, {notMerge: true});
|
||||
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -380,12 +267,17 @@ export default {
|
||||
return el.name.includes(it)
|
||||
}) < 0;
|
||||
});
|
||||
|
||||
this.stationsObj = {};
|
||||
stations.forEach(item => {
|
||||
this.stationsObj[Math.floor(item.kmRange)] = item;
|
||||
});
|
||||
|
||||
this.$store.dispatch('rpTools/setStations', stations).then(() => {
|
||||
this.loadInitData();
|
||||
this.myChart && this.myChart.showLoading();
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.analyticalServiceNumber(this.$store.state.rpTools.editData);
|
||||
this.loadChartData();
|
||||
this.myChart && this.myChart.hideLoading();
|
||||
});
|
||||
@ -405,34 +297,28 @@ export default {
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed'));
|
||||
}
|
||||
},
|
||||
async loadChartData() {
|
||||
try {
|
||||
const stations = this.$store.state.rpTools.stations;
|
||||
const planData = this.$store.state.rpTools.planData;
|
||||
this.stationsObj = {};
|
||||
stations.forEach(item => {
|
||||
this.stationsObj[Math.floor(item.kmRange)] = item;
|
||||
});
|
||||
|
||||
this.viewDisabled = true;
|
||||
|
||||
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.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
|
||||
await this.loadInitChart();
|
||||
|
||||
this.viewDisabled = false;
|
||||
} catch (error) {
|
||||
this.viewDisabled = false;
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
await this.xAxisInit();
|
||||
await this.yAxisInit();
|
||||
await this.loadInitChart();
|
||||
},
|
||||
async loadChartData() {
|
||||
try {
|
||||
const stations = this.$store.state.rpTools.stations;
|
||||
const planData = this.$store.state.rpTools.planData;
|
||||
const option = this.myChart.getOption();
|
||||
|
||||
option.series = [];
|
||||
option.graphic = [{ id: 'operate', elements: [] }];
|
||||
this.kmRangeCoordMap = this.planConvert.convertStationsToMap(stations);
|
||||
this.pushModels(option.series, [this.planConvert.initializeYaxis(this.stations)]);
|
||||
this.pushModels(option.series, this.planConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { width: 0.5, color: '#000' }));
|
||||
this.myChart.setOption(option, {notMerge: true});
|
||||
this.loadInitGraphic();
|
||||
} catch (error) {
|
||||
this.$messageBox(this.$t('error.loadingOperationGraphFailed') + this.$t('global.colon') + error.message);
|
||||
}
|
||||
},
|
||||
pushModels(series, models) {
|
||||
if (models && models.length) {
|
||||
models.forEach(elem => {
|
||||
@ -455,24 +341,6 @@ export default {
|
||||
}
|
||||
|
||||
return series;
|
||||
},
|
||||
loadInitChart() {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
if (this.$route.query.planName || this.$route.query.prdType === '05') {
|
||||
this.option.title.text = this.mapName;
|
||||
}
|
||||
this.myChart = echarts.init(document.getElementById(this.runPlanId));
|
||||
this.myChart.setOption(this.option, {notMerge: true});
|
||||
this.reSize({ width: this.$store.state.rpTools.width, height: this.$store.state.rpTools.height });
|
||||
resolve(true);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
destroy() {
|
||||
if (this.myChart && this.myChart.isDisposed) {
|
||||
@ -480,14 +348,6 @@ export default {
|
||||
this.myChart = null;
|
||||
}
|
||||
},
|
||||
clearCanvas() {
|
||||
this.option.series = [];
|
||||
this.option.title.text = '';
|
||||
if (this.myChart) {
|
||||
this.myChart.clear();
|
||||
}
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
xAxisPointFormat(params) {
|
||||
return timeFormat(params.value);
|
||||
},
|
||||
@ -509,7 +369,7 @@ export default {
|
||||
}
|
||||
|
||||
const startValue = 3600 * 6;
|
||||
const offsetTime = 3600 * 1;
|
||||
const offsetTime = 3600 / 6;
|
||||
|
||||
this.option.xAxis[0].data = list;
|
||||
if (!this.option.dataZoom[0].startValue) {
|
||||
@ -555,17 +415,88 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
createRpTrip(data) {
|
||||
addRpTrip(data).then(resp => {
|
||||
this.loadChartData();
|
||||
}).catch(error => {
|
||||
handleBtnSelect(el, i) {
|
||||
this.active = i;
|
||||
this.action = el.type;
|
||||
},
|
||||
handleCancle() {
|
||||
this.active = -1;
|
||||
this.action = '';
|
||||
this.selected = null;
|
||||
this.clearMarks();
|
||||
},
|
||||
handleCreate(data) {
|
||||
if (this.myChart) {
|
||||
const op = this.myChart.getOption();
|
||||
op.graphic[0].elements = [];
|
||||
this.myChart.setOption(op, {notMerge: true});
|
||||
}
|
||||
addRpTrip(data).then(resp => {
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.loadChartData();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
this.clearMarks();
|
||||
})
|
||||
}
|
||||
},
|
||||
handleRemove() {
|
||||
if (this.myChart && this.selected) {
|
||||
delRpTrip(this.selected.seriesId).then(resp => {
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.loadChartData();
|
||||
this.handleCancle();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
})
|
||||
}
|
||||
},
|
||||
handleJustRunning(time) {
|
||||
if (this.selected) {
|
||||
const model = {
|
||||
seconds: time,
|
||||
stationCode: this.selected.stationCode
|
||||
}
|
||||
|
||||
justTripNoRunning(this.selected.seriesId, model).then(resp => {
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.loadChartData();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
})
|
||||
}
|
||||
},
|
||||
handleJustStop(time){
|
||||
if (this.selected) {
|
||||
const model = {
|
||||
seconds: time,
|
||||
stationCode: this.selected.stationCode
|
||||
}
|
||||
|
||||
justTripNoStop(this.selected.seriesId, model).then(resp => {
|
||||
getRpTools().then(rest => {
|
||||
this.$store.dispatch('rpTools/setPlanData', rest.data).then(() => {
|
||||
this.loadChartData();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainOperationGraphFailed'));
|
||||
});
|
||||
}).catch(error => {
|
||||
this.$message(error.message);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -575,25 +506,14 @@ export default {
|
||||
#PlanSchedule {
|
||||
z-index: 0;
|
||||
width: 100%;
|
||||
height: calc(100% - 45px);
|
||||
position: relative;
|
||||
margin-top: 45px;
|
||||
|
||||
.left {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
float: left;
|
||||
}
|
||||
position: relative;
|
||||
|
||||
.position {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 50px;
|
||||
width: 220px;
|
||||
height: calc(100% - 45px);
|
||||
}
|
||||
.data_table_box{
|
||||
height: 50%;
|
||||
.menus {
|
||||
margin: 0 80px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user