@@ -178,41 +185,19 @@ import Search from '../../../components/customField/Search.vue'
import JTable from '../../../components/jero/JTable.vue'
import DomesticStandardModal from './modules/DomesticStandardModal.vue'
import {
- getDomesticStandardTableHeader,
- getDomesticStandardSearchForm,
- shareDomesticStandard,
- deleteDomesticSystemTree,
configDomesticStandard,
- removeDomesticStandard
+ deleteDomesticSystemTree,
+ getDomesticStandardSearchForm,
+ getDomesticStandardTableHeader,
+ getDomesticStandardTree,
+ removeDomesticStandard,
+ shareDomesticStandard
} from '../../../api/standardRegulationLibraryApi'
-import { YesOrNoEnum, StandardSystemTreeNodeType, TagsTypeEnums } from '../../../enums/commonEnums'
+import { StandardSystemTreeNodeType, TagsTypeEnums, YesOrNoEnum } from '../../../enums/commonEnums'
import UserSelectModal from '../../../components/selection/UserSelectModal.vue'
import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
import StandardSelectionModal from '../../../components/selection/StandardSelectionModal.vue'
-const apiTreeData = [
- {
- nodeName: 'parent 1',
- key: '0-0',
- nodeType: '1',
- child: [
- {
- nodeName: '张晨成',
- key: '0-0-0',
- child: [
- { nodeName: 'leaf', key: '0-0-0-0' },
- { nodeName: 'leaf', key: '0-0-0-1' }
- ]
- },
- {
- nodeName: 'parent 1-1',
- key: '0-0-1',
- child: [{ key: '0-0-1-0', nodeName: 'zcvc' }]
- }
- ]
- }
-]
-
export default {
name: 'DomesticStandardList',
components: { Search, JTable, DomesticStandardModal, UserSelectModal, DomesticSystemTreeModal, StandardSelectionModal },
@@ -280,7 +265,14 @@ export default {
* 获取树数据
*/
initTreeData () {
- this.treeData = this.dealTreeData(apiTreeData)
+ getDomesticStandardTree().then(res => {
+ if (res.success) {
+ const treeData = res.result || []
+ this.treeData = this.dealTreeData(treeData)
+ } else {
+ this.$message.warn(res.message)
+ }
+ })
},
/**
* 处理树数据,加入自定义的节点插槽
@@ -289,11 +281,13 @@ export default {
*/
dealTreeData (treeData) {
return treeData.map(item => {
- if (item.child && item.child.length > 0) {
+ if (item.children && item.children.length > 0) {
+ item.scopedSlots = { icon: 'folder', title: 'custom' }
+ item.children = this.dealTreeData(item.children)
+ } else if (item.nodeType === StandardSystemTreeNodeType.ROOT_NODE.value) {
item.scopedSlots = { icon: 'folder', title: 'custom' }
- item.children = this.dealTreeData(item.child)
} else {
- item.scopedSlots = { title: 'custom' }
+ item.scopedSlots = { icon: 'file', title: 'custom' }
}
return item
})
@@ -382,7 +376,7 @@ export default {
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
- this.$refs.treeModal.add({ parentId: dataRef.key })
+ this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
},
/**
* 编辑树节点
@@ -400,7 +394,7 @@ export default {
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
- deleteDomesticSystemTree({ ids: dataRef.id }).then((res) => {
+ deleteDomesticSystemTree({ id: dataRef.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
@@ -537,4 +531,8 @@ export default {
}
}
}
+
+/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
+ display: none;
+}
diff --git a/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue
index 5de71241..e9eb3fa2 100644
--- a/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue
+++ b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticSystemTreeModal.vue
@@ -13,7 +13,7 @@
event.target.value = event.target.value.trim()"
:maxLength="50"
- v-decorator="[ 'nodeName', validatorRules.nodeName]" />
+ v-decorator="['nodeName', validatorRules.nodeName]" />
@@ -69,6 +69,7 @@ export default {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
+ formData.nodeOrder = '0'
let submitFunc
if (this.model.id) {
submitFunc = editDomesticSystemTree
diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue
index aae72919..329f7e9b 100644
--- a/src/views/system/modules/UserModal.vue
+++ b/src/views/system/modules/UserModal.vue
@@ -23,32 +23,40 @@
-
+
-
+
-
-
+
+
-
+
-
-
-
+
+
+
-
+
-
+
>
+ :treeOpera="true">>
+
-
-
+
+
{{ $t('user.ordinaryUsers') }}
{{ $t('user.superior') }}
-
+
-
+
-
+
{{ $t('user.male') }}
{{ $t('user.female') }}
-
+
-
+
-
-
-
+
+
+
-