ol-base-components 3.1.3 → 3.2.0
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 +2 -1
- package/src/App.vue +350 -76
- package/src/main.js +4 -5
- package/src/package/customSearch/index.js +7 -0
- package/src/package/customSearch/src/index.vue +93 -0
- package/src/package/formSearch/index.js +1 -1
- package/src/package/formSearch/src/components/SearchConfigDialog.vue +867 -0
- package/src/package/formSearch/src/index.js +2 -0
- package/src/package/formSearch/src/index.vue +229 -97
- package/src/package/index.js +5 -2
- package/src/package/table/src/index.vue +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ol-base-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "src/package/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"eslint": "^8.57.1",
|
|
26
26
|
"eslint-plugin-vue": "^10.3.0",
|
|
27
27
|
"inquirer": "^8.2.6",
|
|
28
|
+
"sortablejs": "^1.15.7",
|
|
28
29
|
"swagger-client": "^3.0.1",
|
|
29
30
|
"vue": "^2.6.14",
|
|
30
31
|
"vue-plugin-hiprint": "^0.0.60"
|
package/src/App.vue
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
|
-
<
|
|
4
|
-
|
|
3
|
+
<ol-customSearch :form-search-data="formSearchData" @onSave="saveHandler"></ol-customSearch>
|
|
4
|
+
=========
|
|
5
|
+
<!-- <div>table组件案例</div> -->
|
|
6
|
+
<!-- url="/api/app/stock-in/stock-in-pages" -->
|
|
7
|
+
<!-- <ol-search
|
|
5
8
|
:form-search-data="formSearchData"
|
|
6
9
|
@handleSearch="handleSearch"
|
|
7
10
|
@handleReset="handleReset"
|
|
8
|
-
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<ol-table
|
|
11
|
+
@onSave="saveHandler"
|
|
12
|
+
/> -->
|
|
13
|
+
<button @click="aaa">123</button>
|
|
14
|
+
<!-- url="/api/app/bind-record/bind-record-detail-pages" -->
|
|
15
|
+
<!-- <ol-table
|
|
13
16
|
:paginations="paginations"
|
|
14
17
|
:empty-img="tableData.emptyImg"
|
|
15
18
|
:btnlist="[]"
|
|
16
|
-
url="/api/app/bind-record/bind-record-detail-pages"
|
|
17
19
|
:table-data="tableData"
|
|
18
20
|
:multiple-selection="multipleSelection"
|
|
19
21
|
@SelectionChange="SelectionChange"
|
|
20
22
|
@handleSizeChange="handleSizeChange"
|
|
21
23
|
@handleindexChange="handleindexChange"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
>
|
|
25
|
+
<template slot="ceshi" slot-scope="scope">
|
|
26
|
+
<span>333433{{ scope.row.ceshi }}</span>
|
|
27
|
+
</template>
|
|
28
|
+
</ol-table> -->
|
|
29
|
+
<!-- <el-button @click="handlePrint">接口</el-button>
|
|
24
30
|
<el-button @click="onAdd">新建</el-button>
|
|
25
|
-
<el-button @click="onEdit">编辑</el-button>
|
|
31
|
+
<el-button @click="onEdit">编辑</el-button> -->
|
|
26
32
|
|
|
27
|
-
<!--
|
|
28
|
-
<el-dialog :title="`${this.form.title}`" :visible.sync="dialogVisible" width="80%">
|
|
33
|
+
<!-- <el-dialog :title="`${this.form.title}`" :visible.sync="dialogVisible" width="80%">
|
|
29
34
|
<ol-form
|
|
30
35
|
v-if="dialogVisible"
|
|
31
36
|
url="/api/app/admission-info/admission-info"
|
|
@@ -33,32 +38,8 @@
|
|
|
33
38
|
@onCancel="dialogVisible = false"
|
|
34
39
|
@onSubmit="onSubmit"
|
|
35
40
|
/>
|
|
36
|
-
</el-dialog>
|
|
37
|
-
|
|
38
|
-
<!-- <el-button @click="handlePrint">接口</el-button>
|
|
39
|
-
|
|
40
|
-
<div
|
|
41
|
-
class="ellipsis-container"
|
|
42
|
-
id="ellipsis-container"
|
|
43
|
-
v-for="item in 5"
|
|
44
|
-
:key="item"
|
|
45
|
-
>如何处理文本溢出如何实现单行文本溢出显示省略号</div>
|
|
46
|
-
|
|
47
|
-
<div class="triangle-up"></div>
|
|
48
|
-
<div class="grid-content">
|
|
49
|
-
<div>11</div>
|
|
50
|
-
<div>11</div>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<div class="container">
|
|
54
|
-
<div class="item">1</div>
|
|
55
|
-
<div class="item item2">2</div>
|
|
56
|
-
<div class="item">3</div>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div class="square-container">
|
|
60
|
-
<div class="square"></div>
|
|
61
|
-
</div> -->
|
|
41
|
+
</el-dialog> -->
|
|
42
|
+
<!-- <ol-print /> -->
|
|
62
43
|
</div>
|
|
63
44
|
</template>
|
|
64
45
|
|
|
@@ -82,10 +63,16 @@ export default {
|
|
|
82
63
|
rows: [
|
|
83
64
|
{
|
|
84
65
|
bindStateEnum: "11",
|
|
85
|
-
|
|
66
|
+
creationTime: "22",
|
|
67
|
+
ceshi: "hhh",
|
|
86
68
|
},
|
|
87
69
|
], // 表数据
|
|
88
70
|
columns: [
|
|
71
|
+
{
|
|
72
|
+
label: "测试",
|
|
73
|
+
prop: "ceshi",
|
|
74
|
+
renderSlot: true,
|
|
75
|
+
},
|
|
89
76
|
{
|
|
90
77
|
prop: "unit",
|
|
91
78
|
show: false,
|
|
@@ -138,36 +125,37 @@ export default {
|
|
|
138
125
|
},
|
|
139
126
|
|
|
140
127
|
formSearchData: {
|
|
128
|
+
enableConfig: true,
|
|
141
129
|
reset: true, // 重置
|
|
142
130
|
expendShow: true, // 展开
|
|
143
131
|
tableSearchSlice: 5,
|
|
144
132
|
value: {
|
|
145
|
-
DocNo: null, // 对应输入框的value字段
|
|
146
|
-
QualityCheckStateType: null,
|
|
147
|
-
QualityCheckState: null,
|
|
148
|
-
timer: [],
|
|
149
|
-
range: [10, 200],
|
|
133
|
+
// DocNo: null, // 对应输入框的value字段
|
|
134
|
+
// QualityCheckStateType: null,
|
|
135
|
+
// QualityCheckState: null,
|
|
136
|
+
// timer: [],
|
|
137
|
+
// range: [10, 200],
|
|
150
138
|
},
|
|
151
139
|
tableSearch: [
|
|
152
|
-
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
140
|
+
// {
|
|
141
|
+
// label: "数字区间",
|
|
142
|
+
// value: "range",
|
|
143
|
+
// inputType: "numberRange",
|
|
144
|
+
// originalFields: {
|
|
145
|
+
// begin: "begin123",
|
|
146
|
+
// end: "end123",
|
|
147
|
+
// },
|
|
148
|
+
// listeners: {
|
|
149
|
+
// change: e => {
|
|
150
|
+
// const {
|
|
151
|
+
// val: [start, end],
|
|
152
|
+
// } = e;
|
|
153
|
+
// this.formSearchData.value.rang1 = start;
|
|
154
|
+
// this.formSearchData.value.rang2 = end;
|
|
155
|
+
// console.log(this.formSearchData, e);
|
|
156
|
+
// },
|
|
157
|
+
// },
|
|
158
|
+
// },
|
|
171
159
|
// {
|
|
172
160
|
// label: "标签号",
|
|
173
161
|
// value: "carBodyTagNumber",
|
|
@@ -286,6 +274,28 @@ export default {
|
|
|
286
274
|
// inputType: "text"
|
|
287
275
|
// }
|
|
288
276
|
],
|
|
277
|
+
customs: [
|
|
278
|
+
{
|
|
279
|
+
name: "选项1",
|
|
280
|
+
key: "code1",
|
|
281
|
+
keyType: 1,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "选项2",
|
|
285
|
+
key: "code2",
|
|
286
|
+
keyType: 2,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
name: "选项3",
|
|
290
|
+
key: "code3",
|
|
291
|
+
keyType: 3,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "选项4",
|
|
295
|
+
key: "code4",
|
|
296
|
+
keyType: 4,
|
|
297
|
+
},
|
|
298
|
+
],
|
|
289
299
|
},
|
|
290
300
|
|
|
291
301
|
form: {
|
|
@@ -423,7 +433,9 @@ export default {
|
|
|
423
433
|
SelectionChange(row) {
|
|
424
434
|
this.multipleSelection = row;
|
|
425
435
|
},
|
|
426
|
-
handleSearch(from) {
|
|
436
|
+
handleSearch(from, item) {
|
|
437
|
+
console.log(1112223, item);
|
|
438
|
+
|
|
427
439
|
this.formSearchData.value = { ...from };
|
|
428
440
|
this.paginations.page = 1;
|
|
429
441
|
this.getTable();
|
|
@@ -461,17 +473,6 @@ export default {
|
|
|
461
473
|
getTable() {
|
|
462
474
|
console.log("getTable参数", this.formSearchData.value);
|
|
463
475
|
},
|
|
464
|
-
handleSearch(from) {
|
|
465
|
-
this.formSearchData.value = { ...from };
|
|
466
|
-
this.paginations.page = 1;
|
|
467
|
-
this.getTable();
|
|
468
|
-
},
|
|
469
|
-
handleReset() {
|
|
470
|
-
for (let key in this.formSearchData.value) {
|
|
471
|
-
this.formSearchData.value[key] = null;
|
|
472
|
-
}
|
|
473
|
-
this.paginations.page = 1;
|
|
474
|
-
},
|
|
475
476
|
truncateMiddleByWidth(el) {
|
|
476
477
|
let text = el.textContent;
|
|
477
478
|
if (el.scrollWidth <= el.clientWidth) return;
|
|
@@ -527,6 +528,279 @@ export default {
|
|
|
527
528
|
});
|
|
528
529
|
}
|
|
529
530
|
},
|
|
531
|
+
aaa() {
|
|
532
|
+
const printEnpty = this.$hiprint({
|
|
533
|
+
grid: true,
|
|
534
|
+
printData: {
|
|
535
|
+
name: "CcSimple",
|
|
536
|
+
barcode: "33321323",
|
|
537
|
+
table: [
|
|
538
|
+
{ id: "1", name: "王小可123", gender: "男", count: "120", amount: "9089元" },
|
|
539
|
+
{ id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
|
|
540
|
+
],
|
|
541
|
+
table1: [
|
|
542
|
+
{ id: "1", name: "王小可11", gender: "男", count: "120", amount: "9089元" },
|
|
543
|
+
{ id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
|
|
544
|
+
],
|
|
545
|
+
},
|
|
546
|
+
onPrintData: data => {
|
|
547
|
+
return data;
|
|
548
|
+
},
|
|
549
|
+
onTemplate: data => {
|
|
550
|
+
return data;
|
|
551
|
+
},
|
|
552
|
+
defaultTemplate: {
|
|
553
|
+
panels: [
|
|
554
|
+
{
|
|
555
|
+
index: 0,
|
|
556
|
+
name: 1,
|
|
557
|
+
paperType: "A4",
|
|
558
|
+
height: 297,
|
|
559
|
+
width: 210,
|
|
560
|
+
paperHeader: 0,
|
|
561
|
+
paperFooter: 841.8897637795277,
|
|
562
|
+
printElements: [
|
|
563
|
+
{
|
|
564
|
+
options: {
|
|
565
|
+
left: 117,
|
|
566
|
+
top: 94.5,
|
|
567
|
+
height: 9.75,
|
|
568
|
+
width: 120,
|
|
569
|
+
field: "name",
|
|
570
|
+
testData: "内容",
|
|
571
|
+
title: "文本",
|
|
572
|
+
qid: "name",
|
|
573
|
+
},
|
|
574
|
+
printElementType: {
|
|
575
|
+
title: "文本",
|
|
576
|
+
type: "text",
|
|
577
|
+
},
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
options: {
|
|
581
|
+
left: 160.5,
|
|
582
|
+
top: 174,
|
|
583
|
+
height: 36,
|
|
584
|
+
width: 550,
|
|
585
|
+
fields: [],
|
|
586
|
+
field: "table",
|
|
587
|
+
qid: "table",
|
|
588
|
+
columns: [
|
|
589
|
+
[
|
|
590
|
+
{
|
|
591
|
+
width: 137.5,
|
|
592
|
+
title: "名称",
|
|
593
|
+
field: "name",
|
|
594
|
+
checked: true,
|
|
595
|
+
columnId: "name",
|
|
596
|
+
fixed: false,
|
|
597
|
+
rowspan: 1,
|
|
598
|
+
colspan: 1,
|
|
599
|
+
align: "center",
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
width: 137.5,
|
|
603
|
+
title: "性别",
|
|
604
|
+
field: "gender",
|
|
605
|
+
checked: true,
|
|
606
|
+
columnId: "gender",
|
|
607
|
+
fixed: false,
|
|
608
|
+
rowspan: 1,
|
|
609
|
+
colspan: 1,
|
|
610
|
+
align: "center",
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
width: 137.5,
|
|
614
|
+
title: "数量",
|
|
615
|
+
field: "count",
|
|
616
|
+
checked: true,
|
|
617
|
+
columnId: "count",
|
|
618
|
+
fixed: false,
|
|
619
|
+
rowspan: 1,
|
|
620
|
+
colspan: 1,
|
|
621
|
+
align: "center",
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
width: 137.5,
|
|
625
|
+
title: "金额",
|
|
626
|
+
field: "amount",
|
|
627
|
+
checked: true,
|
|
628
|
+
columnId: "amount",
|
|
629
|
+
fixed: false,
|
|
630
|
+
rowspan: 1,
|
|
631
|
+
colspan: 1,
|
|
632
|
+
align: "center",
|
|
633
|
+
},
|
|
634
|
+
],
|
|
635
|
+
],
|
|
636
|
+
},
|
|
637
|
+
printElementType: {
|
|
638
|
+
title: "表格",
|
|
639
|
+
type: "table",
|
|
640
|
+
editable: true,
|
|
641
|
+
columnDisplayEditable: true,
|
|
642
|
+
columnDisplayIndexEditable: true,
|
|
643
|
+
columnTitleEditable: true,
|
|
644
|
+
columnResizable: true,
|
|
645
|
+
columnAlignEditable: true,
|
|
646
|
+
isEnableEditField: true,
|
|
647
|
+
isEnableContextMenu: true,
|
|
648
|
+
isEnableInsertRow: true,
|
|
649
|
+
isEnableDeleteRow: true,
|
|
650
|
+
isEnableInsertColumn: true,
|
|
651
|
+
isEnableDeleteColumn: true,
|
|
652
|
+
isEnableMergeCell: true,
|
|
653
|
+
},
|
|
654
|
+
},
|
|
655
|
+
],
|
|
656
|
+
paperNumberContinue: true,
|
|
657
|
+
watermarkOptions: {},
|
|
658
|
+
panelLayoutOptions: {},
|
|
659
|
+
},
|
|
660
|
+
],
|
|
661
|
+
},
|
|
662
|
+
onSubmit: data => {
|
|
663
|
+
console.log(6666, data);
|
|
664
|
+
},
|
|
665
|
+
});
|
|
666
|
+
|
|
667
|
+
// this.$hiprint.print({
|
|
668
|
+
// printData: {
|
|
669
|
+
// name: "CcSimple",
|
|
670
|
+
// barcode: "33321323",
|
|
671
|
+
// table: [
|
|
672
|
+
// { id: "1", name: "王小可123", gender: "男", count: "120", amount: "9089元" },
|
|
673
|
+
// { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
|
|
674
|
+
// ],
|
|
675
|
+
// table1: [
|
|
676
|
+
// { id: "1", name: "王小可11", gender: "男", count: "120", amount: "9089元" },
|
|
677
|
+
// { id: "2", name: "梦之遥", gender: "女", count: "20", amount: "89元" },
|
|
678
|
+
// ],
|
|
679
|
+
// },
|
|
680
|
+
// onPrintData: data => {
|
|
681
|
+
// return data;
|
|
682
|
+
// },
|
|
683
|
+
// onTemplate: data => {
|
|
684
|
+
// return data;
|
|
685
|
+
// },
|
|
686
|
+
// defaultTemplate: {
|
|
687
|
+
// panels: [
|
|
688
|
+
// {
|
|
689
|
+
// index: 0,
|
|
690
|
+
// name: 1,
|
|
691
|
+
// paperType: "A4",
|
|
692
|
+
// height: 297,
|
|
693
|
+
// width: 210,
|
|
694
|
+
// paperHeader: 0,
|
|
695
|
+
// paperFooter: 841.8897637795277,
|
|
696
|
+
// printElements: [
|
|
697
|
+
// {
|
|
698
|
+
// options: {
|
|
699
|
+
// left: 117,
|
|
700
|
+
// top: 94.5,
|
|
701
|
+
// height: 9.75,
|
|
702
|
+
// width: 120,
|
|
703
|
+
// field: "name",
|
|
704
|
+
// testData: "内容",
|
|
705
|
+
// title: "文本",
|
|
706
|
+
// qid: "name",
|
|
707
|
+
// },
|
|
708
|
+
// printElementType: {
|
|
709
|
+
// title: "文本",
|
|
710
|
+
// type: "text",
|
|
711
|
+
// },
|
|
712
|
+
// },
|
|
713
|
+
// {
|
|
714
|
+
// options: {
|
|
715
|
+
// left: 160.5,
|
|
716
|
+
// top: 174,
|
|
717
|
+
// height: 36,
|
|
718
|
+
// width: 550,
|
|
719
|
+
// fields: [],
|
|
720
|
+
// field: "table",
|
|
721
|
+
// qid: "table",
|
|
722
|
+
// columns: [
|
|
723
|
+
// [
|
|
724
|
+
// {
|
|
725
|
+
// width: 137.5,
|
|
726
|
+
// title: "名称",
|
|
727
|
+
// field: "name",
|
|
728
|
+
// checked: true,
|
|
729
|
+
// columnId: "name",
|
|
730
|
+
// fixed: false,
|
|
731
|
+
// rowspan: 1,
|
|
732
|
+
// colspan: 1,
|
|
733
|
+
// align: "center",
|
|
734
|
+
// },
|
|
735
|
+
// {
|
|
736
|
+
// width: 137.5,
|
|
737
|
+
// title: "性别",
|
|
738
|
+
// field: "gender",
|
|
739
|
+
// checked: true,
|
|
740
|
+
// columnId: "gender",
|
|
741
|
+
// fixed: false,
|
|
742
|
+
// rowspan: 1,
|
|
743
|
+
// colspan: 1,
|
|
744
|
+
// align: "center",
|
|
745
|
+
// },
|
|
746
|
+
// {
|
|
747
|
+
// width: 137.5,
|
|
748
|
+
// title: "数量",
|
|
749
|
+
// field: "count",
|
|
750
|
+
// checked: true,
|
|
751
|
+
// columnId: "count",
|
|
752
|
+
// fixed: false,
|
|
753
|
+
// rowspan: 1,
|
|
754
|
+
// colspan: 1,
|
|
755
|
+
// align: "center",
|
|
756
|
+
// },
|
|
757
|
+
// {
|
|
758
|
+
// width: 137.5,
|
|
759
|
+
// title: "金额",
|
|
760
|
+
// field: "amount",
|
|
761
|
+
// checked: true,
|
|
762
|
+
// columnId: "amount",
|
|
763
|
+
// fixed: false,
|
|
764
|
+
// rowspan: 1,
|
|
765
|
+
// colspan: 1,
|
|
766
|
+
// align: "center",
|
|
767
|
+
// },
|
|
768
|
+
// ],
|
|
769
|
+
// ],
|
|
770
|
+
// },
|
|
771
|
+
// printElementType: {
|
|
772
|
+
// title: "表格",
|
|
773
|
+
// type: "table",
|
|
774
|
+
// editable: true,
|
|
775
|
+
// columnDisplayEditable: true,
|
|
776
|
+
// columnDisplayIndexEditable: true,
|
|
777
|
+
// columnTitleEditable: true,
|
|
778
|
+
// columnResizable: true,
|
|
779
|
+
// columnAlignEditable: true,
|
|
780
|
+
// isEnableEditField: true,
|
|
781
|
+
// isEnableContextMenu: true,
|
|
782
|
+
// isEnableInsertRow: true,
|
|
783
|
+
// isEnableDeleteRow: true,
|
|
784
|
+
// isEnableInsertColumn: true,
|
|
785
|
+
// isEnableDeleteColumn: true,
|
|
786
|
+
// isEnableMergeCell: true,
|
|
787
|
+
// },
|
|
788
|
+
// },
|
|
789
|
+
// ],
|
|
790
|
+
// paperNumberContinue: true,
|
|
791
|
+
// watermarkOptions: {},
|
|
792
|
+
// panelLayoutOptions: {},
|
|
793
|
+
// },
|
|
794
|
+
// ],
|
|
795
|
+
// },
|
|
796
|
+
// onSubmit: data => {
|
|
797
|
+
// console.log(6666, data);
|
|
798
|
+
// },
|
|
799
|
+
// });
|
|
800
|
+
},
|
|
801
|
+
saveHandler(configList) {
|
|
802
|
+
console.log("保存配置", configList);
|
|
803
|
+
},
|
|
530
804
|
},
|
|
531
805
|
};
|
|
532
806
|
</script>
|
package/src/main.js
CHANGED
|
@@ -2,13 +2,12 @@ import Vue from "vue";
|
|
|
2
2
|
import ElementUI from "element-ui";
|
|
3
3
|
import "element-ui/lib/theme-chalk/index.css";
|
|
4
4
|
import App from "./App.vue";
|
|
5
|
-
import OlCom, { swaggerInstall } from "@/package/index.js";
|
|
5
|
+
import OlCom, { swaggerInstall, Hiprint } from "@/package/index.js";
|
|
6
6
|
Vue.use(ElementUI);
|
|
7
|
+
Vue.use(Hiprint);
|
|
7
8
|
|
|
8
9
|
Vue.use(OlCom);
|
|
9
|
-
swaggerInstall("http://220.179.249.140:
|
|
10
|
-
() => {}
|
|
11
|
-
);
|
|
10
|
+
swaggerInstall("http://220.179.249.140:20025/swagger/v1/swagger.json").then(() => {});
|
|
12
11
|
new Vue({
|
|
13
|
-
render:
|
|
12
|
+
render: h => h(App),
|
|
14
13
|
}).$mount("#app");
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ol-search
|
|
3
|
+
:form-search-data="formSearchData"
|
|
4
|
+
@handleSearch="handleSearch"
|
|
5
|
+
@onSave="onSave"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
v-on="$listeners"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: "customSearch",
|
|
14
|
+
props: {
|
|
15
|
+
formSearchData: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => {
|
|
18
|
+
return {
|
|
19
|
+
buttonData: [],
|
|
20
|
+
rules: {},
|
|
21
|
+
value: {},
|
|
22
|
+
tableSearchSlice: 4, // 默认为展开4当出现特色情况可以自行设置
|
|
23
|
+
// 循环的各种组件
|
|
24
|
+
tableSearch: [],
|
|
25
|
+
// 表格框架各种样式
|
|
26
|
+
options: {},
|
|
27
|
+
reset: false, // 是否要重置
|
|
28
|
+
enableConfig: false, // 是否启用配置功能
|
|
29
|
+
customs: [],
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
currentPageItem: {},
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
created() {
|
|
40
|
+
this.init();
|
|
41
|
+
},
|
|
42
|
+
mounted() {},
|
|
43
|
+
methods: {
|
|
44
|
+
init() {
|
|
45
|
+
const handleMenu = (arr, _this) => {
|
|
46
|
+
for (const item of arr) {
|
|
47
|
+
if (item.path === _this.$route.path) {
|
|
48
|
+
return item;
|
|
49
|
+
}
|
|
50
|
+
if (item.child && item.child.length > 0 && item.type !== 1) {
|
|
51
|
+
const found = handleMenu(item.child, _this);
|
|
52
|
+
if (found) return found;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
};
|
|
57
|
+
let wms = JSON.parse(localStorage.getItem("wms"));
|
|
58
|
+
let SET_MENUS = null;
|
|
59
|
+
if (wms) SET_MENUS = wms.SET_MENUS;
|
|
60
|
+
const menus = SET_MENUS;
|
|
61
|
+
this.currentPageItem = handleMenu(menus, this);
|
|
62
|
+
|
|
63
|
+
this.get({
|
|
64
|
+
url: `/api/app/menu-search-setting/by-menu`,
|
|
65
|
+
data: {
|
|
66
|
+
sysMenuId: this.currentPageItem && this.currentPageItem.id,
|
|
67
|
+
},
|
|
68
|
+
}).then(res => {
|
|
69
|
+
if (res.code !== 200) return;
|
|
70
|
+
const configList = res.result.settingJson ? JSON.parse(res.result.settingJson) : [];
|
|
71
|
+
this.formSearchData.tableSearch = configList;
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
//保存
|
|
75
|
+
onSave(configList) {
|
|
76
|
+
this.post({
|
|
77
|
+
url: `/api/app/menu-search-setting`,
|
|
78
|
+
data: {
|
|
79
|
+
sysMenuId: this.currentPageItem && this.currentPageItem.id,
|
|
80
|
+
settingJson: JSON.stringify(configList),
|
|
81
|
+
},
|
|
82
|
+
}).then(res => {
|
|
83
|
+
if (res.code !== 200) return;
|
|
84
|
+
this.$message.success("保存成功");
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
console.log("保存配置数据", configList);
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style lang="scss" scoped></style>
|