80a3ae8d
xingyu
feat: add vue3(el...
|
1
2
3
|
import { reactive } from 'vue'
import { required } from '@/utils/formRules'
import { useI18n } from '@/hooks/web/useI18n'
|
519b08f2
xingyu4j
refactor: datasou...
|
4
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
80a3ae8d
xingyu
feat: add vue3(el...
|
5
6
7
8
9
10
11
12
13
14
|
// 国际化
const { t } = useI18n()
// 表单校验
export const rules = reactive({
name: [required],
url: [required],
username: [required],
password: [required]
})
// 新增 + 修改
|
519b08f2
xingyu4j
refactor: datasou...
|
15
16
17
18
19
20
21
22
|
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
action: true,
columns: [
{
title: '数据源名称',
field: 'name'
|
80a3ae8d
xingyu
feat: add vue3(el...
|
23
|
},
|
519b08f2
xingyu4j
refactor: datasou...
|
24
25
26
27
28
29
30
31
32
33
34
35
|
{
title: '数据源连接',
field: 'url',
form: {
component: 'Input',
componentProps: {
type: 'textarea',
rows: 4
},
colProps: {
span: 24
}
|
80a3ae8d
xingyu
feat: add vue3(el...
|
36
|
}
|
93a97cd5
xingyu
perf: 优化表单校验和查询参数
|
37
|
},
|
519b08f2
xingyu4j
refactor: datasou...
|
38
39
40
41
42
43
44
45
|
{
title: '用户名',
field: 'username'
},
{
title: '密码',
field: 'password',
isTable: false
|
80a3ae8d
xingyu
feat: add vue3(el...
|
46
|
},
|
519b08f2
xingyu4j
refactor: datasou...
|
47
48
49
50
51
|
{
title: t('common.createTime'),
field: 'createTime',
formatter: 'formatDate',
isForm: false
|
80a3ae8d
xingyu
feat: add vue3(el...
|
52
|
}
|
519b08f2
xingyu4j
refactor: datasou...
|
53
54
55
|
]
})
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|