update 国内标准-收藏
This commit is contained in:
@@ -10,6 +10,8 @@ const getDomesticStandardDocumentInfo = (params) => getAction('/laws/standard/do
|
|||||||
const getDomesticStandardTableHeader = (params) => getAction('/laws/standard/domestic/getCommonHeader', params)
|
const getDomesticStandardTableHeader = (params) => getAction('/laws/standard/domestic/getCommonHeader', params)
|
||||||
// 国内标准法规-收藏
|
// 国内标准法规-收藏
|
||||||
const collectionDomesticStandard = (params) => postAction('/personal/lawsStandardCollection/domestic/add', params)
|
const collectionDomesticStandard = (params) => postAction('/personal/lawsStandardCollection/domestic/add', params)
|
||||||
|
// 国内标准法规-取消收藏
|
||||||
|
const cancelCollectionDomesticStandard = (params) => postAction('/personal/lawsStandardCollection/domestic/delete', params)
|
||||||
// 国内标准法规-分享
|
// 国内标准法规-分享
|
||||||
const shareDomesticStandard = (params) => postAction('/personal/lawsStandardSharing/domestic/add', params)
|
const shareDomesticStandard = (params) => postAction('/personal/lawsStandardSharing/domestic/add', params)
|
||||||
// 国内标准-体系新增
|
// 国内标准-体系新增
|
||||||
@@ -41,6 +43,7 @@ export {
|
|||||||
getDomesticStandardDocumentInfo,
|
getDomesticStandardDocumentInfo,
|
||||||
getDomesticStandardTableHeader,
|
getDomesticStandardTableHeader,
|
||||||
collectionDomesticStandard,
|
collectionDomesticStandard,
|
||||||
|
cancelCollectionDomesticStandard,
|
||||||
shareDomesticStandard,
|
shareDomesticStandard,
|
||||||
addDomesticSystemTree,
|
addDomesticSystemTree,
|
||||||
editDomesticSystemTree,
|
editDomesticSystemTree,
|
||||||
|
|||||||
@@ -140,8 +140,8 @@
|
|||||||
<template v-slot:operation="{text, record}">
|
<template v-slot:operation="{text, record}">
|
||||||
<!-- 收藏-->
|
<!-- 收藏-->
|
||||||
<a @click="operationClick(operationList[0],record)" v-has="operationList[0].has">
|
<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-star1" v-show="record.collectionFlag" />
|
||||||
<i class="iconfont icon-star" v-show="!record.collectionFlag || record.collectionFlag === noValue" />
|
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
|
||||||
</a>
|
</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-dropdown placement="bottomCenter">
|
<a-dropdown placement="bottomCenter">
|
||||||
@@ -191,7 +191,9 @@ import {
|
|||||||
getDomesticStandardTableHeader,
|
getDomesticStandardTableHeader,
|
||||||
getDomesticStandardTree,
|
getDomesticStandardTree,
|
||||||
removeDomesticStandard,
|
removeDomesticStandard,
|
||||||
shareDomesticStandard
|
shareDomesticStandard,
|
||||||
|
collectionDomesticStandard,
|
||||||
|
cancelCollectionDomesticStandard
|
||||||
} from '../../../api/standardRegulationLibraryApi'
|
} from '../../../api/standardRegulationLibraryApi'
|
||||||
import { StandardSystemTreeNodeType, TagsTypeEnums, YesOrNoEnum } from '../../../enums/commonEnums'
|
import { StandardSystemTreeNodeType, TagsTypeEnums, YesOrNoEnum } from '../../../enums/commonEnums'
|
||||||
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
|
||||||
@@ -330,20 +332,37 @@ export default {
|
|||||||
* 收藏/取消收藏
|
* 收藏/取消收藏
|
||||||
* @param record
|
* @param record
|
||||||
*/
|
*/
|
||||||
handleCollection ({ collectionFlag }) {
|
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
|
||||||
if (collectionFlag === this.yesValue) {
|
let params
|
||||||
this.dataSource[0].collectionFlag = this.noValue
|
let submitFunc
|
||||||
|
// 取消收藏
|
||||||
|
if (collectionFlag) {
|
||||||
|
params = { id: standardId, standardNumber }
|
||||||
|
submitFunc = cancelCollectionDomesticStandard
|
||||||
} else {
|
} 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 = {
|
this.nowShareInfo = {
|
||||||
standardId: id,
|
standardId: id,
|
||||||
standardNum: standard_number
|
standardNum
|
||||||
}
|
}
|
||||||
this.$refs.userSelectModal.open()
|
this.$refs.userSelectModal.open()
|
||||||
},
|
},
|
||||||
|
|||||||
+1
@@ -55,6 +55,7 @@ export default {
|
|||||||
this.edit(parentInfo)
|
this.edit(parentInfo)
|
||||||
},
|
},
|
||||||
edit (record) {
|
edit (record) {
|
||||||
|
this.form.resetFields()
|
||||||
this.model = Object.assign({}, record)
|
this.model = Object.assign({}, record)
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user