dept.data.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. import { BasicColumn } from '/@/components/Table';
  2. import { FormSchema } from '/@/components/Table';
  3. import { h } from 'vue';
  4. import { Tag } from 'ant-design-vue';
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '煤矿编号',
  8. dataIndex: 'orderNo',
  9. },
  10. {
  11. title: '所属执法处',
  12. dataIndex: 'enforcement',
  13. },
  14. {
  15. title: '煤矿名称',
  16. dataIndex: 'mineName',
  17. },
  18. {
  19. title: '煤矿简称',
  20. dataIndex: 'mineAbbreviation',
  21. },
  22. {
  23. title: '生产状态',
  24. dataIndex: 'productStatus',
  25. customRender: ({ record }) => {
  26. const status = record.productStatus;
  27. const enable = ~~status === 0;
  28. const color = enable ? 'green' : 'red';
  29. const text = enable ? '启用' : '停用';
  30. return h(Tag, { color: color }, () => text);
  31. },
  32. },
  33. {
  34. title: '自燃情况',
  35. dataIndex: 'riskLevel',
  36. },
  37. {
  38. title: '接入状态',
  39. dataIndex: 'connectStatus',
  40. },
  41. {
  42. title: '在线状态',
  43. dataIndex: 'onlineStatus',
  44. },
  45. {
  46. title: '应接数量',
  47. dataIndex: 'yingjieNum',
  48. },
  49. {
  50. title: '已接数量',
  51. dataIndex: 'yijieNum',
  52. },
  53. {
  54. title: '未接数量',
  55. dataIndex: 'weijieNum',
  56. },
  57. ];
  58. export const searchFormSchema: FormSchema[] = [
  59. {
  60. field: 'mineName',
  61. label: '煤矿名称',
  62. component: 'Input',
  63. colProps: { span: 6 },
  64. },
  65. {
  66. field: 'mineAbbreviation',
  67. label: '煤矿简称',
  68. component: 'Input',
  69. colProps: { span: 6 },
  70. },
  71. {
  72. field: 'productStatus',
  73. label: '生产状态',
  74. component: 'Select',
  75. componentProps: {
  76. options: [
  77. { label: '拟建矿井', value: '0' },
  78. { label: '正常生产矿井', value: '1' },
  79. { label: '长期停产矿井', value: '1' },
  80. ],
  81. },
  82. colProps: { span: 6 },
  83. },
  84. {
  85. field: 'isConnected',
  86. label: '是否需要接入',
  87. component: 'Select',
  88. componentProps: {
  89. options: [
  90. { label: '否', value: '0' },
  91. { label: '是', value: '1' },
  92. ],
  93. },
  94. colProps: { span: 6 },
  95. },
  96. {
  97. field: 'onlineStatus',
  98. label: '在线状态',
  99. component: 'Select',
  100. componentProps: {
  101. options: [
  102. { label: '离线', value: '0' },
  103. { label: '在线', value: '1' },
  104. ],
  105. },
  106. colProps: { span: 6 },
  107. },
  108. {
  109. field: 'riskLevel',
  110. label: '风险等级',
  111. component: 'Select',
  112. componentProps: {
  113. options: [
  114. { label: 'Ⅰ类容易自燃', value: '0' },
  115. { label: 'Ⅱ类自燃', value: '1' },
  116. { label: 'Ⅲ类不易自燃', value: '2' },
  117. ],
  118. },
  119. colProps: { span: 6 },
  120. },
  121. {
  122. field: 'statusChange',
  123. label: '状态变化',
  124. component: 'Select',
  125. componentProps: {
  126. options: [
  127. { label: '否', value: '0' },
  128. { label: '是', value: '1' },
  129. ],
  130. },
  131. colProps: { span: 6 },
  132. },
  133. ];
  134. export const formSchema: FormSchema[] = [
  135. {
  136. field: 'deptName',
  137. label: '部门名称11111111',
  138. component: 'Input',
  139. required: true,
  140. },
  141. {
  142. field: 'parentDept',
  143. label: '上级部门',
  144. component: 'TreeSelect',
  145. componentProps: {
  146. replaceFields: {
  147. title: 'deptName',
  148. key: 'id',
  149. value: 'id',
  150. },
  151. getPopupContainer: () => document.body,
  152. },
  153. required: true,
  154. },
  155. {
  156. field: 'orderNo',
  157. label: '排序',
  158. component: 'InputNumber',
  159. required: true,
  160. },
  161. {
  162. field: 'status',
  163. label: '状态',
  164. component: 'RadioButtonGroup',
  165. defaultValue: '0',
  166. componentProps: {
  167. options: [
  168. { label: '启用', value: '0' },
  169. { label: '停用', value: '1' },
  170. ],
  171. },
  172. required: true,
  173. },
  174. {
  175. label: '备注',
  176. field: 'remark',
  177. component: 'InputTextArea',
  178. },
  179. ];
  180. export const minesData = [
  181. {
  182. orderNo:'61082400879',
  183. enforcement:'执法二处',
  184. mineName:'府谷县能源有限公司古城一号煤矿',
  185. mineAbbreviation:'府谷县一号煤矿',
  186. productStatus:'0',
  187. riskLevel:'0',
  188. connectStatus:'0',
  189. onlineStatus:'0',
  190. yingjieNum:'0',
  191. yijieNum:'0',
  192. weijieNum:'0',
  193. },
  194. {
  195. orderNo:'61082400878',
  196. enforcement:'执法二处',
  197. mineName:'府谷县能源有限公司古城二号煤矿',
  198. mineAbbreviation:'府谷县二号煤矿',
  199. productStatus:'0',
  200. riskLevel:'0',
  201. connectStatus:'0',
  202. onlineStatus:'0',
  203. yingjieNum:'0',
  204. yijieNum:'0',
  205. weijieNum:'0',
  206. }
  207. ]