From ae01a27733a4d30b448c853caa5a350e280a987c Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Mon, 18 Sep 2023 16:27:21 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E8=81=94=E8=B0=83=E4=BC=81=E6=A0=87?= =?UTF-8?q?=E6=94=B6=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/enterpriseStandardLibraryApi.js | 5 ++- src/components/jero/JDate.vue | 2 +- .../standard/EnterpriseStandardList.vue | 35 ++++++++++++++----- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/api/enterpriseStandardLibraryApi.js b/src/api/enterpriseStandardLibraryApi.js index 4a59d9cd..69ec76dd 100644 --- a/src/api/enterpriseStandardLibraryApi.js +++ b/src/api/enterpriseStandardLibraryApi.js @@ -21,7 +21,9 @@ const initChange = (params) => getAction('', params) // 临时权限设置 const temporaryPermissionSet = (params) => postAction('/laws/standard/enterprise/tempPermission', params) // 收藏企标 -const collectStandard = (params) => getAction('', params) +const collectStandard = (params) => postAction('/personal/lawsStandardCollection/enterprise/add', params) +// 取消收藏企标 +const cancelCollectStandard = (params) => postAction('/personal/lawsStandardCollection/enterprise/delete', params) // 分享企标 const shareStandard = (params) => getAction('', params) @@ -55,6 +57,7 @@ export { initChange, temporaryPermissionSet, collectStandard, + cancelCollectStandard, shareStandard, setQualityStandard, diff --git a/src/components/jero/JDate.vue b/src/components/jero/JDate.vue index 752cba21..764d8de4 100644 --- a/src/components/jero/JDate.vue +++ b/src/components/jero/JDate.vue @@ -169,6 +169,6 @@ export default { diff --git a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue index 25a59d4f..36697641 100644 --- a/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue +++ b/src/views/enterpriseStandardLibrary/standard/EnterpriseStandardList.vue @@ -161,6 +161,7 @@ import { shiftStandard, initChange, collectStandard, + cancelCollectStandard, shareStandard, deleteTreeNode } from '@api/enterpriseStandardLibraryApi' @@ -415,15 +416,31 @@ export default { }, // 收藏 handleCollection (record) { - const params = {} - params.id = record.id - collectStandard(params).then(res => { - if (res.success) { - this.$message.success(res.message) - } else { - this.$message.warning(res.message) - } - }) + if (record.collectionFlag) { + const params = {} + params.id = record.id + // 说明已收藏,调取消收藏接口 + cancelCollectStandard(params).then(res => { + if (res.success) { + this.$message.success(res.message) + this.loadData() + } else { + this.$message.warning(res.message) + } + }) + } else { + const params = {} + params.standardId = record.id + params.standardNumber = record.standard_no + collectStandard(params).then(res => { + if (res.success) { + this.$message.success(res.message) + this.loadData() + } else { + this.$message.warning(res.message) + } + }) + } }, // 分享 handleShare (record) {