product.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import request from '@/utils/request'
  2. // 新增
  3. export function addChannel(data) {
  4. return request({
  5. url: '/dxtop/company',
  6. method: 'post',
  7. data: data
  8. })
  9. }
  10. // 修改
  11. export function updataChannel(data) {
  12. return request({
  13. url: '/dxtop/company',
  14. method: 'put',
  15. data: data
  16. })
  17. }
  18. // 删除
  19. export function delChannel(deptId) {
  20. return request({
  21. url: '/dxtop/company/' + deptId,
  22. method: 'delete',
  23. })
  24. }
  25. // 查询
  26. export function listChannel(query) {
  27. return request({
  28. url: '/dxtop/company/list',
  29. method: 'get',
  30. params: query
  31. })
  32. }
  33. // 上传文件查询(充值)
  34. export function listRecharge(data) {
  35. return request({
  36. url: '/sysFile/page',
  37. method: 'post',
  38. data
  39. })
  40. }
  41. //图片上传获取四步曲
  42. // 获取上传图片批次id
  43. export function fileId(query) { // batchNo(文件批次id)
  44. return request({
  45. url: '/sysFile/generateBatchNo',
  46. method: 'get',
  47. params: query
  48. })
  49. }
  50. // 上传图片
  51. export function uploadFileApi(a, b, c) { // batchNo(文件批次id)、businessType(文件应用场景)、uploadType(file / url )
  52. return request({
  53. url: '/sysFile' + "?batchNo=" + a + "&businessType=" + b + "&uploadType=file",
  54. method: 'post',
  55. data: c
  56. })
  57. }
  58. // 图片生效
  59. export function fileTakeEffect(batchNo, ids) { // batchNo(文件批次id)
  60. return request({
  61. url: '/sysFile/active?batchNo=' + batchNo,
  62. method: 'post',
  63. data: ids
  64. })
  65. }
  66. // 获取图片url 单张
  67. export function getFile(data) {
  68. return request({
  69. url: '/sysFile/getFile',
  70. method: 'post',
  71. data: data
  72. })
  73. }
  74. // 获取图片url 多张
  75. export function getFileArray(data) {
  76. return request({
  77. url: '/sysFile/files',
  78. method: 'post',
  79. data: data
  80. })
  81. }