bri-components 1.4.80 → 1.4.81

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": "bri-components",
3
- "version": "1.4.80",
3
+ "version": "1.4.81",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -21,7 +21,7 @@
21
21
  :cellStyleOption="cellStyleOption"
22
22
  :rowStyleOption="rowStyleOption"
23
23
  :expandOption="selfPropsObj.expandOption"
24
- :checkbox-option="checkboxOption"
24
+ :checkbox-option="selfCheckboxOption"
25
25
  :radioOption="selfPropsObj.radioOption"
26
26
  :sortOption="sortOption"
27
27
  :cellSelectionOption="selfPropsObj.cellSelectionOption"
@@ -50,25 +50,31 @@
50
50
  export default {
51
51
  name: "BriTable",
52
52
  props: {
53
+ isLoading: Boolean,
54
+ data: Array,
55
+ footerData: Array,
56
+ columns: Array,
57
+
58
+ noDataText: {
59
+ type: String,
60
+ default: "暂无数据…"
61
+ },
53
62
  propsObj: {
54
63
  type: Object,
55
64
  default () {
56
65
  return {};
57
66
  }
58
67
  },
59
- isLoading: Boolean,
60
- noDataText: {
61
- type: String,
62
- default: "暂无数据…"
63
- },
64
- columns: Array,
65
- data: Array,
66
- footerData: Array
68
+ checkboxOption: {
69
+ type: Object,
70
+ default () {
71
+ return {};
72
+ }
73
+ }
67
74
  },
68
75
  data () {
69
76
  // 中文文档https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/api
70
- return {
71
- };
77
+ return { };
72
78
  },
73
79
  computed: {
74
80
  selfPropsObj () {
@@ -138,7 +144,7 @@
138
144
  };
139
145
  },
140
146
  // 全选配置项
141
- checkboxOption () {
147
+ selfCheckboxOption () {
142
148
  return {
143
149
  // 行选择改变事件
144
150
  selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
@@ -156,7 +162,8 @@
156
162
  { isSelected, selectedRowKeys }
157
163
  );
158
164
  },
159
- ...(this.propsObj.checkboxOption || {})
165
+ ...(this.propsObj.checkboxOption || {}),
166
+ ...this.checkboxOption
160
167
  };
161
168
  },
162
169
  // 列宽改变设置项
@@ -58,6 +58,7 @@
58
58
  :data="isLoading ? [] : selfShowListData"
59
59
  :footer-data="footerData"
60
60
  :propsObj="tablePropsObj"
61
+ :checkboxOption="checkboxOption"
61
62
  @changeSelect="changeSelect"
62
63
  @selectAll="changeSelect"
63
64
  ></bri-table>
@@ -167,6 +168,7 @@
167
168
  :data="isLoading ? [] : selfShowListData"
168
169
  :footer-data="footerData"
169
170
  :propsObj="tableInModalPropsObj"
171
+ :checkboxOption="checkboxOption"
170
172
  @changeSelect="changeSelect"
171
173
  @selectAll="changeSelect"
172
174
  ></bri-table>
@@ -233,7 +233,6 @@ export default {
233
233
  return loop(nodes);
234
234
  },
235
235
 
