audit-find-cat-tree-service.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import axios from '@/common/services/axios-instance'
  2. class AuditFindCatTreeService {
  3. // getParentOrgInfo() {
  4. // return axios({
  5. // url: '/api/xcoa-mobile/v1/law-institution/getList',
  6. // method: 'post',
  7. // data: { parentId: 'AUDIT_FIND_CATEGORY' },
  8. // }).then((res) => {
  9. // res.data.forEach((item) => {
  10. // item.isLeaf = item.leaf
  11. // if (item.props.orgId === null) {
  12. // item.props = { ORG_ID: null, BELONGED_ORG_ID: -1 }
  13. // } else {
  14. // item.props = { ORG_ID: item.props.orgId, BELONGED_ORG_ID: -1 }
  15. // }
  16. // })
  17. // return res
  18. // })
  19. // }
  20. // 业务类型分类树
  21. getCategoryTree(parentId) {
  22. // url: `api/xcoa-mobile/v1/iam-tree/findTreeNodeById/${params.configId}/${parentId}`,
  23. return axios({
  24. url: `api/xcoa-mobile/v1/audit-report-find/find-audit-tree?parentId=` + parentId,
  25. method: 'post',
  26. }).then((res) => {
  27. res.data.forEach((item) => {
  28. item.isLeaf = item.leaf
  29. // if (item.props.orgId === null) {
  30. item.props = {}
  31. // } else {
  32. // item.props = { ORG_ID: Number(item.props.orgId), BELONGED_ORG_ID: -1 }
  33. // }
  34. })
  35. return res
  36. })
  37. }
  38. // 拖拽功能
  39. dragNode(params) {
  40. return axios({
  41. url: `api/xcoa-mobile/v1/iam-tree/moveTreeNode/${params.configId}/${params.id}/${params.targetId}/${params.position}`,
  42. method: 'post',
  43. data: null,
  44. }).then((res) => {
  45. res.data.forEach((item) => (item.isLeaf = item.leaf))
  46. return res
  47. })
  48. }
  49. }
  50. export default new AuditFindCatTreeService()