diff --git a/README.md b/README.md index 6e20dc3c78..6c0ea644dd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ +![license](https://img.shields.io/github/license/dataease/dataease?color=%231890FF&style=flat-square) +![release](https://img.shields.io/github/v/release/dataease/dataease?color=%231890FF&sort=semver&style=flat-square) +![stars](https://img.shields.io/github/stars/dataease/dataease?color=%231890FF&style=flat-square) +![downloads](https://img.shields.io/github/downloads/dataease/dataease/total) + # DataEase - 人人可用的开源数据可视化分析工具 DataEase 是开源的数据可视化分析工具,帮助用户分析数据、改善业务。DataEase 支持丰富的数据源连接,能够通过拖拉拽方式快速制作图表,并可以方便的与他人分享。 diff --git a/backend/src/main/java/io/dataease/commons/utils/DorisTableUtils.java b/backend/src/main/java/io/dataease/commons/utils/DorisTableUtils.java index a027f10e89..970078deed 100644 --- a/backend/src/main/java/io/dataease/commons/utils/DorisTableUtils.java +++ b/backend/src/main/java/io/dataease/commons/utils/DorisTableUtils.java @@ -14,6 +14,10 @@ public class DorisTableUtils { return "delete_" + dorisName; } + public static String dorisAddName(String dorisName) { + return "add_" + dorisName; + } + public static String dorisFieldName(String dorisName) { return "f_" + Md5Utils.md5(dorisName); } 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 fe696ff646..0200ea4a5f 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -703,7 +703,7 @@ public class DataSetTableService { if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalAdd().replace(" ", ""))) {// 增量添加 String sql = datasetTableIncrementalConfig.getIncrementalAdd().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); - datasourceRequest.setQuery(sql); + datasourceRequest.setQuery(extractDataService.sqlFix(sql)); List sqlFileds = new ArrayList<>(); datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> { sqlFileds.add(filed); @@ -716,7 +716,7 @@ public class DataSetTableService { if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete()) && StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete().replace(" ", ""))) {// 增量删除 String sql = datasetTableIncrementalConfig.getIncrementalDelete().replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); - datasourceRequest.setQuery(sql); + datasourceRequest.setQuery(extractDataService.sqlFix(sql)); List sqlFileds = new ArrayList<>(); datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed -> { sqlFileds.add(filed); diff --git a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java index c93236d857..ff19e54bd2 100644 --- a/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java +++ b/backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java @@ -491,12 +491,12 @@ public class ExtractDataService { case "all_scope": transName = "trans_" + DorisTableUtils.dorisName(datasetTable.getId()); outFile = DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTable.getId())); - jobName = "job_" + datasetTable.getId(); - script = String.format(shellScript, dorisConfigration.getUsername(), dorisConfigration.getPassword(), String.valueOf(System.currentTimeMillis()), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfigration.getHost(), dorisConfigration.getHttpPort(), dorisConfigration.getDataBase(), DorisTableUtils.dorisName(datasetTable.getId()), root_path + outFile + "." + extention); + jobName = "job_" + DorisTableUtils.dorisName(datasetTable.getId()); + script = String.format(shellScript, dorisConfigration.getUsername(), dorisConfigration.getPassword(), String.valueOf(System.currentTimeMillis()), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfigration.getHost(), dorisConfigration.getHttpPort(), dorisConfigration.getDataBase(), DorisTableUtils.dorisTmpName(DorisTableUtils.dorisName(datasetTable.getId())), root_path + outFile + "." + extention); break; case "incremental_add": transName = "trans_add_" + DorisTableUtils.dorisName(datasetTable.getId()); - outFile = DorisTableUtils.dorisName(datasetTable.getId()); + outFile = DorisTableUtils.dorisAddName(datasetTable.getId()); jobName = "job_add_" + DorisTableUtils.dorisName(datasetTable.getId()); script = String.format(shellScript, dorisConfigration.getUsername(), dorisConfigration.getPassword(), String.valueOf(System.currentTimeMillis()), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfigration.getHost(), dorisConfigration.getHttpPort(), dorisConfigration.getDataBase(), DorisTableUtils.dorisName(datasetTable.getId()), root_path + outFile + "." + extention); break; @@ -566,11 +566,10 @@ public class ExtractDataService { } private String fetchSqlField(String sql, Datasource ds) throws Exception { - String tmpSql = "SELECT * FROM (" + sqlFix(sql) + ") AS tmp " + " LIMIT 0"; DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceRequest datasourceRequest = new DatasourceRequest(); datasourceRequest.setDatasource(ds); - datasourceRequest.setQuery(tmpSql); + datasourceRequest.setQuery(sqlFix(sql)); List dorisFileds = new ArrayList<>(); datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableFiled::getFieldName).forEach(filed ->{ dorisFileds.add(DorisTableUtils.columnName(filed)); @@ -578,12 +577,13 @@ public class ExtractDataService { return String.join(",", dorisFileds); } - private String sqlFix(String sql) { + public String sqlFix(String sql) { sql = sql.trim(); if (sql.lastIndexOf(";") == (sql.length() - 1)) { sql = sql.substring(0, sql.length() - 1); } - return sql; + String tmpSql = "SELECT * FROM (" + sql + ") AS tmp " + " LIMIT 0"; + return tmpSql; } @@ -649,7 +649,7 @@ public class ExtractDataService { break; case "incremental_add": transName = "trans_add_" + DorisTableUtils.dorisName(datasetTable.getId()); - outFile = DorisTableUtils.dorisName(datasetTable.getId()); + outFile = DorisTableUtils.dorisAddName(datasetTable.getId()); transMeta.setName(transName); break; case "incremental_delete": @@ -789,18 +789,18 @@ public class ExtractDataService { switch (type) { case "all_scope": - transName = "trans_" + dataSetTableId; - jobName = "job_" + dataSetTableId; + transName = "trans_" + DorisTableUtils.dorisName(dataSetTableId); + jobName = "job_" + DorisTableUtils.dorisName(dataSetTableId); fileName = DorisTableUtils.dorisTmpName(dataSetTableId); break; case "incremental_add": - transName = "trans_add_" + dataSetTableId; - jobName = "job_add_" + dataSetTableId; - fileName = DorisTableUtils.dorisName(dataSetTableId); + transName = "trans_add_" + DorisTableUtils.dorisName(dataSetTableId); + jobName = "job_add_" + DorisTableUtils.dorisName(dataSetTableId); + fileName = DorisTableUtils.dorisAddName(dataSetTableId); break; case "incremental_delete": - transName = "trans_delete_" + dataSetTableId; - jobName = "job_delete_" + dataSetTableId; + transName = "trans_delete_" + DorisTableUtils.dorisName(dataSetTableId); + jobName = "job_delete_" + DorisTableUtils.dorisName(dataSetTableId); fileName = DorisTableUtils.dorisDeleteName(dataSetTableId); break; default: diff --git a/frontend/src/icons/svg/docs.svg b/frontend/src/icons/svg/docs.svg new file mode 100644 index 0000000000..42a1046e3d --- /dev/null +++ b/frontend/src/icons/svg/docs.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/icons/svg/language.svg b/frontend/src/icons/svg/language.svg index 0082b577ab..312f4f3b54 100644 --- a/frontend/src/icons/svg/language.svg +++ b/frontend/src/icons/svg/language.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 4b70a0d56e..1349a155ad 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -446,7 +446,8 @@ export default { origin_passwd: 'Origin Password', new_passwd: 'New Password', confirm_passwd: 'Confirm Password', - change_password: 'Change Password' + change_password: 'Change Password', + search_by_name: 'Search by name' }, role: { menu_authorization: 'Menu Authorization', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index ea3f54f75f..ba0583b0d1 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -446,7 +446,8 @@ export default { origin_passwd: '原始密碼', new_passwd: '新密碼', confirm_passwd: '確認密碼', - change_password: '修改密碼' + change_password: '修改密碼', + search_by_name: '按姓名搜索' }, role: { menu_authorization: '菜單授權', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 3b8e493fca..11b1923e91 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -446,7 +446,8 @@ export default { origin_passwd: '原始密码', new_passwd: '新密码', confirm_passwd: '确认密码', - change_password: '修改密码' + change_password: '修改密码', + search_by_name: '按姓名搜索' }, role: { menu_authorization: '菜单授权', diff --git a/frontend/src/layout/components/Topbar.vue b/frontend/src/layout/components/Topbar.vue index 8826e2dfef..e68f484a9d 100644 --- a/frontend/src/layout/components/Topbar.vue +++ b/frontend/src/layout/components/Topbar.vue @@ -37,6 +37,11 @@ --> +
+ + + +
@@ -50,9 +55,9 @@ {{ $t('user.change_password') }} - - {{ $t('commons.help_documentation') }} - + + + {{ $t('commons.about_us') }} @@ -206,7 +211,7 @@ export default { // 设置侧边栏的显示和隐藏 setSidebarHide(route) { // if (!route.children || route.children.length === 1) { - if (!route.children || this.showChildLength(route) === 1) { + if (route.name !== 'system' && (!route.children || this.showChildLength(route) === 1)) { this.$store.dispatch('app/toggleSideBarHide', true) } else { this.$store.dispatch('app/toggleSideBarHide', false) diff --git a/frontend/src/layout/index.vue b/frontend/src/layout/index.vue index 0ff45e8d3a..d2841ae1fc 100644 --- a/frontend/src/layout/index.vue +++ b/frontend/src/layout/index.vue @@ -120,6 +120,7 @@ export default { .sidebar-container { width: 100% !important; position: initial !important; + height: calc(100vh - 80px) !important; } } diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 9a2f75a99e..8b40cd5608 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -102,7 +102,7 @@ - + @@ -183,7 +183,7 @@ - + diff --git a/frontend/src/views/dataset/common/DatasetGroupSelector.vue b/frontend/src/views/dataset/common/DatasetGroupSelector.vue index 0a82c28262..e1071ab0b3 100644 --- a/frontend/src/views/dataset/common/DatasetGroupSelector.vue +++ b/frontend/src/views/dataset/common/DatasetGroupSelector.vue @@ -132,6 +132,11 @@ export default { type: Object, required: false, default: null + }, + showMode: { + type: String, + required: false, + default: null } }, data() { @@ -283,7 +288,7 @@ export default { return } // check mode=1的数据集是否创建doris表 - if (data.mode === 1) { + if (data.mode === 1 && !this.showMode) { post('/dataset/table/checkDorisTableIsExists/' + data.id, {}, false).then(response => { if (response.data) { this.$nextTick(function() { diff --git a/frontend/src/views/dataset/data/UnionView.vue b/frontend/src/views/dataset/data/UnionView.vue index bf0d804456..b5d4e2940c 100644 --- a/frontend/src/views/dataset/data/UnionView.vue +++ b/frontend/src/views/dataset/data/UnionView.vue @@ -92,7 +92,7 @@ width="500" trigger="click" > - +

{{ targetTable.name || $t('dataset.pls_slc_union_table') }}

@@ -193,21 +193,21 @@ export default { showUnionEdit() { // 校验同步状态 - post('/dataset/table/checkDorisTableIsExists/' + this.table.id, {}, true).then(response => { - if (response.data) { - this.union.sourceTableId = this.table.id - fieldList(this.table.id).then(response => { - this.sourceFieldOption = response.data - }) - this.editUnion = true - } else { - this.$message({ - type: 'error', - message: this.$t('dataset.invalid_table_check'), - showClose: true - }) - } + // post('/dataset/table/checkDorisTableIsExists/' + this.table.id, {}, true).then(response => { + // if (response.data) { + this.union.sourceTableId = this.table.id + fieldList(this.table.id).then(response => { + this.sourceFieldOption = response.data }) + this.editUnion = true + // } else { + // this.$message({ + // type: 'error', + // message: this.$t('dataset.invalid_table_check'), + // showClose: true + // }) + // } + // }) }, saveUnion() { // console.log(this.union) diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 6c8d1b15aa..c5f82fa174 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -104,7 +104,7 @@ - + @@ -223,7 +223,7 @@ - + diff --git a/frontend/src/views/panel/list/EditPanel/index.vue b/frontend/src/views/panel/list/EditPanel/index.vue index 7583d3b31b..2f29295c0b 100644 --- a/frontend/src/views/panel/list/EditPanel/index.vue +++ b/frontend/src/views/panel/list/EditPanel/index.vue @@ -80,7 +80,25 @@ export default { created() { // this.getTree() }, + mounted() { + this.bindKey() + }, + destroyed() { + this.unBindKey() + }, methods: { + entryKey(event) { + const keyCode = event.keyCode + if (keyCode === 13) { + this.save() + } + }, + bindKey() { + document.addEventListener('keyup', this.entryKey) + }, + unBindKey() { + document.removeEventListener('keyup', this.entryKey) + }, showCurrentTemplateInfo(data) { this.editPanel.panelInfo.name = data.name this.editPanel.panelInfo.panelStyle = data.templateStyle diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index fa8e991f71..06b3fd8f92 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -134,7 +134,7 @@ - + diff --git a/frontend/src/views/system/user/form.vue b/frontend/src/views/system/user/form.vue index 48eaa4c78f..3625f02145 100644 --- a/frontend/src/views/system/user/form.vue +++ b/frontend/src/views/system/user/form.vue @@ -169,7 +169,25 @@ export default { } this.initRoles() }, + mounted() { + this.bindKey() + }, + destroyed() { + this.unBindKey() + }, methods: { + entryKey(event) { + const keyCode = event.keyCode + if (keyCode === 13) { + this.save() + } + }, + bindKey() { + document.addEventListener('keyup', this.entryKey) + }, + unBindKey() { + document.removeEventListener('keyup', this.entryKey) + }, repeatValidator(rule, value, callback) { if (value !== this.form.password) { callback(new Error(this.$t('member.inconsistent_passwords'))) diff --git a/frontend/src/views/system/user/index.vue b/frontend/src/views/system/user/index.vue index fe93048dd3..ee641db4b9 100644 --- a/frontend/src/views/system/user/index.vue +++ b/frontend/src/views/system/user/index.vue @@ -143,6 +143,7 @@ label-width="120px" :rules="rule" class="demo-ruleForm" + @keyup.enter.native="editUserPassword('editPasswordForm')" > @@ -196,12 +197,12 @@ export default { searchConfig: { useQuickSearch: true, useComplexSearch: true, - quickPlaceholder: '按姓名搜索', + quickPlaceholder: this.$t('user.search_by_name'), components: [ - { field: 'nick_name', label: '姓名', component: 'DeComplexInput' }, + { field: 'nick_name', label: this.$t('commons.nick_name'), component: 'DeComplexInput' }, { field: 'u.enabled', - label: '状态', + label: this.$t('commons.status'), component: 'FuComplexSelect', options: [ { label: '启用', value: '1' },