bri-components 1.4.1 → 1.4.2

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.1",
3
+ "version": "1.4.2",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -12,21 +12,6 @@ export default {
12
12
  data () {
13
13
  return {
14
14
  boxWidth: 0
15
- // baseOperationMap: {
16
- // canCreateCol: {
17
- // name: "添加一列",
18
- // type: "canCreateCol",
19
- // icon: "md-add",
20
- // event: "clickCreateCol"
21
- // },
22
- // canDeleteCol: {
23
- // name: "删除该列",
24
- // type: "canDeleteCol",
25
- // icon: "md-trash",
26
- // color: "red",
27
- // event: "clickDeleteCol"
28
- // }
29
- // }
30
15
  };
31
16
  },
32
17
  computed: {
@@ -89,31 +74,6 @@ export default {
89
74
  });
90
75
  },
91
76
 
92
- // /* ----------- 操作 ---------- */
93
- // // 表头操作 -树形表头-添加一列
94
- // clickCreateCol (operationItem, col, colIndex) {
95
- // this.treeColumns.push({
96
- // _id: this.$ObjectID().str,
97
- // _key: this.$randomB36("Field"),
98
- // _type: "textarea",
99
- // _name: `${this.$numToChinese(this.treeColumns.length + 1)}级表头`,
100
- // level: this.treeColumns.length + 1,
101
- // canDelete: true,
102
- // _treeSubForm: []
103
- // });
104
- // this.tableDataObj._treeForm = this.treeColumns;
105
-
106
- // this.change("createCol", null, null, col);
107
- // },
108
- // // 表头操作 -树形表头-删除一列
109
- // clickDeleteCol (operationItem, col, colIndex) {
110
- // this.isDeleteColStatus = true; // isDeleteStatus不用在data中定义
111
- // this.treeColumns.pop();
112
- // this.tableDataObj._treeForm = this.treeColumns;
113
-
114
- // this.change("deleteCol", null, null, col);
115
- // },
116
-
117
77
  /* ----------- 渲染函数(声明:为了代码更加规范清晰,return的是h相关的函数,则函数名get开头;return的是h的直接调用,函数名不要get开头)---------- */
118
78
  // 表格表头渲染函数
119
79
  tableHeadRender (h) {
@@ -209,8 +169,6 @@ export default {
209
169
  },
210
170
  [
211
171
  this.contentThCellRender(h, { column, colIndex })
212
-
213
- // this.treeThDropOperationRender(h, { column, colIndex })
214
172
  ]);
215
173
  },
216
174
  emptyTdRender (h, { row, rowIndex, column }) {
@@ -256,56 +214,6 @@ export default {
256
214
  : this.contentTdCellRender(h, { row, rowIndex, column })
257
215
  );
258
216
  },
259
- // // 树形表头最末级列的下拉渲染函数
260
- // treeThDropOperationRender (h, { column, colIndex }) {
261
- // const list = this.$getOperationList(
262
- // column.colType === "tree" && column.level === this.treeColumns.length
263
- // ? [
264
- // ...(column.level < this.maxLevel ? ["canCreateCol"] : []), // 限制最大添加到几级
265
- // ...(column.canDelete === true ? ["canDeleteCol"] : []) // 只有一级和最后两级节点数不一致时,不能删
266
- // ]
267
- // : []
268
- // );
269
-
270
- // return !this.isSearching &&
271
- // list.length
272
- // ? h("dsh-dropdown", {
273
- // class: "bri-table-dropdown",
274
- // props: {
275
- // menuClass: "bri-table-dropdown-list",
276
- // trigger: "hover",
277
- // list: list
278
- // },
279
- // on: {
280
- // click: (operationItem) => {
281
- // this.$dispatchEvent(operationItem, column, colIndex);
282
- // }
283
- // },
284
- // nativeOn: {
285
- // click: (e) => {
286
- // e.stopPropagation();
287
- // }
288
- // }
289
- // }, [
290
- // h("a", {
291
- // style: {
292
- // fontWeight: "500",
293
- // color: this.appColor
294
- // },
295
- // attrs: {
296
- // href: "javascript:void(0)"
297
- // }
298
- // }, [
299
- // h("Icon", {
300
- // props: {
301
- // type: "md-arrow-dropdown-circle",
302
- // size: "16"
303
- // }
304
- // })
305
- // ])
306
- // ])
307
- // : undefined;
308
- // },
309
217
 
310
218
  /* ----------- 方法 ---------- */
