tableConfig.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. import { useDictionaryStore } from "@/store";
  2. const { dicts } = useDictionaryStore();
  3. import dictDataUtil from "@/common/configs/dictDataUtil";
  4. const switchOp = [
  5. {
  6. label: "",
  7. value: 0,
  8. },
  9. {
  10. label: "",
  11. value: 1,
  12. },
  13. ];
  14. export const tableConfig = {
  15. PROCESS_SELECT: {
  16. url: "/api/v1/category/detail/operation",
  17. column: [
  18. {
  19. label: "工序名称",
  20. prop: "operationName",
  21. span: 12,
  22. search: true,
  23. rules: [
  24. {
  25. required: true,
  26. message: "工序名称不能为空",
  27. trigger: "blur",
  28. },
  29. ],
  30. },
  31. {
  32. label: "工序编码",
  33. prop: "operationCode",
  34. span: 12,
  35. search: true,
  36. display: false,
  37. },
  38. {
  39. label: "工艺条件",
  40. prop: "processAsk",
  41. span: 12,
  42. minWidth: 300,
  43. rules: [
  44. {
  45. required: true,
  46. message: "工艺条件不能为空",
  47. trigger: "blur",
  48. },
  49. ],
  50. },
  51. {
  52. label: "标准工时(分)",
  53. prop: "standardWorktime",
  54. type: "number",
  55. span: 12,
  56. rules: [
  57. {
  58. required: true,
  59. message: "标准工时不能为空",
  60. trigger: "blur",
  61. },
  62. ],
  63. },
  64. {
  65. label: "目标值(%)",
  66. prop: "targetRate",
  67. type: "number",
  68. max: 100,
  69. min: 0,
  70. span: 12,
  71. rules: [
  72. {
  73. required: true,
  74. message: "目标值不能为空",
  75. trigger: "blur",
  76. },
  77. ],
  78. },
  79. {
  80. label: "工序标注",
  81. prop: "operationLabel",
  82. span: 12,
  83. rules: [
  84. {
  85. max: 16,
  86. message: "工序标注不能超过16个字符",
  87. trigger: "blur",
  88. },
  89. ],
  90. },
  91. {
  92. label: "方法",
  93. prop: "method",
  94. span: 12,
  95. },
  96. {
  97. label: "试验规程编号",
  98. prop: "testPlanCode",
  99. span: 12,
  100. },
  101. {
  102. label: "是否可跳过",
  103. prop: "skipped",
  104. span: 8,
  105. hide: true,
  106. type: "switch",
  107. dicData: switchOp,
  108. value: 0,
  109. },
  110. {
  111. label: "是否关键工序",
  112. prop: "keyProcesses",
  113. span: 8,
  114. type: "switch",
  115. dicData: switchOp,
  116. value: 0,
  117. },
  118. {
  119. label: "是否特殊工序",
  120. prop: "isSpecial",
  121. span: 8,
  122. type: "switch",
  123. dicData: switchOp,
  124. value: 0,
  125. },
  126. {
  127. label: "是否禁用",
  128. prop: "enabled",
  129. hide: true,
  130. span: 8,
  131. type: "switch",
  132. dicData: switchOp,
  133. value: 0,
  134. },
  135. ],
  136. },
  137. };