From 99d4a453bbe53a8ee6cf1b94399c1a50585765b3 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Thu, 14 Sep 2023 17:23:05 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=A8=A1=E5=9D=97=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/personCenter.js | 6 +- .../browsingHistory/BrowsingHistory.vue | 61 ++++++++----------- .../myCollection/MyCollection.vue | 32 ++++------ .../receivedShare/ReceivedShare.vue | 18 +++--- .../personalCenter/sentShare/SentShare.vue | 18 +++--- 5 files changed, 60 insertions(+), 75 deletions(-) diff --git a/src/api/personCenter.js b/src/api/personCenter.js index bb93be81..bb788a50 100644 --- a/src/api/personCenter.js +++ b/src/api/personCenter.js @@ -1,10 +1,10 @@ -import { getAction } from './manage' +import { postAction } from './manage' // 我的收藏-取消收藏 -const cancelCollect = (params) => getAction('', params) +const cancelCollect = (params) => postAction('/personal/lawsStandardCollection/delete', params) // 浏览记录-清除浏览记录 -const clearBrowsingHistory = (params) => getAction('', params) +const clearBrowsingHistory = (params) => postAction('/personal/lawsBrowsingHistory/delete', params) export { cancelCollect, diff --git a/src/views/personalCenter/browsingHistory/BrowsingHistory.vue b/src/views/personalCenter/browsingHistory/BrowsingHistory.vue index 95900b9e..31202359 100644 --- a/src/views/personalCenter/browsingHistory/BrowsingHistory.vue +++ b/src/views/personalCenter/browsingHistory/BrowsingHistory.vue @@ -66,14 +66,14 @@ export default { title: this.$t('personalCenter.browsingHistory.standardNo'), align: 'center', width: 180, - dataIndex: 'owningPlate', + dataIndex: 'standardNum', scopedSlots: { customRender: 'toDetail' } }, { title: this.$t('personalCenter.browsingHistory.standardName'), align: 'center', width: 180, - dataIndex: 'title', + dataIndex: 'standardName', scopedSlots: { customRender: 'toDetail' } }, { @@ -84,8 +84,8 @@ export default { } ], url: { - list: '', - deleteBatch: '' + list: '/personal/lawsBrowsingHistory/page', + deleteBatch: '/personal/lawsBrowsingHistory/deleteBatch' } } }, @@ -94,47 +94,40 @@ export default { handleGoDetail (record) { let path = '' // 需要先判断是哪种标准 - if (record.type === 3) { + if (record.standardType === '1') { + path = '/standardRegulationLibrary/DomesticStandardDetail' + } else if (record.standardType === '2') { + path = '/standardRegulationLibrary/OverseasStandardDetail' + } else if (record.standardType === '3') { path = '/enterpriseStandardLibrary/enterpriseStandardDetail' } this.$openPageNewSheet({ path: path, query: { - id: record.id + id: record.standardId } }) }, // 清除浏览记录 clearBrowsingHistory () { - if (this.selectedRowKeys.length <= 0) { - this.$message.warning(this.$t('selectARecord')) - } else { - let ids = '' - for (let a = 0; a < this.selectedRowKeys.length; a++) { - ids += this.selectedRowKeys[a] + ',' + this.$confirm({ + title: this.$t('personalCenter.browsingHistory.clearBrowsingHistory'), + content: this.$t('personalCenter.browsingHistory.confirmClearBrowsingHistory'), + onOk: () => { + this.loading = true + clearBrowsingHistory().then((res) => { + if (res.success) { + this.$message.success(res.message) + this.loadData() + this.onClearSelected() + } else { + this.$message.warning(res.message) + } + }).finally(() => { + this.loading = false + }) } - const that = this - this.$confirm({ - title: this.$t('personCenter.browsingHistory.clearBrowsingHistory'), - content: this.$t('personCenter.browsingHistory.confirmClearBrowsingHistory'), - onOk: function () { - that.loading = true - clearBrowsingHistory({ ids: ids }).then((res) => { - if (res.success) { - // 重新计算分页问题 - that.reCalculatePage(that.selectedRowKeys.length) - that.$message.success(res.message) - that.loadData() - that.onClearSelected() - } else { - that.$message.warning(res.message) - } - }).finally(() => { - that.loading = false - }) - } - }) - } + }) } } } diff --git a/src/views/personalCenter/myCollection/MyCollection.vue b/src/views/personalCenter/myCollection/MyCollection.vue index c9ab18d3..de0e7391 100644 --- a/src/views/personalCenter/myCollection/MyCollection.vue +++ b/src/views/personalCenter/myCollection/MyCollection.vue @@ -5,30 +5,18 @@