diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index f36d5ec6..8e2863ed 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -26,6 +26,10 @@ const configDomesticStandard = (params) => postAction('', params) const removeDomesticStandard = (params) => postAction('', params) // 国内标准-获取体系树 const getDomesticStandardTree = (params) => getAction('/laws/standard/lawsTreeNode/domestic', params) +// 国内标准-新增标准 +const addDomesticStandard = (params) => postAction('/laws/standard/domestic/commonAdd', params) +// 国内标准-编辑标准 +const editDomesticStandard = (params) => postAction('/laws/standard/domestic/commonEdit', params) // 海外标准-获取查询条件 const getOverseasStandardSearchForm = (params) => getAction('/laws/standard/overseas/getQueryCondition', params) @@ -51,6 +55,8 @@ export { configDomesticStandard, removeDomesticStandard, getDomesticStandardTree, + addDomesticStandard, + editDomesticStandard, // 海外标准 getOverseasStandardSearchForm, diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index ad67af3d..6b2b6c07 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -38,11 +38,11 @@ :nameStr="formInline[item.dbFieldName + '_name']" type="radio" :disabled="disabled" /> - - - - - + + + + + @@ -56,12 +56,13 @@ > - - - - - + :backDepart="true">> + + + + + + @@ -74,7 +75,7 @@ + :disabled="disabled" /> @@ -122,12 +123,13 @@ v-model="formInline[item.dbFieldName]" :multi="true" :backDepart="true" - :treeOpera="true">> - - - - - + :treeOpera="true">> + + + + + + @@ -204,17 +206,17 @@
* - {{item.dbFieldTxt}} + {{ item.dbFieldTxt }}
@@ -234,15 +236,15 @@ import JMultiSelectTag from '../dict/JMultiSelectTag' import UploadFile from '../UploadFile' // 选择标准选择器 import StandardSelection from '../selection/StandardSelection' -// 选择用户或组织机构 -import UserOrOrganSelection from '../selection/UserOrOrganSelection' import { FieldType } from '../../enums/commonEnums' import JMultipleDatePicker from '../JMultipleDatePicker' import UserSelection from '../selection/UserSelection' +import { getAction } from '../../api/manage.js' +import { getDictTreeList } from '../../api/api.js' export default { name: 'AddForm', - components: { UserSelection, JMultipleDatePicker, StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile, UserOrOrganSelection }, + components: { UserSelection, JMultipleDatePicker, StandardSelection, JDictSelectTag, JMultiSelectTag, UploadFile }, props: { url: { type: Object, @@ -294,7 +296,8 @@ export default { type: 'add', dataList: [], ruleList: [], - uploadName: '' + uploadName: '', + optionsData: {} // 用接口获取到的下拉数据 } }, methods: { @@ -302,80 +305,6 @@ export default { this.formInline = {} this.type = 'add' this.getForm() - // this.dataList = [ - // { - // 基本信息: [ - // { - // area: '基本信息', - // dbFieldName: 'serial_number', - // dbFieldTxt: '编号', - // db_length: 200, - // dict_field: '', - // fieldMustInput: '1', - // fieldShowType: '1', - // tree: [] - // }, - // { - // area: '基本信息', - // dbFieldName: 'state', - // dbFieldTxt: '状态', - // db_length: 36, - // dict_field: 'state', - // fieldMustInput: '1', - // fieldShowType: '3', - // tree: [] - // }, - // { - // area: '基本信息', - // dbFieldName: 'standard_system', - // dbFieldTxt: '标准体系', - // db_length: 100, - // dict_field: 'standard_system', - // fieldMustInput: '0', - // fieldShowType: '3', - // tree: [] - // }, - // { - // area: '基本信息', - // dbFieldName: 'corresponding_standard', - // dbFieldTxt: '对应标准', - // db_length: 200, - // dict_field: '', - // fieldMustInput: '0', - // fieldShowType: '10', - // tree: [] - // } - // ] - // }, - // { - // 文本信息: [ - // { - // area: '文本信息', - // dbFieldName: 'release_draft', - // dbFieldTxt: '发言稿(必读)', - // db_length: 3000, - // dict_field: '', - // fieldMustInput: '0', - // fieldShowType: '7', - // flag: 1, - // tree: [] - // }, - // { - // area: '文本信息', - // dbFieldName: 'release_draft', - // dbFieldTxt: '发言稿(必读)', - // db_length: 3000, - // dict_field: '', - // fieldMustInput: '0', - // fieldShowType: '7', - // flag: 1, - // tree: [] - // } - // ] - // } - // ] - // this.ruleList = this.dataList - // this.integrateData() }, edit (item) { this.type = 'edit' @@ -387,7 +316,7 @@ export default { } this.getDocumentInfoFunc({ id: item.id }).then((res) => { if (res.success) { - this.formInline = res.result[0] + this.formInline = res.result this.loading = false } else { this.loading = false @@ -410,6 +339,8 @@ export default { this.dataList = res.result this.ruleList = res.result this.integrateData() + console.log(JSON.parse(JSON.stringify(this.dataList))) + this.getOptionsData() // 获取下拉数据 callBack && callBack() } }) @@ -470,6 +401,29 @@ export default { this.isFormInline = true this.confirmLoading = false }, + /** + * 处理需要通过接口获取的下拉数据 + */ + getOptionsData () { + const formList = Object.values(this.dataList).reduce((acc, cur) => acc.concat(cur), []) + formList.forEach(item => { + // 展示类型是树选择,且有接口的 + if (item.fieldShowType === FieldType.TREE.value && item.fieldHref) { + getAction(item.fieldHref).then(res => { + if (res.success) { + this.$set(this.optionsData, item.dbFieldName, res.result) + } + }) + } + if (item.fieldShowType === FieldType.TREE.value && item.dictId) { + getDictTreeList({ dictId: item.dictId }).then(res => { + if (res.success) { + this.$set(this.optionsData, item.dbFieldName, res.result) + } + }) + } + }) + }, // 点击点击上传按钮 clickButtonToUpload (item) { this.$refs.uploadFile.open(this.formInline[item.dbFieldName]) diff --git a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue index 072f6e6f..dc7edd0d 100644 --- a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue +++ b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue @@ -18,27 +18,28 @@ @click="handleSelectTreeNode(record)"> - {{ record.nodeName }} + {{ record.title }}