From 2482fc11c83bd9028108e50edede2de5c5564ce2 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 13 Aug 2021 12:09:41 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix:=20=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5?= =?UTF-8?q?token=E5=AD=98=E5=82=A8=E4=BD=BF=E7=94=A8vuex=E4=B8=8D=E5=AE=9E?= =?UTF-8?q?=E7=94=A8cookie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/canvas/custom-component/UserView.vue | 4 +++- frontend/src/store/getters.js | 1 + frontend/src/store/modules/user.js | 9 ++++++++- frontend/src/utils/request.js | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 50c444cd92..7267dd68b8 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -219,7 +219,9 @@ export default { // 增加判断 仪表板公共连接中使用viewInfo 正常使用viewData let method = viewData - if (!getToken() && getLinkToken()) { + const token = this.$store.getters.token || getToken() + const linkToken = this.$store.getters.linkToken || getLinkToken() + if (!token && linkToken) { method = viewInfo } diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js index ada150bc49..cb814086c2 100644 --- a/frontend/src/store/getters.js +++ b/frontend/src/store/getters.js @@ -4,6 +4,7 @@ const getters = { size: state => state.app.size, device: state => state.app.device, token: state => state.user.token, + linkToken: state => state.user.linkToken, avatar: state => state.user.avatar, name: state => state.user.name, introduction: state => state.user.introduction, diff --git a/frontend/src/store/modules/user.js b/frontend/src/store/modules/user.js index e67c16c1d3..edf18a7091 100644 --- a/frontend/src/store/modules/user.js +++ b/frontend/src/store/modules/user.js @@ -18,7 +18,8 @@ const getDefaultState = () => { // 当前用户拥有哪些资源权限 permissions: [], language: getLanguage(), - uiInfo: null + uiInfo: null, + linkToken: null } } @@ -31,6 +32,9 @@ const mutations = { SET_TOKEN: (state, token) => { state.token = token }, + SET_LINK_TOKEN: (state, linkToken) => { + state.linkToken = linkToken + }, SET_NAME: (state, name) => { state.name = name }, @@ -165,6 +169,9 @@ const actions = { commit('SET_LANGUAGE', language) router.go(0) }) + }, + setLinkToken({ commit }, linkToken) { + commit('SET_LINK_TOKEN', linkToken) } } diff --git a/frontend/src/utils/request.js b/frontend/src/utils/request.js index 77623de695..b0dcabba45 100644 --- a/frontend/src/utils/request.js +++ b/frontend/src/utils/request.js @@ -34,6 +34,10 @@ service.interceptors.request.use( if ((linkToken = getLinkToken()) !== null) { config.headers[LinkTokenKey] = linkToken } + if (!linkToken) { + linkToken = store.getters.linkToken + config.headers[LinkTokenKey] = linkToken + } if (i18n.locale) { const lang = i18n.locale.replace('_', '-') @@ -92,6 +96,7 @@ const checkAuth = response => { if (response.headers[LinkTokenKey.toLocaleLowerCase()] || (response.config.headers && response.config.headers[LinkTokenKey.toLocaleLowerCase()])) { const linkToken = response.headers[LinkTokenKey.toLocaleLowerCase()] || response.config.headers[LinkTokenKey.toLocaleLowerCase()] setLinkToken(linkToken) + store.dispatch('user/setLinkToken', linkToken) } // 许可状态改变 刷新页面 // if (response.headers['lic-status']) { From cc8587aade4fbaa2502ae9dd1452318b73213903 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 13 Aug 2021 12:10:36 +0800 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BackgroundColorSelector.vue | 20 --- .../component-style/LegendSelector.vue | 65 -------- .../component-style/SplitSelector.vue | 53 ------- .../component-style/TitleSelector.vue | 63 -------- .../component-style/XAxisSelector.vue | 84 ---------- .../component-style/YAxisSelector.vue | 84 ---------- .../components/shape-attr/ColorSelector.vue | 52 ------- .../components/shape-attr/LabelSelector.vue | 79 ---------- .../components/shape-attr/SizeSelector.vue | 144 ------------------ .../components/shape-attr/TooltipSelector.vue | 67 -------- frontend/src/views/chart/view/ChartEdit.vue | 129 ---------------- 11 files changed, 840 deletions(-) diff --git a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue index 7e76673d54..d2a2f566f8 100644 --- a/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue +++ b/frontend/src/views/chart/components/component-style/BackgroundColorSelector.vue @@ -10,26 +10,6 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/component-style/LegendSelector.vue b/frontend/src/views/chart/components/component-style/LegendSelector.vue index 02aa399ba2..271bf5e6dd 100644 --- a/frontend/src/views/chart/components/component-style/LegendSelector.vue +++ b/frontend/src/views/chart/components/component-style/LegendSelector.vue @@ -47,71 +47,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/component-style/SplitSelector.vue b/frontend/src/views/chart/components/component-style/SplitSelector.vue index b828660cb5..a2cef6e5b7 100644 --- a/frontend/src/views/chart/components/component-style/SplitSelector.vue +++ b/frontend/src/views/chart/components/component-style/SplitSelector.vue @@ -41,59 +41,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index c2e25ee0d5..c9e31d4181 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -45,69 +45,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/component-style/XAxisSelector.vue b/frontend/src/views/chart/components/component-style/XAxisSelector.vue index 21cdf2fbf6..c42e732e4c 100644 --- a/frontend/src/views/chart/components/component-style/XAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/XAxisSelector.vue @@ -66,90 +66,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/component-style/YAxisSelector.vue b/frontend/src/views/chart/components/component-style/YAxisSelector.vue index ef52af5636..ca6ef455d4 100644 --- a/frontend/src/views/chart/components/component-style/YAxisSelector.vue +++ b/frontend/src/views/chart/components/component-style/YAxisSelector.vue @@ -66,90 +66,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue index bc7a5b2629..f397633982 100644 --- a/frontend/src/views/chart/components/shape-attr/ColorSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/ColorSelector.vue @@ -42,58 +42,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue index a6f2fc4f72..2ee0a55909 100644 --- a/frontend/src/views/chart/components/shape-attr/LabelSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/LabelSelector.vue @@ -61,85 +61,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue index 0295369719..1dd5a77237 100644 --- a/frontend/src/views/chart/components/shape-attr/SizeSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/SizeSelector.vue @@ -161,150 +161,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue index 2e0fc50367..d56d8df48d 100644 --- a/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue +++ b/frontend/src/views/chart/components/shape-attr/TooltipSelector.vue @@ -49,73 +49,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index ca061f74fd..d513721e77 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -925,67 +925,6 @@ export default { }) }, - // saveSnapshot() { - // if (this.view.title && this.view.title.length > 50) { - // this.$warning(this.$t('chart.title_limit')) - // return - // } - // if (this.loading) { - // return - // } - // this.loading = true - // html2canvas(this.$refs.imageWrapper).then(canvas => { - // const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 - // if (snapshot !== '') { - // const view = JSON.parse(JSON.stringify(this.view)) - // view.id = this.view.id - // view.sceneId = this.view.sceneId - // view.name = this.view.name ? this.view.name : this.table.name - // view.tableId = this.view.tableId - // view.xaxis.forEach(function(ele) { - // // if (!ele.summary || ele.summary === '') { - // // ele.summary = 'sum' - // // } - // if (!ele.sort || ele.sort === '') { - // ele.sort = 'none' - // } - // if (!ele.filter) { - // ele.filter = [] - // } - // }) - // view.yaxis.forEach(function(ele) { - // if (!ele.summary || ele.summary === '') { - // if (ele.id === 'count') { - // ele.summary = 'count' - // } else { - // ele.summary = 'sum' - // } - // } - // if (!ele.sort || ele.sort === '') { - // ele.sort = 'none' - // } - // if (!ele.filter) { - // ele.filter = [] - // } - // }) - // if (view.type.startsWith('pie') || view.type.startsWith('funnel') || view.type.startsWith('gauge')) { - // if (view.yaxis.length > 1) { - // view.yaxis.splice(1, view.yaxis.length) - // } - // } - // view.xaxis = JSON.stringify(view.xaxis) - // view.yaxis = JSON.stringify(view.yaxis) - // view.customAttr = JSON.stringify(view.customAttr) - // view.customStyle = JSON.stringify(view.customStyle) - // view.customFilter = JSON.stringify(view.customFilter) - // view.snapshot = snapshot - // post('/chart/view/save', view).then(response => { - // this.loading = false - // this.$success(this.$t('commons.save_success')) - // }) - // } - // }) - // }, closeEdit() { if (this.view.title && this.view.title.length > 50) { this.$warning(this.$t('chart.title_limit')) @@ -1067,74 +1006,6 @@ export default { } }, - // 左边往右边拖动时的事件 - // start1(e) { - // // console.log(e) - // e.clone.className = 'item' - // e.item.className = 'item' - // }, - // end1(e) { - // // console.log(e) - // e.clone.className = 'item' - // e.item.className = 'item' - // this.refuseMove(e) - // this.removeCheckedKey(e) - // this.save(true) - // }, - // 右边往左边拖动时的事件 - // start2(e) { - // console.log(e) - // }, - // end2(e) { - // // console.log(e) - // this.removeDuplicateKey(e) - // this.save(true) - // }, - // removeCheckedKey(e) { - // const that = this - // const xItems = this.view.xaxis.filter(function(m) { - // return m.id === that.moveId - // }) - // const yItems = this.view.yaxis.filter(function(m) { - // return m.id === that.moveId - // }) - // if (xItems && xItems.length > 1) { - // this.view.xaxis.splice(e.newDraggableIndex, 1) - // } - // if (yItems && yItems.length > 1) { - // this.view.yaxis.splice(e.newDraggableIndex, 1) - // } - // }, - // refuseMove(e) { - // const that = this - // const xItems = this.dimension.filter(function(m) { - // return m.id === that.moveId - // }) - // const yItems = this.quota.filter(function(m) { - // return m.id === that.moveId - // }) - // if (xItems && xItems.length > 1) { - // this.dimension.splice(e.newDraggableIndex, 1) - // } - // if (yItems && yItems.length > 1) { - // this.quota.splice(e.newDraggableIndex, 1) - // } - // }, - // removeDuplicateKey(e) { - // const that = this - // const xItems = this.dimension.filter(function(m) { - // return m.id === that.moveId - // }) - // const yItems = this.quota.filter(function(m) { - // return m.id === that.moveId - // }) - // if (xItems && xItems.length > 1) { - // this.dimension.splice(e.newDraggableIndex, 1) - // } - // if (yItems && yItems.length > 1) { - // this.quota.splice(e.newDraggableIndex, 1) - // } - // }, // move回调方法 onMove(e, originalEvent) { // console.log(e) From f96e8a2a88f50dee5a2e421995edaf4cb3121050 Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 13 Aug 2021 12:42:59 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=E5=9C=B0=E5=9B=BE=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map.js | 1 + frontend/src/views/chart/view/ChartEdit.vue | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index e945d23c31..7b5f1734e7 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -45,6 +45,7 @@ export function baseMapOption(chart_option, chart) { if (customAttr.color && customAttr.color.colors) { chart_option.visualMap.inRange.color = customAttr.color.colors + chart_option.visualMap.inRange.colorAlpha = customAttr.color.alpha / 100 } for (let i = 0; i < valueArr.length; i++) { // const y = { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index d513721e77..b3b3350605 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -821,6 +821,9 @@ export default { return } view.tableId = this.view.tableId + if (view.type === 'map' && view.xaxis.length > 1) { + view.xaxis = [view.xaxis[0]] + } view.xaxis.forEach(function(ele) { // if (!ele.summary || ele.summary === '') { // ele.summary = 'sum' @@ -838,6 +841,9 @@ export default { ele.filter = [] } }) + if (view.type === 'map' && view.yaxis.length > 1) { + view.yaxis = [view.yaxis[0]] + } view.yaxis.forEach(function(ele) { if (!ele.summary || ele.summary === '') { if (ele.id === 'count' || ele.deType === 0 || ele.deType === 1) { @@ -1282,11 +1288,17 @@ export default { } }, addXaxis(e) { + if (this.view.type === 'map' && this.view.xaxis.length > 1) { + this.view.xaxis = [this.view.xaxis[0]] + } this.dragCheckType(this.view.xaxis, 'd') this.dragMoveDuplicate(this.view.xaxis, e) this.save(true) }, addYaxis(e) { + if (this.view.type === 'map' && this.view.yaxis.length > 1) { + this.view.yaxis = [this.view.yaxis[0]] + } this.dragCheckType(this.view.yaxis, 'q') this.dragMoveDuplicate(this.view.yaxis, e) this.save(true) From 14f28e8baf60857ef06883a8b28458c26a85a0fb Mon Sep 17 00:00:00 2001 From: junjie Date: Fri, 13 Aug 2021 13:36:10 +0800 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=E5=9C=B0=E5=9B=BE=E9=A2=9C?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/chart/map/map.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 7b5f1734e7..6c003a0fd2 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -33,16 +33,21 @@ export function baseMapOption(chart_option, chart) { } // visualMap const valueArr = chart.data.series[0].data - const values = [] - valueArr.forEach(function(ele) { - values.push(ele.value) - }) - chart_option.visualMap.min = Math.min(...values) - chart_option.visualMap.max = Math.max(...values) - if (chart_option.visualMap.min === chart_option.visualMap.max) { + if (valueArr && valueArr.length > 0) { + const values = [] + valueArr.forEach(function(ele) { + values.push(ele.value) + }) + chart_option.visualMap.min = Math.min(...values) + chart_option.visualMap.max = Math.max(...values) + if (chart_option.visualMap.min === chart_option.visualMap.max) { + chart_option.visualMap.min = 0 + } + } else { chart_option.visualMap.min = 0 + chart_option.visualMap.max = 0 } - + // color if (customAttr.color && customAttr.color.colors) { chart_option.visualMap.inRange.color = customAttr.color.colors chart_option.visualMap.inRange.colorAlpha = customAttr.color.alpha / 100 From 4e69aa6e1d82a3da29abbdbc20dd4a77bd598e4b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 13 Aug 2021 13:58:27 +0800 Subject: [PATCH 5/9] =?UTF-8?q?refactor:=E4=BC=98=E5=8C=96=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E5=85=83=E7=B4=A0=E6=8B=96=E5=8A=A8=EF=BC=8C?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=8F=98=E5=8A=A8=E5=BB=B6=E8=BF=9F=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=EF=BC=8C=E7=A7=BB=E5=8A=A8=E4=BD=BF=E7=94=A8=E5=8E=9F?= =?UTF-8?q?=E5=A7=8Bdom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/DeDrag/index.vue | 10 +++++++++- .../components/canvas/components/Editor/index.vue | 6 ++++++ .../canvas/custom-component/UserView.vue | 15 +++++++++++---- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/DeDrag/index.vue b/frontend/src/components/DeDrag/index.vue index 2063bc28f1..b47cb117ca 100644 --- a/frontend/src/components/DeDrag/index.vue +++ b/frontend/src/components/DeDrag/index.vue @@ -1155,7 +1155,9 @@ export default { this.resizing = false await this.conflictCheck() this.$emit('refLineParams', refLine) - this.$emit('resizestop', this.left, this.top, this.width, this.height) + // this.$emit('resizestop', this.left, this.top, this.width, this.height) + // private + // this.$emit('resizestop') } if (this.dragging) { this.dragging = false @@ -1484,6 +1486,12 @@ export default { style.rotate = this.rotate // this.hasMove = true this.$store.commit('setShapeStyle', style) + + // resize + const self = this + setTimeout(function() { + self.$emit('resizestop') + }, 200) }, mountedFunction() { // private 冲突检测 和水平设计值保持一致 diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index f988791ad4..57b2a8de21 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -37,6 +37,7 @@ :linkage-active="linkageSettingStatus&&item===curLinkageView" @refLineParams="getRefLineParams" @showViewDetails="showViewDetails(index)" + @resizestop="resizestop(index,item)" > From 830013950856f63c1439cfb6e54927bc470d16ac Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 13 Aug 2021 14:00:12 +0800 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20=E5=A4=96=E9=83=A8=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=B8=A6=E5=AF=86=E7=A0=81=E5=B5=8C=E5=9C=A8iframe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/link/index.vue | 5 ++++- frontend/src/views/link/pwd/index.vue | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/link/index.vue b/frontend/src/views/link/index.vue index e88b771fa8..85a6502241 100644 --- a/frontend/src/views/link/index.vue +++ b/frontend/src/views/link/index.vue @@ -1,7 +1,7 @@ @@ -49,6 +49,9 @@ export default { this.showError() }) }, + refreshToken() { + this.loadInit() + }, // 显示无效链接 showError() { diff --git a/frontend/src/views/link/pwd/index.vue b/frontend/src/views/link/pwd/index.vue index f1e01a4673..47c4b2769b 100644 --- a/frontend/src/views/link/pwd/index.vue +++ b/frontend/src/views/link/pwd/index.vue @@ -96,7 +96,8 @@ export default { if (!res.data) { this.msg = this.$t('pblink.pwd_error') } else { - window.location.reload() + // window.location.reload() + this.$emit('fresh-token') } }) }) From d8a9b0a0a89c1bcd2597ea9ff27c7390efb061e7 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 13 Aug 2021 14:10:15 +0800 Subject: [PATCH 7/9] =?UTF-8?q?refactor:=E4=BB=A3=E7=A0=81=E5=9B=9E?= =?UTF-8?q?=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/custom-component/UserView.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 6069bf53bc..35a94904d3 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -381,13 +381,13 @@ export default { if (temp) return temp } } + }, + // chart + chartResize() { + if (this.$refs[this.element.propValue.id]) { + this.$refs[this.element.propValue.id].chartResize() + } } - // chart - chartResize() { - if (this.$refs[this.element.propValue.id]) { - this.$refs[this.element.propValue.id].chartResize() - } - } } } From 7f2daa04dfc2d9605212c2c455279a51a97d5810 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 13 Aug 2021 15:45:43 +0800 Subject: [PATCH 8/9] =?UTF-8?q?refactor:=E4=BC=98=E5=8C=96=E4=B8=8B?= =?UTF-8?q?=E9=92=BB=EF=BC=8C=E8=81=94=E5=8A=A8=E5=BC=B9=E5=87=BA=E7=AA=97?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/PreviewEject.vue | 6 ++++++ frontend/src/views/link/view/index.vue | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index b290d689bd..d79ca08a0e 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -7,6 +7,8 @@ import Preview from './Preview' import { uuid } from 'vue-uuid' import { findOne } from '@/api/panel/panel' +import { getPanelAllLinkageInfo } from '@/api/panel/linkage' + export default { components: { Preview }, @@ -24,6 +26,10 @@ export default { id: response.data.id, name: response.data.name } + // 刷新联动信息 + getPanelAllLinkageInfo(this.panelId).then(rsp => { + this.$store.commit('setNowPanelTrackInfo', rsp.data) + }) this.$store.dispatch('panel/setPanelInfo', data) }) }, diff --git a/frontend/src/views/link/view/index.vue b/frontend/src/views/link/view/index.vue index c92b5fc478..b2b1a1cbf4 100644 --- a/frontend/src/views/link/view/index.vue +++ b/frontend/src/views/link/view/index.vue @@ -8,6 +8,8 @@ import { loadResource } from '@/api/link' import { uuid } from 'vue-uuid' import Preview from '@/components/canvas/components/Editor/Preview' +import { getPanelAllLinkageInfo } from '@/api/panel/linkage' + export default { name: 'LinkView', components: { Preview }, @@ -29,6 +31,10 @@ export default { methods: { setPanelInfo() { loadResource(this.resourceId).then(res => { + // 刷新联动信息 + getPanelAllLinkageInfo(this.resourceId).then(rsp => { + this.$store.commit('setNowPanelTrackInfo', rsp.data) + }) this.$store.commit('setComponentData', this.resetID(JSON.parse(res.data.panelData))) // this.$store.commit('setComponentData', JSON.parse(res.data.panelData)) this.$store.commit('setCanvasStyle', JSON.parse(res.data.panelStyle)) From 93b2dc8b78f65f568cc471b3d6fff621f39cc6bf Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 13 Aug 2021 17:06:24 +0800 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E8=A1=8C=E6=94=BF?= =?UTF-8?q?=E5=8C=BA=E5=88=92=E4=BB=A3=E7=A0=81=E5=89=8D=E7=AB=AF=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/map/utils/MapUtils.java | 2 +- .../canvas/custom-component/UserView.vue | 22 ++++++++++------ frontend/src/views/chart/view/ChartEdit.vue | 25 +++++++++++++------ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/backend/src/main/java/io/dataease/map/utils/MapUtils.java b/backend/src/main/java/io/dataease/map/utils/MapUtils.java index 99dc7b6f7b..9cfa679509 100644 --- a/backend/src/main/java/io/dataease/map/utils/MapUtils.java +++ b/backend/src/main/java/io/dataease/map/utils/MapUtils.java @@ -68,7 +68,7 @@ public class MapUtils { AreaEntity china = root(); - maps.parallelStream().forEach(map -> { + maps.stream().forEach(map -> { // maps.stream().forEach(map -> { String province_code = map.get(Constants.PROVINCE_CODE).toString(); String city_code = map.get(Constants.CITY_CODE).toString(); diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 35a94904d3..939be53126 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -128,6 +128,9 @@ export default { console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo)) return trackMenuInfo }, + chartType() { + return this.chart.type + }, ...mapState([ 'canvasStyleData', 'nowPanelTrackInfo' @@ -174,6 +177,11 @@ export default { if (val1 > 0) { this.getData(this.element.propValue.viewId) } + }, + 'chartType': function(newVal, oldVal) { + if (newVal === 'map' && newVal !== oldVal) { + this.initAreas() + } } }, @@ -181,7 +189,7 @@ export default { this.refId = uuid.v1 // this.filter.filter = this.$store.getters.conditions this.getData(this.element.propValue.viewId) - this.initAreas() + // this.initAreas() }, mounted() { }, @@ -349,14 +357,14 @@ export default { } }, initAreas() { - let mapping - if ((mapping = localStorage.getItem('areaMapping')) !== null) { - this.places = JSON.parse(mapping) - return - } + // let mapping + // if ((mapping = localStorage.getItem('areaMapping')) !== null) { + // this.places = JSON.parse(mapping) + // return + // } Object.keys(this.places).length === 0 && areaMapping().then(res => { this.places = res.data - localStorage.setItem('areaMapping', JSON.stringify(res.data)) + // localStorage.setItem('areaMapping', JSON.stringify(res.data)) }) }, doMapLink(linkFilters) { diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index b3b3350605..c20baa14d4 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -711,7 +711,8 @@ export default { }, moveId: -1, chart: { - id: 'echart' + id: 'echart', + type: null }, dimensionFilterEdit: false, dimensionItem: {}, @@ -754,6 +755,9 @@ export default { // this.getData(this.$store.state.chart.viewId) // return this.$store.state.chart.viewId // } + chartType() { + return this.chart.type + } }, watch: { 'param': function() { @@ -766,11 +770,16 @@ export default { }, searchField(val) { this.fieldFilter(val) + }, + 'chartType': function(newVal, oldVal) { + if (newVal === 'map' && newVal !== oldVal) { + this.initAreas() + } } }, created() { // this.get(this.$store.state.chart.viewId); - this.initAreas() + // this.initAreas() }, mounted() { // this.get(this.$store.state.chart.viewId); @@ -1327,14 +1336,14 @@ export default { }, initAreas() { - let mapping - if ((mapping = localStorage.getItem('areaMapping')) !== null) { - this.places = JSON.parse(mapping) - return - } + // let mapping + // if ((mapping = localStorage.getItem('areaMapping')) !== null) { + // this.places = JSON.parse(mapping) + // return + // } Object.keys(this.places).length === 0 && areaMapping().then(res => { this.places = res.data - localStorage.setItem('areaMapping', JSON.stringify(res.data)) + // localStorage.setItem('areaMapping', JSON.stringify(res.data)) }) },