SmartAuthSecretKeyListView.config.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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: 'id',
  17. visible: false,
  18. title: 'ID',
  19. width: 120,
  20. },
  21. {
  22. field: 'keyName',
  23. title: '{smart.auth.secret.title.keyName}',
  24. width: 120,
  25. fixed: 'left',
  26. },
  27. {
  28. field: 'fileStorageId',
  29. title: '{smart.auth.secret.title.fileStorageId}',
  30. width: 120,
  31. formatter: ({ row }) => {
  32. return row.fileStorage?.storageName;
  33. },
  34. },
  35. {
  36. field: 'seq',
  37. title: '{common.table.seq}',
  38. width: 120,
  39. sortable: true,
  40. },
  41. {
  42. ...tableUseYnClass(),
  43. width: 100,
  44. sortable: true,
  45. },
  46. {
  47. field: 'alias',
  48. title: '{smart.auth.secret.title.alias}',
  49. width: 120,
  50. },
  51. {
  52. field: 'remark',
  53. title: '{common.table.remark}',
  54. width: 120,
  55. },
  56. {
  57. field: 'createTime',
  58. title: '{common.table.createTime}',
  59. width: 160,
  60. },
  61. {
  62. field: 'createBy',
  63. title: '{common.table.createUser}',
  64. width: 120,
  65. },
  66. {
  67. field: 'updateTime',
  68. title: '{common.table.updateTime}',
  69. width: 160,
  70. },
  71. {
  72. field: 'updateBy',
  73. title: '{common.table.updateUser}',
  74. width: 120,
  75. },
  76. {
  77. title: '{common.table.operation}',
  78. field: 'operation',
  79. width: 120,
  80. fixed: 'right',
  81. slots: {
  82. default: 'table-operation',
  83. },
  84. },
  85. ];
  86. };
  87. /**
  88. * 添加修改表单
  89. */
  90. export const getFormSchemas = (t: Function): FormSchema[] => {
  91. return [
  92. {
  93. field: 'id',
  94. label: 'ID',
  95. component: 'Input',
  96. componentProps: {},
  97. show: false,
  98. },
  99. {
  100. field: 'keyName',
  101. label: t('smart.auth.secret.title.keyName'),
  102. component: 'Input',
  103. componentProps: {},
  104. required: true,
  105. },
  106. {
  107. field: 'fileStorageId',
  108. label: t('system.views.file.title.fileStorageId'),
  109. component: 'SmartApiSelectTable',
  110. componentProps: {
  111. modelClassName: 'com.smart.file.manager.model.SmartFileStoragePO',
  112. valueFieldName: 'id',
  113. labelFieldName: 'storageName',
  114. params: {
  115. sortName: 'seq',
  116. parameter: {
  117. 'deleteYn@<>': true,
  118. 'useYn@=': true,
  119. },
  120. },
  121. },
  122. required: true,
  123. },
  124. {
  125. field: 'seq',
  126. label: t('common.table.seq'),
  127. component: 'InputNumber',
  128. componentProps: {},
  129. required: true,
  130. defaultValue: 1,
  131. },
  132. {
  133. field: 'storePassword',
  134. label: t('smart.auth.secret.title.storePassword'),
  135. component: 'InputPassword',
  136. componentProps: {},
  137. required: true,
  138. },
  139. {
  140. field: 'keyPassword',
  141. label: t('smart.auth.secret.title.keyPassword'),
  142. component: 'InputPassword',
  143. componentProps: {},
  144. required: true,
  145. },
  146. {
  147. field: 'alias',
  148. label: t('smart.auth.secret.title.alias'),
  149. component: 'Input',
  150. componentProps: {},
  151. required: true,
  152. },
  153. {
  154. field: 'publicKeyFileList',
  155. label: t('smart.auth.secret.title.publicKeyFile'),
  156. componentProps: {},
  157. slot: 'form-publicKeyFile',
  158. required: true,
  159. },
  160. {
  161. field: 'privateKeyFileList',
  162. label: t('smart.auth.secret.title.privateKeyFile'),
  163. componentProps: {},
  164. slot: 'form-privateKeyFile',
  165. required: true,
  166. },
  167. {
  168. field: 'remark',
  169. label: t('common.table.remark'),
  170. component: 'Input',
  171. componentProps: {},
  172. },
  173. ];
  174. };
  175. export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => {
  176. return [
  177. {
  178. field: 'keyName',
  179. label: t('smart.auth.secret.title.keyName'),
  180. component: 'Input',
  181. searchSymbol: 'like',
  182. },
  183. {
  184. field: 'useYn',
  185. label: t('common.table.useYn'),
  186. component: 'Select',
  187. searchSymbol: '=',
  188. componentProps: {
  189. style: {
  190. width: '120px',
  191. },
  192. options: [
  193. {
  194. label: t('common.form.use'),
  195. value: 1,
  196. },
  197. {
  198. label: t('common.form.noUse'),
  199. value: 0,
  200. },
  201. ],
  202. },
  203. },
  204. ];
  205. };