meixioacomponent 1.1.43 → 1.1.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,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "1.1.43",
3
+ "version": "1.1.44",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -145,10 +145,7 @@ export default {
145
145
  },
146
146
  setTableHeaderConfig() {
147
147
  if (this.isDrag) {
148
- const {useLocalTableConfig} = this.$props;
149
148
  this.$emit('setTableHeaderConfig', this.dragConfigList)
150
- console.log(useLocalTableConfig);
151
-
152
149
  }
153
150
  this.popoverFlag = false
154
151
  },
@@ -35,7 +35,7 @@
35
35
  :proScreenConfig="privateProScreenConfig"
36
36
  :proScreenList="proScreenList"
37
37
  :screenList="screenList"
38
- :table-config="tableConfig"
38
+ :table-config="tableConfigColumnList"
39
39
  :use-pro-screen-list="useProScreenList"
40
40
  :use-search="useSearch"
41
41
  :use-local-table-config="useLocalTableConfig"
@@ -146,6 +146,9 @@
146
146
  <slot :scope="props.row" name="tableExpand"></slot>
147
147
  </template>
148
148
  </el-table-column>
149
+ <!--序号-->
150
+ <el-table-column type="index" width="50" v-if="useIndex"></el-table-column>
151
+
149
152
  <el-table-column
150
153
  v-for="(item, index) in showTableHeader"
151
154
  :key="index"
@@ -303,11 +306,14 @@ export default {
303
306
 
304
307
  // 表格勾选的控制
305
308
  tableCheckControl: null,
309
+
310
+
311
+ tableConfigColumnList: []
312
+
306
313
  };
307
314
  },
308
315
  created() {
309
316
  this.init();
310
-
311
317
  componentConfig.eventBus.$on("handleTableBorder", this.handleTableBorder);
312
318
  },
313
319
  mounted() {
@@ -509,6 +515,10 @@ export default {
509
515
  useLocalTableConfig: {
510
516
  type: String,
511
517
  default: ''
518
+ },
519
+ useIndex: {
520
+ type: Boolean,
521
+ default: false
512
522
  }
513
523
 
514
524
  },
@@ -537,7 +547,7 @@ export default {
537
547
  );
538
548
  },
