24
24
</el-tooltip >
25
25
</el-space >
26
26
27
- <div >
28
- <ElpForm
29
- :formItems =" formItems"
30
- :rules =" rules"
31
- :submitLoading =" submitLoading"
32
- :layoutConfig =" layoutConfig"
33
- @resetForm =" resetForm"
34
- @search =" search"
35
- >
36
- 1212</ElpForm
37
- >
38
- </div >
39
- <div >
40
- <h2 >添加用户</h2 >
41
- <el-button type =" primary" @click =" dialogVisible = true" >添加账号</el-button >
42
- <el-dialog v-model =" dialogVisible" title =" 添加账号" width =" 40%" >
27
+ <div class =" container" >
28
+ <el-card class =" box-card" >
29
+ <template #header >
30
+ <div class =" card-header" >
31
+ <span >{{ t("text.search") }}</span >
32
+ </div >
33
+ </template >
34
+ <ElpForm
35
+ :formItems =" formItems"
36
+ :rules =" rules"
37
+ :submitLoading =" submitLoading"
38
+ :formAttr =" { inline: true }"
39
+ @resetForm =" resetForm"
40
+ @search =" search"
41
+ >
42
+ </ElpForm >
43
+ </el-card >
44
+
45
+ <el-card class =" box-card" style =" width : 480px " >
46
+ <template #header >
47
+ <div class =" card-header" >
48
+ <span >{{ t("text.addUser") }}</span >
49
+ </div >
50
+ </template >
43
51
<ElpForm
44
52
:formItems =" addUserForm"
45
53
:rules =" rules"
46
54
:submitLoading =" submitLoading"
47
55
@resetForm =" resetForm"
48
56
@search =" search"
49
- />
50
- </el-dialog >
51
- <ElpForm
52
- :formItems =" addUserForm"
53
- :rules =" rules"
54
- :submitLoading =" submitLoading"
55
- @resetForm =" resetForm"
56
- @search =" search"
57
- />
57
+ >
58
+ </ElpForm >
59
+ </el-card >
58
60
</div >
59
61
</template >
60
62
@@ -108,20 +110,20 @@ const rules = reactive<FormRules>({
108
110
});
109
111
const formItems = reactive ([
110
112
{
111
- label: " 姓名 " ,
113
+ label: t ( " text.name " ) ,
112
114
type: " input" ,
113
115
value: " name" ,
114
116
defaultValue: " " ,
115
117
116
118
attribute: {
117
119
maxlength: 20 ,
118
120
clearable: true ,
119
- placeholder: " 请输入姓名 "
121
+ placeholder: t ( " text.name " )
120
122
},
121
123
rowIndex: 0
122
124
},
123
125
{
124
- label: " 电话 " ,
126
+ label: t ( " text.phone " ) ,
125
127
type: " input" ,
126
128
value: " mobile" ,
127
129
defaultValue: " " ,
@@ -130,44 +132,44 @@ const formItems = reactive([
130
132
maxlength: 11 ,
131
133
showWordLimit: true ,
132
134
clearable: true ,
133
- placeholder: " 请输入电话 "
135
+ placeholder: t ( " text.phone " )
134
136
},
135
137
rowIndex: 1
136
138
},
137
139
{
138
- label: " 状态 " ,
140
+ label: t ( " text.status " ) ,
139
141
type: " select" ,
140
142
value: " selectValue" ,
141
143
defaultValue: " 0" ,
142
144
143
145
attribute: {
144
- placeholder: " 请选择状态 "
146
+ placeholder: t ( " text.status " )
145
147
},
146
148
options: [
147
149
{
148
- label: " 全部 " ,
150
+ label: t ( " text.all " ) ,
149
151
value: " 0"
150
152
},
151
153
{
152
- label: " 启用 " ,
154
+ label: t ( " text.abel " ) ,
153
155
value: " 1"
154
156
},
155
157
{
156
- label: " 禁用 " ,
158
+ label: t ( " text.disable " ) ,
157
159
value: " 2"
158
160
}
159
161
],
160
162
rowIndex: 2
161
163
},
162
164
// 日期
163
165
{
164
- label: " 日期 " ,
166
+ label: t ( " text.date " ) ,
165
167
type: " date" ,
166
168
value: " date" ,
167
169
defaultValue: " " ,
168
170
attribute: {
169
- startPlaceholder: " 开始日期 " ,
170
- endPlaceholder: " 结束日期 " ,
171
+ startPlaceholder: t ( " text.startDate " ) ,
172
+ endPlaceholder: t ( " text.endDate " ) ,
171
173
type: " datetimerange" ,
172
174
// "value-format": "yyyy-MM-dd HH:mm:ss",
173
175
" range-separator" : " 至" ,
@@ -183,39 +185,49 @@ const formItems = reactive([
183
185
]);
184
186
const addUserForm = [
185
187
{
186
- label: " 姓名" ,
188
+ label: t (" text.username" ),
189
+ type: " switch" ,
190
+ value: " switch" ,
191
+ defaultValue: false ,
192
+ attribute: {
193
+ // placeholder: t("placeholder.username"),
194
+ },
195
+ rowIndex: 10
196
+ },
197
+ {
198
+ label: t (" text.username" ),
187
199
type: " input" ,
188
200
value: " username" ,
189
201
defaultValue: " " ,
190
202
191
203
attribute: {
192
- placeholder: " 请输入姓名 " ,
204
+ placeholder: t ( " placeholder.username " ) ,
193
205
maxlength: 20 ,
194
206
clearable: true
195
207
},
196
208
rowIndex: 0
197
209
},
198
210
{
199
- label: " 账号 " ,
211
+ label: t ( " text.account " ) ,
200
212
type: " input" ,
201
213
value: " password" ,
202
214
defaultValue: " " ,
203
215
204
216
attribute: {
205
- placeholder: " 请输入账号 " ,
217
+ placeholder: t ( " placeholder.account " ) ,
206
218
maxlength: 20 ,
207
219
clearable: true
208
220
},
209
221
rowIndex: 1
210
222
},
211
223
{
212
- label: " 密码 " ,
224
+ label: t ( " text.password " ) ,
213
225
type: " input" ,
214
226
value: " password" ,
215
227
defaultValue: " " ,
216
228
217
229
attribute: {
218
- placeholder: " 请输入密码 " ,
230
+ placeholder: t ( " placeholder.password " ) ,
219
231
maxlength: 20 ,
220
232
clearable: true
221
233
},
@@ -263,7 +275,7 @@ const layoutConfig = [
263
275
onMounted (() => {});
264
276
</script >
265
277
266
- <style >
278
+ <style lang="scss" >
267
279
.el-empty__description {
268
280
margin : 0 !important ;
269
281
}
@@ -275,4 +287,12 @@ onMounted(() => {});
275
287
align-items : center ;
276
288
align-content : center ;
277
289
}
290
+
291
+ .container {
292
+ // background: red;
293
+ margin-top : 1.5rem ;
294
+ .box-card :not (:last-child ) {
295
+ margin-bottom : 20px ;
296
+ }
297
+ }
278
298
</style >
0 commit comments