update 国内标准-收藏
This commit is contained in:
@@ -140,8 +140,8 @@
|
||||
<template v-slot:operation="{text, record}">
|
||||
<!-- 收藏-->
|
||||
<a @click="operationClick(operationList[0],record)" v-has="operationList[0].has">
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag === yesValue" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag || record.collectionFlag === noValue" />
|
||||
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
|
||||
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||
</a>
|
||||
<a-divider type="vertical" />
|
||||
<a-dropdown placement="bottomCenter">
|
||||
@@ -191,7 +191,9 @@ import {
|
||||
getDomesticStandardTableHeader,
|
||||
getDomesticStandardTree,
|
||||
removeDomesticStandard,
|
||||
shareDomesticStandard
|
||||
shareDomesticStandard,
|
||||
collectionDomesticStandard,
|
||||
cancelCollectionDomesticStandard
|
||||
} from '../../../api/standardRegulationLibraryApi'
|
||||
import { StandardSystemTreeNodeType, TagsTypeEnums, YesOrNoEnum } from '../../../enums/commonEnums'
|
||||
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
||||
@@ -330,20 +332,37 @@ export default {
|
||||
* 收藏/取消收藏
|
||||
* @param record
|
||||
*/
|
||||
handleCollection ({ collectionFlag }) {
|
||||
if (collectionFlag === this.yesValue) {
|
||||
this.dataSource[0].collectionFlag = this.noValue
|
||||
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
|
||||
let params
|
||||
let submitFunc
|
||||
// 取消收藏
|
||||
if (collectionFlag) {
|
||||
params = { id: standardId, standardNumber }
|
||||
submitFunc = cancelCollectionDomesticStandard
|
||||
} else {
|
||||
this.dataSource[0].collectionFlag = this.yesValue
|
||||
params = { standardId, standardNumber }
|
||||
submitFunc = collectionDomesticStandard
|
||||
}
|
||||
// 收藏
|
||||
this.loading = true
|
||||
submitFunc(params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.loadData(1)
|
||||
} else {
|
||||
this.$message.warn(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 分享
|
||||
*/
|
||||
handleShare ({ id, standard_number }) {
|
||||
handleShare ({ id, standard_number: standardNum }) {
|
||||
this.nowShareInfo = {
|
||||
standardId: id,
|
||||
standardNum: standard_number
|
||||
standardNum
|
||||
}
|
||||
this.$refs.userSelectModal.open()
|
||||
},
|
||||
|
||||
+1
@@ -55,6 +55,7 @@ export default {
|
||||
this.edit(parentInfo)
|
||||
},
|
||||
edit (record) {
|
||||
this.form.resetFields()
|
||||
this.model = Object.assign({}, record)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user