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 9a1e59333c..0a300867bd 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -719,10 +719,14 @@ public class DataSetTableService { } else { rows = sheet0.getPhysicalNumberOfRows(); } + int columnNum = 0; for (int i = 0; i < rows; i++) { HSSFRow row = sheet0.getRow(i); - String[] r = new String[row.getPhysicalNumberOfCells()]; - for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { + if (i == 0) { + columnNum = row.getPhysicalNumberOfCells(); + } + String[] r = new String[columnNum]; + for (int j = 0; j < columnNum; j++) { if (i == 0) { TableFiled tableFiled = new TableFiled(); tableFiled.setFieldType("TEXT"); @@ -759,10 +763,14 @@ public class DataSetTableService { } else { rows = sheet0.getPhysicalNumberOfRows(); } + int columnNum = 0; for (int i = 0; i < rows; i++) { XSSFRow row = sheet0.getRow(i); - String[] r = new String[row.getPhysicalNumberOfCells()]; - for (int j = 0; j < row.getPhysicalNumberOfCells(); j++) { + if (i == 0) { + columnNum = row.getPhysicalNumberOfCells(); + } + String[] r = new String[columnNum]; + for (int j = 0; j < columnNum; j++) { if (i == 0) { TableFiled tableFiled = new TableFiled(); tableFiled.setFieldType("TEXT"); @@ -828,6 +836,9 @@ public class DataSetTableService { } private String readCell(Cell cell, boolean cellType, TableFiled tableFiled) { + if (cell == null) { + return ""; + } CellType cellTypeEnum = cell.getCellTypeEnum(); if (cellTypeEnum.equals(CellType.STRING)) { if (cellType) { diff --git a/backend/src/main/resources/db/migration/V6__alter_table.sql b/backend/src/main/resources/db/migration/V6__alter_table.sql index 37106309dd..08febbdd3d 100644 --- a/backend/src/main/resources/db/migration/V6__alter_table.sql +++ b/backend/src/main/resources/db/migration/V6__alter_table.sql @@ -1,2 +1,33 @@ ALTER TABLE `dataset_table` ADD COLUMN `sync_status` VARCHAR(45) NULL AFTER `create_time`; ALTER TABLE `dataset_table` ADD COLUMN `qrtz_instance` VARCHAR(1024) NULL AFTER `create_time`; + + +BEGIN; +INSERT INTO `sys_auth` VALUES ('05e5440f-b9c1-4998-bb7e-cabdb293183f', '25', 'menu', '2', 'role', 1622713311975, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('19569764-ad2e-4d7b-b575-508913495ccf', '8', 'menu', '2', 'role', 1622713307681, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('4541d582-b532-47b1-9e64-b4937c7b614f', '30', 'menu', '2', 'role', 1622713299688, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('45dacd42-e9a4-4ce5-a03c-61c8850cf5b1', '10', 'menu', '2', 'role', 1622713304841, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('8b1e1e02-b6c2-49dc-9118-10ab31f78b46', '34', 'menu', '2', 'role', 1623142236719, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('a11f5705-887d-403b-9a9d-d3a1317ed91f', '24', 'menu', '2', 'role', 1622713311583, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('c318d302-457d-43d8-bb01-96a7cbbf6cb7', '27', 'menu', '2', 'role', 1622713313044, NULL, 'admin', NULL); +INSERT INTO `sys_auth` VALUES ('c3349d14-1433-41e6-9ddc-ba947c3b523c', '26', 'menu', '2', 'role', 1622713312606, NULL, 'admin', NULL); +COMMIT; + +BEGIN; +INSERT INTO `sys_auth_detail` VALUES ('980c14e1-c836-11eb-bbcc-00163e0c8d3f', '8b1e1e02-b6c2-49dc-9118-10ab31f78b46', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1623142236000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('980c1674-c836-11eb-bbcc-00163e0c8d3f', '8b1e1e02-b6c2-49dc-9118-10ab31f78b46', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1623142236000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('e59001d3-c44f-11eb-bbcc-00163e0c8d3f', '4541d582-b532-47b1-9e64-b4937c7b614f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713299000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('e59003a0-c44f-11eb-bbcc-00163e0c8d3f', '4541d582-b532-47b1-9e64-b4937c7b614f', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713299000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('e8a4bdbf-c44f-11eb-bbcc-00163e0c8d3f', '45dacd42-e9a4-4ce5-a03c-61c8850cf5b1', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713304000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('e8a4bf70-c44f-11eb-bbcc-00163e0c8d3f', '45dacd42-e9a4-4ce5-a03c-61c8850cf5b1', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713304000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ea536049-c44f-11eb-bbcc-00163e0c8d3f', '19569764-ad2e-4d7b-b575-508913495ccf', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713307000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ea5361d6-c44f-11eb-bbcc-00163e0c8d3f', '19569764-ad2e-4d7b-b575-508913495ccf', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713307000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('eca67ad0-c44f-11eb-bbcc-00163e0c8d3f', 'a11f5705-887d-403b-9a9d-d3a1317ed91f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713311000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('eca67c74-c44f-11eb-bbcc-00163e0c8d3f', 'a11f5705-887d-403b-9a9d-d3a1317ed91f', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713311000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ece430b9-c44f-11eb-bbcc-00163e0c8d3f', '05e5440f-b9c1-4998-bb7e-cabdb293183f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713312000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ece4330e-c44f-11eb-bbcc-00163e0c8d3f', '05e5440f-b9c1-4998-bb7e-cabdb293183f', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713312000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ed4328d0-c44f-11eb-bbcc-00163e0c8d3f', 'c3349d14-1433-41e6-9ddc-ba947c3b523c', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713312000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ed432abc-c44f-11eb-bbcc-00163e0c8d3f', 'c3349d14-1433-41e6-9ddc-ba947c3b523c', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713312000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ed8722a7-c44f-11eb-bbcc-00163e0c8d3f', 'c318d302-457d-43d8-bb01-96a7cbbf6cb7', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1622713313000, NULL); +INSERT INTO `sys_auth_detail` VALUES ('ed872435-c44f-11eb-bbcc-00163e0c8d3f', 'c318d302-457d-43d8-bb01-96a7cbbf6cb7', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1622713313000, NULL); +COMMIT; \ No newline at end of file diff --git a/frontend/src/api/system/dynamic.js b/frontend/src/api/system/dynamic.js index 3ab521ed0e..053c405aaa 100644 --- a/frontend/src/api/system/dynamic.js +++ b/frontend/src/api/system/dynamic.js @@ -3,7 +3,8 @@ import request from '@/utils/request' export function get(url) { return request({ url: url, - method: 'get' + method: 'get', + loading: true }) } diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 9142155081..12cd71c0e2 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -93,6 +93,7 @@ export default { }, filters() { // 必要 勿删勿该 watch数组,哪怕发生变化 oldValue等于newValue ,深拷贝解决 + if (!this.element.filters) return [] return JSON.parse(JSON.stringify(this.element.filters)) }, ...mapState([ diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 8b13f536a2..d977c47a3c 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -663,7 +663,7 @@ export default { radius_mode: 'Radius', area_mode: 'Area', rose_radius: 'Fillet', - view_name: 'Chart Name', + view_name: 'Chart Title', name_can_not_empty: 'Name cannot be empty', template_can_not_empty: 'Please check a Template', custom_count: 'Number of records', @@ -715,7 +715,8 @@ export default { date_split: 'yyyy/MM/dd', chartName: 'New Chart', chart_show_error: 'can not show normal', - chart_error_tips: 'Please contact admin ' + chart_error_tips: 'Please contact admin ', + title_cannot_empty: 'Title can not be empty' }, dataset: { sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', @@ -834,7 +835,11 @@ export default { edit_excel_table: 'Edit Excel Dataset', edit_excel: 'Edit Excel', excel_replace: 'Replace', - excel_add: 'Add' + excel_add: 'Add', + dataset_group: 'Dataset Group', + m1: 'Move ', + m2: ' To', + char_can_not_more_50: 'Dataset name can not more 50' }, datasource: { datasource: 'Data Source', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 038985893b..dac653393d 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -663,7 +663,7 @@ export default { radius_mode: '半徑', area_mode: '面積', rose_radius: '園角', - view_name: '視圖名稱', + view_name: '視圖標題', name_can_not_empty: '名稱不能為空', template_can_not_empty: '请选择仪表板', custom_count: '記錄數', @@ -715,7 +715,8 @@ export default { date_split: 'yyyy/MM/dd', chartName: '新建視圖', chart_show_error: '無法正常顯示', - chart_error_tips: '如有疑問請聯系管理員' + chart_error_tips: '如有疑問請聯系管理員', + title_cannot_empty: '標題不能為空' }, dataset: { sheet_warn: '有多個sheet頁面,默認抽取第一個', @@ -834,7 +835,11 @@ export default { edit_excel_table: '編輯Excel數據集', edit_excel: '編輯Excel', excel_replace: '替換', - excel_add: '追加' + excel_add: '追加', + dataset_group: '數據集分組', + m1: '將 ', + m2: ' 移動到', + char_can_not_more_50: '數據集名稱不能超過50個字符' }, datasource: { datasource: '數據源', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 06e76636ed..7aa86ef99b 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -663,7 +663,7 @@ export default { radius_mode: '半径', area_mode: '面积', rose_radius: '圆角', - view_name: '视图名称', + view_name: '视图标题', name_can_not_empty: '名称不能为空', template_can_not_empty: '请选择仪表版', custom_count: '记录数', @@ -715,7 +715,8 @@ export default { date_split: 'yyyy/MM/dd', chartName: '新建视图', chart_show_error: '无法正常显示', - chart_error_tips: '如有疑问请联系管理员' + chart_error_tips: '如有疑问请联系管理员', + title_cannot_empty: '标题不能为空' }, dataset: { sheet_warn: '有多个 Sheet 页,默认抽取第一个', @@ -834,7 +835,11 @@ export default { edit_excel_table: '编辑Excel数据集', edit_excel: '编辑Excel', excel_replace: '替换', - excel_add: '追加' + excel_add: '追加', + dataset_group: '数据集分组', + m1: '将 ', + m2: ' 移动到', + char_can_not_more_50: '数据集名称不能超过50个字符' }, datasource: { datasource: '数据源', diff --git a/frontend/src/views/chart/components/component-style/TitleSelector.vue b/frontend/src/views/chart/components/component-style/TitleSelector.vue index 67938b87ea..4da0873d01 100644 --- a/frontend/src/views/chart/components/component-style/TitleSelector.vue +++ b/frontend/src/views/chart/components/component-style/TitleSelector.vue @@ -115,6 +115,11 @@ export default { this.fontSize = arr }, changeTitleStyle() { + if (this.titleForm.title.length < 1) { + this.$error(this.$t('chart.title_cannot_empty')) + this.titleForm.title = this.chart.title + return + } if (!this.titleForm.show) { this.isSetting = false } diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 941b077e0f..6a6f96d4e5 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -40,6 +40,8 @@ node-key="id" :expand-on-click-node="true" @node-click="nodeClick" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" > @@ -166,9 +168,9 @@ /> - - {{ $t('chart.rename') }} - + + + {{ $t('chart.delete') }} @@ -491,14 +493,14 @@ export default { this.$store.dispatch('chart/setSceneId', this.currGroup.id) this.chartTree() } - if (node.expanded) { - this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } - } + // if (node.expanded) { + // this.expandedArray.push(data.id) + // } else { + // const index = this.expandedArray.indexOf(data.id) + // if (index > -1) { + // this.expandedArray.splice(index, 1) + // } + // } }, back() { @@ -534,6 +536,7 @@ export default { this.chartData.forEach(function(ele) { if (ele.id === that.$store.state.chart.chartSceneData.id) { ele.type = that.$store.state.chart.chartSceneData.type + ele.name = that.$store.state.chart.chartSceneData.name } }) } @@ -609,6 +612,17 @@ export default { this.currGroup = response.data }) } + }, + + nodeExpand(data) { + if (data.id) { + this.expandedArray.push(data.id) + } + }, + nodeCollapse(data) { + if (data.id) { + this.expandedArray.splice(this.expandedArray.indexOf(data.id), 1) + } } } } diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 29eadf3e26..dc04eaf7fa 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -486,9 +486,9 @@ export default { 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.name = this.view.title ? this.view.title : this.table.name if (view.title.length > 50) { - this.$warning(this.$t('chart.title_limit')) + this.$error(this.$t('chart.title_limit')) return } view.tableId = this.view.tableId @@ -623,7 +623,7 @@ export default { } // 从仪表板入口关闭 bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' }) - this.$emit('switchComponent', { name: '' }) + // this.$emit('switchComponent', { name: '' }) }, getData(id) { if (id) { diff --git a/frontend/src/views/dataset/add/AddCustom.vue b/frontend/src/views/dataset/add/AddCustom.vue index 1d80d54548..c30c3ed23b 100644 --- a/frontend/src/views/dataset/add/AddCustom.vue +++ b/frontend/src/views/dataset/add/AddCustom.vue @@ -192,7 +192,7 @@ export default { if (this.name.length > 50) { this.$message({ showClose: true, - message: this.$t('commons.char_can_not_more_50'), + message: this.$t('dataset.char_can_not_more_50'), type: 'error' }) return diff --git a/frontend/src/views/dataset/add/AddExcel.vue b/frontend/src/views/dataset/add/AddExcel.vue index e5de317cb3..b475fc17fe 100644 --- a/frontend/src/views/dataset/add/AddExcel.vue +++ b/frontend/src/views/dataset/add/AddExcel.vue @@ -171,7 +171,7 @@ export default { if (this.name.length > 50) { this.$message({ showClose: true, - message: this.$t('commons.char_can_not_more_50'), + message: this.$t('dataset.char_can_not_more_50'), type: 'error' }) return diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index 225c7797ce..187d72445a 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -248,7 +248,7 @@ export default { if (this.name.length > 50) { this.$message({ showClose: true, - message: this.$t('commons.char_can_not_more_50'), + message: this.$t('dataset.char_can_not_more_50'), type: 'error' }) return diff --git a/frontend/src/views/dataset/group/DsMoveSelector.vue b/frontend/src/views/dataset/group/DsMoveSelector.vue new file mode 100644 index 0000000000..6300c721a2 --- /dev/null +++ b/frontend/src/views/dataset/group/DsMoveSelector.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index acc8cb2fd4..137bfb2cb0 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -40,6 +40,8 @@ node-key="id" :expand-on-click-node="true" @node-click="nodeClick" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" > @@ -86,9 +88,9 @@ {{ $t('dataset.rename') }} - - - + + {{ $t('dataset.move_to') }} + {{ $t('dataset.delete') }} @@ -207,9 +209,9 @@ {{ $t('dataset.rename') }} - - - + + {{ $t('dataset.move_to') }} + {{ $t('dataset.delete') }} @@ -238,14 +240,37 @@ + + + + + + + + + + + + + + diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 5065e0483d..c6f6963413 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -390,6 +390,7 @@ export default { viewId: componentInfo.id } component.propValue = propValue + component.filters = [] } }) } else {