ol-base-components 3.1.4 → 3.2.1

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