engineeringIndustry.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import request from '@/utils/request'
  2. // 根据url直接获取type
  3. function getTypeFromUrl(url) {
  4. // 使用正则表达式或其他方法从 URL 中提取 type 参数
  5. const params = new URLSearchParams(url.split('?')[1]);
  6. return params.get('type');
  7. }
  8. export function getEngineeIndustryList(sata) {
  9. sata.type = getTypeFromUrl(window.location.href)
  10. return request({
  11. url: `/zdsz/engineeringIndustry/list`,
  12. method: 'get',
  13. params:sata
  14. })
  15. }
  16. export function addEngineeEngineeIndustry(data) {
  17. return request({
  18. url: '/zdsz/engineeringIndustry',
  19. method: 'post',
  20. data
  21. })
  22. }
  23. export function putEngineeEngineeIndustry(id) {
  24. return request({
  25. url: `/zdsz/engineeringIndustry/${id}`,
  26. method: 'get',
  27. })
  28. }
  29. export function EditEngineeEngineeIndustry(data) {
  30. return request({
  31. url: '/zdsz/engineeringIndustry',
  32. method: 'put',
  33. data
  34. })
  35. }
  36. export function DelEngineeEngineeIndustry(id) {
  37. return request({
  38. url: `/zdsz/engineeringIndustry/${id}`,
  39. method: 'delete',
  40. })
  41. }
  42. export function QueryEngineeIndustry({id, type}) {
  43. // alert(`${id}`)
  44. // alert(`${type}`)
  45. return request({
  46. // url: `/zdsz/engineeringIndustry/${id}/1`,
  47. url: `/zdsz/engineeringIndustry/${id}/${type}`,
  48. method: 'get',
  49. })
  50. }
  51. export function QueryEngineeIndustrys({id, type}) {
  52. return request({
  53. url: `/zdsz/engineeringIndustry/query/${id}/${type}`,
  54. method: 'get',
  55. })
  56. }
  57. export function UpdateEngineeIndustry(data) {
  58. return request({
  59. url: '/zdsz/engineeringIndustry/updateNodeByBo',
  60. method: 'put',
  61. data
  62. })
  63. }