From 46f8cd634d1e28cede1cf686b51e6abedef0f944 Mon Sep 17 00:00:00 2001 From: junjun Date: Thu, 23 Jun 2022 10:05:58 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=95=B0=E6=8D=AE=E9=A2=84=E8=A7=88tab?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AE=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dataset/data/CalcFieldEdit.vue | 18 +-- frontend/src/views/dataset/data/FieldEdit.vue | 4 + frontend/src/views/dataset/data/ViewTable.vue | 107 ++++++++++++------ frontend/src/views/dataset/index.vue | 1 + 4 files changed, 89 insertions(+), 41 deletions(-) diff --git a/frontend/src/views/dataset/data/CalcFieldEdit.vue b/frontend/src/views/dataset/data/CalcFieldEdit.vue index 0254e15668..e6728bb188 100644 --- a/frontend/src/views/dataset/data/CalcFieldEdit.vue +++ b/frontend/src/views/dataset/data/CalcFieldEdit.vue @@ -361,12 +361,15 @@ export default { pre[next[from]] = next[to] return pre }, {}) - originName.match(/(?<=\[).+?(?=\])/g).forEach(ele => { - if (name2Auto) { - name2Auto.push(nameIdMap[ele]) - } - name2Id = name2Id.replace(ele, nameIdMap[ele]) - }) + const on = originName.match(/(?<=\[).+?(?=\])/g) + if (on) { + on.forEach(ele => { + if (name2Auto) { + name2Auto.push(nameIdMap[ele]) + } + name2Id = name2Id.replace(ele, nameIdMap[ele]) + }) + } return name2Id }, @@ -382,7 +385,8 @@ export default { this.fieldForm.tableId = this.param.id this.fieldForm.columnIndex = this.tableFields.dimensionList.length + this.tableFields.quotaList.length } - post('/dataset/field/save', {...this.fieldForm, originName: this.setNameIdTrans('name', 'id', originName) }).then(response => { + post('/dataset/field/save', { ...this.fieldForm, originName: this.setNameIdTrans('name', 'id', originName) }).then(response => { + localStorage.setItem('reloadDsData', 'true') this.closeCalcField() }) }, diff --git a/frontend/src/views/dataset/data/FieldEdit.vue b/frontend/src/views/dataset/data/FieldEdit.vue index 7b6703dcd8..29a2fb28ab 100644 --- a/frontend/src/views/dataset/data/FieldEdit.vue +++ b/frontend/src/views/dataset/data/FieldEdit.vue @@ -346,8 +346,10 @@ export default { post('/dataset/field/save', item).then(response => { this.initField() + localStorage.setItem('reloadDsData', 'true') }).catch(res => { this.initField() + localStorage.setItem('reloadDsData', 'true') }) }, @@ -398,6 +400,7 @@ export default { showClose: true }) this.initField() + localStorage.setItem('reloadDsData', 'true') }) }).catch(() => { }) @@ -411,6 +414,7 @@ export default { }).then(() => { this.isSyncField = true post('/dataset/table/syncField/' + this.param.id, null).then(response => { + localStorage.setItem('reloadDsData', 'true') setTimeout(() => { this.isSyncField = false this.initField() diff --git a/frontend/src/views/dataset/data/ViewTable.vue b/frontend/src/views/dataset/data/ViewTable.vue index 5001f9bab2..4810573dcf 100644 --- a/frontend/src/views/dataset/data/ViewTable.vue +++ b/frontend/src/views/dataset/data/ViewTable.vue @@ -14,14 +14,22 @@ @show="showTab" @hide="hideTab" > - + - + - + {{ $t('dataset.edit_excel') }} @@ -45,53 +53,80 @@ - + - + - + - + :label="$t('dataset.join_view')" + name="joinView" + > + - + :label="$t('dataset.update_info')" + name="updateInfo" + > + - - + + - - + +