From 673bec292f0d879ef27631d508b525dd2b79d678 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:53:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=A0=8F=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=20sql?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86table=E9=A2=84=E8=A7=88=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E6=98=BE=E7=A4=BA=20=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20=E5=88=9B=E5=BB=BA=E6=95=B0=E6=8D=AE=E9=9B=86=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E9=94=AE=E5=85=A5=E5=8F=97=E9=99=90#3392?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/dataset/add/AddApi.vue | 54 +++++-------- frontend/src/views/dataset/add/AddDB.vue | 55 ++++++------- frontend/src/views/dataset/add/AddSQL.vue | 2 +- .../src/views/panel/GrantAuth/shareTree.vue | 4 +- .../views/system/sysParam/BasicSetting.vue | 3 +- .../views/system/sysParam/EmailSetting.vue | 79 +++++-------------- .../views/system/sysParam/KettleSetting.vue | 22 +----- .../sysParam/MapSetting/MapSettingLeft.vue | 28 +++---- .../sysParam/MapSetting/MapSettingRight.vue | 18 ++--- .../system/sysParam/MapSetting/index.vue | 11 ++- .../system/sysParam/SimpleModeSetting.vue | 6 -- frontend/src/views/system/sysParam/index.vue | 18 ++--- .../src/views/system/task/DatasetTaskList.vue | 31 +------- frontend/src/views/system/task/Form.vue | 37 +++------ frontend/src/views/system/task/index.vue | 8 -- frontend/src/views/system/task/options.js | 35 +++++++- .../src/views/system/user/PrivateForm.vue | 1 - 17 files changed, 140 insertions(+), 272 deletions(-) diff --git a/frontend/src/views/dataset/add/AddApi.vue b/frontend/src/views/dataset/add/AddApi.vue index c0171cd5aa..e58af02b67 100644 --- a/frontend/src/views/dataset/add/AddApi.vue +++ b/frontend/src/views/dataset/add/AddApi.vue @@ -153,14 +153,13 @@
{{ $t('dataset.name') }}
@@ -257,15 +256,13 @@ export default { avilibelTable: false, noAvilibelTableImg: require('@/assets/None.png'), noSelectTable: require('@/assets/None_Select_ds.png'), + activeTable: {}, activeName: '' } }, computed: { - activeIndex() { - return this.tableData.findIndex((ele) => ele.name === this.activeName) - }, checkDatasetName() { - return this.tableData + return this.tables .filter((ele, index) => { return this.checkTableList.includes(ele.name) }) @@ -285,11 +282,11 @@ export default { const dsName = this.options.find((ele) => ele.id === val).name post('/datasource/getTables/' + val, {}).then((response) => { this.tables = response.data - this.tableData = JSON.parse(JSON.stringify(this.tables)) - this.tableData.forEach((ele) => { + this.tables.forEach((ele) => { this.$set(ele, 'datasetName', dsName + '_' + ele.name) this.$set(ele, 'nameExsit', false) }) + this.tableData = [...this.tables] this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck) }).finally(() => { this.dsLoading = false @@ -302,18 +299,15 @@ export default { } }, searchTable(val) { + this.activeName = '' if (val && val !== '') { - this.tableData = JSON.parse( - JSON.stringify( - this.tables.filter((ele) => { - return ele.name - .toLocaleLowerCase() - .includes(val.toLocaleLowerCase()) - }) - ) - ) + this.tableData = [...this.tables.filter((ele) => { + return ele.name + .toLocaleLowerCase() + .includes(val.toLocaleLowerCase()) + })] } else { - this.tableData = JSON.parse(JSON.stringify(this.tables)) + this.tableData = [...this.tables] } } }, @@ -355,17 +349,17 @@ export default { } this.LeftWidth = e.pageX }, - nameExsitValidator(activeIndex) { - this.tableData[activeIndex].nameExsit = + nameExsitValidator(ele) { + ele.nameExsit = this.nameList .concat(this.checkDatasetName) - .filter((name) => name === this.tableData[activeIndex].datasetName) + .filter((name) => name === ele.datasetName) .length > 1 }, validateName() { - this.tableData.forEach((ele, index) => { - if (this.checkDatasetName.includes(ele.datasetName)) { - this.nameExsitValidator(index) + this.tables.forEach((ele, index) => { + if (this.checkTableList.includes(ele.name)) { + this.nameExsitValidator(ele) } else { ele.nameExsit = false } @@ -381,6 +375,7 @@ export default { setActiveName({ name, datasourceId, enableCheck }) { if (!enableCheck) return this.activeName = name + this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {} this.dbPreview({ dataSourceId: datasourceId, info: JSON.stringify({ table: name }) @@ -428,7 +423,7 @@ export default { const mode = this.mode const syncType = this.syncType this.checkTableList.forEach((name) => { - const datasetName = this.tableData.find( + const datasetName = this.tables.find( (ele) => ele.name === name ).datasetName tables.push({ @@ -449,13 +444,6 @@ export default { .finally(() => { this.loading = false }) - }, - dataReset() { - this.searchTable = '' - this.options = [] - this.dataSource = '' - this.tables = [] - this.checkTableList = [] } } } diff --git a/frontend/src/views/dataset/add/AddDB.vue b/frontend/src/views/dataset/add/AddDB.vue index 8cbf9458c0..1702e67cfe 100644 --- a/frontend/src/views/dataset/add/AddDB.vue +++ b/frontend/src/views/dataset/add/AddDB.vue @@ -160,14 +160,13 @@
{{ $t('dataset.name') }}
@@ -263,15 +262,13 @@ export default { avilibelTable: false, noAvilibelTableImg: require('@/assets/None.png'), noSelectTable: require('@/assets/None_Select_ds.png'), + activeTable: {}, activeName: '' } }, computed: { - activeIndex() { - return this.tableData.findIndex((ele) => ele.name === this.activeName) - }, checkDatasetName() { - return this.tableData + return this.tables .filter((ele, index) => { return this.checkTableList.includes(ele.name) }) @@ -288,14 +285,15 @@ export default { this.dsLoading = true this.checkTableList = [] this.activeName = '' + this.activeTable = {} const dsName = this.options.find((ele) => ele.id === val).name post('/datasource/getTables/' + val, {}).then((response) => { this.tables = response.data - this.tableData = JSON.parse(JSON.stringify(this.tables)) - this.tableData.forEach((ele) => { + this.tables.forEach((ele) => { this.$set(ele, 'datasetName', dsName + '_' + ele.name) this.$set(ele, 'nameExsit', false) }) + this.tableData = [...this.tables] this.avilibelTable = !this.tableData.some((ele) => ele.enableCheck) }).finally(() => { this.dsLoading = false @@ -318,18 +316,15 @@ export default { } }, searchTable(val) { + this.activeName = '' if (val && val !== '') { - this.tableData = JSON.parse( - JSON.stringify( - this.tables.filter((ele) => { - return ele.name - .toLocaleLowerCase() - .includes(val.toLocaleLowerCase()) - }) - ) - ) + this.tableData = [...this.tables.filter((ele) => { + return ele.name + .toLocaleLowerCase() + .includes(val.toLocaleLowerCase()) + })] } else { - this.tableData = JSON.parse(JSON.stringify(this.tables)) + this.tableData = [...this.tables] } } }, @@ -371,17 +366,17 @@ export default { } this.LeftWidth = e.pageX }, - nameExsitValidator(activeIndex) { - this.tableData[activeIndex].nameExsit = + nameExsitValidator(ele) { + ele.nameExsit = this.nameList .concat(this.checkDatasetName) - .filter((name) => name === this.tableData[activeIndex].datasetName) + .filter((name) => name === ele.datasetName) .length > 1 }, validateName() { - this.tableData.forEach((ele, index) => { - if (this.checkDatasetName.includes(ele.datasetName)) { - this.nameExsitValidator(index) + this.tables.forEach((ele, index) => { + if (this.checkTableList.includes(ele.name)) { + this.nameExsitValidator(ele) } else { ele.nameExsit = false } @@ -410,6 +405,7 @@ export default { setActiveName({ name, datasourceId, enableCheck }) { if (!enableCheck) return this.activeName = name + this.activeTable = this.tableData.find((ele) => ele.name === this.activeName) || {} this.dbPreview({ dataSourceId: datasourceId, info: JSON.stringify({ table: name }) @@ -444,7 +440,7 @@ export default { const mode = this.mode const syncType = this.syncType this.checkTableList.forEach((name) => { - const datasetName = this.tableData.find( + const datasetName = this.tables.find( (ele) => ele.name === name ).datasetName tables.push({ @@ -465,13 +461,6 @@ export default { .finally(() => { this.loading = false }) - }, - dataReset() { - this.searchTable = '' - this.options = [] - this.dataSource = '' - this.tables = [] - this.checkTableList = [] } } } diff --git a/frontend/src/views/dataset/add/AddSQL.vue b/frontend/src/views/dataset/add/AddSQL.vue index b349980f0b..0686cd2223 100644 --- a/frontend/src/views/dataset/add/AddSQL.vue +++ b/frontend/src/views/dataset/add/AddSQL.vue @@ -479,7 +479,7 @@ export default { errMsgCont: '', options: [], sql: '', - dataReference: false, + dataReference: true, sqlOption: { tabSize: 2, styleActiveLine: true, diff --git a/frontend/src/views/panel/GrantAuth/shareTree.vue b/frontend/src/views/panel/GrantAuth/shareTree.vue index 1b07cc713d..07d8273f57 100644 --- a/frontend/src/views/panel/GrantAuth/shareTree.vue +++ b/frontend/src/views/panel/GrantAuth/shareTree.vue @@ -1,6 +1,6 @@