Blame view

yudao-ui-admin-vue3/src/views/system/errorCode/errorCode.data.ts 1.29 KB
80a3ae8d   xingyu   feat: add vue3(el...
1
2
3
4
  import { reactive } from 'vue'
  import { required } from '@/utils/formRules'
  import { useI18n } from '@/hooks/web/useI18n'
  import { DICT_TYPE } from '@/utils/dict'
725cc4e4   xingyu4j   perf: vxe
5
6
  import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  const { t } = useI18n() // 国际化
80a3ae8d   xingyu   feat: add vue3(el...
7
8
9
10
11
12
13
  // 表单校验
  export const rules = reactive({
    applicationName: [required],
    code: [required],
    message: [required]
  })
  // 新增 + 修改
725cc4e4   xingyu4j   perf: vxe
14
15
16
17
18
19
20
21
22
23
24
25
  const crudSchemas = reactive<VxeCrudSchema>({
    primaryKey: 'id',
    primaryType: 'seq',
    action: true,
    columns: [
      {
        title: '错误码类型',
        field: 'type',
        dictType: DICT_TYPE.SYSTEM_ERROR_CODE_TYPE,
        search: {
          show: true
        }
80a3ae8d   xingyu   feat: add vue3(el...
26
      },
725cc4e4   xingyu4j   perf: vxe
27
28
29
30
31
32
      {
        title: '应用名',
        field: 'applicationName',
        search: {
          show: true
        }
80a3ae8d   xingyu   feat: add vue3(el...
33
      },
725cc4e4   xingyu4j   perf: vxe
34
35
36
37
38
      {
        title: '错误码编码',
        field: 'code',
        search: {
          show: true
80a3ae8d   xingyu   feat: add vue3(el...
39
        }
80a3ae8d   xingyu   feat: add vue3(el...
40
      },
725cc4e4   xingyu4j   perf: vxe
41
42
43
44
45
46
47
48
49
50
      {
        title: '错误码错误提示',
        field: 'message'
      },
      {
        title: t('common.createTime'),
        field: 'createTime',
        formatter: 'formatDate',
        form: {
          show: false
ac476382   xingyu4j   perf: vxe
51
52
53
54
55
56
        },
        search: {
          show: true,
          itemRender: {
            name: 'XDataTimePicker'
          }
725cc4e4   xingyu4j   perf: vxe
57
        }
80a3ae8d   xingyu   feat: add vue3(el...
58
      }
725cc4e4   xingyu4j   perf: vxe
59
60
61
    ]
  })
  export const { allSchemas } = useVxeCrudSchemas(crudSchemas)