audit-modaltree-service.js 780 B

123456789101112131415161718192021222324252627
  1. import axios from '@/common/services/axios-instance'
  2. class AuditTreeService {
  3. // 业务类型分类树
  4. getCategoryTree(parentId, params) {
  5. return axios({
  6. url: `api/xcoa-mobile/v1/iam-choose/findTreeNodeById/${params.configId}/${parentId}`,
  7. method: 'post',
  8. data: null,
  9. }).then((res) => {
  10. res.data.forEach((item) => (item.isLeaf = item.leaf))
  11. return res
  12. })
  13. }
  14. // 拖拽功能
  15. dragNode(params) {
  16. return axios({
  17. url: `api/xcoa-mobile/v1/iam-tree/moveTreeNode/${params.configId}/${params.id}/${params.targetId}/${params.position}`,
  18. method: 'post',
  19. data: null,
  20. }).then((res) => {
  21. res.data.forEach((item) => (item.isLeaf = item.leaf))
  22. return res
  23. })
  24. }
  25. }
  26. export default new AuditTreeService()