sideTree.mock.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { defineMock } from "../base";
  2. export default defineMock([
  3. {
  4. url: "sideTree/options",
  5. method: ["GET"],
  6. body: {
  7. code: "00000",
  8. data: [
  9. {
  10. value: 1,
  11. label: "外球面球轴承",
  12. children: [
  13. {
  14. value: 11,
  15. label: "UCPH205",
  16. },
  17. {
  18. value: 12,
  19. label: "UCPH206",
  20. },
  21. ],
  22. },
  23. {
  24. value: 2,
  25. label: "滚子轴承",
  26. children: [
  27. {
  28. value: 21,
  29. label: "KLM11749-LM11710",
  30. },
  31. {
  32. value: 22,
  33. label: "KL44643-L44610",
  34. },
  35. ],
  36. },
  37. {
  38. value: 3,
  39. label: "角接触球轴承",
  40. children: [
  41. {
  42. value: 31,
  43. label: "23805",
  44. },
  45. {
  46. value: 32,
  47. label: "234422",
  48. },
  49. ],
  50. },
  51. ],
  52. msg: "一切ok",
  53. },
  54. },
  55. ]);
  56. // 部门映射表数据
  57. const sideTreeMap: Record<string, any> = {
  58. 1: {
  59. id: 1,
  60. name: "外球面球轴承",
  61. parentId: 0,
  62. status: 1,
  63. sort: 1,
  64. },
  65. 11: {
  66. id: 11,
  67. name: "UCPH205",
  68. parentId: 1,
  69. status: 1,
  70. sort: 1,
  71. },
  72. 12: {
  73. id: 12,
  74. name: "UCPH206",
  75. parentId: 1,
  76. status: 1,
  77. sort: 2,
  78. },
  79. 2: {
  80. id: 2,
  81. name: "滚子轴承",
  82. parentId: 0,
  83. status: 1,
  84. sort: 2,
  85. },
  86. 21: {
  87. id: 21,
  88. name: "KLM11749-LM11710",
  89. parentId: 2,
  90. status: 1,
  91. sort: 1,
  92. },
  93. 22: {
  94. id: 22,
  95. name: "KL44643-L44610",
  96. parentId: 2,
  97. status: 1,
  98. sort: 2,
  99. },
  100. 3: {
  101. id: 3,
  102. name: "角接触球轴承",
  103. parentId: 0,
  104. status: 1,
  105. sort: 3,
  106. },
  107. 31: {
  108. id: 31,
  109. name: "23805",
  110. parentId: 3,
  111. status: 1,
  112. sort: 1,
  113. },
  114. 32: {
  115. id: 32,
  116. name: "234422",
  117. parentId: 3,
  118. status: 1,
  119. sort: 2,
  120. },
  121. };