bri-components 1.3.98 → 1.4.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.
@@ -6,30 +6,56 @@ 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
+ },
45
+ treeFormKeys () {
46
+ return this.treeForm.map(treeFormItem => treeFormItem._key);
47
+ },
22
48
  maxLevel () {
23
- return this.selfPropsObj._maxLevel;
49
+ return this.selfPropsObj._maxLevel || 3;
24
50
  },
25
51
 
26
52
  selfColumns () {
27
53
  return this.columns.map(column => {
28
- // 层级表格类型,level字段的进行特殊处理(_treeForm加工成_data)
54
+ // 层级表格类型,level字段的进行特殊处理(treeForm加工成_data)
29
55
  return column._key === "level"
30
56
  ? {
31
57
  ...column,
32
- _data: this.selfPropsObj._treeForm.map((treeFormItem, treeFormIndex) => ({
58
+ _data: this.treeForm.map((treeFormItem, treeFormIndex) => ({
33
59
  name: treeFormItem._name,
34
60
  _key: (treeFormIndex + 1),
35
61
  color: Object.keys(resourceData.colorMap)[treeFormIndex + 1]
@@ -37,6 +63,17 @@ export default {
37
63
  }
38
64
  : column;
39
65
  });
66
+ },
67
+ selfAllOperationMap () {
68
+ return {
69
+ canCreateChild: {
70
+ ...this.baseOperationMap.canCreateChild,
71
+ name: this.showMode === "form"
72
+ ? this.baseOperationMap.canCreateChild.name.replace("行", "条")
73
+ : this.baseOperationMap.canCreateChild.name
74
+ // disabled: !!this.disabledCreateBtn
75
+ }
76
+ };
40
77
  }
41
78
  },
42
79
  created () { },
@@ -85,18 +122,18 @@ export default {
85
122
  }
86
123
  });
87
124
  },
88
- // 节点操作 -删除所有子行
89
- clickDeleteChilds (operationItem, row, rowIndex, col) {
90
- this.$Modal.confirm({
91
- title: "警告",
92
- content: "确定删除所有下级吗?",
93
- onOk: () => {
94
- row.children.splice(0);
125
+ // // 节点操作 -删除所有子行
126
+ // clickDeleteChilds (operationItem, row, rowIndex, col) {
127
+ // this.$Modal.confirm({
128
+ // title: "警告",
129
+ // content: "确定删除所有下级吗?",
130
+ // onOk: () => {
131
+ // row.children.splice(0);
95
132
 
96
- this.change("deleteChildRows", row, rowIndex, null);
97
- }
98
- });
99
- },
133
+ // this.change("deleteChildRows", row, rowIndex, null);
134
+ // }
135
+ // });
136
+ // },
100
137
 
101
138
  // 展开/隐藏节点
102
139
  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"
@@ -171,7 +171,7 @@
171
171
  &-expand {
172
172
 
173
173
  }
174
- &-index {
174
+ &-treeIndex {
175
175
  padding: 4px 16px 4px 12px!important;
176
176
  }
177
177
  &-operation {
@@ -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;