From 180020c75b3077737f343338f3a0c4e78dc05f3b Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Jul 2021 18:57:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix:=E4=B8=8D=E5=8F=82=E4=B8=8E=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E7=9A=84=E8=8F=9C=E5=8D=95=E6=8E=88=E6=9D=83=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=B8=8D=E5=86=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V15__update_function.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/resources/db/migration/V15__update_function.sql b/backend/src/main/resources/db/migration/V15__update_function.sql index dde16205a2..9889fee7ae 100644 --- a/backend/src/main/resources/db/migration/V15__update_function.sql +++ b/backend/src/main/resources/db/migration/V15__update_function.sql @@ -28,3 +28,6 @@ RETURN concat(chartName,'-copy(',chartNameCount,')'); END ;; delimiter ; + +DROP VIEW IF EXISTS `v_auth_model`; +CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `v_auth_model` AS select `sys_user`.`user_id` AS `id`,`sys_user`.`username` AS `name`,`sys_user`.`username` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'user' AS `model_type`,'user' AS `model_inner_type`,'target' AS `auth_type`,`sys_user`.`create_by` AS `create_by` from `sys_user` union all select `sys_role`.`role_id` AS `id`,`sys_role`.`name` AS `name`,`sys_role`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'role' AS `model_type`,'role' AS `model_inner_type`,'target' AS `auth_type`,`sys_role`.`create_by` AS `create_by` from `sys_role` union all select `sys_dept`.`dept_id` AS `id`,`sys_dept`.`name` AS `name`,`sys_dept`.`name` AS `lable`,cast(`sys_dept`.`pid` as char charset utf8mb4) AS `pid`,if((`sys_dept`.`sub_count` = 0),'leaf','spine') AS `node_type`,'dept' AS `model_type`,'dept' AS `model_inner_type`,'target' AS `auth_type`,`sys_dept`.`create_by` AS `create_by` from `sys_dept` union all select `datasource`.`id` AS `id`,`datasource`.`name` AS `NAME`,`datasource`.`name` AS `label`,'0' AS `pid`,'leaf' AS `node_type`,'link' AS `model_type`,`datasource`.`type` AS `model_inner_type`,'source' AS `auth_type`,`datasource`.`create_by` AS `create_by` from `datasource` union all select `dataset_group`.`id` AS `id`,`dataset_group`.`name` AS `NAME`,`dataset_group`.`name` AS `lable`,if(isnull(`dataset_group`.`pid`),'0',`dataset_group`.`pid`) AS `pid`,'spine' AS `node_type`,'dataset' AS `model_type`,`dataset_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_group`.`create_by` AS `create_by` from `dataset_group` union all select `dataset_table`.`id` AS `id`,`dataset_table`.`name` AS `NAME`,`dataset_table`.`name` AS `lable`,`dataset_table`.`scene_id` AS `pid`,'leaf' AS `node_type`,'dataset' AS `model_type`,`dataset_table`.`type` AS `model_inner_type`,'source' AS `auth_type`,`dataset_table`.`create_by` AS `create_by` from `dataset_table` union all select `chart_group`.`id` AS `id`,`chart_group`.`name` AS `name`,`chart_group`.`name` AS `label`,if(isnull(`chart_group`.`pid`),'0',`chart_group`.`pid`) AS `pid`,'spine' AS `node_type`,'chart' AS `model_type`,`chart_group`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_group`.`create_by` AS `create_by` from `chart_group` union all select `chart_view`.`id` AS `id`,`chart_view`.`name` AS `name`,`chart_view`.`name` AS `label`,`chart_view`.`scene_id` AS `pid`,'leaf' AS `node_type`,'chart' AS `model_type`,`chart_view`.`type` AS `model_inner_type`,'source' AS `auth_type`,`chart_view`.`create_by` AS `create_by` from `chart_view` union all select `panel_group`.`id` AS `id`,`panel_group`.`name` AS `NAME`,`panel_group`.`name` AS `label`,(case `panel_group`.`id` when 'panel_list' then '0' when 'default_panel' then '0' else `panel_group`.`pid` end) AS `pid`,if((`panel_group`.`node_type` = 'folder'),'spine','leaf') AS `node_type`,'panel' AS `model_type`,`panel_group`.`panel_type` AS `model_inner_type`,'source' AS `auth_type`,`panel_group`.`create_by` AS `create_by` from `panel_group` union all select `sys_menu`.`menu_id` AS `menu_id`,`sys_menu`.`title` AS `name`,`sys_menu`.`title` AS `label`,`sys_menu`.`pid` AS `pid`,if((`sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`sys_menu`.`create_by` AS `create_by` from `sys_menu` where (((`sys_menu`.`permission` is not null) or (`sys_menu`.`pid` = 0)) and ((`sys_menu`.`name` <> 'panel') or isnull(`sys_menu`.`name`))) union all select `plugin_sys_menu`.`menu_id` AS `menu_id`,`plugin_sys_menu`.`title` AS `name`,`plugin_sys_menu`.`title` AS `label`,`plugin_sys_menu`.`pid` AS `pid`,if((`plugin_sys_menu`.`sub_count` > 0),'spine','leaf') AS `node_type`,'menu' AS `model_type`,(case `plugin_sys_menu`.`type` when 0 then 'folder' when 1 then 'menu' when 2 then 'button' end) AS `model_inner_type`,'source' AS `auth_type`,`plugin_sys_menu`.`create_by` AS `create_by` from `plugin_sys_menu` where ((`plugin_sys_menu`.`permission` is not null) or (`plugin_sys_menu`.`pid` = 0)); From f952c1f0f125338049809370c6af5b6f42f8a7fa Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 27 Jul 2021 19:13:22 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=95=8C=E9=9D=A2=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddCustom.vue | 2 +- frontend/src/views/dataset/add/AddSQL.vue | 2 +- frontend/src/views/dataset/data/ViewTable.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index 62f14f7420..a5b058a2aa 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -233,7 +233,7 @@ export default { cancel() { // this.dataReset() if (this.param.tableId) { - this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) + this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table }) } else { this.$emit('switchComponent', { name: '' }) } diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 6315217ec4..759c5f6ccd 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -283,7 +283,7 @@ export default { cancel() { // this.dataReset() if (this.param.tableId) { - this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) + this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table}) } else { this.$emit('switchComponent', { name: '' }) } diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index 10187440aa..92ccfce9c8 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -122,7 +122,7 @@ export default { if (id !== null) { this.fields = [] this.data = [] - getTable(id, true).then(response => { + post('/dataset/table/getWithPermission/' + id, null).then(response => { this.table = response.data this.initPreviewData(this.page) }).catch(res => { From f7132e9e71e846c4d4cb008aed23334b1358eee0 Mon Sep 17 00:00:00 2001 From: junjie Date: Tue, 27 Jul 2021 19:19:35 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E9=A1=B5=E9=9D=A2=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddExcel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index 55f99bdff2..c7aee57a3e 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -258,7 +258,7 @@ export default { type: 'excel', mode: parseInt(this.mode), // info: '{"data":"' + this.path + '"}', - info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]]}), + info: JSON.stringify({ data: this.path, sheets: [this.sheets[0]] }), fields: this.fields } } else { @@ -285,7 +285,7 @@ export default { this.dataReset() // this.$router.push('/dataset/home') if (this.param.tableId) { - this.$emit('switchComponent', { name: 'ViewTable', param: { id: this.param.tableId }}) + this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table }) } else { this.$emit('switchComponent', { name: '' }) } From 5d97212c5002e2253f4b2e536dea3e9a5c71fd3f Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 28 Jul 2021 11:30:53 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=E8=BF=87=E6=BB=A4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=8F=98=E5=8A=A8=E4=B9=9F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeDate.vue | 4 ++++ frontend/src/components/widget/DeWidget/DeNumberRange.vue | 4 ++++ frontend/src/components/widget/DeWidget/DeSelect.vue | 5 +++++ frontend/src/components/widget/DeWidget/DeSelectGrid.vue | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/frontend/src/components/widget/DeWidget/DeDate.vue b/frontend/src/components/widget/DeWidget/DeDate.vue index d50a0f8f65..fc6abdc5e4 100644 --- a/frontend/src/components/widget/DeWidget/DeDate.vue +++ b/frontend/src/components/widget/DeWidget/DeDate.vue @@ -64,6 +64,7 @@ export default { }, dateChange(value) { this.setCondition() + this.styleChange() }, formatValues(values) { if (!values || values.length === 0) { @@ -83,6 +84,9 @@ export default { const value = values[0] return timeSection(value, this.options.attrs.type) } + }, + styleChange() { + this.$store.state.styleChangeTimes++ } } } diff --git a/frontend/src/components/widget/DeWidget/DeNumberRange.vue b/frontend/src/components/widget/DeWidget/DeNumberRange.vue index 94d688f80e..17dc4cde31 100644 --- a/frontend/src/components/widget/DeWidget/DeNumberRange.vue +++ b/frontend/src/components/widget/DeWidget/DeNumberRange.vue @@ -135,6 +135,7 @@ export default { return false } this.setCondition() + this.styleChange() }) }, setCondition() { @@ -165,6 +166,9 @@ export default { this.inDraw && this.$store.commit('addViewFilter', param) return } + }, + styleChange() { + this.$store.state.styleChangeTimes++ } } } diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 6b11223f28..db6978ca48 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -80,6 +80,7 @@ export default { methods: { changeValue(value) { this.setCondition() + this.styleChange() this.showNumber = false this.$nextTick(() => { if (!this.$refs.deSelect.$refs.tags || !this.options.attrs.multiple) { @@ -101,7 +102,11 @@ export default { operator: this.operator } this.inDraw && this.$store.commit('addViewFilter', param) + }, + styleChange() { + this.$store.state.styleChangeTimes++ } + } } diff --git a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue index d03e024a00..daacf5ba8b 100644 --- a/frontend/src/components/widget/DeWidget/DeSelectGrid.vue +++ b/frontend/src/components/widget/DeWidget/DeSelectGrid.vue @@ -167,6 +167,7 @@ export default { this.options.value = values this.setCondition() + this.styleChange() }, // 勾选数据项 会影响全选节点的状态 setAllNodeStatus() { @@ -208,7 +209,11 @@ export default { filterNode(value, data) { if (!value) return true return data[this.defaultProp.label].indexOf(value) !== -1 + }, + styleChange() { + this.$store.state.styleChangeTimes++ } + } } From 09d6ae7396d4313d7c088a949d8794fb0cb0f4af Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 28 Jul 2021 11:36:51 +0800 Subject: [PATCH 5/7] =?UTF-8?q?reactor:=E5=8E=BB=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=97=A5=E5=BF=97=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/canvas/components/Toolbar.vue | 1 - frontend/src/views/panel/edit/index.vue | 2 -- frontend/src/views/panel/list/EditPanel/index.vue | 1 - 3 files changed, 4 deletions(-) diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 7d5f866d4f..b9be1d55cf 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -264,7 +264,6 @@ export default { }, save(withClose) { - debugger // 保存到数据库 const requestInfo = { id: this.$store.state.panel.panelInfo.id, diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 1fe526a6ab..2e86229107 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -646,7 +646,6 @@ export default { }) }, newViewInfo(newViewInfo) { - debugger let component const newComponentId = uuid.v1() // 用户视图设置 复制一个模板 @@ -681,7 +680,6 @@ export default { } }, canvasScroll(event) { - debugger this.scrollLeft = event.target.scrollLeft this.scrollTop = event.target.scrollTop }, diff --git a/frontend/src/views/panel/list/EditPanel/index.vue b/frontend/src/views/panel/list/EditPanel/index.vue index 636938ee42..6f53ecb6f5 100644 --- a/frontend/src/views/panel/list/EditPanel/index.vue +++ b/frontend/src/views/panel/list/EditPanel/index.vue @@ -73,7 +73,6 @@ export default { }, watch: { inputType(newVal) { - debugger if (newVal === 'self') { this.editPanel = deepCopy(this.editPanelOut) } else { From 990c6778df512ee8fb856082fa943283c3ca7b5c Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 28 Jul 2021 11:32:29 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=88=87=E6=8D=A2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A1=B5=E9=9D=A2=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddCustom.vue | 16 ++++++++++++++-- frontend/src/views/dataset/add/AddSQL.vue | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index a5b058a2aa..64031a1c50 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -88,6 +88,11 @@ export default { } }, watch: { + 'param.tableId': { + handler: function() { + this.resetComponent() + } + }, 'checkedList': function() { // console.log(this.checkedList) this.getUnionData() @@ -239,8 +244,15 @@ export default { } }, - dataReset() { - + resetComponent() { + this.name = '自定义数据集' + this.table = {} + this.checkedList = [] + this.unionData = [] + this.height = 500 + this.data = [] + this.fields = [] + this.customType = ['db', 'sql', 'excel'] } } diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 759c5f6ccd..cb8873deb4 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -163,6 +163,7 @@ export default { watch: { 'param.tableId': { handler: function() { + this.resetComponent() this.initTableInfo() } } @@ -302,6 +303,20 @@ export default { // console.log(newCode) this.sql = newCode this.$emit('codeChange', this.sql) + }, + + resetComponent() { + this.dataSource = '' + this.options = [] + this.name = '' + this.sql = '' + this.data = [] + this.fields = [] + this.mode = '0' + this.syncType = 'sync_now' + this.height = 500 + this.kettleRunning = false + this.$refs.plxTable.reloadData(this.data) } } } From 89a7d4b311d4f8ea46e986e89a0cd8cebc4c2795 Mon Sep 17 00:00:00 2001 From: junjie Date: Wed, 28 Jul 2021 11:41:06 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=E8=BF=87=E6=BB=A4=E5=99=A8=E5=A4=9A?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E9=9B=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/service/chart/ChartViewService.java | 14 ++++++++------ frontend/src/views/dataset/add/AddSQL.vue | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index fe8f3a5a4e..23716d853b 100644 --- a/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -138,14 +138,16 @@ public class ChartViewService { }.getType()); List fieldCustomFilter = new Gson().fromJson(view.getCustomFilter(), new TypeToken>() { }.getType()); - List customFilter = fieldCustomFilter.stream().map(ele -> { - ChartCustomFilterDTO dto = new ChartCustomFilterDTO(); - ele.getFilter().forEach(f -> { + List customFilter = new ArrayList<>(); + for (ChartFieldCustomFilterDTO ele : fieldCustomFilter) { + List collect = ele.getFilter().stream().map(f -> { + ChartCustomFilterDTO dto = new ChartCustomFilterDTO(); BeanUtils.copyBean(dto, f); dto.setField(dataSetTableFieldsService.get(f.getFieldId())); - }); - return dto; - }).collect(Collectors.toList()); + return dto; + }).collect(Collectors.toList()); + customFilter.addAll(collect); + } if (StringUtils.equalsIgnoreCase("text", view.getType()) || StringUtils.equalsIgnoreCase("gauge", view.getType())) { xAxis = new ArrayList<>(); diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index cb8873deb4..4cb93f2393 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -284,7 +284,7 @@ export default { cancel() { // this.dataReset() if (this.param.tableId) { - this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table}) + this.$emit('switchComponent', { name: 'ViewTable', param: this.param.table }) } else { this.$emit('switchComponent', { name: '' }) }