From 8413cf28fb74591b57924d26c6816bf80211ba29 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Nov 2021 11:48:59 +0800 Subject: [PATCH 1/9] =?UTF-8?q?refactor:=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=EF=BC=8C=E5=8F=AF=E8=83=BD=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E8=B7=B3=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 2 +- .../canvas/components/Editor/index.vue | 19 +++++++++++-------- .../src/components/canvas/store/snapshot.js | 6 +++++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index b5087c6f46..c0277b3f58 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -1603,7 +1603,7 @@ export default { style.height = height style.rotate = this.rotate // this.hasMove = true - console.log('recordMatrixCurShadowStyle:t1:' + JSON.stringify(style)) + // console.log('recordMatrixCurShadowStyle:t1:' + JSON.stringify(style)) this.$store.commit('setShapeStyle', style) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index d5ce8a86b5..ad47254977 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -338,7 +338,7 @@ function recalcCellWidth() { } function init() { - console.log('init') + // console.log('init-cellWidth') this.cellWidth = this.baseWidth + this.baseMarginLeft this.cellHeight = this.baseHeight + this.baseMarginTop this.yourList = this.getList() @@ -993,7 +993,7 @@ export default { 'editor', 'linkageSettingStatus', 'curLinkageView', - 'snapshotIndex' + 'doSnapshotIndex' ]) }, watch: { @@ -1035,6 +1035,7 @@ export default { // 初始化时componentData 加载可能出现慢的情况 此时重新初始化一下matrix if (newVal.length !== this.lastComponentDataLength) { this.lastComponentDataLength = newVal.length + console.log('.initMatrix2') this.initMatrix() } }, @@ -1047,9 +1048,10 @@ export default { deep: true }, // 镜像索引有变化 刷新一下矩阵(撤销重做等) - snapshotIndex: { + doSnapshotIndex: { handler(newVal, oldVla) { // console.log('snapshotIndexChange:' + newVal) + // console.log('.initMatrix3') this.initMatrix() }, deep: true @@ -1061,11 +1063,11 @@ export default { this.$store.commit('getEditor') const _this = this // bus.$on('auxiliaryMatrixChange', this.initMatrix) - bus.$on('auxiliaryMatrixChange', () => { - _this.$nextTick(() => { - _this.initMatrix() - }) - }) + // bus.$on('auxiliaryMatrixChange', () => { + // _this.$nextTick(() => { + // _this.initMatrix() + // }) + // }) eventBus.$on('hideArea', () => { this.hideArea() }) @@ -1300,6 +1302,7 @@ export default { this.baseHeight = this.matrixStyle.height this.cellWidth = this.matrixStyle.width this.cellHeight = this.matrixStyle.height + // console.log('.initMatrix1') this.initMatrix() this.scaleWidth = this.outStyle.width * 100 / this.canvasStyleData.width diff --git a/frontend/src/components/canvas/store/snapshot.js b/frontend/src/components/canvas/store/snapshot.js index 1e26aded05..d9717c8c6b 100644 --- a/frontend/src/components/canvas/store/snapshot.js +++ b/frontend/src/components/canvas/store/snapshot.js @@ -8,13 +8,15 @@ export default { snapshotIndex: -1, // 快照索引 changeTimes: -1, // 修改次数 lastSaveSnapshotIndex: 0, // 最后保存是snapshotIndex的索引 - styleChangeTimes: 0 // 组件样式修改次数 + styleChangeTimes: 0, // 组件样式修改次数 + doSnapshotIndex: -1 // snapshot undo redo 时的索引记录 }, mutations: { undo(state) { store.commit('setCurComponent', { component: null, index: null }) if (state.snapshotIndex > 0) { state.snapshotIndex-- + state.doSnapshotIndex = state.snapshotIndex store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) store.commit('setCanvasStyle', deepCopy(state.snapshotStyleData[state.snapshotIndex])) } @@ -24,6 +26,7 @@ export default { store.commit('setCurComponent', { component: null, index: null }) if (state.snapshotIndex < state.snapshotData.length - 1) { state.snapshotIndex++ + state.doSnapshotIndex = state.snapshotIndex store.commit('setComponentData', deepCopy(state.snapshotData[state.snapshotIndex])) store.commit('setCanvasStyle', deepCopy(state.snapshotStyleData[state.snapshotIndex])) } @@ -42,6 +45,7 @@ export default { } }, refreshSnapshot(state) { + console.log('refreshSnapshot') // 刷新快照 state.snapshotData = [] state.snapshotStyleData = [] From 330d5370d688da3f9584deed2864bc7d8a6725cf Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 3 Nov 2021 14:08:31 +0800 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20cron=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/cron/cron.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/cron/cron.vue b/frontend/src/components/cron/cron.vue index d694fc9715..56e9df57cc 100644 --- a/frontend/src/components/cron/cron.vue +++ b/frontend/src/components/cron/cron.vue @@ -126,9 +126,9 @@ export default { }) } const v = `${this.sVal} ${this.mVal} ${this.hVal} ${this.dVal} ${this.monthVal} ${this.weekVal} ${this.yearVal}` - if (v !== this.value) { - this.$emit('input', v) - } + // if (v !== this.value) { + this.$emit('input', v) + // } return v } }, From 1bb5e849b94af5d5f50ca522ecb037ee582c6ff3 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Nov 2021 14:21:21 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix:=E7=BC=96=E8=BE=91=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E6=97=B6,=E5=88=87=E6=8D=A2=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E9=A2=84=E8=A7=88,=E8=BE=B9=E7=95=8C=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E5=8F=AF=E8=83=BD=E9=94=99=E4=BD=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Editor/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index ad47254977..ff815a25af 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -1059,6 +1059,7 @@ export default { }, mounted() { + this.changeScale() // 获取编辑器元素 this.$store.commit('getEditor') const _this = this From 828685dd8c5ce0a4dc45fb20f36d0abdb07f165b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Nov 2021 15:07:32 +0800 Subject: [PATCH 4/9] =?UTF-8?q?fix:=E8=B7=B3=E8=BD=AC=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=85=8D=E7=BD=AE=E5=90=8E=E5=86=8D=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/panel/LinkJumpSet/index.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/views/panel/LinkJumpSet/index.vue b/frontend/src/views/panel/LinkJumpSet/index.vue index 9c1ec9fbf0..ff12c25556 100644 --- a/frontend/src/views/panel/LinkJumpSet/index.vue +++ b/frontend/src/views/panel/LinkJumpSet/index.vue @@ -65,6 +65,7 @@ :placeholder="$t('panel.select_jump_panel')" style="margin-right: 10px" @select="panelNodeClick" + @input="inputVal" /> @@ -309,6 +310,13 @@ export default { this.linkJumpInfo.targetViewInfoList = [] this.getPanelViewList(data.id) }, + inputVal(value) { + if (!value) { + this.linkJumpInfo.targetViewInfoList = [] + this.viewIdFieldArrayMap = {} + this.currentLinkPanelViewArray = [] + } + }, addLinkJumpField() { this.linkJumpInfo.targetViewInfoList.push({ targetViewId: '', From 8b0947484f68be6c8e5fc8382aba594c338e91c1 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Nov 2021 16:49:38 +0800 Subject: [PATCH 5/9] =?UTF-8?q?refactor:=E5=8E=BB=E6=8E=89=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Editor/index.vue | 2 +- frontend/src/components/canvas/store/snapshot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index ff815a25af..959822a2ef 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -1035,7 +1035,7 @@ export default { // 初始化时componentData 加载可能出现慢的情况 此时重新初始化一下matrix if (newVal.length !== this.lastComponentDataLength) { this.lastComponentDataLength = newVal.length - console.log('.initMatrix2') + // console.log('.initMatrix2') this.initMatrix() } }, diff --git a/frontend/src/components/canvas/store/snapshot.js b/frontend/src/components/canvas/store/snapshot.js index d9717c8c6b..173725a674 100644 --- a/frontend/src/components/canvas/store/snapshot.js +++ b/frontend/src/components/canvas/store/snapshot.js @@ -45,7 +45,7 @@ export default { } }, refreshSnapshot(state) { - console.log('refreshSnapshot') + // console.log('refreshSnapshot') // 刷新快照 state.snapshotData = [] state.snapshotStyleData = [] From dfc65d205a6fc84656a8590f21df9ecf66977fca Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 29 Oct 2021 17:46:04 +0800 Subject: [PATCH 6/9] =?UTF-8?q?refactor:=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=88=B0=E7=A7=92=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Editor/Preview.vue | 2 +- frontend/src/components/canvas/custom-component/UserView.vue | 2 +- frontend/src/lang/en.js | 1 + frontend/src/lang/tw.js | 1 + frontend/src/lang/zh.js | 1 + .../panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue | 4 ++-- frontend/src/views/panel/edit/index.vue | 4 ++-- frontend/src/views/panel/list/PanelList.vue | 2 +- frontend/src/views/panel/panel.js | 2 +- 9 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index c256d970ff..f3c481b03f 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -175,7 +175,7 @@ export default { this.timer && clearInterval(this.timer) let refreshTime = 300000 if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) { - refreshTime = this.canvasStyleData.refreshTime * 60000 + refreshTime = this.canvasStyleData.refreshTime * 1000 } this.timer = setInterval(() => { this.searchCount++ diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 0a5e3da298..15d84015e8 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -211,7 +211,7 @@ export default { }, // 监听外部计时器变化 searchCount: function(val1) { - if (val1 > 0) { + if (val1 > 0 && this.requestStatus !== 'waiting') { this.getData(this.element.propValue.viewId) } }, diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 61c5c068b3..8097c46e64 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1239,6 +1239,7 @@ export default { component_gap: 'Component Gap', refresh_time: 'Refresh Time', minute: 'minute', + second: 'second', photo: 'Photo', default_panel: 'Default Dashboard', create_public_links: 'Create public links', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index cab7541558..3e606b6bd1 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1242,6 +1242,7 @@ export default { component_gap: '組件間隙', refresh_time: '刷新时间', minute: '分钟', + second: '秒', photo: '圖片', default_panel: '默認儀表板', create_public_links: '創建公共鏈接', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 2c58090311..295cd025ca 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1250,6 +1250,7 @@ export default { component_gap: '组件间隙', refresh_time: '刷新时间', minute: '分钟', + second: '秒', photo: '图片', default_panel: '默认仪表板', create_public_links: '创建公共链接', diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue index 24d883cce4..67344bb1f0 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/PanelRefreshTime.vue @@ -8,8 +8,8 @@ > - - + + diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 0af8fe5e24..12f3477610 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -422,7 +422,7 @@ export default { this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', this.resetID(JSON.parse(componentDataTemp))) const temp = JSON.parse(canvasStyleDataTemp) - temp.refreshTime = (temp.refreshTime || 5) + temp.refreshTime = (temp.refreshTime || 300) this.$store.commit('setCanvasStyle', temp) // 清空临时画布数据 @@ -443,7 +443,7 @@ export default { this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) const panelStyle = JSON.parse(response.data.panelStyle) - panelStyle.refreshTime = (panelStyle.refreshTime || 5) + panelStyle.refreshTime = (panelStyle.refreshTime || 300) this.$store.commit('setCanvasStyle', panelStyle) this.$store.commit('recordSnapshot', 'init')// 记录快照 diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index c19ab8cd75..2748b32e50 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -631,7 +631,7 @@ export default { this.$store.commit('setComponentData', this.resetID(componentDatas)) // this.$store.commit('setComponentData', sourceInfo.type === 'custom' ? sourceInfo : this.resetID(sourceInfo)) const temp = JSON.parse(response.data.panelStyle) - temp.refreshTime = (temp.refreshTime || 5) + temp.refreshTime = (temp.refreshTime || 300) this.$store.commit('setCanvasStyle', temp) this.$store.dispatch('panel/setPanelInfo', data) diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js index f238d33acd..4760c847af 100644 --- a/frontend/src/views/panel/panel.js +++ b/frontend/src/views/panel/panel.js @@ -20,7 +20,7 @@ export const CANVAS_STYLE = { auxiliaryMatrix: true, openCommonStyle: true, panel: DEFAULT_PANEL_STYLE, - refreshTime: 5 // 仪表板刷新时间 默认五分钟 + refreshTime: 300 // 仪表板刷新时间 默认300秒 } export const DEFAULT_COMMON_CANVAS_STYLE_STRING = { From b67e8d8dd576f1085cbb4988e9d4262912a5486b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 3 Nov 2021 17:44:20 +0800 Subject: [PATCH 7/9] =?UTF-8?q?feat:=E5=88=B7=E6=96=B0=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E9=80=89=E6=8B=A9=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/Preview.vue | 6 +++++- .../components/canvas/custom-component/UserView.vue | 2 +- frontend/src/components/canvas/utils/style.js | 3 ++- .../SubjectSetting/PanelStyle/PanelRefreshTime.vue | 13 +++++++++++-- frontend/src/views/panel/edit/index.vue | 8 ++++++-- frontend/src/views/panel/list/PanelList.vue | 4 +++- frontend/src/views/panel/panel.js | 4 +++- 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index f3c481b03f..4bb6f4d3fd 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -175,7 +175,11 @@ export default { this.timer && clearInterval(this.timer) let refreshTime = 300000 if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) { - refreshTime = this.canvasStyleData.refreshTime * 1000 + if (this.canvasStyleData.refreshUnit === 'second') { + refreshTime = this.canvasStyleData.refreshTime * 1000 + } else { + refreshTime = this.canvasStyleData.refreshTime * 60000 + } } this.timer = setInterval(() => { this.searchCount++ diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 15d84015e8..554ab6ec1e 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -1,6 +1,6 @@