AppGrid
# 一、简介
AppGrid 是基于 Vxe-Table (opens new window) 封装的表格组件。
# 二、效果
http://210.12.53.106:8888/outer/test/AppToolbar (opens new window)
# 三、代码示例
<template>
<app-1 :mainGrid="mainGrid" :style="{ padding: '8px' }">
<div slot="singleTableTop">
<div>singleTableTop插槽</div>
</div>
<div slot="singleTableCenter">
<div>singleTableCenter插槽</div>
</div>
<div slot="singleTableTbarLeft" :style="{ 'margin-right': '20px' }">
<div>singleTableTbarLeft插槽</div>
</div>
</app-1>
</template>
<script>
export default {
data () {
return {
mainGrid: {
name: 'mainTable',
columns: [
{
title: 'id',
dataIndex: 'id',
hidden: true
},
{
title: '姓名',
dataIndex: 'name',
xtype: 'textfield',
align: 'left',
sortable: true,
allowBlank: false,
width: 100
},
{
title: '地址',
dataIndex: 'address',
xtype: 'textfield',
align: 'left',
sortable: true,
allowBlank: false,
width: 150
},
{
title: '备注',
dataIndex: 'comments',
xtype: 'textfield',
sortable: true,
width: 250
},
{
title: '创建人',
dataIndex: 'createUser',
xtype: 'textfield',
defaultValue: '{user}',
sortable: true,
readOnly: true,
width: 80
},
{
title: '创建时间',
dataIndex: 'createDate',
xtype: 'textfield',
defaultValue: '{today}',
align: 'center',
sortable: true,
readOnly: true,
width: 135
}
],
isEditGrid: true,
isCheckBoxModel: true,
rowNumber: true,
autoRetrieve: true,
findUrl: '/mock/app1/pagelist',
saveUrl: '/mock/app1/batchsave',
delUrl: '/mock/app1/batchdelete',
defaultOption: true,
tbar: [
{
text: '增加',
iconCls: 'add'
},
{
text: '删除',
iconCls: 'del'
},
{
text: '保存',
iconCls: 'save'
},
{
text: '保存',
iconCls: 'save'
}
],
findForm: [
{
title: '姓名',
dataIndex: 'name1',
xtype: 'textfield',
width: 150
}
]
}
}
}
}
</script>
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
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