update 资料中心
This commit is contained in:
@@ -77,6 +77,19 @@ const getDynamicMessageById = (params) => getAction('/laws/standard/lawsNewsFeed
|
|||||||
// 动态消息-分享
|
// 动态消息-分享
|
||||||
const shareDynamicMessageById = (params) => postAction('/personal/lawsStandardSharing/dynamicMessages/add', params)
|
const shareDynamicMessageById = (params) => postAction('/personal/lawsStandardSharing/dynamicMessages/add', params)
|
||||||
|
|
||||||
|
// 资料中心-新增
|
||||||
|
const addProfileCenter = (params) => postAction('', params)
|
||||||
|
// 资料中心-编辑
|
||||||
|
const editProfileCenter = (params) => postAction('', params)
|
||||||
|
// 资料中心-新增树节点
|
||||||
|
const addProfileCenterTree = (params) => postAction('', params)
|
||||||
|
// 资料中心-编辑树节点
|
||||||
|
const editProfileCenterTree = (params) => postAction('', params)
|
||||||
|
// 资料中心-删除树节点
|
||||||
|
const deleteProfileCenterTree = (params) => postAction('', params)
|
||||||
|
// 资料中心-获取树节点树
|
||||||
|
const getProfileCenterTree = (params) => getAction('', params)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
// 国内标准
|
// 国内标准
|
||||||
getDomesticStandardSearchForm,
|
getDomesticStandardSearchForm,
|
||||||
@@ -119,5 +132,13 @@ export {
|
|||||||
saveDynamicMessage,
|
saveDynamicMessage,
|
||||||
releaseDynamicMessage,
|
releaseDynamicMessage,
|
||||||
getDynamicMessageById,
|
getDynamicMessageById,
|
||||||
shareDynamicMessageById
|
shareDynamicMessageById,
|
||||||
|
|
||||||
|
// 资料中心
|
||||||
|
addProfileCenter,
|
||||||
|
editProfileCenter,
|
||||||
|
addProfileCenterTree,
|
||||||
|
editProfileCenterTree,
|
||||||
|
deleteProfileCenterTree,
|
||||||
|
getProfileCenterTree
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,9 @@ module.exports = {
|
|||||||
pushRange: 'Push range',
|
pushRange: 'Push range',
|
||||||
dynamicDetails: 'Dynamic details',
|
dynamicDetails: 'Dynamic details',
|
||||||
dataText: 'Data text'
|
dataText: 'Data text'
|
||||||
|
},
|
||||||
|
profileCenter: {
|
||||||
|
typeOfOwnership: 'Type of ownership',
|
||||||
|
uploadData: 'Upload data'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,5 +51,10 @@ module.exports = {
|
|||||||
pushRange: '推送范围',
|
pushRange: '推送范围',
|
||||||
dynamicDetails: '动态详情',
|
dynamicDetails: '动态详情',
|
||||||
dataText: '资料文本'
|
dataText: '资料文本'
|
||||||
|
},
|
||||||
|
// 资料中心
|
||||||
|
profileCenter: {
|
||||||
|
typeOfOwnership: '所属类型',
|
||||||
|
uploadData: '上传资料'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,20 +24,14 @@
|
|||||||
<!-- 新增-->
|
<!-- 新增-->
|
||||||
<a-button icon="plus"
|
<a-button icon="plus"
|
||||||
class="tree-operate-node-btn"
|
class="tree-operate-node-btn"
|
||||||
@click.stop="handleAddTreeNode(record)"
|
@click.stop="handleAddTreeNode(record)" />
|
||||||
v-if="record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
|
|
||||||
v-has="'domesticStandard:tree:add'"></a-button>
|
|
||||||
<!-- 编辑,根节点不能编辑-->
|
<!-- 编辑,根节点不能编辑-->
|
||||||
<a-button class="tree-operate-node-btn"
|
<a-button class="tree-operate-node-btn"
|
||||||
@click.stop="handleEditTreeNode(record)"
|
@click.stop="handleEditTreeNode(record)">
|
||||||
v-has="'domesticStandard:tree:edit'"
|
|
||||||
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
|
|
||||||
<i class="iconfont icon-bianji" />
|
<i class="iconfont icon-bianji" />
|
||||||
</a-button>
|
</a-button>
|
||||||
<!-- 删除,根节点不能删除-->
|
<!-- 删除,根节点不能删除-->
|
||||||
<a-button class="tree-operate-node-btn"
|
<a-button class="tree-operate-node-btn"
|
||||||
v-has="'domesticStandard:tree:delete'"
|
|
||||||
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
|
|
||||||
@click.stop="handleDelTreeNode(record)">
|
@click.stop="handleDelTreeNode(record)">
|
||||||
<i class="iconfont icon-shanchu_" />
|
<i class="iconfont icon-shanchu_" />
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -111,17 +105,24 @@
|
|||||||
</j-table>
|
</j-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--表格数据新增、编辑-->
|
||||||
|
<profile-center-modal ref="modalForm" @ok="modalFormOk" />
|
||||||
|
<!--树节点新增、编辑-->
|
||||||
|
<profile-center-tree-modal ref="treeModal" @ok="modalFormOk"/>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import JTable from '../../../components/jero/JTable.vue'
|
import JTable from '../../../components/jero/JTable.vue'
|
||||||
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
||||||
import { deleteDomesticSystemTree } from '../../../api/standardRegulationLibraryApi.js'
|
import { deleteProfileCenterTree, getProfileCenterTree } from '../../../api/standardRegulationLibraryApi.js'
|
||||||
|
import ProfileCenterModal from './modules/ProfileCenterModal.vue'
|
||||||
|
import ProfileCenterTreeModal from './modules/ProfileCenterTreeModal.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProfileCenterList',
|
name: 'ProfileCenterList',
|
||||||
components: { JTable },
|
components: { JTable, ProfileCenterModal, ProfileCenterTreeModal },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -182,7 +183,7 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
url: {
|
url: {
|
||||||
list: '',
|
list: '/extRepo/extRepoData/page',
|
||||||
delete: '',
|
delete: '',
|
||||||
deleteBatch: ''
|
deleteBatch: ''
|
||||||
},
|
},
|
||||||
@@ -202,19 +203,19 @@ export default {
|
|||||||
if (!params.nodeName) {
|
if (!params.nodeName) {
|
||||||
delete params.nodeName
|
delete params.nodeName
|
||||||
}
|
}
|
||||||
// (params).then(res => {
|
getProfileCenterTree(params).then(res => {
|
||||||
// this.treeData = []
|
this.treeData = []
|
||||||
// this.selectedTreeKeys = []
|
this.selectedTreeKeys = []
|
||||||
// this.selectedTreeNodeCodes = []
|
this.selectedTreeNodeCodes = []
|
||||||
// this.filters.nodeCode = null
|
this.filters.nodeCode = null
|
||||||
// if (res.success) {
|
if (res.success) {
|
||||||
// this.treeData = res.result || []
|
this.treeData = res.result || []
|
||||||
// } else {
|
} else {
|
||||||
// this.$message.warn(res.message)
|
this.$message.warn(res.message)
|
||||||
// }
|
}
|
||||||
// }).finally(() => {
|
}).finally(() => {
|
||||||
// this.treeLoading = false
|
this.treeLoading = false
|
||||||
// })
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 树节点查询
|
* 树节点查询
|
||||||
@@ -277,7 +278,7 @@ export default {
|
|||||||
title: this.$t('confirmDeletion'),
|
title: this.$t('confirmDeletion'),
|
||||||
content: this.$t('areYouSure'),
|
content: this.$t('areYouSure'),
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
deleteDomesticSystemTree({ id: dataRef.id }).then((res) => {
|
deleteProfileCenterTree({ id: dataRef.id }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$message.success(res.message)
|
this.$message.success(res.message)
|
||||||
this.modalFormOk()
|
this.modalFormOk()
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:maskClosable="false"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirm-loading="confirmLoading"
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
|
||||||
|
<a-form :form="form">
|
||||||
|
<!--文件名称-->
|
||||||
|
<a-form-item :label="$t('fileName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('fileName')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator="['title', validatorRules.title]" />
|
||||||
|
</a-form-item>
|
||||||
|
<!--所属类型-->
|
||||||
|
<a-form-item :label="$t('standardRegulationLibrary.profileCenter.typeOfOwnership')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-tree-select v-decorator="['title', validatorRules.title]"
|
||||||
|
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||||
|
style="width: 100%"
|
||||||
|
:tree-data="typeOfOwnershipTreeData"
|
||||||
|
:label-in-value="false"
|
||||||
|
:placeholder="$t('pleaseSelect')+$t('standardRegulationLibrary.profileCenter.typeOfOwnership')" />
|
||||||
|
</a-form-item>
|
||||||
|
<!--上传资料-->
|
||||||
|
<a-form-item :label="$t('standardRegulationLibrary.profileCenter.uploadData')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<j-upload v-decorator="['title', validatorRules.title]" return-id />
|
||||||
|
</a-form-item>
|
||||||
|
<!--推送范围-->
|
||||||
|
<a-form-item :label="$t('standardRegulationLibrary.dynamicMessage.pushRange')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<user-selection v-decorator="['title', validatorRules.title]"
|
||||||
|
:placeholder="$t('pleaseSelect')+$t('standardRegulationLibrary.dynamicMessage.pushRange')" />
|
||||||
|
</a-form-item>
|
||||||
|
<!--文件说明-->
|
||||||
|
<a-form-item :label="$t('fileDeclaration')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input type="textarea"
|
||||||
|
:placeholder="$t('pleaseEnter') + $t('fileDeclaration')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="500"
|
||||||
|
v-decorator="['title', validatorRules.title]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import UserSelection from '../../../../components/selection/UserSelection.vue'
|
||||||
|
import { addProfileCenter, editProfileCenter } from '../../../../api/standardRegulationLibraryApi.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProfileCenterModal',
|
||||||
|
components: { UserSelection },
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title: this.$t('newlyAdded'),
|
||||||
|
width: 600,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
modal: {},
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 4 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
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: {
|
||||||
|
rules: [{ required: true, message: this.$t('uploadFile.pleaseUpload') + this.$t('uploadFile.file') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 推送范围
|
||||||
|
problemOccurrenceTime: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.dynamicMessage.pushRange') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 文件说明
|
||||||
|
respondent: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('fileDeclaration') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
typeOfOwnershipTreeData: [] // 所属类型树形下拉
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add () {
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.modal = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
this.form.validateFields((errors, values) => {
|
||||||
|
if (!errors) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
let submitFunc
|
||||||
|
if (this.modal.id) {
|
||||||
|
submitFunc = editProfileCenter
|
||||||
|
} else {
|
||||||
|
submitFunc = addProfileCenter
|
||||||
|
}
|
||||||
|
const formData = Object.assign(this.modal, values)
|
||||||
|
submitFunc(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:maskClosable="false"
|
||||||
|
:width="width"
|
||||||
|
:visible="visible"
|
||||||
|
:confirm-loading="confirmLoading"
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.nodeName')">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator="['nodeName', validatorRules.nodeName]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addProfileCenterTree, editProfileCenterTree } from '../../../../api/standardRegulationLibraryApi.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ProfileCenterTreeModal',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
title: this.$t('operation'),
|
||||||
|
width: 800,
|
||||||
|
visible: false,
|
||||||
|
confirmLoading: false,
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
model: {},
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 4 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 20 }
|
||||||
|
},
|
||||||
|
validatorRules: {
|
||||||
|
// 节点名称
|
||||||
|
nodeName: {
|
||||||
|
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
add (parentInfo) {
|
||||||
|
this.edit(parentInfo)
|
||||||
|
},
|
||||||
|
edit (record) {
|
||||||
|
this.form.resetFields()
|
||||||
|
this.model = Object.assign({}, record)
|
||||||
|
this.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.model)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
handleOk () {
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
this.confirmLoading = true
|
||||||
|
const formData = Object.assign(this.model, values)
|
||||||
|
formData.nodeOrder = '0'
|
||||||
|
let submitFunc
|
||||||
|
if (this.model.id) {
|
||||||
|
submitFunc = editProfileCenterTree
|
||||||
|
} else {
|
||||||
|
submitFunc = addProfileCenterTree
|
||||||
|
}
|
||||||
|
submitFunc(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$emit('ok')
|
||||||
|
this.close()
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.confirmLoading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel () {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user