kz-ui-base 1.0.43 → 1.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,498 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import ListBasePage from "@components/base/page/listBasePage";
|
|
3
|
-
//import tableListBasePage from "@components/base/page/tablelistBasePage";
|
|
4
|
-
import SampleEditDialog from "@views/sample/dialog/sampleEditDialog";
|
|
5
|
-
import SimpleDialogTest from "./OpMenusDialogTest.vue";
|
|
6
|
-
import {
|
|
7
|
-
listEntity,
|
|
8
|
-
getEntity,
|
|
9
|
-
addEntity,
|
|
10
|
-
updateEntity,
|
|
11
|
-
getUrl,
|
|
12
|
-
} from "@api/common/common";
|
|
13
|
-
import * as Utils from "@utils/utils";
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
extends: ListBasePage,
|
|
17
|
-
name: "ListPage",
|
|
18
|
-
components: { SampleEditDialog },
|
|
19
|
-
data() {
|
|
20
|
-
return {
|
|
21
|
-
//微服务模块名称
|
|
22
|
-
moduleName: "system",
|
|
23
|
-
//实体名称-服务名称
|
|
24
|
-
serviceName: "notice",
|
|
25
|
-
pkField: "noticeId",
|
|
26
|
-
//设置编辑界面窗口组件
|
|
27
|
-
//editDialogComponent: "SampleEditDialog",
|
|
28
|
-
// 列表列信息
|
|
29
|
-
listColumns: [
|
|
30
|
-
{ text: `Id`, property: "noticeId" },
|
|
31
|
-
{ text: `公告标题`, property: "noticeTitle" },
|
|
32
|
-
{ text: `公告内容`, property: "noticeContent", visible: true },
|
|
33
|
-
{
|
|
34
|
-
text: `公告类型`,
|
|
35
|
-
property: "noticeType",
|
|
36
|
-
visible: true,
|
|
37
|
-
setting: { dictType: "sys_notice_type" },
|
|
38
|
-
},
|
|
39
|
-
{ text: `创建时间`, property: "createTime", displayType: "DatePicker" },
|
|
40
|
-
{
|
|
41
|
-
text: `自定义格式时间`,
|
|
42
|
-
property: "createTime",
|
|
43
|
-
displayType: "DatePicker",
|
|
44
|
-
setting: { format: "yyyy-MM-dd" },
|
|
45
|
-
},
|
|
46
|
-
{ text: `备注`, property: "remark" },
|
|
47
|
-
{ text: `文件类型列`, property: "remark", displayType: "Upload" },
|
|
48
|
-
{
|
|
49
|
-
text: `文件名称显示`,
|
|
50
|
-
property: "remark",
|
|
51
|
-
format: "fileFormat",
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
text: `自定义显示格式列`,
|
|
55
|
-
property: "remark",
|
|
56
|
-
format: "remarkFormat",
|
|
57
|
-
},
|
|
58
|
-
{ text: `自定义click列`, property: "remark", click: "onFilePriview" },
|
|
59
|
-
{
|
|
60
|
-
text: `自定义html列`,
|
|
61
|
-
property: "remark",
|
|
62
|
-
htmlFormat: "getFilePriviewLink",
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
|
|
66
|
-
// 查询条件
|
|
67
|
-
searchRules: [
|
|
68
|
-
{
|
|
69
|
-
text: `公告标题`,
|
|
70
|
-
property: "noticeTitle",
|
|
71
|
-
displayType: "TextBox",
|
|
72
|
-
visible: false,
|
|
73
|
-
setting: {
|
|
74
|
-
default: "公告公告", //默认显示值
|
|
75
|
-
customStyle: "color:red", //自定义样式
|
|
76
|
-
},
|
|
77
|
-
// inputType: "number", // 输入类型默认不传
|
|
78
|
-
// maxLength: "10", // 输入长度限制
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
text: `公告类型`,
|
|
82
|
-
property: "noticeType",
|
|
83
|
-
displayType: "DropDownList",
|
|
84
|
-
setting: {
|
|
85
|
-
parameter: {}, //自定义参数
|
|
86
|
-
dictType: "sys_notice_type",
|
|
87
|
-
default: "1", //默认显示值
|
|
88
|
-
multiple: false, //多选
|
|
89
|
-
// findValue:'',//需要过滤的value
|
|
90
|
-
// noneFindValue:''//需要去除的value
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
text: `复选框`,
|
|
95
|
-
items: [
|
|
96
|
-
{ value: "测试1", key: "1" },
|
|
97
|
-
{ value: "测试2", key: "2" },
|
|
98
|
-
],
|
|
99
|
-
property: "test1",
|
|
100
|
-
displayType: "CheckBox",
|
|
101
|
-
disabled: false,
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
//弹出框设置
|
|
105
|
-
editSetting: {
|
|
106
|
-
//input标题宽度
|
|
107
|
-
labelWidth: "120px",
|
|
108
|
-
},
|
|
109
|
-
// 列信息
|
|
110
|
-
editColumns: [
|
|
111
|
-
{
|
|
112
|
-
text: `公告标题`,
|
|
113
|
-
property: "noticeTitle",
|
|
114
|
-
displayType: "TextBox",
|
|
115
|
-
visible: true,
|
|
116
|
-
placeholder: "自定义占位符", //占位符文案 默认不传 不传就显示text的文案
|
|
117
|
-
// inputType: "number", // 输入类型默认不传
|
|
118
|
-
// maxLength: "10", // 输入长度限制
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
text: `公告类型`,
|
|
122
|
-
property: "noticeType",
|
|
123
|
-
displayType: "DropDownList",
|
|
124
|
-
setting: {
|
|
125
|
-
dictType: "sys_notice_type",
|
|
126
|
-
formatKeyValue: true,
|
|
127
|
-
// filterable: true, //搜索下拉 不传为false
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
text: `创建时间`,
|
|
132
|
-
property: "createTime",
|
|
133
|
-
displayType: "DatePicker",
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
text: `公告内容`,
|
|
137
|
-
property: "noticeContent",
|
|
138
|
-
displayType: "Editor",
|
|
139
|
-
width: 24,
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
text: `级联下拉-部门`,
|
|
143
|
-
property: "dept_id",
|
|
144
|
-
displayType: "DropDownList",
|
|
145
|
-
setting: {
|
|
146
|
-
type: "Dept",
|
|
147
|
-
//关联字段,用于下拉选项变更时,自动将下拉选项中的其它值带到当前实体类属性值上,比如选择部门时,除了带出部门Id,同时带出部门名称到下面的关联字段部门名称上
|
|
148
|
-
relationFields: { dept_name: "deptName" },
|
|
149
|
-
default: "1470273027207061504", //默认显示值
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
text: `级联下拉-用户`,
|
|
154
|
-
property: "userId",
|
|
155
|
-
displayType: "DropDownList",
|
|
156
|
-
setting: {
|
|
157
|
-
//当前实体类主键字段。若为id则无需配置
|
|
158
|
-
pkField: "noticeId",
|
|
159
|
-
type: "User",
|
|
160
|
-
//级联绑定查询字段。property为查询参数名,dependenceField为依赖变更触发字段(比如此处用户用户下拉依赖上面的部门Id字段),dependenceValueField为依赖取值字段(可为空,为空时取dependenceField,比如依赖部门Id,但变更时需要取值部门名称)
|
|
161
|
-
searchRules: [
|
|
162
|
-
{
|
|
163
|
-
property: "deptId",
|
|
164
|
-
dependenceField: "dept_id",
|
|
165
|
-
dependenceValueField: "dept_id",
|
|
166
|
-
value: null,
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
{
|
|
173
|
-
text: `关联字段-部门名称`,
|
|
174
|
-
property: "dept_name",
|
|
175
|
-
displayType: "TextBox",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
text: `复选框`,
|
|
179
|
-
items: [
|
|
180
|
-
{ value: "测试1", key: "1" },
|
|
181
|
-
{ value: "测试2", key: "2" },
|
|
182
|
-
],
|
|
183
|
-
property: "test1",
|
|
184
|
-
displayType: "CheckBox",
|
|
185
|
-
disabled: false,
|
|
186
|
-
},
|
|
187
|
-
{ text: `颜色选择器`, property: "test2", displayType: "ColorPicker" },
|
|
188
|
-
{ text: `开关`, property: "test3", displayType: "Switch" },
|
|
189
|
-
{
|
|
190
|
-
text: `文本域`,
|
|
191
|
-
property: "test4",
|
|
192
|
-
displayType: "TextArea",
|
|
193
|
-
disabled: true,
|
|
194
|
-
},
|
|
195
|
-
{ text: `上传组件`, property: "remark", displayType: "Upload" },
|
|
196
|
-
{
|
|
197
|
-
text: `日期控件`,
|
|
198
|
-
property: "test6",
|
|
199
|
-
displayType: "DatePicker",
|
|
200
|
-
// range: true, //是否显示日期范围 不传默认为false
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
{
|
|
204
|
-
text: `用户Lookup框`,
|
|
205
|
-
property: "test17",
|
|
206
|
-
displayType: "Lookup",
|
|
207
|
-
//常用功能简化配置
|
|
208
|
-
setting: {
|
|
209
|
-
title: "请选择用户",
|
|
210
|
-
type: "User",
|
|
211
|
-
//弹框是否显示确定 取消 不传默认不显示true
|
|
212
|
-
footerButton: true,
|
|
213
|
-
//搜索弹框宽度 不传默认为800px
|
|
214
|
-
width: "1000px",
|
|
215
|
-
//树配置 不传默认为false
|
|
216
|
-
treeSetting: {
|
|
217
|
-
visable: true,
|
|
218
|
-
moduleName: "system",
|
|
219
|
-
serviceName: "dept",
|
|
220
|
-
//主键字段
|
|
221
|
-
pkField: "deptId",
|
|
222
|
-
//树外键主键字段
|
|
223
|
-
treeFkField: "id",
|
|
224
|
-
title: "请输入部门|岗位名称",
|
|
225
|
-
},
|
|
226
|
-
listColumns: [
|
|
227
|
-
{ text: `用户名1`, property: "userName" },
|
|
228
|
-
{ text: `昵称`, property: "nickName" },
|
|
229
|
-
],
|
|
230
|
-
// 查询条件 不传默认不显示
|
|
231
|
-
searchRules: [
|
|
232
|
-
{ text: `用户名`, property: "userName" },
|
|
233
|
-
{
|
|
234
|
-
text: `状态`,
|
|
235
|
-
property: "status",
|
|
236
|
-
displayType: "DropDownList",
|
|
237
|
-
setting: { dictType: "sys_normal_disable" },
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
text: `用户Lookup框-Url配置`,
|
|
244
|
-
property: "test17",
|
|
245
|
-
displayType: "Lookup",
|
|
246
|
-
//直接使用微服务配置其它任意功能为Lookup选择数据源,指定显示字段和取值字段
|
|
247
|
-
setting: {
|
|
248
|
-
url: "/system/user/list?noticeType={noticeType}",
|
|
249
|
-
//moduleName: "system",
|
|
250
|
-
//serviceName: "user",
|
|
251
|
-
//getListAction: "list",
|
|
252
|
-
displayField: "nickName",
|
|
253
|
-
valueField: "userId",
|
|
254
|
-
},
|
|
255
|
-
//直接使用Url配置其它任意功能为Lookup选择数据源,指定显示字段和取值字段
|
|
256
|
-
//setting: {
|
|
257
|
-
// url: "/system/user/list",
|
|
258
|
-
// displayField: "nickName",
|
|
259
|
-
// valueField: "userId"
|
|
260
|
-
//},
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
text: `用户下拉框`,
|
|
264
|
-
property: "test7",
|
|
265
|
-
displayType: "DropDownList",
|
|
266
|
-
setting: { type: "User" },
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
text: `自定义下拉`,
|
|
270
|
-
property: "test8",
|
|
271
|
-
displayType: "DropDownList",
|
|
272
|
-
setting: {
|
|
273
|
-
multiple: true, //多选
|
|
274
|
-
items: [
|
|
275
|
-
{ text: "选项1", value: "1" },
|
|
276
|
-
{ text: "选项2", value: "2" },
|
|
277
|
-
],
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
text: `Url数据源下拉`,
|
|
282
|
-
property: "test9",
|
|
283
|
-
displayType: "DropDownList",
|
|
284
|
-
setting: {
|
|
285
|
-
url: "/system/user/list",
|
|
286
|
-
displayField: "nickName",
|
|
287
|
-
valueField: "userId",
|
|
288
|
-
assignment: "assignment",
|
|
289
|
-
// filterable: true, //搜索下拉 不传为false
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
text: `赋值`,
|
|
294
|
-
property: "assignment",
|
|
295
|
-
displayType: "TextBox",
|
|
296
|
-
visible: true,
|
|
297
|
-
|
|
298
|
-
// placeholder: "自定义占位符", //占位符文案 默认不传 不传就显示text的文案
|
|
299
|
-
// inputType: "number", // 输入类型默认不传
|
|
300
|
-
// maxLength: "10", // 输入长度限制
|
|
301
|
-
},
|
|
302
|
-
],
|
|
303
|
-
// 表单校验
|
|
304
|
-
editRules: {
|
|
305
|
-
noticeTitle: [
|
|
306
|
-
{ required: true, message: "公告标题不能为空", trigger: "blur" },
|
|
307
|
-
{
|
|
308
|
-
min: 2,
|
|
309
|
-
max: 20,
|
|
310
|
-
message: "公告标题长度必须介于 2 和 20 之间",
|
|
311
|
-
trigger: "blur",
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
digits: true,
|
|
315
|
-
min: 0,
|
|
316
|
-
message: "公告标题必须为正整数",
|
|
317
|
-
trigger: "blur",
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
noticeType: [
|
|
321
|
-
{ required: true, message: "公告类型不能为空", trigger: "blur" },
|
|
322
|
-
],
|
|
323
|
-
noticeContent: [
|
|
324
|
-
{ required: true, message: "公告内容不能为空", trigger: "blur" },
|
|
325
|
-
],
|
|
326
|
-
//userName: [
|
|
327
|
-
// { required: true, message: "用户账号不能为空", trigger: "blur" }
|
|
328
|
-
//],
|
|
329
|
-
//nickName: [
|
|
330
|
-
// { required: true, message: "用户名称不能为空", trigger: "blur" }
|
|
331
|
-
//],
|
|
332
|
-
//password: [
|
|
333
|
-
// { required: true, message: "用户密码不能为空", trigger: "blur" },
|
|
334
|
-
// { min: 6, max: 20, message: '用户密码长度必须介于 6 和 20 之间', trigger: 'blur' }
|
|
335
|
-
//],
|
|
336
|
-
//email: [
|
|
337
|
-
// {
|
|
338
|
-
// type: "email",
|
|
339
|
-
// message: "'请输入正确的邮箱地址",
|
|
340
|
-
// trigger: ["blur", "change"]
|
|
341
|
-
// }
|
|
342
|
-
//],
|
|
343
|
-
//phone: [
|
|
344
|
-
// {
|
|
345
|
-
// pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
346
|
-
// message: "请输入正确的手机号码",
|
|
347
|
-
// trigger: "blur"
|
|
348
|
-
// }
|
|
349
|
-
//]
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
//自定义操作菜单设定 - 若无自定义按钮,不需要重写
|
|
353
|
-
customOpMenus: [
|
|
354
|
-
{
|
|
355
|
-
visable: true,
|
|
356
|
-
text: "按钮11",
|
|
357
|
-
icon: "el-icon-plus",
|
|
358
|
-
permission: "system:user:list",
|
|
359
|
-
name: "custom1",
|
|
360
|
-
isShowText: false,
|
|
361
|
-
},
|
|
362
|
-
{
|
|
363
|
-
visable: true,
|
|
364
|
-
text: "按钮2",
|
|
365
|
-
text: "el-icon-plus",
|
|
366
|
-
name: "custom2",
|
|
367
|
-
isShowText: false,
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
visable: true,
|
|
371
|
-
text: "按钮3",
|
|
372
|
-
icon: "el-icon-plus",
|
|
373
|
-
name: "custom3",
|
|
374
|
-
isShowText: false,
|
|
375
|
-
},
|
|
376
|
-
],
|
|
377
|
-
//列表自定义操作菜单设定 - 若无自定义按钮,不需要重写
|
|
378
|
-
listCustomOpMenus: [
|
|
379
|
-
{
|
|
380
|
-
visable: true,
|
|
381
|
-
text: "预览",
|
|
382
|
-
icon: "el-icon-edit",
|
|
383
|
-
permission: "",
|
|
384
|
-
name: "priview",
|
|
385
|
-
isShowText: false,
|
|
386
|
-
},
|
|
387
|
-
],
|
|
388
|
-
//编辑界面自定义按钮菜单 - 若无自定义按钮,不需要重写
|
|
389
|
-
editCustomOpMenus: [
|
|
390
|
-
{
|
|
391
|
-
name: "custom1",
|
|
392
|
-
visable: true,
|
|
393
|
-
icon: "ion-plus-round",
|
|
394
|
-
text: "自定义1",
|
|
395
|
-
},
|
|
396
|
-
],
|
|
397
|
-
//树形表格
|
|
398
|
-
treeSetting: {
|
|
399
|
-
visable: true,
|
|
400
|
-
moduleName: "system",
|
|
401
|
-
serviceName: "notice",
|
|
402
|
-
//主键字段
|
|
403
|
-
pkField: "createBy",
|
|
404
|
-
//树外键主键字段
|
|
405
|
-
treeFkField: "id",
|
|
406
|
-
title: "请输入部门|岗位名称",
|
|
407
|
-
},
|
|
408
|
-
};
|
|
409
|
-
},
|
|
410
|
-
created() {
|
|
411
|
-
/*
|
|
412
|
-
//隐藏操作菜单按钮示例,隐藏或更新其它操作菜单按钮配置值
|
|
413
|
-
this.updateOpMenu({ visable: false }, ["custom2"]);
|
|
414
|
-
//隐藏列表列示例,隐藏或更新其它操作菜单按钮配置值
|
|
415
|
-
this.updateListColumn({ visable: false }, ["noticeId"]);
|
|
416
|
-
//禁用和隐藏编辑列示例,隐藏或更新其它操作菜单按钮配置值
|
|
417
|
-
this.updateEditColumn({ disabled: true }, ["noticeTitle", "test3"]);
|
|
418
|
-
*/
|
|
419
|
-
},
|
|
420
|
-
methods: {
|
|
421
|
-
/** 列表表格自定义按钮点击处理 */
|
|
422
|
-
onListCustomOpMenuClick(args) {
|
|
423
|
-
switch (args.opMenu.name) {
|
|
424
|
-
case "priview":
|
|
425
|
-
this.onFilePriview(args.data);
|
|
426
|
-
break;
|
|
427
|
-
case "custom2":
|
|
428
|
-
alert("自定义按钮2点击事件");
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
/** 自定义操作菜单按钮点击处理 */
|
|
433
|
-
onCustomOpMenuClick(args) {
|
|
434
|
-
switch (args.opMenu.name) {
|
|
435
|
-
case "custom1":
|
|
436
|
-
this.Dialog.open({
|
|
437
|
-
component: SampleEditDialog,
|
|
438
|
-
setting: {
|
|
439
|
-
isShow: true,
|
|
440
|
-
title: "标题标题",
|
|
441
|
-
size: "small", //可选项tiny/small/large/full
|
|
442
|
-
width: "800px", //表格宽度 不传默认为800px
|
|
443
|
-
labelWidth: "120px", //input标题宽度 不传默认为100px
|
|
444
|
-
data: { entity: this.currentEntity },
|
|
445
|
-
},
|
|
446
|
-
//beforeClose: (done) => {
|
|
447
|
-
// //点右上角关闭按钮后触发
|
|
448
|
-
// console.log("1");
|
|
449
|
-
// done();
|
|
450
|
-
//},
|
|
451
|
-
//close: () => {
|
|
452
|
-
// //关闭后触发
|
|
453
|
-
// console.log("2");
|
|
454
|
-
//},
|
|
455
|
-
confirm: (result) => {
|
|
456
|
-
//显式$emit('confirm')时触发
|
|
457
|
-
console.log("3 ", result);
|
|
458
|
-
},
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
break;
|
|
462
|
-
case "custom2":
|
|
463
|
-
alert("自定义按钮2点击事件");
|
|
464
|
-
break;
|
|
465
|
-
case "custom3":
|
|
466
|
-
break;
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
/** 编辑界面自定义按钮点击处理 */
|
|
470
|
-
onEditCustomOpMenuClick(args) {
|
|
471
|
-
switch (args.opMenu.name) {
|
|
472
|
-
case "custom1":
|
|
473
|
-
alert("编辑界面自定义按钮1点击事件");
|
|
474
|
-
break;
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
/** 自定义列显示格式方法 */
|
|
479
|
-
fileFormat(data, column) {
|
|
480
|
-
return this.getFileNickName(data.remark);
|
|
481
|
-
},
|
|
482
|
-
/** 自定义列显示格式方法 */
|
|
483
|
-
remarkFormat(data, column) {
|
|
484
|
-
return data.remark ? "有备注" : "无备注";
|
|
485
|
-
},
|
|
486
|
-
/** 自定义列点击方法 */
|
|
487
|
-
onFilePriview(data, column) {
|
|
488
|
-
if (data.remark) this.filePriview(data.remark);
|
|
489
|
-
},
|
|
490
|
-
/** 自定义列显示Html */
|
|
491
|
-
getFilePriviewLink(data, column) {
|
|
492
|
-
return `<a href="${this.getFilePriviewUrl(
|
|
493
|
-
data.remark
|
|
494
|
-
)}" target="_blank">${data.remark ? "自定义预览" : ""}</a>`;
|
|
495
|
-
},
|
|
496
|
-
},
|
|
497
|
-
};
|
|
498
|
-
</script>
|