update 国内标准-收藏连点问题

This commit is contained in:
赵霄
2023-09-19 18:07:13 +08:00
parent 2eafb3a179
commit 91ebefb762
@@ -258,7 +258,8 @@ export default {
selectedTreeKeys: [], // 选中的树节点key selectedTreeKeys: [], // 选中的树节点key
selectedTreeNodeCodes: [], // 选中树节点的code selectedTreeNodeCodes: [], // 选中树节点的code
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段 tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
treeLoading: false treeLoading: false,
isCollection: false
} }
}, },
computed: { computed: {
@@ -335,6 +336,10 @@ export default {
* @param record * @param record
*/ */
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) { handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
if (this.isCollection) {
return
}
this.isCollection = true
let params let params
let submitFunc let submitFunc
// 取消收藏 // 取消收藏
@@ -346,16 +351,15 @@ export default {
submitFunc = collectionDomesticStandard submitFunc = collectionDomesticStandard
} }
// 收藏 // 收藏
this.loading = true
submitFunc(params).then(res => { submitFunc(params).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.loadData(1) this.loadData()
} else { } else {
this.$message.warn(res.message) this.$message.warn(res.message)
} }
}).finally(() => { }).finally(() => {
this.loading = false this.isCollection = false
}) })
}, },
/** /**