task.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import request from '@/common/request'
  2. const TaskApi = {
  3. // 刷新令牌
  4. taskType: () => {
  5. return request({
  6. url: `/call/api/call-task-type/findListByPage?page=1&pageCount=1000`,
  7. method: 'POST',
  8. data:{},
  9. custom: {
  10. showLoading: false, // 不用加载中
  11. showError: false, // 不展示错误提示
  12. },
  13. })
  14. },
  15. //创建任务
  16. addTask: (data) => {
  17. return request({
  18. url: `/call/api/task/add`,
  19. method: 'POST',
  20. data,
  21. custom: {
  22. showSuccess: true,
  23. loadingMsg: '新建中',
  24. successMsg: '新建成功',
  25. },
  26. })
  27. },
  28. //测试话术
  29. addTest: (data) => {
  30. return request({
  31. url: `/call/api/call-user-call-test-record/add`,
  32. method: 'POST',
  33. data,
  34. custom: {
  35. showSuccess: false,
  36. showLoading: false,
  37. },
  38. })
  39. },
  40. taskList: (data) => {
  41. return request({
  42. url: `/call/api/task/findListByPage?page=${data.page}&pageCount=${data.pageCount}`,
  43. method: 'POST',
  44. data,
  45. custom: {
  46. showLoading: false, // 加载中
  47. showError: true, // 展示错误提示
  48. },
  49. })
  50. },
  51. taskDetail: (id) => {
  52. return request({
  53. url: `/call/api/task/findById`,
  54. method: 'get',
  55. params: {
  56. id
  57. },
  58. custom: {
  59. showLoading: true, // 加载中
  60. showError: true, // 展示错误提示
  61. },
  62. })
  63. },
  64. intentionList: (id) => {
  65. return request({
  66. url: `/call/api/task/intention-options?taskId=${id}`,
  67. method: 'post',
  68. custom: {
  69. showLoading: false, // 加载中
  70. showError: true, // 展示错误提示
  71. },
  72. })
  73. },
  74. phoneList: (data) => {
  75. return request({
  76. url: `/call/api/task/phone/findListByPage`,
  77. method: 'post',
  78. data,
  79. custom: {
  80. showLoading: false, // 加载中
  81. showError: true, // 展示错误提示
  82. },
  83. })
  84. },
  85. lastTaskDetail: () => {
  86. return request({
  87. url: `/call/api/task/lastTask`,
  88. method: 'get',
  89. custom: {
  90. showLoading: false, // 加载中
  91. showError: false, // 展示错误提示
  92. },
  93. })
  94. },
  95. taskDel: (data) => {
  96. return request({
  97. url: `/call/api/task/del?id=${data.id}`,
  98. method: 'POST',
  99. data,
  100. custom: {
  101. showLoading: false, // 加载中
  102. showError: true, // 展示错误提示
  103. },
  104. })
  105. },
  106. phoneExport: (data) => {
  107. return request({
  108. url: `/call/api/task/phone/export`,
  109. method: 'POST',
  110. data,
  111. custom: {
  112. showLoading: false, // 加载中
  113. showError: true, // 展示错误提示
  114. },
  115. })
  116. },
  117. }
  118. export default TaskApi;