schoolOpen.data.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { getInsureList } from '/@/api/common/api';
  3. import { useUserStore } from '/@/store/modules/user';
  4. import { storeToRefs } from 'pinia';
  5. const { getIsMerchant, userInfo } = storeToRefs(useUserStore());
  6. export const formSchema: FormSchema[] = [
  7. {
  8. field: 'tenantId',
  9. label: '营业名称',
  10. component: 'ApiSelect',
  11. required: true,
  12. labelWidth: 120,
  13. slot: 'tenant',
  14. colProps: {
  15. span: 14,
  16. xs: 24,
  17. },
  18. },
  19. {
  20. field: 'title1',
  21. colSlot: 'title1',
  22. label: '',
  23. component: 'Input',
  24. labelWidth: 0,
  25. ifShow({ model }) {
  26. return getIsMerchant.value ? true : model['tenantId'];
  27. },
  28. },
  29. {
  30. field: 'teachingDay',
  31. label: '教学日',
  32. component: 'Input',
  33. slot: 'ZtCustomTable1',
  34. defaultValue: [],
  35. required: true,
  36. labelWidth: 120,
  37. colProps: {
  38. span: 20,
  39. xs: 24,
  40. },
  41. componentProps: {
  42. disabled: !getIsMerchant.value,
  43. },
  44. ifShow({ model }) {
  45. return getIsMerchant.value ? true : model['tenantId'];
  46. },
  47. },
  48. {
  49. field: 'noTeachingDay',
  50. label: '非教学日',
  51. component: 'Input',
  52. slot: 'ZtCustomTable2',
  53. defaultValue: [],
  54. required: true,
  55. labelWidth: 120,
  56. colProps: {
  57. span: 20,
  58. xs: 24,
  59. },
  60. ifShow({ model }) {
  61. return getIsMerchant.value ? true : model['tenantId'];
  62. },
  63. },
  64. {
  65. field: 'title2',
  66. colSlot: 'title2',
  67. label: '',
  68. component: 'Input',
  69. labelWidth: 0,
  70. ifShow({ model }) {
  71. return getIsMerchant.value ? true : model['tenantId'];
  72. },
  73. },
  74. {
  75. field: 'cover',
  76. label: '封面',
  77. component: 'JImageUpload',
  78. required: true,
  79. labelWidth: 120,
  80. colProps: {
  81. span: 14,
  82. xs: 24,
  83. },
  84. ifShow({ model }) {
  85. return getIsMerchant.value ? true : model['tenantId'];
  86. },
  87. componentProps: {
  88. disabled: !getIsMerchant.value,
  89. },
  90. },
  91. {
  92. field: 'insureIds',
  93. label: '配套保险',
  94. component: 'ApiSelect',
  95. componentProps: {
  96. api: getInsureList,
  97. resultField: 'data',
  98. labelField: 'name',
  99. valueField: 'id',
  100. mode: 'multiple',
  101. disabled: !getIsMerchant.value,
  102. },
  103. required: true,
  104. labelWidth: 120,
  105. colProps: {
  106. span: 14,
  107. xs: 24,
  108. },
  109. ifShow({ model }) {
  110. return getIsMerchant.value ? true : model['tenantId'];
  111. },
  112. },
  113. {
  114. field: 'reminder',
  115. label: '使用须知',
  116. component: 'InputTextArea',
  117. required: true,
  118. labelWidth: 120,
  119. colProps: {
  120. span: 22,
  121. xs: 24,
  122. },
  123. componentProps: {
  124. disabled: !getIsMerchant.value,
  125. },
  126. ifShow({ model }) {
  127. return getIsMerchant.value ? true : model['tenantId'];
  128. },
  129. },
  130. ];
  131. export const ScheduleArrangementColums: BasicColumn[] = [
  132. {
  133. title: '时间段',
  134. dataIndex: 'time',
  135. editComponent: 'TimeRangePicker',
  136. editRule: true,
  137. editComponentProps: {
  138. placeholder: ['开始时间', '结束时间'],
  139. size: 'middle',
  140. valueFormat: 'HH:mm',
  141. disabled: !getIsMerchant.value,
  142. },
  143. width: 350,
  144. editRow: true,
  145. editable: true,
  146. },
  147. {
  148. title: '总票数',
  149. key: 'InputNumber',
  150. dataIndex: 'ticketNum',
  151. width: 250,
  152. editComponent: 'InputNumber',
  153. editRule: true,
  154. editComponentProps: {
  155. size: 'middle',
  156. disabled: !getIsMerchant.value,
  157. },
  158. editRow: true,
  159. editable: true,
  160. },
  161. {
  162. key: 'op',
  163. dataIndex: 'operation',
  164. title: 'operation',
  165. fixed: 'right',
  166. },
  167. ];