SysAuthAccessSecretListView.config.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import type { SmartColumn, SmartSearchFormSchema } from '@/components/SmartTable';
  2. import type { FormSchema } from '@/components/Form';
  3. import { tableUseYnClass } from '@/components/SmartTable';
  4. /**
  5. * 表格列表
  6. */
  7. export const getTableColumns = (): SmartColumn[] => {
  8. return [
  9. {
  10. type: 'checkbox',
  11. width: 60,
  12. align: 'center',
  13. fixed: 'left',
  14. },
  15. {
  16. field: 'seq',
  17. sortable: true,
  18. title: '{common.table.seq}',
  19. width: 100,
  20. },
  21. {
  22. field: 'accessKey',
  23. title: '{system.views.auth.acccessSecret.title.accessKey}',
  24. width: 120,
  25. },
  26. {
  27. field: 'secretKey',
  28. title: '{system.views.auth.acccessSecret.title.secretKey}',
  29. width: 120,
  30. },
  31. {
  32. field: 'expireDate',
  33. title: '{system.views.auth.acccessSecret.title.expireDate}',
  34. width: 165,
  35. },
  36. {
  37. field: 'accessIp',
  38. title: '{system.views.auth.acccessSecret.title.accessIp}',
  39. width: 120,
  40. },
  41. {
  42. field: 'remark',
  43. title: '{common.table.remark}',
  44. width: 200,
  45. },
  46. {
  47. ...tableUseYnClass(),
  48. },
  49. {
  50. field: 'createBy',
  51. title: '{common.table.createUser}',
  52. width: 120,
  53. },
  54. {
  55. field: 'createTime',
  56. title: '{common.table.createTime}',
  57. width: 165,
  58. },
  59. {
  60. field: 'updateBy',
  61. title: '{common.table.updateUser}',
  62. width: 120,
  63. },
  64. {
  65. field: 'updateTime',
  66. title: '{common.table.updateTime}',
  67. width: 165,
  68. },
  69. {
  70. title: '{common.table.operation}',
  71. field: 'operation',
  72. width: 120,
  73. fixed: 'right',
  74. slots: {
  75. default: 'table-operation',
  76. },
  77. },
  78. ];
  79. };
  80. /**
  81. * 添加修改表单
  82. */
  83. export const getFormSchemas = (t: Function): FormSchema[] => {
  84. return [
  85. {
  86. field: 'id',
  87. show: false,
  88. label: '',
  89. component: 'Input',
  90. componentProps: {},
  91. },
  92. {
  93. field: 'accessKey',
  94. label: t('system.views.auth.acccessSecret.title.accessKey'),
  95. component: 'Input',
  96. componentProps: {},
  97. dynamicDisabled: true,
  98. },
  99. {
  100. field: 'secretKey',
  101. label: t('system.views.auth.acccessSecret.title.secretKey'),
  102. component: 'Input',
  103. componentProps: {},
  104. dynamicDisabled: true,
  105. },
  106. {
  107. field: 'expireDate',
  108. label: t('system.views.auth.acccessSecret.title.expireDate'),
  109. component: 'DatePicker',
  110. componentProps: {
  111. showTime: true,
  112. style: { width: '100%' },
  113. },
  114. },
  115. {
  116. field: 'accessIp',
  117. label: t('system.views.auth.acccessSecret.title.accessIp'),
  118. component: 'InputTextArea',
  119. componentProps: {
  120. placeholder: t('system.views.auth.acccessSecret.validate.accessIp'),
  121. },
  122. },
  123. {
  124. field: 'remark',
  125. label: t('common.table.remark'),
  126. component: 'InputTextArea',
  127. componentProps: {},
  128. },
  129. {
  130. field: 'useYn',
  131. label: t('common.table.useYn'),
  132. component: 'Switch',
  133. componentProps: {},
  134. defaultValue: true,
  135. },
  136. {
  137. field: 'seq',
  138. label: t('common.table.seq'),
  139. component: 'InputNumber',
  140. componentProps: {},
  141. required: true,
  142. },
  143. ];
  144. };
  145. export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => {
  146. return [
  147. {
  148. field: 'accessKey',
  149. label: t('system.views.auth.acccessSecret.title.accessKey'),
  150. component: 'Input',
  151. searchSymbol: 'like',
  152. },
  153. {
  154. field: 'secretKey',
  155. label: t('system.views.auth.acccessSecret.title.secretKey'),
  156. component: 'Input',
  157. searchSymbol: 'like',
  158. },
  159. {
  160. field: 'useYn',
  161. label: t('common.table.useYn'),
  162. component: 'Select',
  163. searchSymbol: '=',
  164. defaultValue: 1,
  165. componentProps: {
  166. style: {
  167. width: '120px',
  168. },
  169. options: [
  170. {
  171. label: t('common.form.use'),
  172. value: 1,
  173. },
  174. {
  175. label: t('common.form.noUse'),
  176. value: 0,
  177. },
  178. ],
  179. },
  180. },
  181. ];
  182. };