diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index fcf2c004..913359e8 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -82,15 +82,17 @@ const getDynamicMessageById = (params) => getAction('/laws/standard/lawsNewsFeed const shareDynamicMessageById = (params) => postAction('/personal/lawsStandardSharing/dynamicMessages/add', params) // 资料中心-新增 -const addProfileCenter = (params) => postAction('', params) +const addProfileCenter = (params) => postAction('/laws/dataCenter/lawsDataCenterFile/add', params) // 资料中心-编辑 -const editProfileCenter = (params) => postAction('', params) -// 资料中心-新增树节点 -const addProfileCenterTree = (params) => postAction('', params) +const editProfileCenter = (params) => postAction('/laws/dataCenter/lawsDataCenterFile/edit', params) +// 资料中心-新增同级 +const addProfileCenterTree = (params) => postAction('/laws/dataCenter/lawsDataCenterFolder/addBrother', params) +// 资料中心-新增子文件夹 +const addChildrenFolder = (params) => postAction('/laws/dataCenter/lawsDataCenterFolder/addChild', params) // 资料中心-编辑树节点 -const editProfileCenterTree = (params) => postAction('', params) +const editProfileCenterTree = (params) => postAction('/laws/dataCenter/lawsDataCenterFolder/edit', params) // 资料中心-删除树节点 -const deleteProfileCenterTree = (params) => postAction('', params) +const deleteProfileCenterTree = (params) => postAction('/laws/dataCenter/lawsDataCenterFolder/delete', params) // 资料中心-获取树节点树 const getProfileCenterTree = (params) => getAction('/laws/dataCenter/lawsDataCenterFolder/getTreeList', params) @@ -144,6 +146,7 @@ export { addProfileCenter, editProfileCenter, addProfileCenterTree, + addChildrenFolder, editProfileCenterTree, deleteProfileCenterTree, getProfileCenterTree diff --git a/src/common/lang/en-us.js b/src/common/lang/en-us.js index 3116fd84..f47a17c9 100644 --- a/src/common/lang/en-us.js +++ b/src/common/lang/en-us.js @@ -165,6 +165,7 @@ module.exports = { submitAddAdd: '提交并新增', pleaseSelectOneStandard: '请选择至少一条标准', selectAtLeastOne: '选中至少一条列表数据', + pleaseSelectTime: '请选择时间', // 树右键 treeRight: { addFolder: 'Create New Folder', diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index 27fd1970..d7d13c4e 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -168,6 +168,7 @@ module.exports = { submitAddAdd: '提交并新增', pleaseSelectOneStandard: '请选择至少一条标准', selectAtLeastOne: '选中至少一条列表数据', + pleaseSelectTime: '请选择时间', // 树右键 treeRight: { addFolder: '新增文件夹', diff --git a/src/views/standardRegulationLibrary/profileCenter/ProfileCenterList.vue b/src/views/standardRegulationLibrary/profileCenter/ProfileCenterList.vue index e910e708..53590239 100644 --- a/src/views/standardRegulationLibrary/profileCenter/ProfileCenterList.vue +++ b/src/views/standardRegulationLibrary/profileCenter/ProfileCenterList.vue @@ -10,29 +10,40 @@ @@ -119,6 +140,8 @@ import { JeroListMixin } from '../../../mixins/JeroListMixin.js' import { deleteProfileCenterTree, getProfileCenterTree } from '../../../api/standardRegulationLibraryApi.js' import ProfileCenterModal from './modules/ProfileCenterModal.vue' import ProfileCenterTreeModal from './modules/ProfileCenterTreeModal.vue' +import { filterObj } from '../../../utils/util' +import { downloadFile } from '../../../api/manage' export default { name: 'ProfileCenterList', @@ -132,25 +155,25 @@ export default { columns: [ // 文件名称 { - dataIndex: 'standardNumber', + dataIndex: 'fileName', title: this.$t('fileName'), width: 150 }, // 文件说明 { - dataIndex: 'standardName', + dataIndex: 'fileDescription', title: this.$t('fileDeclaration'), width: 150 }, // 上传人 { - dataIndex: 'fileType', + dataIndex: 'uploader', title: this.$t('uploadedBy'), width: 150 }, // 上传时间 { - dataIndex: 'fileName', + dataIndex: 'createTime', title: this.$t('uploadTime'), width: 150 }, @@ -167,30 +190,33 @@ export default { { text: this.$t('download'), clickEvent: 'handleDownload', - has: '' + has: 'profileCenter:table' }, // 编辑 { text: this.$t('edit'), clickEvent: 'handleEdit', - has: '' + has: 'profileCenter:table' }, // 删除 { text: this.$t('delete'), clickEvent: 'handleDelete', - has: '' + has: 'profileCenter:table' } ], url: { - list: '', - delete: '', - deleteBatch: '' + list: '/laws/dataCenter/lawsDataCenterFile/page', + delete: '/laws/dataCenter/lawsDataCenterFile/delete', + deleteBatch: '/laws/dataCenter/lawsDataCenterFile/deleteBatch' }, selectedTreeKeys: [], // 选中的树节点key treeLoading: false } }, + created () { + this.initTreeData() + }, methods: { /** * 获取树数据 @@ -198,10 +224,10 @@ export default { initTreeData () { this.treeLoading = true const params = { - nodeName: this.treeInput + folderName: this.treeInput } - if (!params.nodeName) { - delete params.nodeName + if (!params.folderName) { + delete params.folderName } getProfileCenterTree(params).then(res => { this.treeData = [] @@ -256,11 +282,19 @@ export default { this.onClearSelected() }, /** - * 新增树节点 + * 新增同级节点 * @param dataRef */ - handleAddTreeNode ({ dataRef }) { - this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode }) + handleAddPeerFolder ({ dataRef }) { + console.log(dataRef) + this.$refs.treeModal.add({ parentId: dataRef.parentId }, true) + }, + /** + * 新增子节点 + * @param dataRef + */ + handleAddChildrenFolder ({ dataRef }) { + this.$refs.treeModal.add({ parentId: dataRef.id }, false) }, /** * 编辑树节点 @@ -296,6 +330,27 @@ export default { this.queryParam = {} this.selectedTreeKeys = [] this.loadData(1) + }, + getQueryParams () { + // 获取查询条件 + const sqp = {} + if (this.superQueryParams) { + sqp.superQueryParams = encodeURI(this.superQueryParams) + sqp.superQueryMatchType = this.superQueryMatchType + } + const param = Object.assign(sqp, this.queryParam, this.isorter, this.filters) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + Object.keys(param).forEach(val => { + if (param[val] instanceof Array) { + param[val] = param[val].join(',') + } + }) + return filterObj(param) + }, + handleDownload ({ id, fileName }) { + downloadFile(`/laws/dataCenter/lawsDataCenterFile/download?id=${id}`, fileName) } } } diff --git a/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterModal.vue b/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterModal.vue index f452000d..9c45ee19 100644 --- a/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterModal.vue +++ b/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterModal.vue @@ -11,12 +11,12 @@ - - - + + + + + + @@ -28,11 +28,11 @@ - + - @@ -41,7 +41,7 @@ :placeholder="$t('pleaseEnter') + $t('fileDeclaration')" @change="event => event.target.value = event.target.value.trim()" :maxLength="500" - v-decorator="['title', validatorRules.title]" /> + v-decorator="['fileDescription', validatorRules.fileDescription]" /> @@ -72,28 +72,18 @@ export default { sm: { span: 20 } }, validatorRules: { - // 文件名称 - title: { - rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('fileName') }], - validateTrigger: 'blur' - }, - // 所属类型 - project: { - rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.profileCenter.typeOfOwnership') }], - validateTrigger: 'change' - }, // 上传资料 - standardNumber: { + fileId: { rules: [{ required: true, message: this.$t('uploadFile.pleaseUpload') + this.$t('uploadFile.file') }], validateTrigger: 'change' }, // 推送范围 - problemOccurrenceTime: { + pushRangeIds: { rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.dynamicMessage.pushRange') }], validateTrigger: 'change' }, // 文件说明 - respondent: { + fileDescription: { rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('fileDeclaration') }], validateTrigger: 'blur' } @@ -106,8 +96,11 @@ export default { this.visible = true }, edit (record) { - this.modal = Object.assign({}, record) this.visible = true + this.modal = Object.assign({}, record) + this.$nextTick(() => { + this.form.setFieldsValue(this.modal) + }) }, handleOk () { this.form.validateFields((errors, values) => { diff --git a/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterTreeModal.vue b/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterTreeModal.vue index 4d4236c3..ae5b07a5 100644 --- a/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterTreeModal.vue +++ b/src/views/standardRegulationLibrary/profileCenter/modules/ProfileCenterTreeModal.vue @@ -15,17 +15,17 @@ + v-decorator="['folderName', validatorRules.folderName]" /> + v-decorator="['authManageIds', validatorRules.authManageIds]" /> - + @@ -33,7 +33,7 @@ @change="event => event.target.value = event.target.value.trim()" :maxLength="50" type="number" - v-decorator="['nodeName', validatorRules.nodeName]" /> + v-decorator="['sort', validatorRules.sort]" /> @@ -41,7 +41,7 @@