App9
# 一、简介
App9 是封装的单列表操作的功能组件。
# 二、效果
http://210.12.53.106:8888/outer/test/App9 (opens new window)
# 三、代码示例
<template>
<app9 :listOption="listOption">
<template #singleListTop>
<div>singleListTop 插槽</div>
</template>
<template #singleListCenter>
<div>singleListCenter 插槽</div>
</template>
<template #singleListTbarLeft>
<div>singleListTbarLeft 插槽</div>
</template>
<template #listRow="{ item }">
<div>{{ item.created }}</div>
</template>
<template slot="header">
<div>list 头部</div>
</template>
<template slot="footer">
<div>list 尾部</div>
</template>
</app9>
</template>
<script>
export default {
name: 'TestApp9',
data () {
return {
listOption: {
// component: () => import('@/components/Application/common/List/item/DescriptionsItem.vue'),
isEditList: true,
component: 'form',
isCheckBoxModel: true,
rowNumber: true,
autoRetrieve: true,
// itemStyle: { padding: '8px' },
columns: [
{
title: 'id',
dataIndex: 'id',
hidden: true
},
{
title: '国家编码',
dataIndex: 'countryCode',
xtype: 'textfield',
align: 'left',
sortable: true,
allowBlank: false,
width: 100
},
{
title: '国家名称',
dataIndex: 'description',
xtype: 'textfield',
align: 'left',
sortable: true,
allowBlank: false,
width: 150
},
{
title: '备注',
dataIndex: 'comments',
xtype: 'textfield',
align: 'left',
sortable: true,
width: 250
},
{
title: '禁用',
dataIndex: 'snatchFlag',
xtype: 'checkbox',
defaultValue: 0,
align: 'center',
sortable: true,
onData: 1,
offData: 0,
width: 80
},
{
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
}
],
findUrl: '/smm/country/find',
saveUrl: '/smm/country/batchsave',
delUrl: '/smm/country/batchdelete',
updateUrl: '/smm/country/update',
addUrl: '/smm/country/add',
defaultOption: true,
tbar: [
{
text: '全选',
btnId: 'selectAll'
},
{
text: '增加',
iconCls: 'add'
},
{
text: '删除',
iconCls: 'del'
},
{
text: '保存',
iconCls: 'save'
}
],
findForm: [
{
title: '国家编码',
dataIndex: 'countryCode',
xtype: 'textfield',
width: 150
},
'->',
{
title: '国家名称',
dataIndex: 'description',
xtype: 'textfield',
width: 200
},
{
title: '禁用',
dataIndex: 'snatchFlag',
xtype: 'radiogroup',
options: [
{ label: '可用', value: 0 },
{ label: '禁用', value: 1 },
{ label: '全部', value: undefined }
]
}
]
}
}
}
}
</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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153