From e12d76e2ad4970100064b179b61f391e0afecff0 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Tue, 31 Oct 2023 18:46:02 +0800 Subject: [PATCH] =?UTF-8?q?CN-1445=20fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=8D=E5=90=8C=E7=9F=A5=E8=AF=86=E5=BA=93=E7=9A=84?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E5=90=8E=EF=BC=8Cpsiphon3?= =?UTF-8?q?=E7=9A=84=E6=9F=B1=E7=8A=B6=E5=9B=BE=E4=B8=8D=E8=83=BD=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 64f376e22a8250823c903f3d63a67deffdb23c50) --- .../views/setting/knowledgeBase.scss | 3 + .../setting/knowledgeBaseTableForCard.vue | 56 +++++++++++++++---- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/assets/css/components/views/setting/knowledgeBase.scss b/src/assets/css/components/views/setting/knowledgeBase.scss index 34602449..7495e195 100644 --- a/src/assets/css/components/views/setting/knowledgeBase.scss +++ b/src/assets/css/components/views/setting/knowledgeBase.scss @@ -1905,6 +1905,9 @@ &.update-dialog__table--psiphon3 { height: calc(90vh - 190px - 200px - 50px - 10px); } + &.update-dialog__table--system-user { + height: calc(100% - 139px); + } } .update-knowledge-form { .el-upload { diff --git a/src/components/table/setting/knowledgeBaseTableForCard.vue b/src/components/table/setting/knowledgeBaseTableForCard.vue index 61603ce2..e257dd9d 100644 --- a/src/components/table/setting/knowledgeBaseTableForCard.vue +++ b/src/components/table/setting/knowledgeBaseTableForCard.vue @@ -66,7 +66,9 @@
@@ -127,7 +129,7 @@
-
+
@@ -155,7 +161,7 @@ -
+
{{$t('knowledgeBase.psiphon3IpCount')}}
@@ -526,7 +532,9 @@ export default { timeChange () { this.timeFilter.endTime = window.$dayJs.tz().valueOf() this.timeFilter.startTime = this.timeFilter.endTime - this.selectTime * 60 * 1000 - this.init() + if (this.updateKnowledge.source === 'cn_psiphon3_ip') { + this.init() + } this.$nextTick(() => { this.handleActiveBar() }) @@ -536,7 +544,9 @@ export default { this.tabType = item.class } this.legendSelectChange(item) - this.init() + if (this.updateKnowledge.source === 'cn_psiphon3_ip') { + this.init() + } }, mouseenterTab (item) { if (this.isNoDataForPsiphon3) return @@ -578,7 +588,9 @@ export default { this.$message.success(this.$t('tip.success')) this.showAddUpdateDialog = false this.getCurTabData() - this.init() + if (this.updateKnowledge.source === 'cn_psiphon3_ip') { + this.init() + } /* } else { this.$message.error(this.$t('tip.uploadFailed', { msg: response.message })) } */ @@ -613,6 +625,13 @@ export default { data.isSelected = val this.$emit('checkboxStatusChange', val, data) }, + beforeClose (done) { + if (this.myChart) { + this.myChart.dispose() + this.myChart = null + } + done() + }, handleClose () { this.showUpdateDialog = false this.showAddUpdateDialog = false @@ -632,7 +651,9 @@ export default { this.updateKnowledge = data this.showEnable = showEnable await this.getCurTabData() - await this.init() + if (data.source === 'cn_psiphon3_ip') { + await this.init() + } this.showUpdate() this.$nextTick(() => { this.handleActiveBar() @@ -677,6 +698,9 @@ export default { // 切换tab handleClick (tab) { this.getCurTabData() + if (tab.index === '1') { + this.init() + } }, clearSelect () { this.$nextTick(() => { @@ -743,7 +767,9 @@ export default { }, timeFilter: { handler () { - this.init() + if (this.updateKnowledge.source === 'cn_psiphon3_ip') { + this.init() + } this.$nextTick(() => { this.handleActiveBar() }) @@ -772,6 +798,14 @@ export default { } } }, + activeTab (n) { + if (n === 'updateRecord') { + if (this.myChart) { + this.myChart.dispose() + this.myChart = null + } + } + }, showAddUpdateDialog: { handler (n) { if (!n) { @@ -780,8 +814,10 @@ export default { this.init() } } else { - this.myChart && this.myChart.dispose() - this.myChart = null + if (this.myChart) { + this.myChart.dispose() + this.myChart = null + } } } }