bri-components 1.3.97 → 1.4.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.
@@ -6,30 +6,53 @@ export default {
6
6
  props: {},
7
7
  data () {
8
8
  return {
9
- searchMode: "flat" // "flat", "tree"
9
+ searchMode: "flat", // "flat", "tree"
10
+
11
+ baseOperationMap: {
12
+ canCreateChild: {
13
+ name: "添加一行下级",
14
+ type: "canCreateChild",
15
+ btnType: "default",
16
+ icon: "md-add-circle",
17
+ size: "default",
18
+ color: "#3DB8C5",
19
+ disabled: false,
20
+ event: "clickCreateChild"
21
+ }
22
+ // canDeleteChilds: {
23
+ // name: "删除所有子级",
24
+ // type: "canDeleteChilds",
25
+ // btnType: "errorText",
26
+ // icon: "ios-trash-outline",
27
+ // size: "small",
28
+ // color: "#E83636",
29
+ // disabled: false,
30
+ // event: "clickDeleteChilds"
31
+ // }
32
+ }
10
33
  };
11
34
  },
12
35
  computed: {
13
- selfPropsObj () {
36
+ treeTableBasePropsObj () {
14
37
  return {
15
38
  _treeForm: [],
16
- ...(this.typePropsObj || {}),
17
- ...this.commonPropsObj,
18
-
19
- _maxLevel: this.commonPropsObj._maxLevel || 3 // 最大级数
39
+ _maxLevel: 3 // 最大级数
20
40
  };
21
41
  },
42
+ treeForm () {
43
+ return this.selfPropsObj._treeForm;
44
+ },
22
45
  maxLevel () {
23
- return this.selfPropsObj._maxLevel;
46
+ return this.selfPropsObj._maxLevel || 3;
24
47
  },
25
48
 
26
49
  selfColumns () {
27
50
  return this.columns.map(column => {
28
- // 层级表格类型,level字段的进行特殊处理(_treeForm加工成_data)
51
+ // 层级表格类型,level字段的进行特殊处理(treeForm加工成_data)
29
52
  return column._key === "level"
30
53
  ? {
31
54
  ...column,
32
- _data: this.selfPropsObj._treeForm.map((treeFormItem, treeFormIndex) => ({
55
+ _data: this.treeForm.map((treeFormItem, treeFormIndex) => ({
33
56
  name: treeFormItem._name,
34
57
  _key: (treeFormIndex + 1),
35
58
  color: Object.keys(resourceData.colorMap)[treeFormIndex + 1]
@@ -37,6 +60,17 @@ export default {
37
60
  }
38
61
  : column;
39
62
  });
63
+ },
64
+ selfAllOperationMap () {
65
+ return {
66
+ canCreateChild: {
67
+ ...this.baseOperationMap.canCreateChild,
68
+ name: this.showMode === "form"
69
+ ? this.baseOperationMap.canCreateChild.name.replace("行", "条")
70
+ : this.baseOperationMap.canCreateChild.name
71
+ // disabled: !!this.disabledCreateBtn
72
+ }
73
+ };
40
74
  }
41
75
  },
42
76
  created () { },
@@ -57,7 +91,7 @@ export default {
57
91
  : list.length;
58
92
  list.splice(newRowIndex, 0, newRow);
59
93
 
60
- this.change("createRow", null, newRow, newRowIndex);
94
+ this.change("createRow", newRow, newRowIndex, null);
61
95
  },
62
96
  // 节点操作 -添加子行
63
97
  clickCreateChild (operationItem, row, rowIndex, col) {
@@ -69,7 +103,7 @@ export default {
69
103
  // 展开子级
70
104
  this.toggleExpand(row, true);
71
105
 
72
- this.change("createChildRow", null, newRow, newRowIndex);
106
+ this.change("createChildRow", newRow, newRowIndex, null);
73
107
  },
74
108
  // 节点操作 -删除行
75
109
  clickDelete (operationItem, row, rowIndex, col) {
@@ -81,22 +115,22 @@ export default {
81
115
  const index = parentRow.children.findIndex(childRowItem => childRowItem._id === row._id);
82
116
  parentRow.children.splice(index, 1);
83
117
 
84
- this.change("deleteRow", null, row, rowIndex);
118
+ this.change("deleteRow", row, rowIndex, null);
85
119
  }
86
120
  });
87
121
  },
88
- // 节点操作 -删除所有子行
89
- clickDeleteChilds (operationItem, row, rowIndex, col) {
90
- this.$Modal.confirm({
91
- title: "警告",
92
- content: "确定删除所有下级吗?",
93
- onOk: () => {
94
- row.children.splice(0);
122
+ // // 节点操作 -删除所有子行
123
+ // clickDeleteChilds (operationItem, row, rowIndex, col) {
124
+ // this.$Modal.confirm({
125
+ // title: "警告",
126
+ // content: "确定删除所有下级吗?",
127
+ // onOk: () => {
128
+ // row.children.splice(0);
95
129
 
96
- this.change("deleteChildRows", null, row, rowIndex);
97
- }
98
- });
99
- },
130
+ // this.change("deleteChildRows", row, rowIndex, null);
131
+ // }
132
+ // });
133
+ // },
100
134
 
101
135
  // 展开/隐藏节点
102
136
  toggleExpand (row, bool = true) {
@@ -48,7 +48,7 @@
48
48
  class="list"
49
49
  >
50
50
  <DropdownItem
51
- v-for="dropdownItem in showList"
51
+ v-for="(dropdownItem, dropdownIndex) in showList"
52
52
  :key="dropdownItem._id || dropdownItem._key || dropdownItem.type"
53
53
  :class="{
54
54
  'list-item': true,
@@ -63,6 +63,7 @@
63
63
  <slot
64
64
  name="dropdownItem"
65
65
  :dropdownItem="dropdownItem"
66
+ :dropdownIndex="dropdownIndex"
66
67
  >
67
68
  <dsh-icons
68
69
  v-if="dropdownItem.icon || dropdownItem.customIcon"
@@ -224,8 +224,9 @@
224
224
  display: none!important;
225
225
  }
226
226
 
227
- &-tree,
228
227
  &-merge {
228
+ background-color: #fbfbfb!important;
229
+
229
230
  textarea.ivu-input {
230
231
  min-height: 18px;
231
232
  padding: 0px;
@@ -123,7 +123,7 @@ const transformToColumns = function (form, {
123
123
  }
124
124
  : undefined
125
125
  : undefined,
126
- renderHeaderCell: ({ row, column }, h) => {
126
+ renderHeaderCell: ({ column }, h) => {
127
127
  return getHeadRender(h, column, {
128
128
  showRequired,
129
129
  showDescription,