update 标签管理可配模块数据字典字段处理

This commit is contained in:
赵霄
2023-09-14 16:37:55 +08:00
parent da909e3f41
commit 9de2b8074f
5 changed files with 50 additions and 25 deletions
+3
View File
@@ -34,6 +34,8 @@ const editDomesticStandard = (params) => postAction('/laws/standard/domestic/com
const getDomesticStandardNoSystem = (params) => getAction('/laws/standard/common/getStandardRightBox', params) const getDomesticStandardNoSystem = (params) => getAction('/laws/standard/common/getStandardRightBox', params)
// 国内标准-获取详情信息 // 国内标准-获取详情信息
const getDomesticStandardDetail = (params) => getAction('/laws/standard/domestic/getByIdAndModule', params) const getDomesticStandardDetail = (params) => getAction('/laws/standard/domestic/getByIdAndModule', params)
// 国内标准-获取更新记录
const getDomesticStandardUpdateRecord = (params) => getAction('/laws/standard/domestic/getUpdateRecordList', params)
// 海外标准-获取查询条件 // 海外标准-获取查询条件
const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params) const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params)
@@ -63,6 +65,7 @@ export {
editDomesticStandard, editDomesticStandard,
getDomesticStandardNoSystem, getDomesticStandardNoSystem,
getDomesticStandardDetail, getDomesticStandardDetail,
getDomesticStandardUpdateRecord,
// 海外标准 // 海外标准
getOverseasStandardSearchForm, getOverseasStandardSearchForm,
+11 -7
View File
@@ -6,9 +6,13 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import store from '@/store' import store from '@/store'
import { isHasPermission } from '../utils/hasPermission.js' import { isHasPermission } from '../utils/hasPermission.js'
import { FieldType } from '../enums/commonEnums.js'
let importModalLoading let importModalLoading
// 需要数据字段翻译的属性类型
const NEED_DICT_FIELD_TYPE = [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value]
export const ConfigurableTableMixin = { export const ConfigurableTableMixin = {
data () { data () {
return { return {
@@ -96,6 +100,7 @@ export const ConfigurableTableMixin = {
this.getTableHeaderFunc(params).then(res => { this.getTableHeaderFunc(params).then(res => {
if (res.success) { if (res.success) {
this.columns = this.dealColumns(res.result || []) this.columns = this.dealColumns(res.result || [])
console.log(this.columns)
this.isTrue = false this.isTrue = false
this.$nextTick(() => { this.$nextTick(() => {
this.isTrue = true this.isTrue = true
@@ -112,12 +117,7 @@ export const ConfigurableTableMixin = {
const tempColumns = [] const tempColumns = []
columns.forEach(item => { columns.forEach(item => {
// 可点击项加入插槽 // 可点击项加入插槽
// 标准编号和标准名称可以跳转详情页 if (item.urlClick === 'true') {
if (item.dbFieldName === 'standard_number' || item.dbFieldName === 'standard_name') {
item.scopedSlots = {
customRender: 'detailClick'
}
} else if (item.urlClick === 'true') {
item.scopedSlots = { item.scopedSlots = {
customRender: 'urlClick' customRender: 'urlClick'
} }
@@ -126,7 +126,11 @@ export const ConfigurableTableMixin = {
item.sorter = item.sortFlag === 1 item.sorter = item.sortFlag === 1
item.width = 215 item.width = 215
item.title = item.dbFieldTxt item.title = item.dbFieldTxt
item.dataIndex = item.dbFieldName if (NEED_DICT_FIELD_TYPE.includes(item.fieldShowType)) {
item.dataIndex = item.dbFieldName + '_dictText'
} else {
item.dataIndex = item.dbFieldName
}
// 在各自页面写此页面需要使用插槽的字段 // 在各自页面写此页面需要使用插槽的字段
if (this.tableSlotField && this.tableSlotField.includes(item.dbFieldName)) { if (this.tableSlotField && this.tableSlotField.includes(item.dbFieldName)) {
item.scopedSlots = { item.scopedSlots = {
@@ -26,7 +26,7 @@
<div class="detail-page-part-form" v-if="index !== 3"> <div class="detail-page-part-form" v-if="index !== 3">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id"> <div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label> <label>{{ formItem.dbFieldTxt }}</label>
<span>{{ detailData[formItem.dbFieldName] }}</span> <span>{{ detailData[needDictFieldList.includes(formItem.fieldShowType) ? formItem.dbFieldName + '_dictText' : formItem.dbFieldName] }}</span>
</div> </div>
</div> </div>
<!-- 过程稿件特殊处理--> <!-- 过程稿件特殊处理-->
@@ -60,7 +60,7 @@
</a-spin> </a-spin>
<!-- 更新记录--> <!-- 更新记录-->
<upload-record-modal ref="uploadRecordModal" /> <update-record-modal ref="uploadRecordModal" />
<!-- 提交问题--> <!-- 提交问题-->
<submit-question-modal ref="submitQuestionModal" /> <submit-question-modal ref="submitQuestionModal" />
<!-- 分享选人--> <!-- 分享选人-->
@@ -72,9 +72,9 @@
<script> <script>
import '@assets/less/common.less' import '@assets/less/common.less'
import { TagsTypeEnums } from '../../../enums/commonEnums' import { FieldType, TagsTypeEnums } from '../../../enums/commonEnums'
import { getDomesticStandardFormModal, shareDomesticStandard, getDomesticStandardDetail } from '../../../api/standardRegulationLibraryApi' import { getDomesticStandardFormModal, shareDomesticStandard, getDomesticStandardDetail } from '../../../api/standardRegulationLibraryApi'
import UploadRecordModal from './modules/UploadRecordModal.vue' import UpdateRecordModal from './modules/UpdateRecordModal.vue'
import SubmitQuestionModal from './modules/SubmitQuestionModal.vue' import SubmitQuestionModal from './modules/SubmitQuestionModal.vue'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue' import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal.vue' import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal.vue'
@@ -97,7 +97,7 @@ const DomesticApi = {
export default { export default {
name: 'StandardDetailPage', name: 'StandardDetailPage',
components: { UploadRecordModal, SubmitQuestionModal, UserSelectModal, StandardResolutionSheetModal }, components: { UpdateRecordModal, SubmitQuestionModal, UserSelectModal, StandardResolutionSheetModal },
data () { data () {
return { return {
loading: false, loading: false,
@@ -115,7 +115,9 @@ export default {
draft_for_comment: [], draft_for_comment: [],
// 草案 // 草案
draft: [] draft: []
} },
// 需要数据字段翻译的属性类型
needDictFieldList: [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.STANDARD_MORE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value]
} }
}, },
computed: { computed: {
@@ -185,7 +187,7 @@ export default {
* 更新记录 * 更新记录
*/ */
handleOpenUpdateRecord () { handleOpenUpdateRecord () {
this.$refs.uploadRecordModal.open() this.$refs.uploadRecordModal.open(this.$route.query.standardNumber)
}, },
/** /**
* 提交问题 * 提交问题
@@ -7,9 +7,11 @@
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
@cancel="handleCancel"> @cancel="handleCancel">
<div class="record-item" v-for="record in recordList" :key="record"> <a-spin :spinning="confirmLoading">
{{ record }} <div class="record-item" v-for="record in recordList" :key="record.id">
</div> {{ record.content }}
</div>
</a-spin>
<template v-slot:footer> <template v-slot:footer>
<a-button @click="handleCancel">{{ $t('close') }}</a-button> <a-button @click="handleCancel">{{ $t('close') }}</a-button>
@@ -18,22 +20,34 @@
</template> </template>
<script> <script>
import { getDomesticStandardUpdateRecord } from '../../../../api/standardRegulationLibraryApi.js'
export default { export default {
name: 'UploadRecordModal', name: 'UpdateRecordModal',
data () { data () {
return { return {
width: 800, width: 800,
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
recordList: [ recordList: []
'111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111',
'222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
]
} }
}, },
methods: { methods: {
open () { open (standardNumber) {
this.visible = true this.visible = true
this.initRecord(standardNumber)
},
initRecord (standardNumber) {
this.confirmLoading = true
getDomesticStandardUpdateRecord({standardNumber}).then(res => {
if (res.success) {
this.recordList = res.result || []
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}, },
handleCancel () { handleCancel () {
this.visible = false this.visible = false
@@ -512,13 +512,15 @@ export default {
/** /**
* 跳转详情页 * 跳转详情页
* @param id * @param id
* @param standardNumber
*/ */
toDetailPage ({ id }) { toDetailPage ({ id, standard_number: standardNumber }) {
this.$openPageNewSheet({ this.$openPageNewSheet({
path: '/standardRegulationLibrary/DomesticStandardDetail', path: '/standardRegulationLibrary/DomesticStandardDetail',
query: { query: {
id, id,
type: TagsTypeEnums.DOMESTIC_LIST.value type: TagsTypeEnums.DOMESTIC_LIST.value,
standardNumber
} }
}) })
} }