236
-
237
236
  bodyCellSpan ({ row, rowIndex, column }) {
238
237
  row = row[column.nodeKey || column._key];
239
238
  return {
@@ -1,7 +1,13 @@
1
1
  export default {
2
2
  mixins: [],
3
3
  components: {},
4
- props: {},
4
+ props: {
5
+ // 使用多选列
6
+ useSelection: {
7
+ type: Boolean,
8
+ default: false
9
+ }
10
+ },
5
11
  data () {
6
12
  return {
7
13
  isUseDescSort: false,
@@ -283,6 +289,7 @@ export default {
283
289
  }
284
290
  }
285
291
 
292
+ this.changeSelect();
286
293
  this.change("createRow", newRow, newRowIndex, null);
287
294
  },
288
295
  // 点击 -删除行
@@ -443,7 +450,6 @@ export default {
443
450
  const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
444
451
  list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
445
452
  .forEach(rowItem => {
446
- console.log(rowItem[column._key]);
447
453
  rowItem[column._key] = this.$deepCopy(row[column._key]);
448
454
  });
449
455
  }
@@ -48,7 +48,6 @@ export default {
48
48
 
49
49
  showColumns () {
50
50
  return [
51
- ...(this.useSelection === true ? [this.selectionColumn] : []),
52
51
  this.expandColumn,
53
52
  ...(this.useIndex === true ? [this.indexColumn] : []),
54
53
  ...this.$transformToColumns(this.showContentColumns),
@@ -77,7 +77,7 @@ export default {
77
77
  showRuleMessage: false, // 进行全体校验
78
78
 
79
79
  idRecordMap: {}, // 默认id转换映射
80
- hoverRecordMap: {},
80
+ // hoverRecordMap: {},
81
81
  ruleRecordMap: {}, // 单元格是否发生校验的记录映射
82
82
 
83
83
  showTopSearch: true,
@@ -97,6 +97,7 @@ export default {
97
97
  },
98
98
 
99
99
  isLoading: false,
100
+ selectIds: [],
100
101
 
101
102
  dshRenderName: undefined,
102
103
  hideStatus: true,
@@ -244,7 +245,6 @@ export default {
244
245
  _contentHeight: 500, // 表格最大高度
245
246
  _headHeightAuto: false, // 表头高度自适应
246
247
  _heightAuto: false, // 单元格高度自适应
247
- _useSelection: false, // 使用选择列 -配置端暂时用不到
248
248
  _useIndex: true, // 使用序号列
249
249
  _useSummary: false, // 使用汇总行
250
250
  _noborderColKeys: [], // 无边线的列
@@ -330,9 +330,6 @@ export default {
330
330
  heightAuto () {
331
331
  return this.selfPropsObj._heightAuto;
332
332
  },
333
- useSelection () {
334
- return this.selfPropsObj._useSelection;
335
- },
336
333
  useIndex () {
337
334
  return this.selfPropsObj._useIndex;
338
335
  },
@@ -543,7 +540,6 @@ export default {
543
540
  : true
544
541
  );
545
542
  },
546
-
547
543
  selectionColumn () {
548
544
  return {
549
545
  _key: "__selection__",
@@ -573,6 +569,11 @@ export default {
573
569
  };
574
570
  },
575
571
 
572
+ checkboxOption () {
573
+ return {
574
+ selectedRowKeys: this.selectIds
575
+ };
576
+ },
576
577
  tablePropsObj () {
577
578
  return {
578
579
  // isLoading: false,
@@ -581,13 +582,6 @@ export default {
581
582
  // clickHighlight: true,
582
583
  // stripe: true // 斑马纹
583
584
  // },
584
- ...(
585
- this.selfPropsObj.checkboxOption
586
- ? {
587
- checkboxOption: this.selfPropsObj.checkboxOption
588
- }
589
- : {}
590
- ),
591
585
  maxHeight: this.contentHeight,
592
586
  // 通过实例方法 hideColumnsByKeys(keys)将列隐藏,通过实例方法 showColumnsByKeys(keys)将隐藏的列显示
593
587
  columnHiddenOption: {
@@ -818,7 +812,7 @@ export default {
818
812
  this.showRuleMessage = false;
819
813
 
820
814
  this.idRecordMap = {};
821
- this.hoverRecordMap = {};
815
+ // this.hoverRecordMap = {};
822
816
  this.ruleRecordMap = {};
823
817
 
824
818
  this.dftAdvSearch = {
@@ -832,8 +826,9 @@ export default {
832
826
  },
833
827
  loadingFunc () {
834
828
  this.isLoading = true;
829
+ this.changeSelect();
830
+
835
831
  setTimeout(() => {
836
- this.changeSelect();
837
832
  this.isLoading = false;
838
833
  });
839
834
  },
@@ -847,9 +842,10 @@ export default {
847
842
  this.changePage && this.changePage(1);
848
843
  }
849
844
  },
850
- // 列表选择项改变
845
+ // 列表选择项改变 (!!!外部在使用)
851
846
  changeSelect (selections = [], ...params) {
852
- this.$emit("changeSelect", selections.map(item => item._id), selections, ...params);
847
+ this.selectIds = selections.map(item => item._id);
848
+ this.$emit("changeSelect", this.selectIds, selections, ...params);
853
849
  },
854
850
 
855
851
  // 输入框失去焦点
@@ -1438,10 +1434,10 @@ export default {
1438
1434
  // console.log("contextmenu::", row, rowIndex, column, event);
1439
1435
  },
1440
1436
  mouseenter: (event) => {
1441
- this.$set(this.hoverRecordMap, `${row._id}`, true);
1437
+ // this.$set(this.hoverRecordMap, `${row._id}`, true);
1442
1438
  },
1443
1439
  mouseleave: (event) => {
1444
- this.$set(this.hoverRecordMap, `${row._id}`, false);
1440
+ // this.$set(this.hoverRecordMap, `${row._id}`, false);
1445
1441
  }
1446
1442
  };
1447
1443
  },