From b43009ab0634430da1423f5684d5ac801dcae142 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Tue, 30 Jun 2020 15:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9D=83=E9=99=90=E5=88=86?= =?UTF-8?q?=E9=85=8D=E6=97=B6=E9=97=B4=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jmapNew/map.js | 5 ++--- src/views/components/limits/distribute.vue | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/jmapNew/map.js b/src/jmapNew/map.js index 6021aad5d..472eeef36 100644 --- a/src/jmapNew/map.js +++ b/src/jmapNew/map.js @@ -216,9 +216,8 @@ class Jlmap { (list || []).forEach(elem => { const code = elem.code; const type = elem._type; - // const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); - // const nDevice = deepAssign(oDevice || {}, elem); - const oDevice = deviceFactory(type, elem, this.showConfig); + const oDevice = this.mapDevice[code] || deviceFactory(type, elem, this.showConfig); + // const oDevice = deviceFactory(type, elem, this.showConfig); const nDevice = deepAssign(oDevice || {}, elem); this.$painter.delete(oDevice); delete this.mapDevice[code]; diff --git a/src/views/components/limits/distribute.vue b/src/views/components/limits/distribute.vue index a52e3a77c..a12c06355 100644 --- a/src/views/components/limits/distribute.vue +++ b/src/views/components/limits/distribute.vue @@ -161,6 +161,14 @@ export default { let endTime; let startTime; if (this.formModel.date) { + const h = new Date().getHours(); + const m = new Date().getMinutes(); + if (+new Date(this.formModel.date[0]) < +new Date()) { + this.formModel.date[0] = `${this.formModel.date[0].split(' ')[0]} ${h < 10 ? '0' + h : h }:${m < 10 ? '0' + m : m }:00`; + } + if (+new Date(this.formModel.date[1]) < +new Date()) { + this.formModel.date[1] = `${this.formModel.date[1].split(' ')[0]} ${h < 10 ? '0' + h : h }:${m < 10 ? '0' + m : m }:00`; + } endTime = this.formModel.date[1]; startTime = this.formModel.date[0]; }