engineeringIndustry.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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() {
  9. const type = getTypeFromUrl(window.location.href);
  10. return request({
  11. url: `/zdsz/engineeringIndustry/list?type=${type}`,
  12. method: 'get',
  13. })
  14. }
  15. export function addEngineeEngineeIndustry(data) {
  16. return request({
  17. url: '/zdsz/engineeringIndustry',
  18. method: 'post',
  19. data
  20. })
  21. }
  22. export function putEngineeEngineeIndustry(id) {
  23. return request({
  24. url: `/zdsz/engineeringIndustry/${id}`,
  25. method: 'get',
  26. })
  27. }
  28. export function EditEngineeEngineeIndustry(data) {
  29. return request({
  30. url: '/zdsz/engineeringIndustry',
  31. method: 'put',
  32. data
  33. })
  34. }
  35. export function DelEngineeEngineeIndustry(id) {
  36. return request({
  37. url: `/zdsz/engineeringIndustry/${id}`,
  38. method: 'delete',
  39. })
  40. }
  41. export function QueryEngineeIndustry({id}) {
  42. return request({
  43. url: `/zdsz/engineeringIndustry/${id}`,
  44. method: 'get',
  45. })
  46. }
  47. export function UpdateEngineeIndustry(data) {
  48. return request({
  49. url: '/zdsz/engineeringIndustry/updateNodeByBo',
  50. method: 'put',
  51. data
  52. })
  53. }