Browse Source

全宗关联门类

master
xuhuajiao 1 year ago
parent
commit
2f76010bd7
  1. 37
      src/api/system/flowable.js
  2. 24
      src/api/system/fonds.js
  3. 85
      src/views/system/groupManage/index.vue
  4. 19
      src/views/system/metadata/data.json

37
src/api/system/flowable.js

@ -0,0 +1,37 @@
import request from '@/utils/request'
// 获取全部流程列表
export function FetchInitFlowAll(params) {
return request({
url: 'api/flowable/initFlowAll',
method: 'get',
params
})
}
// 获取全部流程列表
export function FetchFlowList(params) {
return request({
url: 'api/flowable/getFlowList',
method: 'get',
params
})
}
export function add(data) {
return request({
url: 'api/fourTests/editFourTests',
method: 'post',
data
})
}
export function edit(data) {
return request({
url: 'api/fourTests/editFourTests',
method: 'post',
data
})
}
export default { FetchInitFlowAll, add, edit }

24
src/api/system/fonds.js

@ -34,7 +34,7 @@ export function del(data) {
export function FetchUpdateFondsStatus(data) { export function FetchUpdateFondsStatus(data) {
return request({ return request({
url: '/api/fonds/updateFondsStatus',
url: 'api/fonds/updateFondsStatus',
method: 'post', method: 'post',
data data
}) })
@ -42,7 +42,7 @@ export function FetchUpdateFondsStatus(data) {
export function FetchDownload(params) { export function FetchDownload(params) {
return request({ return request({
url: '/api/fonds/download',
url: 'api/fonds/download',
method: 'get', method: 'get',
params params
}) })
@ -50,9 +50,25 @@ export function FetchDownload(params) {
export function FetchFondsAll() { export function FetchFondsAll() {
return request({ return request({
url: '/api/fonds/getFondsAll',
url: 'api/fonds/getFondsAll',
method: 'get' method: 'get'
}) })
} }
export default { add, edit, del, FetchInitFondsList, FetchUpdateFondsStatus, FetchDownload }
export function FetchFondsCategory(data) {
return request({
url: 'api/fonds/fondsCategory',
method: 'post',
data
})
}
export function FetchFondsDetail(params) {
return request({
url: 'api/fonds/getFondsDetail',
method: 'get',
params
})
}
export default { add, edit, del, FetchInitFondsList, FetchUpdateFondsStatus, FetchDownload, FetchFondsCategory, FetchFondsDetail }

85
src/views/system/groupManage/index.vue

@ -122,6 +122,7 @@
node-key="id" node-key="id"
highlight-current highlight-current
:props="defaultProps" :props="defaultProps"
@check="categoryChange"
/> />
</div> </div>
</div> </div>
@ -161,6 +162,7 @@ export default {
defaultProps: { children: 'children', label: 'cnName', isLeaf: 'leaf' }, defaultProps: { children: 'children', label: 'cnName', isLeaf: 'leaf' },
currentId: 0, categoryLoading: false, showButton: false, currentId: 0, categoryLoading: false, showButton: false,
categoryDatas: [], categoryIds: [], depts: [], deptDatas: [], // 使 categoryDatas: [], categoryIds: [], depts: [], deptDatas: [], // 使
categoryAllData: [],
permission: { permission: {
add: ['admin', 'fonds:add'], add: ['admin', 'fonds:add'],
edit: ['admin', 'fonds:edit'], edit: ['admin', 'fonds:edit'],
@ -233,16 +235,22 @@ export default {
// //
handleCurrentChange(val) { handleCurrentChange(val) {
if (val) { if (val) {
// const _this = this
const _this = this
// //
this.$refs.category.setCheckedKeys([]) this.$refs.category.setCheckedKeys([])
// id // id
this.currentId = val.id
// key
this.categoryIds = []
// val.menus.forEach(function(data) {
// _this.categoryIds.push(data.id)
// })
this.currentId = val.fondsId
crudfonds.FetchFondsDetail({ id: this.currentId }).then((res) => {
// key
this.categoryIds = []
if (res.categorys) {
res.categorys.forEach(function(data) {
_this.categoryIds.push(data.id)
})
}
}).catch(err => {
console.log(err)
})
this.showButton = true this.showButton = true
} }
}, },
@ -307,39 +315,48 @@ export default {
}).catch(() => { }).catch(() => {
}) })
}, },
// menuChange(menu) {
// console.log(menu)
// // id
// getChild(menu.id).then(childIds => {
// // categoryIds
// if (this.categoryIds.indexOf(menu.id) !== -1) {
// for (let i = 0; i < childIds.length; i++) {
// const index = this.categoryIds.indexOf(childIds[i])
// if (index !== -1) {
// this.categoryIds.splice(index, 1)
// }
// }
// } else {
// for (let i = 0; i < childIds.length; i++) {
// const index = this.categoryIds.indexOf(childIds[i])
// if (index === -1) {
// this.categoryIds.push(childIds[i])
// }
// }
// }
// this.$refs.category.setCheckedKeys(this.categoryIds)
// })
// },
categoryChange(categorys) {
console.log(categorys)
if (categorys.pid === 0) {
categorys.isChecked = !categorys.isChecked
this.categoryIds.push(categorys.id)
this.categoryAllData.forEach(childIds => {
if (categorys.isChecked) {
const index = this.categoryIds.indexOf(childIds.id)
if (index !== -1) {
this.categoryIds.splice(index, 1)
}
this.categoryIds.push(childIds.id)
} else {
this.categoryIds = []
}
})
} else {
if (this.categoryIds.indexOf(categorys.id) !== -1) {
const index = this.categoryIds.indexOf(categorys.id)
if (index !== -1) {
this.categoryIds.splice(index, 1)
}
} else {
const index = this.categoryIds.indexOf(categorys.id)
if (index === -1) {
this.categoryIds.push(categorys.id)
}
}
}
this.$refs.category.setCheckedKeys(this.categoryIds)
},
// //
saveCategory() { saveCategory() {
this.categoryLoading = true this.categoryLoading = true
const fonds = { id: this.currentId, menus: [] }
const fonds = { id: this.currentId, categorys: [] }
// key // key
this.categoryIds.forEach(function(id) { this.categoryIds.forEach(function(id) {
const menu = { id: id }
fonds.menus.push(menu)
const categorys = { id: id }
fonds.categorys.push(categorys)
}) })
crudfonds.editMenu(fonds).then(() => {
console.log(fonds)
crudfonds.FetchFondsCategory(fonds).then(() => {
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.categoryLoading = false this.categoryLoading = false
this.update() this.update()

19
src/views/system/metadata/data.json

@ -1,19 +0,0 @@
[
{
"id": 1,
"label": "元数据方案",
"isType": 1,
"children": [
{
"id": 2,
"isType": 2,
"label": "精简方案"
},
{
"id": 3,
"isType": 2,
"label": "完全方案"
}
]
}
]
Loading…
Cancel
Save