cloud-web-corejs 1.0.54-dev.802 → 1.0.54-dev.804

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.
@@ -0,0 +1,686 @@
1
+ <template>
2
+ <div id="containt">
3
+ <el-tabs v-model="activeName" class="tab-box">
4
+ <el-tab-pane :label="$t1('列表')" name="second">
5
+ <div class="grid-height">
6
+ <vxe-grid
7
+ ref="table-m1"
8
+ v-bind="vxeOption"
9
+ @resizable-change="$vxeTableUtil.onColumnWitchChange"
10
+ @custom="$vxeTableUtil.customHandle"
11
+ >
12
+ <template #form>
13
+ <div class="clearfix screen-btns">
14
+ <div class="fl">
15
+ <vxe-button
16
+ status="primary"
17
+ class="button-sty"
18
+ icon="el-icon-plus"
19
+ :disabled="!hasSysType"
20
+ @click="addMenu(0)"
21
+ >
22
+ {{ $t1("新增一级菜单") }}
23
+ </vxe-button>
24
+ </div>
25
+ <div class="fr">
26
+ <vxe-button
27
+ icon="el-icon-brush"
28
+ class="button-sty"
29
+ @click="resetEvent"
30
+ type="text"
31
+ status="primary"
32
+ plain
33
+ >{{ $t1("刷新") }}
34
+ </vxe-button>
35
+ <vxe-button
36
+ status="warning"
37
+ icon="el-icon-search"
38
+ class="button-sty"
39
+ @click="searchEvent"
40
+ >
41
+ {{ $t1("搜索") }}
42
+ </vxe-button>
43
+ </div>
44
+ </div>
45
+ <vxe-form
46
+ ref="form"
47
+ class="screen-box"
48
+ title-width="92px"
49
+ title-align="right"
50
+ :data="formData"
51
+ @submit="searchEvent"
52
+ >
53
+ <vxe-form-item :title="$t1('系统类型') + ':'" field="sysType">
54
+ <template v-slot>
55
+ <el-select
56
+ v-model="formData.sysType"
57
+ size="small"
58
+ @change="onSysTypeChange"
59
+ >
60
+ <el-option
61
+ v-for="(dict, index) in sysTypeDicts"
62
+ :key="index"
63
+ :value="dict.sn"
64
+ :label="dict.value"
65
+ ></el-option>
66
+ </el-select>
67
+ </template>
68
+ </vxe-form-item>
69
+ <vxe-form-item :title="$t1('菜单名称') + ':'" field="menuName">
70
+ <template v-slot>
71
+ <el-input
72
+ v-model="formData.menuName"
73
+ size="small"
74
+ clearable
75
+ />
76
+ </template>
77
+ </vxe-form-item>
78
+ <vxe-form-item :title="$t1('菜单编码') + ':'" field="menuCode">
79
+ <template v-slot>
80
+ <el-input
81
+ v-model="formData.menuCode"
82
+ size="small"
83
+ clearable
84
+ />
85
+ </template>
86
+ </vxe-form-item>
87
+ <vxe-form-item :title="$t1('是否启用') + ':'" field="enabled">
88
+ <template v-slot>
89
+ <el-select v-model="formData.enabled" clearable>
90
+ <el-option value="true" :label="$t1('启用')"></el-option>
91
+ <el-option value="false" :label="$t1('禁用')"></el-option>
92
+ </el-select>
93
+ </template>
94
+ </vxe-form-item>
95
+ </vxe-form>
96
+ </template>
97
+ <template #menuImgEdit="{ row, rowIndex }">
98
+ <el-popover
99
+ placement="bottom"
100
+ width="680"
101
+ trigger="click"
102
+ :ref="'menuImg' + rowIndex"
103
+ >
104
+ <div class="icons-box">
105
+ <div
106
+ class="item iconfont"
107
+ v-for="(item, index) in iconList"
108
+ :key="index"
109
+ :class="[item, row.menuImg == item ? 'on' : '']"
110
+ @click="checkMenuImg(row, item, rowIndex)"
111
+ ></div>
112
+ </div>
113
+ <label
114
+ class="icons-box_select"
115
+ :class="{ noNone: !!row.menuImg }"
116
+ slot="reference"
117
+ >
118
+ <i :class="row.menuImg" class="iconfont"></i>
119
+ <i class="el-icon-arrow-down"></i>
120
+ <i
121
+ class="el-icon-circle-close icon-box_del"
122
+ @click.stop="clearMenuImg(row)"
123
+ ></i>
124
+ </label>
125
+ </el-popover>
126
+ </template>
127
+ <template #operate="obj">
128
+ <div class="cell-operate">
129
+ <template v-if="$refs['table-m1'].isActiveByRow(obj.row)">
130
+ <a @click="saveRowEvent(obj)" class="a-link">
131
+ <el-tooltip
132
+ :enterable="false"
133
+ effect="dark"
134
+ :content="$t1('保存')"
135
+ placement="top"
136
+ popper-class="tooltip-skin"
137
+ ><i class="el-icon-circle-check"></i
138
+ ></el-tooltip>
139
+ </a>
140
+ <a
141
+ @click="cancleRowEvent(obj)"
142
+ class="a-link"
143
+ v-if="hasSaveRow(obj.row)"
144
+ >
145
+ <el-tooltip
146
+ :enterable="false"
147
+ effect="dark"
148
+ :content="$t1('取消行编辑')"
149
+ placement="top"
150
+ popper-class="tooltip-skin"
151
+ ><i class="el-icon-circle-close"></i
152
+ ></el-tooltip>
153
+ </a>
154
+ <a
155
+ @click="removeRowEvent(obj)"
156
+ class="a-link"
157
+ v-if="!hasSaveRow(obj.row)"
158
+ >
159
+ <el-tooltip
160
+ :enterable="false"
161
+ effect="dark"
162
+ :content="$t1('删除')"
163
+ placement="top"
164
+ popper-class="tooltip-skin"
165
+ ><i class="el-icon-delete"></i
166
+ ></el-tooltip>
167
+ </a>
168
+ </template>
169
+ <template v-else>
170
+ <a
171
+ class="a-link"
172
+ @click="addMenu(0, obj)"
173
+ v-if="obj.row && obj.row.type != 2"
174
+ >
175
+ <el-tooltip
176
+ :enterable="false"
177
+ effect="dark"
178
+ :content="$t1('新增')"
179
+ placement="top"
180
+ popper-class="tooltip-skin"
181
+ ><i class="el-icon-circle-plus-outline"></i
182
+ ></el-tooltip>
183
+ </a>
184
+ <a
185
+ @click="editRowEvent(obj)"
186
+ class="a-link"
187
+ v-if="obj.row && !obj.row.is_top"
188
+ >
189
+ <el-tooltip
190
+ :enterable="false"
191
+ effect="dark"
192
+ :content="$t1('行编辑')"
193
+ placement="top"
194
+ popper-class="tooltip-skin"
195
+ ><i class="el-icon-edit-outline"></i
196
+ ></el-tooltip>
197
+ </a>
198
+ </template>
199
+ </div>
200
+ </template>
201
+ </vxe-grid>
202
+ </div>
203
+ </el-tab-pane>
204
+ </el-tabs>
205
+ </div>
206
+ </template>
207
+
208
+ <script>
209
+ import { tableTreeMixins } from "@base/mixins/tableTree/index.js";
210
+
211
+ export default {
212
+ name: "menu:in_list",
213
+ components: {},
214
+ mixins: [tableTreeMixins],
215
+ mounted() {
216
+ this.$getBaseDicts({
217
+ code: "sysType",
218
+ success: ({ dicts }) => {
219
+ this.sysTypeDicts = dicts || [];
220
+ if (this.sysTypeDicts.length) {
221
+ this.formData.sysType = this.sysTypeDicts[0].sn;
222
+ }
223
+ },
224
+ }).finally(() => {
225
+ this.initTableList();
226
+ });
227
+ },
228
+ computed: {
229
+ hasSysType() {
230
+ return (
231
+ this.formData.sysType !== null &&
232
+ this.formData.sysType !== undefined &&
233
+ this.formData.sysType !== ""
234
+ );
235
+ },
236
+ },
237
+ data() {
238
+ let that = this;
239
+ return {
240
+ activeName: "second",
241
+ dataId: "",
242
+ formData: {
243
+ sysType: "",
244
+ },
245
+ sysTypeDicts: [],
246
+ vxeOption: {},
247
+ menuType: 0,
248
+ iconList: [
249
+ "icon-shangji-shangjiguanli",
250
+ "icon-daifahuodingdan",
251
+ "icon-jichuziliao",
252
+ "icon-zuzhi",
253
+ "icon-shujujianmo",
254
+ "icon-wenjianguanli",
255
+ "icon-guanli1",
256
+ "icon-dianshang",
257
+ "icon-ziyuan",
258
+ "icon-feiyongguanli",
259
+ "icon-yunpingtai",
260
+ "icon-yingxiao",
261
+ "icon-biaodanguanli",
262
+ "icon-baobiao",
263
+ "icon-yusuanguanli",
264
+ "icon-baoxiao",
265
+ "icon-yanfa",
266
+ "icon-hetong",
267
+ "icon-danjuliuchengshezhi",
268
+ "icon-shenqingguanli",
269
+ "icon-xitongshezhi",
270
+ "icon-icon-servicenetwork",
271
+ "icon-a-zu96",
272
+ "icon-chanpin2",
273
+ "icon-shangpin2",
274
+ "icon-tuihuanhuo1",
275
+ "icon-wenquantiaocha",
276
+ "icon-cangchu",
277
+ "icon-caigou",
278
+ "icon-churuku",
279
+ "icon-fl-gouwuche",
280
+ "icon-shangpinfenlei",
281
+ "icon-shangpinshangxiajia",
282
+ "icon-taocanxinxi_changgui",
283
+ "icon-kehuchaxun",
284
+ "icon-shangpin-canshumoban",
285
+ "icon-shangpinguanli-shangpinweihu",
286
+ "icon-kehubiangeng",
287
+ "icon-shanghuguanxiweihu",
288
+ "icon-kehuxinzeng",
289
+ "icon-dunpaibaowei",
290
+ "icon-a-061_bijiben",
291
+ "icon-a-061_gengduo",
292
+ "icon-a-061_gouwu-12",
293
+ "icon-a-061_jianzhu-17",
294
+ "icon-a-061_shuben",
295
+ "icon-a-061_jinbi",
296
+ "icon-a-061_guangbo",
297
+ "icon-a-061_shuqian",
298
+ "icon-a-061_shangpin",
299
+ "icon-a-061_kuaidi",
300
+ "icon-a-061_wenjian",
301
+ "icon-a-061_xiaoxi",
302
+ "icon-a-rongqi262",
303
+ "icon-a-rongqi256",
304
+ "icon-a-rongqi265",
305
+ "icon-a-rongqi285",
306
+ "icon-huomiao-mianxing",
307
+ "icon-dingwei-mianxing",
308
+ "icon-xiuxian-mianxing",
309
+ "icon-shuju-wenjianliebiao",
310
+ "icon-chexing-pinpailiebiao",
311
+ "icon-yonghu-gongzuodanwei",
312
+ "icon-shujujieguo",
313
+ "icon-gongyingshangguanli",
314
+ "icon-xitong-quanxianguanli",
315
+ "icon-shujuguanli",
316
+ "icon-yonghushenhe",
317
+ "icon-gongyingshangliebiao",
318
+ "icon-xiaoliangliebiao",
319
+ "icon-chexing-ruanjianbanben",
320
+ "icon-xitong-meijuguanli",
321
+ "icon-huiyuan-qiyeguanli",
322
+ "icon-chexing-ruanjianbanben1",
323
+ "icon-shuju-ceshiguihua",
324
+ "icon-yonghuliebiao",
325
+ "icon-yonghuguanli",
326
+ "icon-xitong-jiaoseguanli",
327
+ "icon-chexingliebiao",
328
+ "icon-chexingguanli",
329
+ "icon-shujujiegou",
330
+ "icon-huiyuanyonghu",
331
+ "icon-huiyuan-quanxianguanli",
332
+ "icon-shexiangtouqiehuan",
333
+ "icon-luyin",
334
+ "icon-yingpianjiesuo",
335
+ "icon-yingpianjiasuo",
336
+ "icon-qianlu",
337
+ "icon-luxiangjiasuo",
338
+ "icon-a-yonghuliebiao3x",
339
+ "icon-a-yijianfankui3x",
340
+ "icon-a-chanpinshangjiaguanli3x",
341
+ "icon-a-kefufankui3x",
342
+ "icon-a-zhanghaoguanli3x",
343
+ "icon-a-kefu3x",
344
+ "icon-a-kesu3x",
345
+ "icon-a-ribaobiaoshuju3x",
346
+ "icon-a-tuikuan3x",
347
+ "icon-gudingmianzhi",
348
+ "icon-manjianquan",
349
+ "icon-xiangouhuodong",
350
+ "icon-youhuiquan",
351
+ "icon-Xyuanhuodong",
352
+ "icon-shangpindongcha",
353
+ "icon-zhijianghuodong",
354
+ "icon-shizhongshezhi",
355
+ "icon-kasuceshi",
356
+ "icon-SDkarongliang",
357
+ "icon-sudubuchang",
358
+ "icon-sududanwei",
359
+ "icon-GPSxinxi",
360
+ "icon-GPSxianshi",
361
+ "icon-GPSshuiyin",
362
+ "icon-a-shouhui3x",
363
+ "icon-a-yunyingpeizhi3x",
364
+ "icon-biaotitubiao",
365
+ "icon-tubiao1",
366
+ "icon-tubiao18",
367
+ "icon-tubiao28",
368
+ "icon-tiyugonggongsheshi",
369
+ "icon-tubiaoliebiao",
370
+ "icon-VRtubiao",
371
+ "icon-tubiaoAzitubiao",
372
+ "icon-tubiao2",
373
+ "icon-tubiao-",
374
+ "icon-tubiao-1",
375
+ "icon-tubiao-2",
376
+ "icon-tubiao-3",
377
+ "icon-tubiao3",
378
+ "icon-a-tubiao-daqijiayou",
379
+ "icon-charge-fill",
380
+ "icon-book-fill",
381
+ "icon-device-set-fill",
382
+ "icon-dynamic-password-fill",
383
+ "icon-map-fill",
384
+ "icon-security-fill",
385
+ "icon-tool-fill",
386
+ "icon-readcard-fill",
387
+ "icon-chaye",
388
+ "icon-baoxian",
389
+ "icon-dadou",
390
+ "icon-nongye",
391
+ "icon-nongyeqixiang",
392
+ "icon-pingguo",
393
+ "icon-nongyebaoxian",
394
+ "icon-yaogan",
395
+ "icon-zhiwu",
396
+ "icon-weixing",
397
+ "icon-qixiang",
398
+ "icon-zuowu",
399
+ "icon-qiyeguanli-2",
400
+ "icon-qiyeshenhe-2",
401
+ "icon-xiaoxi",
402
+ "icon-xunhuan",
403
+ "icon-zoushi",
404
+ "icon-bushu",
405
+ "icon-duanlian",
406
+ "icon-gaojing",
407
+ "icon-renyuan",
408
+ "icon-tubiao4",
409
+ "icon-wangguan",
410
+ "icon-wangluo",
411
+ "icon-fenzhi",
412
+ "icon-gongchang",
413
+ "icon-zhihuizhongxin",
414
+ "icon-mti-an-gongmaoqiye",
415
+ "icon-mti-an-zhongdaweixianyuan",
416
+ "icon-mti-cheng-huanjing",
417
+ "icon-mti-cheng-lvhua",
418
+ "icon-mti-di-dimianchenjiang",
419
+ "icon-mti-cheng-fengli",
420
+ "icon-mti-di-qiangzhentai",
421
+ "icon-mti-dong-yinhuan",
422
+ "icon-mti-dong-jiaotongshigu",
423
+ "icon-mti-dong-jianzhugongdi",
424
+ "icon-mti-fang-jiangyuliang",
425
+ "icon-mti-dong-weihuapin",
426
+ "icon-mti-gu-shengtaihuanjing",
427
+ "icon-mti-ying-daochang",
428
+ "icon-mti-sen-shumuziyuanfenbu",
429
+ "icon-mti-gongdi",
430
+ "icon-mti-ying-moshiqiehuan",
431
+ "icon-mti-ying-tongxunbaozhang",
432
+ "icon-mti-ying-qidongyuan",
433
+ "icon-mti-ying-jishuidian",
434
+ "icon-mti-ying-zaihoufupan",
435
+ "icon-wodeshequ2",
436
+ "icon-service-line-1",
437
+ "icon-notice-manage-fill",
438
+ "icon-announcement-fill",
439
+ "icon-box-noise-fill",
440
+ ],
441
+ typeMap: {
442
+ 0: this.$t1("菜单"),
443
+ 1: this.$t1("按钮"),
444
+ 2: this.$t1("首页"),
445
+ 3: this.$t1("外部菜单"),
446
+ 4: this.$t1("第三方地址"),
447
+ 5: this.$t1("动态表单"),
448
+ },
449
+ };
450
+ },
451
+ methods: {
452
+ ensureSysType() {
453
+ if (!this.hasSysType) {
454
+ this.$message.warning(this.$t1("请先选择系统类型"));
455
+ return false;
456
+ }
457
+ return true;
458
+ },
459
+ onSysTypeChange() {
460
+ if (this.hasSysType) {
461
+ this.searchEvent();
462
+ }
463
+ },
464
+ searchEvent() {
465
+ if (!this.ensureSysType()) {
466
+ return;
467
+ }
468
+ this.$refs["table-m1"].commitProxy("reload");
469
+ },
470
+ resetEvent() {
471
+ let sysType = this.formData.sysType;
472
+ this.formData = { sysType };
473
+ if (this.hasSysType) {
474
+ this.$refs["table-m1"].commitProxy("reload");
475
+ }
476
+ },
477
+ initTableList() {
478
+ let that = this;
479
+ let tableOption = {
480
+ vue: this,
481
+ tableRef: "table-m1",
482
+ tableName: "user_menu_list-m1",
483
+ path: USER_PREFIX + "/third_party_menu/list",
484
+ treeNodeUrl: USER_PREFIX + "/third_party_menu/listChildren",
485
+ editSaveUrl: USER_PREFIX + "/third_party_menu/save",
486
+ editDefaultRow: () => {
487
+ return { enabled: true, type: 0, sysType: this.formData.sysType };
488
+ },
489
+ param: () => {
490
+ return this.formData;
491
+ },
492
+ treeNodeParam: (row) => {
493
+ return {
494
+ parent: row.id,
495
+ enabled: this.formData.enabled,
496
+ sysType: this.formData.sysType,
497
+ };
498
+ },
499
+ treeConditions: ["enabled", "sysType"],
500
+ config: {
501
+ proxyConfig: {
502
+ autoLoad: false,
503
+ },
504
+ treeConfig: {
505
+ parentField: "parent",
506
+ },
507
+ scrollX: {
508
+ enabled: false,
509
+ },
510
+ },
511
+ columns: [
512
+ { type: "checkbox", width: 48, resizable: false, fixed: "left" },
513
+ {
514
+ title: this.$t1("菜单名称"),
515
+ field: "menuName",
516
+ width: 250,
517
+ fixed: "left",
518
+ treeNode: true,
519
+ editRender: { name: "input" },
520
+ slots: {
521
+ default: ({ row }) => {
522
+ return [
523
+ <a
524
+ class="levitate-tips"
525
+ onclick={(event) => {
526
+ event.stopPropagation();
527
+ this.$refs["table-m1"].toggleTreeExpand(row);
528
+ }}
529
+ >
530
+ {row.menuName}
531
+ </a>,
532
+ ];
533
+ },
534
+ },
535
+ },
536
+ {
537
+ field: "menuCode",
538
+ title: this.$t1("菜单编码"),
539
+ width: 250,
540
+ editRender: {},
541
+ slots: {
542
+ edit: ({ row }) => {
543
+ return [<el-input v-model={row.menuCode} />];
544
+ },
545
+ },
546
+ },
547
+ {
548
+ field: "url",
549
+ title: this.$t1("菜单地址"),
550
+ width: 200,
551
+ editRender: {},
552
+ slots: {
553
+ edit: ({ row }) => {
554
+ return [<el-input v-model={row.url} />];
555
+ },
556
+ },
557
+ },
558
+ {
559
+ field: "enabled",
560
+ title: this.$t1("是否启用"),
561
+ width: 150,
562
+ editRender: {
563
+ name: "$select",
564
+ events: {
565
+ change: () => {
566
+ this.$forceUpdate();
567
+ },
568
+ },
569
+ options: [
570
+ {
571
+ label: this.$t1("启用"),
572
+ value: true,
573
+ },
574
+ {
575
+ label: this.$t1("禁用"),
576
+ value: false,
577
+ },
578
+ ],
579
+ },
580
+ slots: {
581
+ default: ({ row }) => {
582
+ if (row.enabled) {
583
+ return [<div class="txt-status">{this.$t1("启用")}</div>];
584
+ } else {
585
+ return [<div class="txt-status s-3">{this.$t1("禁用")}</div>];
586
+ }
587
+ },
588
+ },
589
+ },
590
+ {
591
+ field: "orders",
592
+ title: this.$t1("序号"),
593
+ width: 100,
594
+ editRender: { name: "input" },
595
+ },
596
+ {
597
+ field: "type",
598
+ title: this.$t1("类型"),
599
+ width: 100,
600
+ slots: {
601
+ default: ({ row }) => {
602
+ return this.typeMap[row.type] || "";
603
+ },
604
+ },
605
+ },
606
+ {
607
+ field: "menuImg",
608
+ title: this.$t1("图标"),
609
+ width: 150,
610
+ editRender: {},
611
+ slots: {
612
+ default: ({ row }) => {
613
+ return [<i class={"iconfont " + row.menuImg}></i>];
614
+ },
615
+ edit: "menuImgEdit",
616
+ },
617
+ },
618
+ {
619
+ field: "route",
620
+ title: this.$t1("路由"),
621
+ width: 100,
622
+ editRender: { name: "input" },
623
+ },
624
+ { title: this.$t1("创建时间"), field: "createDate", width: 150 },
625
+ { title: this.$t1("更新时间"), field: "modifyDate", width: 150 },
626
+ {
627
+ width: 100,
628
+ title: "",
629
+ fixed: "right",
630
+ sortable: false,
631
+ slots: { default: "operate" },
632
+ },
633
+ ],
634
+ };
635
+ this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
636
+ this.vxeOption = opts;
637
+ this.$nextTick(() => {
638
+ if (this.hasSysType) {
639
+ this.searchEvent();
640
+ }
641
+ });
642
+ });
643
+ },
644
+ addMenu(type, parentParam) {
645
+ if (!this.ensureSysType()) {
646
+ return;
647
+ }
648
+ this.menuType = type;
649
+ if (parentParam) {
650
+ this.insertChildEvent(parentParam);
651
+ } else {
652
+ this.insertTopRow(this.$refs["table-m1"]);
653
+ }
654
+ },
655
+ checkMenuImg(row, menuImg, rowIndex) {
656
+ row.menuImg = menuImg;
657
+ this.$refs["menuImg" + rowIndex].showPopper = false;
658
+ },
659
+ clearMenuImg(row) {
660
+ row.menuImg = null;
661
+ },
662
+ },
663
+ };
664
+ </script>
665
+ <style scoped lang="scss">
666
+ .el-select-dropdown__item .iconfont {
667
+ vertical-align: middle;
668
+ margin-right: 3px;
669
+ }
670
+
671
+ .icons-box_select {
672
+ .el-icon-circle-close {
673
+ display: none;
674
+ }
675
+ }
676
+
677
+ .icons-box_select.noNone:hover {
678
+ .el-icon-arrow-down {
679
+ display: none;
680
+ }
681
+
682
+ .el-icon-circle-close {
683
+ display: inline-block;
684
+ }
685
+ }
686
+ </style>