kz-ui-base 1.0.41 → 1.0.43

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.
@@ -48,12 +48,12 @@
48
48
  <script>
49
49
  import { addEntity, updateEntity } from "../../../api/common/common";
50
50
 
51
- import FormColumns from "@components/customForm/formColumns";
51
+ // import FormColumns from "@components/customForm/formColumns";
52
52
 
53
53
  export default {
54
54
  name: "EditDialog",
55
55
  components: {
56
- FormColumns,
56
+ // FormColumns,
57
57
  },
58
58
  props: {
59
59
  //微服务模块名称
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  // import ListBasePage from "@components/base/page/listBasePage";
3
- import DoubleListBasePage from "@components/base/page/doublelistBasePage";
3
+ // import DoubleListBasePage from "@components/base/page/doublelistBasePage"
4
+ import {DoubleListBasePage} from "kz-ui-base";
4
5
  import SampleEditDialog from "@views/sample/dialog/sampleEditDialog";
5
6
  import SimpleDialogTest from "./OpMenusDialogTest.vue";
6
7
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,427 +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 { filePriview } from "@utils/file";
14
- import { getFilePriviewUrl } from "@utils/file";
15
-
16
- export default {
17
- // extends: tableListBasePage,
18
- extends: ListBasePage,
19
- name: "tableIndex",
20
- components: { SampleEditDialog },
21
- data() {
22
- return {
23
- //微服务模块名称
24
- moduleName: "system",
25
- //实体名称-服务名称
26
- serviceName: "notice",
27
- pkField: "noticeId",
28
- //设置编辑界面窗口组件
29
- //editDialogComponent: "SampleEditDialog",
30
- // 列表列信息
31
- listColumns: [
32
- { text: `Id`, property: "noticeId" },
33
- { text: `公告标题`, property: "noticeTitle" },
34
- { text: `公告内容`, property: "noticeContent", visible: true },
35
- {
36
- text: `公告类型`,
37
- property: "noticeType",
38
- visible: true,
39
- setting: { dictType: "sys_notice_type" },
40
- },
41
- { text: `备注`, property: "remark" },
42
- {
43
- text: `自定义显示格式列`,
44
- property: "remark",
45
- format: "remarkFormat",
46
- },
47
- { text: `自定义click列`, property: "remark", click: "onFilePriview" },
48
- {
49
- text: `自定义html列`,
50
- property: "remark",
51
- htmlFormat: "getFilePriviewLink",
52
- },
53
- ],
54
-
55
- // 查询条件
56
- searchRules: [
57
- { text: `公告标题`, property: "noticeTitle", visible: false },
58
- {
59
- text: `公告类型`,
60
- property: "noticeType",
61
- displayType: "DropDownList",
62
- setting: { dictType: "sys_notice_type" },
63
- },
64
- ],
65
- // 列信息
66
- editColumns: [
67
- {
68
- text: `公告标题`,
69
- property: "noticeTitle",
70
- displayType: "TextBox",
71
- visible: true,
72
- },
73
- {
74
- text: `公告类型`,
75
- property: "noticeType",
76
- displayType: "DropDownList",
77
- setting: { dictType: "sys_notice_type" },
78
- },
79
- {
80
- text: `公告内容`,
81
- property: "noticeContent",
82
- displayType: "Editor",
83
- width: 24,
84
- },
85
- {
86
- text: `复选框`,
87
- property: "test1",
88
- displayType: "CheckBox",
89
- disabled: true,
90
- },
91
- { text: `颜色选择器`, property: "test2", displayType: "ColorPicker" },
92
- { text: `开关`, property: "test3", displayType: "Switch" },
93
- {
94
- text: `文本域`,
95
- property: "test4",
96
- displayType: "TextArea",
97
- disabled: true,
98
- },
99
- { text: `上传组件`, property: "test5", displayType: "Upload" },
100
- { text: `日期控件`, property: "test6", displayType: "DatePicker" },
101
- {
102
- text: `用户下拉框`,
103
- property: "test7",
104
- displayType: "DropDownList",
105
- setting: { type: "User" },
106
- },
107
- {
108
- text: `自定义下拉`,
109
- property: "test8",
110
- displayType: "DropDownList",
111
- setting: {
112
- items: [
113
- { text: "选项1", value: "1" },
114
- { text: "选项2", value: "2" },
115
- ],
116
- },
117
- },
118
- {
119
- text: `Url数据源下拉`,
120
- property: "test9",
121
- displayType: "DropDownList",
122
- setting: {
123
- url: "/system/user/list",
124
- displayField: "nickName",
125
- valueField: "userId",
126
- },
127
- },
128
- ],
129
- // 表单校验
130
- editRules: {
131
- noticeTitle: [
132
- { required: true, message: "公告标题不能为空", trigger: "blur" },
133
- {
134
- min: 2,
135
- max: 20,
136
- message: "公告标题长度必须介于 2 和 20 之间",
137
- trigger: "blur",
138
- },
139
- ],
140
- noticeType: [
141
- { required: true, message: "公告类型不能为空", trigger: "blur" },
142
- ],
143
- noticeContent: [
144
- { required: true, message: "公告内容不能为空", trigger: "blur" },
145
- ],
146
- //userName: [
147
- // { required: true, message: "用户账号不能为空", trigger: "blur" }
148
- //],
149
- //nickName: [
150
- // { required: true, message: "用户名称不能为空", trigger: "blur" }
151
- //],
152
- //password: [
153
- // { required: true, message: "用户密码不能为空", trigger: "blur" },
154
- // { min: 6, max: 20, message: '用户密码长度必须介于 6 和 20 之间', trigger: 'blur' }
155
- //],
156
- //email: [
157
- // {
158
- // type: "email",
159
- // message: "'请输入正确的邮箱地址",
160
- // trigger: ["blur", "change"]
161
- // }
162
- //],
163
- //phone: [
164
- // {
165
- // pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
166
- // message: "请输入正确的手机号码",
167
- // trigger: "blur"
168
- // }
169
- //]
170
- },
171
-
172
- //自定义操作菜单设定 - 若无自定义按钮,不需要重写
173
- customOpMenus: [
174
- {
175
- visable: true,
176
- text: "按钮11",
177
- icon: "el-icon-plus",
178
- permission: "system:user:list",
179
- name: "custom1",
180
- isShowText: false,
181
- },
182
- {
183
- visable: true,
184
- text: "按钮2",
185
- text: "el-icon-plus",
186
- permission: "",
187
- name: "custom2",
188
- isShowText: false,
189
- },
190
- {
191
- visable: true,
192
- text: "按钮3",
193
- icon: "el-icon-plus",
194
- permission: "",
195
- name: "custom3",
196
- isShowText: false,
197
- },
198
- ],
199
- //列表自定义操作菜单设定 - 若无自定义按钮,不需要重写
200
- listCustomOpMenus: [
201
- {
202
- visable: true,
203
- text: "预览",
204
- icon: "el-icon-edit",
205
- permission: "",
206
- name: "priview",
207
- isShowText: false,
208
- },
209
- ],
210
- //编辑界面自定义按钮菜单 - 若无自定义按钮,不需要重写
211
- editCustomOpMenus: [
212
- {
213
- name: "custom1",
214
- visable: true,
215
- icon: "ion-plus-round",
216
- text: "自定义1",
217
- },
218
- ],
219
- //树形表格
220
- treeSetting: {
221
- visable: false,
222
- moduleName: "system",
223
- serviceName: "notice",
224
- title: "请输入部门|岗位名称",
225
- },
226
- //弹框列表配置
227
- springFrametable: {
228
- //列表微服务模块名称
229
- moduleName: "system",
230
- //列表实体名称-服务名称
231
- serviceName: "notice",
232
- //显示
233
- visable: true,
234
- //接口是否有编辑框参数
235
- editData: true, //false 可传可不传
236
- //接受参数字段名
237
- tableListName: "tableList",
238
- // //显示新增按钮
239
- // buttomShow: false, //false 可传可不传
240
- //弹框宽度
241
- width: "1000px",
242
- //表格自定义参数
243
- parameter: {},
244
- //弹框内列表信息
245
- tableColumns: [
246
- {
247
- prop: "createName",//对应字段
248
- text: "",//列表名
249
- attr: { width: "180" },//td宽度
250
- edit: true,//显示input false,//为只读状态
251
- type: "input",//输入框、select下拉框/选择器、日期选择器、checkbox复选框、switch开关、mixInput搜索框其中checkbox/select 配置
252
- options: [
253
- { label: "1", value: "1" },//
254
- { label: "2", value: "2" },
255
- ],
256
-
257
- //或以下配置
258
- property: "createName",
259
- text: "",//列表名
260
- displayType: "DropDownList",
261
- setting: {
262
- type: "User",
263
- dictType: "sys_notice_type",
264
- items: [
265
- { text: "选项1", value: "1" },
266
- { text: "选项2", value: "2" },
267
- ],
268
- },
269
- },
270
- {
271
- prop: "noticeId",
272
- text: "id",
273
- attr: { width: "180" },
274
- edit: true,
275
- },
276
- {
277
- prop: "noticeTitle",
278
- text: "公告标题",
279
- attr: { width: "180" },
280
- edit: false,
281
- },
282
- // {
283
- // prop: "noticeType",
284
- // text: "公告类型",
285
- // attr: { minWidth: "110" },
286
- // edit: true,
287
- // type: "select",
288
- // options: [
289
- // { label: "1", value: "1" },
290
- // { label: "2", value: "2" },
291
- // ],
292
- // },
293
- // {
294
- // prop: "remark",
295
- // text: "备注",
296
- // attr: { minWidth: "110" },
297
- // edit: true,
298
- // },
299
- // {
300
- // prop: "noticeContent",
301
- // text: "自定义html",
302
- // attr: { minWidth: "110" },
303
- // edit: true,
304
- // },
305
- // {
306
- // prop: "product",
307
- // text: "产品",
308
- // attr: { minWidth: "110" },
309
- // edit: true,
310
- // type: "checkbox",
311
- // options: [
312
- // { label: "1", value: "1" },
313
- // { label: "2", value: "2" },
314
- // ],
315
- // },
316
- // {
317
- // prop: "date",
318
- // text: "日期",
319
- // attr: { minWidth: "110" },
320
- // edit: true,
321
- // type: "date",
322
- // required: false,
323
- // },
324
- // {
325
- // prop: "status",
326
- // text: "锁定",
327
- // attr: { minWidth: "110" },
328
- // edit: true,
329
- // type: "switch",
330
- // },
331
- // {
332
- // prop: "search",
333
- // text: "搜索",
334
- // attr: { minWidth: "110" },
335
- // edit: true,
336
- // type: "mixInput",
337
- // cb: (row) => {
338
- // console.log(row);
339
- // },
340
- // },
341
- // { prop: "opt", text: "操作", attr: { minWidth: "110" }, edit: true },
342
- ],
343
- },
344
- };
345
- },
346
- created() {
347
- //隐藏操作菜单按钮示例,隐藏或更新其它操作菜单按钮配置值
348
- this.updateOpMenu({ visable: false }, ["custom2"]);
349
- //隐藏列表列示例,隐藏或更新其它操作菜单按钮配置值
350
- this.updateListColumn({ visable: false }, ["noticeId"]);
351
- //禁用和隐藏编辑列示例,隐藏或更新其它操作菜单按钮配置值
352
- this.updateEditColumn({ disabled: true }, ["noticeTitle", "test3"]);
353
- },
354
- methods: {
355
- /** 列表表格自定义按钮点击处理 */
356
- onListCustomOpMenuClick(args) {
357
- switch (args.opMenu.name) {
358
- case "priview":
359
- this.onFilePriview(args.data);
360
- break;
361
- case "custom2":
362
- alert("自定义按钮2点击事件");
363
- break;
364
- }
365
- },
366
- /** 自定义操作菜单按钮点击处理 */
367
- onCustomOpMenuClick(args) {
368
- switch (args.opMenu.name) {
369
- case "custom1":
370
- this.Dialog.open({
371
- component: SampleEditDialog,
372
- setting: {
373
- isShow: true,
374
- title: "标题标题",
375
- size: "small", //可选项tiny/small/large/full
376
- width: "800px", //表格宽度
377
- data: { entity: this.currentEntity },
378
- },
379
- //beforeClose: (done) => {
380
- // //点右上角关闭按钮后触发
381
- // console.log("1");
382
- // done();
383
- //},
384
- //close: () => {
385
- // //关闭后触发
386
- // console.log("2");
387
- //},
388
- // confirm: (result) => {
389
- // //显式$emit('confirm')时触发
390
- // console.log("3 ", result);
391
- // },
392
- });
393
-
394
- break;
395
- case "custom2":
396
- alert("自定义按钮2点击事件");
397
- break;
398
- case "custom3":
399
- break;
400
- }
401
- },
402
- /** 编辑界面自定义按钮点击处理 */
403
- onEditCustomOpMenuClick(args) {
404
- switch (args.opMenu.name) {
405
- case "custom1":
406
- alert("编辑界面自定义按钮1点击事件");
407
- break;
408
- }
409
- },
410
-
411
- /** 自定义列显示格式方法 */
412
- remarkFormat(data, column) {
413
- return data.remark ? "有备注" : "无备注";
414
- },
415
- /** 自定义列点击方法 */
416
- onFilePriview(data, column) {
417
- if (data.remark) filePriview(data.remark);
418
- },
419
- /** 自定义列显示Html */
420
- getFilePriviewLink(data, column) {
421
- return `<a href="${getFilePriviewUrl(data.remark)}" target="_blank">${
422
- data.remark ? "自定义预览" : ""
423
- }</a>`;
424
- },
425
- },
426
- };
427
- </script>