AdwebTheme.data.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { BasicColumn, FormSchema } from '/@/components/Table';
  2. import { render } from '/@/utils/common/renderUtils';
  3. import { rules } from '@/utils/helper/validator';
  4. //列表数据
  5. export const columns: BasicColumn[] = [
  6. {
  7. title: '上架状态:0:未上架;1:已上架;默认0',
  8. align: 'center',
  9. dataIndex: 'putaway',
  10. },
  11. {
  12. title: '图片路径',
  13. align: 'center',
  14. dataIndex: 'images',
  15. customRender: render.renderImage,
  16. },
  17. {
  18. title: '模板价格',
  19. align: 'center',
  20. dataIndex: 'templatePrice',
  21. },
  22. {
  23. title: '模板标签',
  24. align: 'center',
  25. dataIndex: 'templateTags',
  26. },
  27. {
  28. title: '站点域名',
  29. align: 'center',
  30. dataIndex: 'domain',
  31. },
  32. {
  33. title: '站点备注',
  34. align: 'center',
  35. dataIndex: 'descirbe',
  36. },
  37. {
  38. title: '站点状态:0:创建失败,1:正常运行,2:运行异常 3:站点停止',
  39. align: 'center',
  40. dataIndex: 'runStatus',
  41. },
  42. ];
  43. export const formSchema: FormSchema[] = [
  44. {
  45. label: '',
  46. field: 'id',
  47. component: 'Input',
  48. show: false,
  49. },
  50. {
  51. label: '模板名称',
  52. field: 'name',
  53. component: 'Input',
  54. required: true,
  55. },
  56. {
  57. label: '图片路径',
  58. field: 'images',
  59. required: true,
  60. component: 'JImageUpload',
  61. componentProps: {
  62. fileMax: 1,
  63. },
  64. },
  65. {
  66. label: '站点code',
  67. field: 'code',
  68. component: 'Input',
  69. dynamicDisabled: ({ values }) => {
  70. return !!values.code && !!values.id;
  71. },
  72. ifShow: ({ values }) => {
  73. return !values.domain;
  74. },
  75. dynamicRules: ({ model, schema }) => {
  76. return [{ ...rules.existCheckRule('adweb_site', 'code', model, schema, false, '该临时站点不存在')[0], trigger: 'blur' }];
  77. },
  78. helpMessage: '请输入已经存在的临时站点code,系统将会自动生成该模板站点,如果该站点code为空,将会创建仅带图片的模板',
  79. //自定义提示属性,需要结合helpMessage一起使用
  80. helpComponentProps: {
  81. maxWidth: '200px',
  82. color: '#FFF',
  83. },
  84. },
  85. {
  86. label: '域名',
  87. field: 'domain',
  88. component: 'Input',
  89. dynamicDisabled: ({ values }) => {
  90. return !!values.id;
  91. },
  92. ifShow: ({ values }) => {
  93. return !!values.domain;
  94. },
  95. },
  96. ];