Browse Source

档案分类

master
xuhuajiao 1 year ago
parent
commit
bcadb44a8f
  1. 11
      src/api/system/archivesClass.js
  2. 56
      src/views/system/archivesClassify/module/tableList.vue

11
src/api/system/archivesClass.js

@ -9,6 +9,15 @@ export function FetchInitArchivesClass(params) {
})
}
// 获取档案分类子集
export function FetchSonArchivesClass(params) {
return request({
url: 'api/archivesClass/getSonArchivesClass',
method: 'get',
params
})
}
// 获取档案分类树
export function FetchArchivesClassTree(params) {
return request({
@ -42,4 +51,4 @@ export function del(data) {
})
}
export default { add, edit, del, FetchInitArchivesClass, FetchArchivesClassTree }
export default { add, edit, del, FetchInitArchivesClass, FetchSonArchivesClass, FetchArchivesClassTree }

56
src/views/system/archivesClassify/module/tableList.vue

@ -104,9 +104,10 @@
ref="table"
v-loading="crud.loading"
lazy
:data="crud.data"
row-key="id"
:tree-props="{ children: 'childMenus', hasChildren: 'hasChildren' }"
:data="tableData"
:row-key="getRowKey"
:load="getSonClass"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
highlight-current-row
@select-all="selectAll"
@select="selectTr"
@ -178,6 +179,7 @@ export default {
},
data() {
return {
tableData: [],
classifyOptions: [],
categoryDatas: [],
selections: [],
@ -210,17 +212,24 @@ export default {
created() {
},
methods: {
getRowKey(row) {
return row.id
},
//
[CRUD.HOOK.beforeRefresh]() {
this.tableData = []
this.crud.query.categoryId = this.selectedCategory.id
},
[CRUD.HOOK.afterRefresh]() {
},
//
[CRUD.HOOK.beforeToAdd](crud, form) {
},
// /
[CRUD.HOOK.afterSubmit]() {
[CRUD.HOOK.afterRefresh](crud) {
crud.data.forEach(function(item, index) {
if (item.sonNum !== 0) {
item.hasChildren = true
item.children = null
} else {
item.hasChildren = false
}
})
this.tableData = this.crud.data
},
//
[CRUD.HOOK.afterValidateCU](crud) {
@ -230,13 +239,8 @@ export default {
},
changeIsTop(val) {
if (this.crud.status.edit) {
if (val === '0') {
// const params = {
// 'fondsId': this.form.fondsId,
// 'fondsName': this.form.fondsName,
// 'status': 1
// }
// this.getDepts(params)
if (val === '1') {
this.form.pid = null
}
}
},
@ -301,9 +305,25 @@ export default {
})
}
},
getSonClass(tree, treeNode, resolve) {
setTimeout(() => {
crudClassify.FetchSonArchivesClass({ pid: tree.id }).then(res => {
const data = res.map(function(obj) {
if (obj.sonNum !== 0 && obj.sonNum) {
obj.hasChildren = true
obj.children = null
} else {
obj.hasChildren = false
}
return obj
})
resolve(data)
})
}, 100)
},
selectAll() {
this.isAllSelect = !this.isAllSelect
const data = this.crud.data
const data = this.tableData
this.toggleSelect(data, this.isAllSelect, 'all')
},
//

Loading…
Cancel
Save