539
549
  fixedList() {
540
- return this.$props.tableConfig.filter((item) => {
550
+ return this.tableConfigColumnList.filter((item) => {
541
551
  const {lock} = item;
542
552
  return lock && lock !== "right";
543
553
  });
@@ -553,38 +563,21 @@ export default {
553
563
  },
554
564
 
555
565
  showTableHeader() {
556
- if (this.$props.tableConfig) {
557
-
558
566
 
559
- const useLocalTableConfig = this.$props.useLocalTableConfig;
567
+ return this.tableConfigColumnList.filter((item) => {
560
568
 
561
- if (useLocalTableConfig) {
562
-
563
-
564
- const checkAccordFlag = proTableLocalConfigManage.checkRenderTableConfigAccordLocal(useLocalTableConfig, this.$props.tableConfig);
565
-
566
- if (checkAccordFlag) {
567
- return proTableLocalConfigManage.hasConfigByTableKey(useLocalTableConfig);
569
+ if (item.hasOwnProperty('disabledSortable')) {
570
+ if (!item.disabledSortable) {
571
+ item.disabledSortable = false;
568
572
  }
569
-
573
+ } else {
574
+ item.disabledSortable = false;
570
575
  }
571
576
 
572
577
 
573
- return this.$props.tableConfig.filter((item) => {
574
-
575
- if (item.hasOwnProperty('disabledSortable')) {
576
- if (!item.disabledSortable) {
577
- item.disabledSortable = false;
578
- }
579
- } else {
580
- item.disabledSortable = false;
581
- }
582
-
578
+ return item.show;
579
+ });
583
580
 
584
- return item.show;
585
- });
586
- }
587
- return [];
588
581
  },
589
582
 
590
583
  isCheckTableRow() {
@@ -644,6 +637,7 @@ export default {
644
637
  return value.toString().length > 10;
645
638
  },
646
639
  init() {
640
+ this.setTableConfigColumList();
647
641
  const {rowKey} = this.$props;
648
642
  if (rowKey) {
649
643
  this.initTableControl();
@@ -651,15 +645,15 @@ export default {
651
645
  // canPush = !this.isAverageWidth;
652
646
  this.initProScreenConfig();
653
647
  this.initFooterHandleConfig();
654
- this.$props.tableConfig.forEach((item, index) => {
648
+ this.tableConfigColumnList.forEach((item, index) => {
655
649
  item.preIndex = index;
656
- this.$set(item, "show", true);
650
+
651
+ if (!item.hasOwnProperty('show')) {
652
+ this.$set(item, "show", true);
653
+ }
657
654
  if (!item.width || item.width <= 80) {
658
655
  item.width = 80;
659
656
  }
660
- // if (item.lock === "right") {
661
- // canPush = false;
662
- // }
663
657
  });
664
658
 
665
659
  // if (canPush) {
@@ -669,16 +663,44 @@ export default {
669
663
  this.refreshData();
670
664
  },
671
665
 
666
+ setTableConfigColumList() {
667
+ if (this.$props.tableConfig) {
668
+
669
+
670
+ const useLocalTableConfig = this.$props.useLocalTableConfig;
671
+
672
+ if (useLocalTableConfig) {
673
+
674
+
675
+ const checkAccordFlag = proTableLocalConfigManage.checkRenderTableConfigAccordLocal(useLocalTableConfig, this.$props.tableConfig);
676
+
677
+ if (checkAccordFlag) {
678
+ proTableLocalConfigManage.hasConfigByTableKey(useLocalTableConfig).forEach(item => {
679
+ this.tableConfigColumnList.push(item);
680
+ })
681
+ return;
682
+ }
683
+
684
+ }
685
+
686
+
687
+ this.tableConfigColumnList = JSON.parse(JSON.stringify(this.$props.tableConfig));
688
+
689
+ console.log(this.tableConfigColumnList);
690
+ }
691
+ },
692
+
693
+
672
694
  tableConfigPushEmpty() {
673
- const {tableConfig} = this.$props;
674
- tableConfig.push({
675
- label: "",
676
- key: "noData",
677
- lock: false,
678
- width: 40,
679
- show: true,
680
- template: false,
681
- });
695
+ //
696
+ // this.tableConfigColumnList.push({
697
+ // label: "",
698
+ // key: "noData",
699
+ // lock: false,
700
+ // width: 40,
701
+ // show: true,
702
+ // template: false,
703
+ // });
682
704
  },
683
705
 
684
706
  initTableControl() {
@@ -699,7 +721,7 @@ export default {
699
721
  const tableWidth = this.$refs.elTable.$el.offsetWidth;
700
722
  let totalWidth = 0;
701
723
  let staticLength = 0;
702
- const {tableConfig} = this.$props;
724
+ const tableConfig = this.tableConfigColumnList;
703
725
  tableConfig.forEach((item) => {
704
726
  if (item.lock || item.staticWidth) {
705
727
  staticLength += 1;
@@ -728,7 +750,7 @@ export default {
728
750
 
729
751
  headerItemLock(params) {
730
752
  let {preIndex, index} = {...params};
731
- let tableConfig = this.$props.tableConfig;
753
+ let tableConfig = this.tableConfigColumnList;
732
754
  tableConfig[index].lock = true;
733
755
  if (tableConfig[index].preIndex === undefined) {
734
756
  tableConfig[index].preIndex = preIndex;
@@ -751,7 +773,7 @@ export default {
751
773
  },
752
774
  headerItemUnlock(params) {
753
775
  let {preIndex, index} = {...params};
754
- let tableConfig = this.$props.tableConfig;
776
+ let tableConfig = this.tableConfigColumnList;
755
777
  tableConfig[index].lock = false;
756
778
 
757
779
  tableConfig.splice(
@@ -792,7 +814,7 @@ export default {
792
814
  // 初始化高级筛选
793
815
  initProScreenConfig() {
794
816
  this.privateProScreenConfig = [];
795
- this.$props.tableConfig.forEach((item) => {
817
+ this.tableConfigColumnList.forEach((item) => {
796
818
  if (item.proScreenItem) {
797
819
  this.$set(item.proScreenItem, "label", item.label);
798
820
  this.$set(item.proScreenItem, "isCheck", false);
@@ -1129,6 +1151,11 @@ export default {
1129
1151
 
1130
1152
 
1131
1153
  },
1154
+ watch: {
1155
+ tableConfig() {
1156
+ this.setTableConfigColumList();
1157
+ }
1158
+ }
1132
1159
  };
1133
1160
  </script>
1134
1161