1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
| import type { FormSchemaGetter } from '#/adapter/form';
| import type { VxeGridProps } from '#/adapter/vxe-table';
| import { h } from 'vue';
| import { FolderIcon, VbenIcon } from '@vben/icons';
|
| export const querySchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| fieldName: 'name',
| label: '页面名称',
| },
| {
| component: 'Select',
| componentProps: {
| options: [
| { label: '正常', value: '1' },
| { label: '停用', value: '0' },
| ],
| },
| fieldName: 'status',
| label: '页面状态',
| },
| ];
|
| export const columns: VxeGridProps['columns'] = [
| {
| title: '页面名称',
| field: 'name',
| },
| {
| title: '上级目录',
| field: 'parentName',
| slots: {
| default: ({ row }) => {
| return row.parent?.name || row.menu?.menuName || '-';
| },
| },
| },
| {
| title: '状态',
| field: 'status',
| slots: {
| default: ({ row }) => {
| return row.status === '1' ? '正常' : '停用';
| },
| },
| },
| {
| title: '创建时间',
| field: 'createTime',
| },
| {
| field: 'action',
| fixed: 'right',
| slots: { default: 'action' },
| title: '操作',
| },
| ];
|
| export const drawerSchema = () => [
| {
| component: 'Input',
| fieldName: 'name',
| label: '页面名称',
| rules: 'required',
| },
| {
| component: 'TreeSelect',
| fieldName: 'menuId',
| label: '上级目录',
| componentProps: {
| allowClear: true,
| showSearch: true,
| },
| rules: 'selectRequired',
| },
| {
| component: 'Select',
| fieldName: 'status',
| label: '状态',
| componentProps: {
| options: [
| { label: '正常', value: '1' },
| { label: '停用', value: '0' },
| ],
| },
| rules: 'selectRequired',
| },
| {
| component: 'CheckboxGroup',
| fieldName: 'actionsFunc',
| label: '启用功能',
| defaultValue: ['add', 'edit', 'delete', 'query'],
| componentProps: {
| options: [
| { label: '新增', value: 'add' },
| { label: '编辑', value: 'edit' },
| { label: '删除', value: 'delete' },
| { label: '查询', value: 'query' },
| ],
| },
| rules: 'required',
| },
| {
| component: 'Input',
| fieldName: 'remark',
| label: '备注',
| componentProps: {
| type: 'textarea',
| rows: 2,
| },
| },
| ];
|
|