From 3dcf6edde05aef3f58cdbfd13efc6037f85c9a7d Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Wed, 28 Oct 2020 16:32:45 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=9B=BD=E8=B5=9B=E7=9A=AE=E8=82=A4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/shape/Section/ETextName.js | 2 +- src/jmapNew/shape/Signal/index.js | 4 ++ .../theme/haerbin_01/menus/menuButton.vue | 4 +- .../haerbin_01/menus/menuDialog/alarm.vue | 44 ------------- .../menus/menuDialog/alarmTable.vue | 61 +++++++++++++++++++ src/utils/baseUrl.js | 4 +- 6 files changed, 71 insertions(+), 48 deletions(-) delete mode 100644 src/jmapNew/theme/haerbin_01/menus/menuDialog/alarm.vue create mode 100644 src/jmapNew/theme/haerbin_01/menus/menuDialog/alarmTable.vue diff --git a/src/jmapNew/shape/Section/ETextName.js b/src/jmapNew/shape/Section/ETextName.js index 87d10f131..06523e0ab 100644 --- a/src/jmapNew/shape/Section/ETextName.js +++ b/src/jmapNew/shape/Section/ETextName.js @@ -126,7 +126,7 @@ class ETextName extends Group { fontSize: styleModel.fontSize, fontFamily: styleModel.fontFamily || this.model.style.fontFamily, text: styleName, - textFill: model.approach ? styleModel.approachColor : styleModel.fontColor, + textFill: model.approach && this.model.type === 'name' ? styleModel.approachColor : styleModel.fontColor, textAlign: styleModel.textAlign, textPosition: styleModel.textPosition || 'inside', textVerticalAlign: styleModel.textVerticalAlign || null diff --git a/src/jmapNew/shape/Signal/index.js b/src/jmapNew/shape/Signal/index.js index 8ce875cd5..6c852fe24 100644 --- a/src/jmapNew/shape/Signal/index.js +++ b/src/jmapNew/shape/Signal/index.js @@ -371,6 +371,10 @@ class Signal extends Group { } else { this.lamps[0].setColor(this.style.Signal.lamp.redColor); } + } else if (this.count == 3) { + this.lamps[0] && this.lamps[0].setColor(this.style.Signal.lamp.redColor); + this.lamps[1] && this.lamps[1].setColor(this.style.backgroundColor); + this.lamps[2] && this.lamps[2].setColor(this.style.backgroundColor); } } } diff --git a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue index 4c499bd83..f9028246b 100644 --- a/src/jmapNew/theme/haerbin_01/menus/menuButton.vue +++ b/src/jmapNew/theme/haerbin_01/menus/menuButton.vue @@ -58,9 +58,11 @@ import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo' import CMD from '@/scripts/cmdPlugin/CommandEnum'; import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler'; import { TrainingMode } from '@/scripts/ConstDic'; +import AlarmTable from './menuDialog/alarmTable'; export default { components: { - NoticeInfo + NoticeInfo, + AlarmTable }, props: { selected: { diff --git a/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarm.vue b/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarm.vue deleted file mode 100644 index 09fdf1452..000000000 --- a/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarm.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarmTable.vue b/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarmTable.vue new file mode 100644 index 000000000..ea9f48b47 --- /dev/null +++ b/src/jmapNew/theme/haerbin_01/menus/menuDialog/alarmTable.vue @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index e459aa552..1628a46bf 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,8 +2,8 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; - BASE_API = 'http://192.168.8.107:9000'; // 袁琪 + 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.8.144:9000'; // 旭强 // BASE_API = 'http://192.168.3.175:9000'; // 张赛 From 57c5862ab0ac7e5f27d77bddbc30d983dd520092 Mon Sep 17 00:00:00 2001 From: lVAL Date: Wed, 28 Oct 2020 17:43:44 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0AUSTool=20=E5=8F=AA?= =?UTF-8?q?=E8=AF=BB=E5=92=8C=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=93=8D?= =?UTF-8?q?=E4=BD=9CBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/rpTools.js | 16 ++++++ .../planMonitor/editToolAUS/line/index.vue | 2 +- .../planMonitor/editToolAUS/line/modify.vue | 2 +- .../tool/dialog/planJustRunning.vue | 2 +- .../editToolAUS/tool/dialog/planJustStop.vue | 2 +- .../tool/dialog/planJustTurnback.vue | 2 +- .../editToolAUS/tool/dialog/planSetParams.vue | 14 ++--- .../planMonitor/editToolAUS/tool/index.vue | 55 ++++++++++++++++++- .../planMonitor/editToolAUS/tool/list.vue | 3 + .../planMonitor/editToolAUS/tool/monitor.js | 3 +- .../planMonitor/editToolAUS/tool/schedule.vue | 7 ++- src/views/planMonitor/editToolAUS/utils.js | 18 ++++++ 12 files changed, 108 insertions(+), 18 deletions(-) diff --git a/src/api/rpTools.js b/src/api/rpTools.js index 49e080d99..5b303aeb7 100644 --- a/src/api/rpTools.js +++ b/src/api/rpTools.js @@ -179,3 +179,19 @@ export function justTripTurnBack(planId, tripNo, data) { data }); } + +/** 开始编辑*/ +export function startRpEdit(planId) { + return request({ + url: `/api/rpTools/${planId}/edit`, + method: 'put' + }) +} + +/** 开始编辑*/ +export function endRpEdit(planId) { + return request({ + url: `/api/rpTools/${planId}/endEdit`, + method: 'put' + }) +} diff --git a/src/views/planMonitor/editToolAUS/line/index.vue b/src/views/planMonitor/editToolAUS/line/index.vue index 58bc8b2bd..7b7b75d3c 100644 --- a/src/views/planMonitor/editToolAUS/line/index.vue +++ b/src/views/planMonitor/editToolAUS/line/index.vue @@ -129,7 +129,7 @@ export default { height: calc(100% - 10px); /deep/ { .el-card__body { - height: 100%; + height: calc(100% - 50px); overflow-y: auto; &::-webkit-scrollbar { diff --git a/src/views/planMonitor/editToolAUS/line/modify.vue b/src/views/planMonitor/editToolAUS/line/modify.vue index ae3e4bd19..bf30f03b3 100644 --- a/src/views/planMonitor/editToolAUS/line/modify.vue +++ b/src/views/planMonitor/editToolAUS/line/modify.vue @@ -1,6 +1,6 @@ drawer=false"> - 修改表单 + 修改站信息 diff --git a/src/views/planMonitor/editToolAUS/tool/dialog/planJustRunning.vue b/src/views/planMonitor/editToolAUS/tool/dialog/planJustRunning.vue index c8a0180a3..0a18c2f20 100644 --- a/src/views/planMonitor/editToolAUS/tool/dialog/planJustRunning.vue +++ b/src/views/planMonitor/editToolAUS/tool/dialog/planJustRunning.vue @@ -63,7 +63,7 @@ export default { rules: { time: [ { - type: 'number', min: 0, message: 'Please select the arrival time.', trigger: 'blur' + required: true, type: 'number', min: 0, message: 'Please select the arrival time.', trigger: 'blur' }, { validator: validator, trigger: 'blur' diff --git a/src/views/planMonitor/editToolAUS/tool/dialog/planJustStop.vue b/src/views/planMonitor/editToolAUS/tool/dialog/planJustStop.vue index 5411fd8d9..e0bc09a51 100644 --- a/src/views/planMonitor/editToolAUS/tool/dialog/planJustStop.vue +++ b/src/views/planMonitor/editToolAUS/tool/dialog/planJustStop.vue @@ -46,7 +46,7 @@ export default { rules: { time: [ { - type: 'number', min: 0, max: 12*3600, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 0, max: 12*3600, message: 'Please select the stop time.', trigger: 'blur' }, { validator: validator, trigger: 'blur' diff --git a/src/views/planMonitor/editToolAUS/tool/dialog/planJustTurnback.vue b/src/views/planMonitor/editToolAUS/tool/dialog/planJustTurnback.vue index cd136203e..818709d1c 100644 --- a/src/views/planMonitor/editToolAUS/tool/dialog/planJustTurnback.vue +++ b/src/views/planMonitor/editToolAUS/tool/dialog/planJustTurnback.vue @@ -38,7 +38,7 @@ export default { rules: { time: [ { - type: 'number', min: 0, message: 'Please select turn back time.', trigger: 'blur' + required: true, type: 'number', min: 0, message: 'Please select turn back time.', trigger: 'blur' } ], } diff --git a/src/views/planMonitor/editToolAUS/tool/dialog/planSetParams.vue b/src/views/planMonitor/editToolAUS/tool/dialog/planSetParams.vue index 58f3a98bd..a0449c62e 100644 --- a/src/views/planMonitor/editToolAUS/tool/dialog/planSetParams.vue +++ b/src/views/planMonitor/editToolAUS/tool/dialog/planSetParams.vue @@ -1,6 +1,6 @@ - + km/h @@ -57,32 +57,32 @@ export default { rules: { averageSpeed: [ { - type: 'number', min: 20, max: 60, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 20, max: 60, message: 'Please select the stop time.', trigger: 'blur' } ], maxSpeed: [ { - type: 'number', min: 50, max: 80, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 50, max: 80, message: 'Please select the stop time.', trigger: 'blur' } ], stopTime: [ { - type: 'number', min: 10, max: 120, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 10, max: 120, message: 'Please select the stop time.', trigger: 'blur' } ], minStopTime: [ { - type: 'number', min: 10, max: 30, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 10, max: 30, message: 'Please select the stop time.', trigger: 'blur' } ], minIntervalTime: [ { - type: 'number', min: 30, max: 360, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 30, max: 360, message: 'Please select the stop time.', trigger: 'blur' } ], turnBackTime: [ { - type: 'number', min: 60, max: 180, message: 'Please select the stop time.', trigger: 'blur' + required: true, type: 'number', min: 60, max: 180, message: 'Please select the stop time.', trigger: 'blur' } ] } diff --git a/src/views/planMonitor/editToolAUS/tool/index.vue b/src/views/planMonitor/editToolAUS/tool/index.vue index ab2527587..3d89d2039 100644 --- a/src/views/planMonitor/editToolAUS/tool/index.vue +++ b/src/views/planMonitor/editToolAUS/tool/index.vue @@ -73,6 +73,7 @@ import * as utils from '../utils.js'; import { timeFormat } from '@/utils/date'; import { mapGetters } from 'vuex'; import { + startRpEdit, endRpEdit, listLines, listStations, listRps, createRp, deleteRp, getRpTools, clearRpPlan, addRpTrip, delRpTrip, @@ -102,6 +103,7 @@ export default { planData: {}, selected: null, target: null, + isModify: false, textareaModel: { id: 0, show: false, @@ -123,7 +125,7 @@ export default { }, computed: { disabled() { - return !this.planId; + return !this.planId || !this.isModify; }, show() { return this.textareaModel.show; @@ -157,14 +159,35 @@ export default { height() { this.setPosition(); }, - $route() { - this.loadPlanData(); + $route: function (to, from) { + const fromPlanId = from.query.planId; + if (fromPlanId) { + if(utils.getModifyState(fromPlanId)) { + endRpEdit(fromPlanId).then(resp => { + utils.delModifyState(fromPlanId); + this.loadPlanData(); + }) + } else { + this.loadPlanData(); + } + } else { + this.loadPlanData(); + } } }, created() { this.planUtil = this.$theme.loadPlanConvert(this.lineCode); }, mounted() { + window.onbeforeunload = e => { + if(this.planId && + utils.getModifyState(this.planId)) { + endRpEdit(this.planId).then(resp => { + utils.setModifyState(this.planId, resp.data); + }) + } + }; + this.setPosition(); this.loadPlanData(); }, @@ -177,6 +200,7 @@ export default { return { id: it.id, isPlan: true, + isModify: it.editable, name: it.mapName, lineId: it.mapId, } @@ -200,6 +224,31 @@ export default { this.$refs.schedule.loadChartPage(stations); if (this.planId) { + if(utils.getModifyState(this.planId)) { + endRpEdit(this.planId).then(resp => { + utils.setModifyState(this.planId, resp.data); + startRpEdit(this.planId).then(resp => { + this.isModify = resp.data; + utils.setModifyState(this.planId, resp.data); + if (this.isModify) { + listRps().then(resp => { + this.planList = this.buildPlanList(resp.data); + }); + } + }); + }) + } else { + startRpEdit(this.planId).then(resp => { + this.isModify = resp.data; + utils.setModifyState(this.planId, resp.data); + if (this.isModify) { + listRps().then(resp => { + this.planList = this.buildPlanList(resp.data); + }); + } + }); + } + getRpTools(this.planId).then(rest => { const planData = this.planData = rest.data; this.$store.commit('rpTools/setPlanData', planData); diff --git a/src/views/planMonitor/editToolAUS/tool/list.vue b/src/views/planMonitor/editToolAUS/tool/list.vue index 8ec47c7e8..50ed48aaf 100644 --- a/src/views/planMonitor/editToolAUS/tool/list.vue +++ b/src/views/planMonitor/editToolAUS/tool/list.vue @@ -13,6 +13,9 @@ @click.stop="onDelete(data)"> Delete + + {{data.isModify? '编辑': '只读'}} + diff --git a/src/views/planMonitor/editToolAUS/tool/monitor.js b/src/views/planMonitor/editToolAUS/tool/monitor.js index 940fcc2e1..d1406ffa3 100644 --- a/src/views/planMonitor/editToolAUS/tool/monitor.js +++ b/src/views/planMonitor/editToolAUS/tool/monitor.js @@ -42,9 +42,8 @@ export default { const xIndex = pointInGrid[0]; const yIndex = pointInGrid[1]; const option = this.myChart.getOption(); - const minY = option.yAxis[0].min; const xVal = option.xAxis[0].data[xIndex]; - const yObj = this.planUtil.getStationByCoordinateY(this.stations, yIndex-minY); + const yObj = this.planUtil.getStationByCoordinateY(this.stations, yIndex); if (yObj) { cb({yObj, xVal, pointInPixel, pointInGrid, e}); } diff --git a/src/views/planMonitor/editToolAUS/tool/schedule.vue b/src/views/planMonitor/editToolAUS/tool/schedule.vue index 4e8e3a6ef..84c40f04c 100644 --- a/src/views/planMonitor/editToolAUS/tool/schedule.vue +++ b/src/views/planMonitor/editToolAUS/tool/schedule.vue @@ -163,7 +163,9 @@ export default { shadowColor: 'rgba(0, 0, 0, 0.6)', shadowOffsetX: 2, shadowOffsetY: 2 - }, + }, + rangeMode: 'percent', + labelFormatter: this.dataZoomFormat, bottom: '20px' } ] @@ -197,6 +199,9 @@ export default { yAxisLabelFormat(value, index) { return ''; }, + dataZoomFormat(value) { + return timeFormat(value); + }, axisTooltip(param) { let data = ''; diff --git a/src/views/planMonitor/editToolAUS/utils.js b/src/views/planMonitor/editToolAUS/utils.js index 97426f1c0..e00416cbe 100644 --- a/src/views/planMonitor/editToolAUS/utils.js +++ b/src/views/planMonitor/editToolAUS/utils.js @@ -111,3 +111,21 @@ 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}); } + +const ModifyFlag = 'AUS-modify-flag' +export function getModifyState(planId) { + const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`); + return state[planId]; +} +export function setModifyState(planId, bool) { + const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`); + bool + ? state[planId] = bool + : delete state[planId] + localStorage.setItem(ModifyFlag, JSON.stringify(state)); +} +export function delModifyState(planId) { + const state = JSON.parse(localStorage.getItem(ModifyFlag)||`{ }`); + delete state[planId]; + localStorage.setItem(ModifyFlag, JSON.stringify(state)); +} From 897e4342011d53270d2c1d1e447cff827c186ba3 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Wed, 28 Oct 2020 17:54:06 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/chatView/chatContent.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/views/newMap/chatView/chatContent.vue b/src/views/newMap/chatView/chatContent.vue index 94b343081..ceae84d44 100644 --- a/src/views/newMap/chatView/chatContent.vue +++ b/src/views/newMap/chatView/chatContent.vue @@ -5,7 +5,7 @@ {{ covertName(chatContent.memberId) }} - {{ chatContent.time }} + {{ covertTime(chatContent.time) }} @@ -23,6 +23,7 @@