From 9ba73cbb77ed2854d2dfa600b6bd591d0c3c35cd Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 24 Nov 2020 17:35:14 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=93=88=E5=B0=94?= =?UTF-8?q?=E6=BB=A8=E7=BB=BC=E5=90=88=E7=9B=91=E6=8E=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iscsSystem/config/canvas/iscsCanvas.vue | 36 +++++++++++++------ .../iscsSystem/config/fire-alarm/stand.vue | 1 - .../lessoncategory/edit/lesson/publish.vue | 6 ++-- .../newMap/displayNew/demon/planSchedule.vue | 2 -- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue index 10bf0ab97..a59c34312 100644 --- a/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue +++ b/src/views/iscs/iscsSystem/config/canvas/iscsCanvas.vue @@ -1,6 +1,6 @@ @@ -8,7 +8,8 @@ import Vue from 'vue'; import Iscs from '@/iscs/iscs'; import { parser } from '@/iscs/utils/parser'; -import {getIscsData} from '@/iscs/constant/iscsData'; +// import { getIscsData } from '@/iscs/constant/iscsData'; +import { getIscsData } from '@/api/iscs'; export default { name: 'Iscs', @@ -45,7 +46,6 @@ export default { showBackButton: true, initTime: '', started: false, - loading: false, stationCode: '', banUpOpenScreenDoor: false, banDownOpenScreenDoor: false @@ -78,7 +78,20 @@ export default { this.iscsDestroy(); }, methods: { - show (mode, system, part) { + async getDetail(mode, system, part) { + const params = { + lineCode: this.$route.query.lineCode, + totalSystem: mode, + system: system, + userInterface : part + }; + const resp = await getIscsData(params); + if (resp.data) { + const data = JSON.parse(resp.data.graphData); + return data; + } + }, + async show (mode, system, part) { if (!mode || !system || !part) { return; } @@ -86,8 +99,8 @@ export default { return false; }; this.iscsDestroy(); - this.loading = true; - const data = parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight}); + const dataIscs = await this.getDetail(mode, system, part); + const data = parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight}); this.$iscs = new Iscs({ dom: document.getElementById(this.iscsId), config: { @@ -109,8 +122,8 @@ export default { if (this.$route.params.mode) { this.$iscs.on('selected', this.onSelected, this); } - this.setIscs(data, getIscsData(mode, system, part)); - this.$store.dispatch('iscs/setIscsData', getIscsData(mode, system, part)); + this.setIscs(data, dataIscs); + this.$store.dispatch('iscs/setIscsData', dataIscs); window.document.oncontextmenu = function () { return false; }; @@ -118,8 +131,9 @@ export default { setIscs(data, oldData) { this.$iscs.setIscs(oldData, data, this.$route.query.lineCode); }, - iscsLoadData(mode, system, part) { - this.$iscs.loadData(parser(getIscsData(mode, system, part), {width: this.widthCanvas, height: this.canvasHeight})); + async iscsLoadData(mode, system, part) { + const dataIscs = await this.getDetail(mode, system, part); + this.$iscs.loadData(parser(dataIscs, {width: this.widthCanvas, height: this.canvasHeight})); }, // 点击选择事件 onSelected(em) { @@ -147,7 +161,7 @@ export default { } }, handleViewLoaded() { - this.loading = false; + }, statusMessage(val) { this.$iscs && this.$iscs.setDeviceStatus(val); diff --git a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue index bdbc598fa..28bfa04ff 100644 --- a/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue +++ b/src/views/iscs/iscsSystem/config/fire-alarm/stand.vue @@ -26,7 +26,6 @@ export default { this.$nextTick(() => { this.$refs.iscsPlate.iscsLoadData('fas', 'stand', 'standPublicArea'); }); - console.log(this.width); } else if (device && device._type === 'IscsButton' && device.function === 'GoBack') { this.width = 1100; this.$nextTick(() => { diff --git a/src/views/lesson/lessoncategory/edit/lesson/publish.vue b/src/views/lesson/lessoncategory/edit/lesson/publish.vue index 0fc49a88f..0ee244475 100644 --- a/src/views/lesson/lessoncategory/edit/lesson/publish.vue +++ b/src/views/lesson/lessoncategory/edit/lesson/publish.vue @@ -1,5 +1,5 @@