ic-tree-service.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import axios from '@/common/services/axios-instance'
  2. class IcTreeService {
  3. // 业务类型分类树
  4. getCategoryTree(parentId, params, types) {
  5. const auditOrgId = params.auditOrgId
  6. const versionId = params.versionId
  7. let url = `api/xcoa-mobile/v1/icmtxprocess/findIamAuditMattersCategoryTree?parentId=${parentId}&auditOrgId=${auditOrgId}&versionId=${versionId}`
  8. if (types === 'FK') {
  9. url = `api/xcoa-mobile/v1/riskcategory/findIamAuditMattersCategoryTree?parentId=${parentId}&auditOrgId=${auditOrgId}&versionId=${versionId}`
  10. }
  11. return axios({
  12. url: url,
  13. method: 'post',
  14. }).then((res) => {
  15. res.data.forEach((item) => (item.isLeaf = item.leaf))
  16. return res
  17. })
  18. }
  19. // 获取措施节点
  20. getMeasureTree(parentId, params, types) {
  21. const auditOrgId = params.auditOrgId
  22. const versionId = params.versionId
  23. let url = `api/xcoa-mobile/v1/icmtxprocess/findIcIcmeasureCategoryTree?parentId=${parentId}&auditOrgId=${auditOrgId}&versionId=${versionId}`
  24. if (types === 'FK') {
  25. url = `api/xcoa-mobile/v1/riskcategory/findIcIcmeasureCategoryTree?parentId=${parentId}&auditOrgId=${auditOrgId}&versionId=${versionId}&isAbandonment=${params.isAbandonment}`
  26. }
  27. return axios({
  28. url: url,
  29. method: 'post',
  30. }).then((res) => {
  31. res.data.forEach((item) => (item.isLeaf = item.leaf))
  32. return res
  33. })
  34. }
  35. // 拖拽功能
  36. dragNode(params) {
  37. return axios({
  38. url: `api/xcoa-mobile/v1/iam-tree/moveTreeNode/${params.configId}/${params.id}/${params.targetId}/${params.position}`,
  39. method: 'post',
  40. data: null,
  41. }).then((res) => {
  42. res.data.forEach((item) => (item.isLeaf = item.leaf))
  43. return res
  44. })
  45. }
  46. // 获取分级授权下拉列表
  47. getManagedHierarchyOrg(formId) {
  48. return axios({
  49. url: `api/xcoa-mobile/v1/iam-page/getHavePermissionOrg/${formId}`,
  50. method: 'post',
  51. }).then((res) => {
  52. return res
  53. })
  54. }
  55. }
  56. export default new IcTreeService()