311
219
  // 表头 -获取样式
@@ -449,15 +357,6 @@ export default {
449
357
 
450
358
  // 最后一列(根节点)
451
359
  if (rowItem.level === treeForm.length) {
452
- // // 处理删除了最后一列后,把根节点上的subForm属性值全部给上级节点
453
- // if (this.isDeleteColStatus) {
454
- // let subNode = rowItem.children[0];
455
- // subForm.forEach(subFormItem => {
456
- // // 用$set也可以
457
- // rowItem[subFormItem._key] = subNode[subFormItem._key];
458
- // });
459
- // }
460
-
461
360
  rowItem.children = [];
462
361
  rowItem.isLeaf = true;
463
362
 
@@ -469,13 +368,6 @@ export default {
469
368
  }
470
369
  // 非最后一列(最后一列前的列,非根节点),需继续向下循环
471
370
  else {
472
- // // 判断是否能删除最后一列(1.判断条件:判断根节点列的前一列的所有节点 都必须只有一个子结点 2.canDelete放在表头treeForm最后一项,默认true)
473
- // if (rowItem.level === treeForm.length - 1) {
474
- // if (rowItem.children.length > 1) {
475
- // treeForm[rowItem.level].canDelete = false;
476
- // }
477
- // }
478
-
479
371
  // 非最后一列的 正常的非根节点
480
372
  if (rowItem.children && rowItem.children.length) {
481
373
  loop(rowItem.children, [...parentNodes, rowItem]);
@@ -166,7 +166,7 @@ export default {
166
166
  event: "clickExport"
167
167
  },
168
168
  canEnlarge: {
169
- name: "全屏展示",
169
+ name: "全屏",
170
170
  type: "canEnlarge",
171
171
  icon: "md-expand",
172
172
  size: "small",
@@ -251,14 +251,15 @@ export default {
251
251
  }, // 引用列表筛选条件
252
252
  _isImport: false, // 导入
253
253
  _isExport: false, // 导出
254
+ _useEnlarge: true, // 全屏
254
255
 
255
256
  _default: {
256
257
  rowDefault: {},
257
258
  list: [],
258
259
  tree: []
259
260
  },
260
- ...(this.selfBasePropsObj || {}),
261
261
 
262
+ ...(this.selfBasePropsObj || {}),
262
263
  ...this.propsObj
263
264
  };
264
265
  },
@@ -386,7 +387,7 @@ export default {
386
387
  : this.allListData.length;
387
388
  },
388
389
  rowsNumStr () {
389
- return `当前${this.isSearching ? "筛选" : "全部"}数据, 共 ${this.rowsNum} ${this.showMode === "form" ? "条" : "行"}`;
390
+ return `当前${this.isSearching ? "筛选" : "全部"}数据, 共 ${this.rowsNum} ${this.showMode === "form" ? "条" : "行"};`;
390
391
  },
391
392
 
392
393
  /* 数据 */
@@ -589,6 +590,9 @@ export default {
589
590
  advSearch: this.finalTableAdvSearch
590
591
  };
591
592
  },
593
+ useEnlarge () {
594
+ return this.selfPropsObj._useEnlarge;
595
+ },
592
596
  modalPropsObj () {
593
597
  return {
594
598
  mode: "fullscreen",
@@ -631,22 +635,21 @@ export default {
631
635
  this.allOperationMap,
632
636
  undefined,
633
637
  undefined,
634
- this.canEdit
635
- ? [
636
- ...(this.disabledBtns ? [] : this.baseOperationBtns),
637
- ...this.otherOperationBtns,
638
- ...(this.isQuote ? ["canQuote"] : []),
639
- ...(this.isImport ? ["canImport"] : []),
640
-
641
- ...(this.isExport ? ["canExport"] : []),
642
- ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
643
- "canEnlarge"
644
- ]
645
- : [
646
- ...(this.isExport ? ["canExport"] : []),
647
- ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
648
- "canEnlarge"
649
- ]
638
+ [
639
+ ...(
640
+ this.canEdit
641
+ ? [
642
+ ...(this.disabledBtns ? [] : this.baseOperationBtns),
643
+ ...this.otherOperationBtns,
644
+ ...(this.isQuote ? ["canQuote"] : []),
645
+ ...(this.isImport ? ["canImport"] : [])
646
+ ]
647
+ : []
648
+ ),
649
+ ...(this.isExport ? ["canExport"] : []),
650
+ ...(this.useEnlarge ? ["canEnlarge"] : []),
651
+ ...(this.hideColKeys.length ? ["canHideOrShow"] : [])
652
+ ]
650
653
  );
651
654
  }
652
655
  },
@@ -900,7 +903,7 @@ export default {
900
903
  },
901
904
 
902
905
  /* ----------- 渲染函数(声明:为了代码更加规范清晰,return的是h相关的函数,则函数名get开头;return的是h的直接调用,函数名不要get开头)---------- */
903
- getTableTopRender (isEnlarge = false) {
906
+ getTableTopRender (inEnlarge = false) {
904
907
  return (h, params) => {
905
908
  return h("div", {
906
909
  style: {
@@ -912,43 +915,29 @@ export default {
912
915
  }
913
916
  }, [
914
917
  // 左 -统计,逻辑
915
- this.topSummaryRender(h, params),
918
+ this.topSummaryRender(h),
916
919
 
917
920
  // 右 -功能按钮
918
- isEnlarge ? undefined : this.topOperationRender(h, params)
921
+ this.topOperationRender(h, inEnlarge)
919
922
  ]);
920
923
  };
921
924
  },
922
- topSearchRender (h) {
923
- return this.searchFormList.length
924
- ? h("dsh-default-search", {
925
- props: {
926
- formList: this.searchFormList,
927
- initValue: this.dftAdvSearch.conditions,
928
- labelWidth: this.searchLabelWidth
929
- },
930
- on: {
931
- change: this.searchCb
932
- }
933
- })
934
- : undefined;
935
- },
936
925
  topSummaryRender (h) {
937
- return h("div", {
938
- style: {
939
- "display": "flex",
940
- "flex-direction": "row",
941
- "align-items": "center"
942
- }
943
- }, [
944
- h("span", {
926
+ return this.searchFormList.length
927
+ ? h("div", {
945
928
  style: {
946
- "font-weight": "500"
929
+ "display": "flex",
930
+ "flex-direction": "row",
931
+ "align-items": "center"
947
932
  }
948
- }, this.rowsNumStr + ";"),
933
+ }, [
934
+ h("span", {
935
+ style: {
936
+ "font-weight": "500"
937
+ }
938
+ }, this.rowsNumStr),
949
939
 
950
- this.searchFormList.length
951
- ? h("div", {
940
+ h("div", {
952
941
  style: {
953
942
  "display": "flex",
954
943
  "flex-direction": "row",
@@ -973,30 +962,47 @@ export default {
973
962
  }
974
963
  })
975
964
  ])
976
- : undefined
977
- ]);
978
- },
979
- topOperationRender (h) {
980
- return h("dsh-buttons", {
981
- style: {
982
- "text-align": "right"
983
- },
984
- props: {
985
- itemClass: undefined,
986
- list: this.$getOperationList(this.topOperationBtns)
987
- },
988
- on: {
989
- click: (event) => {
990
- this.$dispatchEvent(event);
991
- }
992
- },
993
- nativeOn: {
994
- click: (e) => {
995
- e.stopPropagation();
965
+ ])
966
+ : h("div", "");
967
+ },
968
+ // 全屏里不显示功能按钮
969
+ topOperationRender (h, inEnlarge) {
970
+ return inEnlarge
971
+ ? undefined
972
+ : h("dsh-buttons", {
973
+ style: {
974
+ "text-align": "right"
975
+ },
976
+ props: {
977
+ itemClass: undefined,
978
+ list: this.$getOperationList(this.topOperationBtns)
979
+ },
980
+ on: {
981
+ click: (event) => {
982
+ this.$dispatchEvent(event);
983
+ }
984
+ },
985
+ nativeOn: {
986
+ click: (e) => {
987
+ e.stopPropagation();
988
+ }
996
989
  }
997
- }
998
990
  });
999
991
  },
992
+ topSearchRender (h) {
993
+ return this.searchFormList.length
994
+ ? h("dsh-default-search", {
995
+ props: {
996
+ formList: this.searchFormList,
997
+ initValue: this.dftAdvSearch.conditions,
998
+ labelWidth: this.searchLabelWidth
999
+ },
1000
+ on: {
1001
+ change: this.searchCb
1002
+ }
1003
+ })
1004
+ : undefined;
1005
+ },
1000
1006
  createBtnRender (h) {
1001
1007
  return !this.isSearching && this.disabledFootCreateBtn !== true
1002
1008
  ? h("dsh-buttons", {