audit-matters-tree-service.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import axios from '@/common/services/axios-instance'
  2. class AuditMattersTreeService {
  3. // 审计事项树
  4. findIamAuditMattersTree(orgId, parentId, treeDataType) {
  5. var urlM = ''
  6. if (treeDataType === '') {
  7. urlM =
  8. `api/xcoa-mobile/v1/iam-audit-matters/findIamAuditMattersTree?orgId=` +
  9. orgId +
  10. `&parentId=` +
  11. parentId
  12. } else if (treeDataType === 'templateTree') {
  13. if (parentId != null) {
  14. urlM =
  15. `api/xcoa-mobile/v1/iam-auditmatters-template/findIamAuditTemplateTree?templateId=` +
  16. orgId +
  17. `&id=` +
  18. parentId
  19. } else {
  20. urlM =
  21. `api/xcoa-mobile/v1/iam-auditmatters-template/findIamAuditTemplateTree?templateId=` +
  22. orgId +
  23. `&id=`
  24. }
  25. }
  26. return axios({
  27. url: urlM,
  28. method: 'post',
  29. data: null,
  30. }).then((res) => {
  31. res.data.forEach((item) => {
  32. item.isLeaf = item.props.isItem
  33. })
  34. return res
  35. })
  36. }
  37. // 拖拽功能
  38. dragNode(params) {
  39. return axios({
  40. url: `api/xcoa-mobile/v1/iam-tree/moveTreeNode/${params.configId}/${params.id}/${params.targetId}/${params.position}`,
  41. method: 'post',
  42. data: null,
  43. }).then((res) => {
  44. res.data.forEach((item) => (item.isLeaf = item.leaf))
  45. return res
  46. })
  47. }
  48. // 获取分级授权下拉列表
  49. getManagedHierarchyOrg(formId) {
  50. return axios({
  51. url: `api/xcoa-mobile/v1/iam-page/getHavePermissionOrg/${formId}`,
  52. method: 'post',
  53. }).then((res) => {
  54. return res
  55. })
  56. }
  57. // 获取节点下所有节点信息
  58. getAllNodeInfo(parentId, frameId) {
  59. return axios({
  60. url: `api/xcoa-mobile/v1/iam-audit-frame-category/findIamAuditFrameCategoryAll`,
  61. method: 'get',
  62. params: {
  63. parentId,
  64. frameId,
  65. },
  66. }).then((res) => {
  67. return res
  68. })
  69. }
  70. // 获取用户所在机构
  71. getCurrentUserGroup() {
  72. return axios({
  73. url: `api/xcoa-mobile/v1/iamorg/getCurrentUserGroup`,
  74. method: 'get',
  75. }).then((res) => {
  76. return res
  77. })
  78. }
  79. }
  80. export default new AuditMattersTreeService()