From 6336c1bdfe64bfd25dfbc6858cb7d23a5e921b4b Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 28 Apr 2022 18:28:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E7=BC=BA=E5=A4=B1schema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index 71caa0df56..ef23921d06 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -1,5 +1,7 @@ package io.dataease.service.dataset; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import io.dataease.auth.annotation.DeCleaner; import io.dataease.auth.api.dto.CurrentUserDto; @@ -960,6 +962,8 @@ public class DataSetTableService { res.put("data", jsonArray); return res; } catch (Exception e) { + e.printStackTrace(); + logger.error(e.getMessage()); return res; } } @@ -1321,6 +1325,17 @@ public class DataSetTableService { DatasourceTypes datasourceTypes = DatasourceTypes.valueOf(ds.getType()); String keyword = datasourceTypes.getKeywordPrefix() + "%s" + datasourceTypes.getKeywordSuffix(); + String configuration = ds.getConfiguration(); + JSONObject jsonObject = JSON.parseObject(configuration); + String schema = jsonObject.getString("schema"); + String joinPrefix = ""; + if (StringUtils.isNotEmpty(schema) && (StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.db2.getType()) || + StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.sqlServer.getType()) || + StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.oracle.getType()) || + StringUtils.equalsIgnoreCase(ds.getType(), DatasourceTypes.pg.getType()))) { + joinPrefix = String.format(keyword, schema) + "."; + } + List union = dataTableInfoDTO.getUnion(); // 所有选中的字段,即select后的查询字段 Map checkedInfo = new LinkedHashMap<>(); @@ -1386,7 +1401,7 @@ public class DataSetTableService { String currentTableName = new Gson().fromJson(currentTable.getInfo(), DataTableInfoDTO.class) .getTable(); - join.append(" ").append(joinType).append(" ").append(String.format(keyword, currentTableName)) + join.append(" ").append(joinType).append(" ").append(joinPrefix).append(String.format(keyword, currentTableName)) .append(" ON "); for (int i = 0; i < unionParamDTO.getUnionFields().size(); i++) { UnionItemDTO unionItemDTO = unionParamDTO.getUnionFields().get(i); @@ -1409,13 +1424,13 @@ public class DataSetTableService { if (StringUtils.isEmpty(f)) { DEException.throwException(Translator.get("i18n_union_ds_no_checked")); } - sql = MessageFormat.format("SELECT {0} FROM {1}", f, String.format(keyword, tableName)) + join.toString(); + sql = MessageFormat.format("SELECT {0} FROM {1}", f, joinPrefix + String.format(keyword, tableName)) + join.toString(); } else { String f = StringUtils.join(checkedInfo.get(tableName), ","); if (StringUtils.isEmpty(f)) { throw new RuntimeException(Translator.get("i18n_union_ds_no_checked")); } - sql = MessageFormat.format("SELECT {0} FROM {1}", f, String.format(keyword, tableName)); + sql = MessageFormat.format("SELECT {0} FROM {1}", f, joinPrefix + String.format(keyword, tableName)); } Map map = new HashMap<>(); map.put("sql", sql); From 95a40e3d08708505c3f959d674920e9dbe888757 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 28 Apr 2022 18:44:33 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90=E5=90=8E=E5=88=9B=E5=BB=BA=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/dataease/service/dataset/DataSetTableService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index ef23921d06..635bfa35c2 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -1509,6 +1509,9 @@ public class DataSetTableService { public void saveTableField(DatasetTable datasetTable) throws Exception { Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId()); + if (ObjectUtils.isEmpty(ds)) { + throw new RuntimeException(Translator.get("i18n_datasource_delete")); + } DataSetTableRequest dataSetTableRequest = new DataSetTableRequest(); BeanUtils.copyBean(dataSetTableRequest, datasetTable); From 6fe299c5c96f943323b51aec9f1f081258373cfa Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 29 Apr 2022 10:35:00 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E6=9D=BF=E5=AF=BC=E5=87=BA=E6=A8=A1=E6=9D=BF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/panel/list/PanelViewShow.vue | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index d1fd023a2f..6b35ea6764 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -266,35 +266,40 @@ export default { downloadToTemplate() { const _this = this _this.dataLoading = true - _this.findStaticSource(function(staticResource) { - html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { - _this.dataLoading = false - const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 - if (snapshot !== '') { - _this.templateInfo = { - name: _this.$store.state.panel.panelInfo.name, - templateType: 'self', - snapshot: snapshot, - panelStyle: JSON.stringify(_this.canvasStyleData), - panelData: JSON.stringify(_this.componentData), - dynamicData: JSON.stringify(_this.panelViewDetailsInfo), - staticResource: JSON.stringify(staticResource || {}) + try { + _this.findStaticSource(function(staticResource) { + html2canvas(document.getElementById('canvasInfoTemp')).then(canvas => { + _this.dataLoading = false + const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 + if (snapshot !== '') { + _this.templateInfo = { + name: _this.$store.state.panel.panelInfo.name, + templateType: 'self', + snapshot: snapshot, + panelStyle: JSON.stringify(_this.canvasStyleData), + panelData: JSON.stringify(_this.componentData), + dynamicData: JSON.stringify(_this.panelViewDetailsInfo), + staticResource: JSON.stringify(staticResource || {}) + } + const blob = new Blob([JSON.stringify(_this.templateInfo)], { type: '' }) + FileSaver.saveAs(blob, _this.$store.state.panel.panelInfo.name + '-TEMPLATE.DET') } - const blob = new Blob([JSON.stringify(_this.templateInfo)], { type: '' }) - FileSaver.saveAs(blob, _this.$store.state.panel.panelInfo.name + '-TEMPLATE.DET') - } + }) }) - }) + } catch (e) { + console.error(e) + _this.dataLoading = false + } }, // 解析静态文件 findStaticSource(callBack) { const staticResource = [] // 系统背景文件 - if (this.canvasStyleData.panel.imageUrl && this.canvasStyleData.panel.imageUrl.indexOf('static-resource') > -1) { + if (typeof this.canvasStyleData.panel.imageUrl === 'string' && this.canvasStyleData.panel.imageUrl.indexOf('static-resource') > -1) { staticResource.push(this.canvasStyleData.panel.imageUrl) } this.componentData.forEach(item => { - if (item.commonBackground && item.commonBackground.outerImage && item.commonBackground.outerImage.indexOf('static-resource') > -1) { + if (typeof item.commonBackground.outerImage === 'string' && item.commonBackground.outerImage.indexOf('static-resource') > -1) { staticResource.push(item.commonBackground.outerImage) } }) @@ -308,7 +313,9 @@ export default { callBack() } } else { - callBack() + setTimeout(() => { + callBack() + }, 0) } }, From 670906b38efdf2d930efff7f3912b314e55f5ebc Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 29 Apr 2022 11:10:08 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=9F=9F=E5=90=8D=E8=AE=BF=E9=97=AE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/public/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/public/index.html b/mobile/public/index.html index ba6f5166c9..7f4260a564 100644 --- a/mobile/public/index.html +++ b/mobile/public/index.html @@ -3,7 +3,8 @@ - + + <%= htmlWebpackPlugin.options.title %> From 7dad0503f31563c1d4dc556a5518547933a0ad4a Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 29 Apr 2022 11:46:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E6=97=B6=EF=BC=8C=E7=AD=89=E5=BE=85=E5=8C=BA=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0=E7=A9=BA=E7=99=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/index.vue | 6 +++++- .../canvas/custom-component/DeStreamMedia.vue | 2 +- frontend/src/views/chart/chart/gauge/gauge_antv.js | 2 +- frontend/src/views/panel/edit/ComponentWait.vue | 2 +- .../src/views/panel/edit/ComponentWaitItem.vue | 14 +++++--------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue index 8f6a94c459..231ba8fd2e 100644 --- a/frontend/src/components/canvas/components/Editor/index.vue +++ b/frontend/src/components/canvas/components/Editor/index.vue @@ -1368,7 +1368,11 @@ export default { resizeView(index, item) { if (item.type === 'view' || item.type === 'de-show-date') { - this.$refs.wrapperChild[index].chartResize() + try { + this.$refs.wrapperChild[index].chartResize() + } catch (e) { + // ignore error + } } }, editComponent(index, item) { diff --git a/frontend/src/components/canvas/custom-component/DeStreamMedia.vue b/frontend/src/components/canvas/custom-component/DeStreamMedia.vue index d6242c99f7..23ec89cc24 100644 --- a/frontend/src/components/canvas/custom-component/DeStreamMedia.vue +++ b/frontend/src/components/canvas/custom-component/DeStreamMedia.vue @@ -115,7 +115,7 @@ export default { this.flvPlayer.load() this.flvPlayer.play() } catch (error) { - console.log(error) + console.log('flvjs err ignore') } } } diff --git a/frontend/src/views/chart/chart/gauge/gauge_antv.js b/frontend/src/views/chart/chart/gauge/gauge_antv.js index d444678c36..88f9711fd5 100644 --- a/frontend/src/views/chart/chart/gauge/gauge_antv.js +++ b/frontend/src/views/chart/chart/gauge/gauge_antv.js @@ -128,7 +128,7 @@ export function baseGaugeOptionAntV(plot, container, chart, action, scale = 1) { } } } - console.log(options.indicator.pin) + // console.log(options.indicator.pin) // 开始渲染 if (plot) { diff --git a/frontend/src/views/panel/edit/ComponentWait.vue b/frontend/src/views/panel/edit/ComponentWait.vue index adc4f2c09b..8a0b8b4fb0 100644 --- a/frontend/src/views/panel/edit/ComponentWait.vue +++ b/frontend/src/views/panel/edit/ComponentWait.vue @@ -9,7 +9,7 @@ v-for="(config, index) in pcComponentData" v-if="!config.mobileSelected" :id="'wait' + config.id" - :key="index" + :key="config.id" > -
+
From c645664d26367983498bee73dde0d115e60f234c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 29 Apr 2022 16:49:00 +0800 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=90=8E=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/user/index.vue | 9 +++++++-- frontend/src/views/system/user/personPwd.vue | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue index c8272a8227..a3614a0081 100644 --- a/frontend/src/views/system/user/index.vue +++ b/frontend/src/views/system/user/index.vue @@ -183,7 +183,7 @@ import { pluginLoaded } from '@/api/user' /* import { ldapStatus, pluginLoaded } from '@/api/user' */ import { userLists, addUser, editUser, delUser, editPassword, editStatus, allRoles } from '@/api/system/user' import { getDeptTree, treeByDeptId } from '@/api/system/dept' - +import { mapGetters } from 'vuex' export default { components: { ComplexTable, LayoutContent, Treeselect }, @@ -320,6 +320,11 @@ export default { canLoadDom: false } }, + computed: { + ...mapGetters([ + 'user' + ]) + }, mounted() { this.allRoles() this.search() @@ -420,7 +425,7 @@ export default { this.$success(this.$t('commons.modify_success')) this.editPasswordVisible = false this.search() - window.location.reload() + this.user && this.user.userId && (this.user.userId === editPasswordForm.userId) && window.location.reload() }) } else { return false diff --git a/frontend/src/views/system/user/personPwd.vue b/frontend/src/views/system/user/personPwd.vue index e6d26c116c..5a5e9f4385 100644 --- a/frontend/src/views/system/user/personPwd.vue +++ b/frontend/src/views/system/user/personPwd.vue @@ -85,12 +85,17 @@ export default { } updatePersonPwd(param).then(res => { this.$success(this.$t('commons.save_success')) - this.$router.push('/panel/index') + this.logout() + // this.$router.push('/panel/index') }) } else { return false } }) + }, + async logout() { + await this.$store.dispatch('user/logout') + this.$router.push('/') } } }