[update] 修改UAT问题:外来标准详情页可以收藏和取消收藏
This commit is contained in:
+51
-1
@@ -8,6 +8,13 @@
|
|||||||
<div class="detail-page-part">
|
<div class="detail-page-part">
|
||||||
<div class="detail-page-part-title">
|
<div class="detail-page-part-title">
|
||||||
<span>{{ $t('dataInfo') }}</span>
|
<span>{{ $t('dataInfo') }}</span>
|
||||||
|
<div class="detail-page-part-title-operate-box">
|
||||||
|
<!-- 收藏 -->
|
||||||
|
<a-button type="link" @click="handleCollection" v-has="'domesticStandard:collection'">
|
||||||
|
<i class="iconfont icon-star1" v-show="detailData.collectionFlag" />
|
||||||
|
<i class="iconfont icon-star" v-show="!detailData.collectionFlag" />
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail-page-part-form">
|
<div class="detail-page-part-form">
|
||||||
<div class="detail-page-part-form-item">
|
<div class="detail-page-part-form-item">
|
||||||
@@ -170,6 +177,10 @@ import { downloadFile, getFileAccessHttpUrl } from '../../../../api/manage'
|
|||||||
import { previewPdf } from '../../../../utils/previewPdf'
|
import { previewPdf } from '../../../../utils/previewPdf'
|
||||||
import { kkFilePreview } from '../../../../utils/kkFilePreview'
|
import { kkFilePreview } from '../../../../utils/kkFilePreview'
|
||||||
import { queryStandardInfoByStandardNumber } from '../../../../utils/util'
|
import { queryStandardInfoByStandardNumber } from '../../../../utils/util'
|
||||||
|
import {
|
||||||
|
cancelCollectionForeignStandard,
|
||||||
|
collectionForeignStandard
|
||||||
|
} from '../../../../api/standardRegulationLibraryApi'
|
||||||
|
|
||||||
// 外来标准法规权限
|
// 外来标准法规权限
|
||||||
const ForeignStandardPermission = {
|
const ForeignStandardPermission = {
|
||||||
@@ -196,6 +207,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
DisplayAreaManagement,
|
DisplayAreaManagement,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
collectionFlag: false,
|
||||||
partList: [], // 页面模块列表
|
partList: [], // 页面模块列表
|
||||||
form: {}, // 页面字段
|
form: {}, // 页面字段
|
||||||
// 页面数据
|
// 页面数据
|
||||||
@@ -454,7 +466,38 @@ export default {
|
|||||||
this.$openPageNewSheet({
|
this.$openPageNewSheet({
|
||||||
path, query
|
path, query
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
/**
|
||||||
|
* 收藏/取消收藏
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
handleCollection () {
|
||||||
|
if (this.collectionFlag || this.loading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.collectionFlag = true
|
||||||
|
let params
|
||||||
|
let submitFunc
|
||||||
|
// 取消收藏
|
||||||
|
if (this.detailData.collectionFlag) {
|
||||||
|
params = { id: this.detailData.id, standardNumber: this.detailData.standard_number }
|
||||||
|
submitFunc = cancelCollectionForeignStandard
|
||||||
|
} else {
|
||||||
|
params = { standardId: this.detailData.id, standardNumber: this.detailData.standard_number }
|
||||||
|
submitFunc = collectionForeignStandard
|
||||||
|
}
|
||||||
|
// 收藏
|
||||||
|
submitFunc(params).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.initDetailData()
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.collectionFlag = false
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -502,4 +545,11 @@ export default {
|
|||||||
.title-red-span {
|
.title-red-span {
|
||||||
color: #D52C26;
|
color: #D52C26;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//.icon-star1 {
|
||||||
|
// color: rgba(243, 129, 65);
|
||||||
|
//}
|
||||||
|
//.icon-star {
|
||||||
|
// color: rgba(243, 129, 65, 0.50);
|
||||||
|
//}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user