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.
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +15 -0
- package/src/components/controls/base/BriUpload/uploadList.vue +217 -56
- package/src/components/controls/mixins/controlMixin.js +29 -29
- package/src/components/controls/senior/cascaderTable.vue +4 -2
- package/src/components/controls/senior/flatTable.vue +2 -0
- package/src/components/controls/senior/selectUsers/departMenu.vue +2 -1
- package/src/components/form/DshForm.vue +5 -1
- package/src/components/list/DshBox/DshCrossTable.vue +0 -3
- package/src/components/list/DshCascaderTable.vue +4 -4
- package/src/components/list/mixins/DshCascaderTableMixin.js +378 -355
- package/src/components/list/mixins/DshFlatTableMixin.js +46 -10
- package/src/components/list/mixins/DshTreeTableMixin.js +10 -10
- package/src/components/list/mixins/tableBaseMixin.js +256 -230
- package/src/components/list/mixins/treeTableBaseMixin.js +57 -23
- package/src/components/small/DshDropdown.vue +2 -1
- package/src/styles/components/list/BriTable.less +2 -1
- package/src/utils/table.js +1 -1
|
@@ -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
|
-
|
|
36
|
+
treeTableBasePropsObj () {
|
|
14
37
|
return {
|
|
15
38
|
_treeForm: [],
|
|
16
|
-
|
|
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字段的进行特殊处理(
|
|
51
|
+
// 层级表格类型,level字段的进行特殊处理(treeForm加工成_data)
|
|
29
52
|
return column._key === "level"
|
|
30
53
|
? {
|
|
31
54
|
...column,
|
|
32
|
-
_data: this.
|
|
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",
|
|
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",
|
|
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",
|
|
118
|
+
this.change("deleteRow", row, rowIndex, null);
|
|
85
119
|
}
|
|
86
120
|
});
|
|
87
121
|
},
|
|
88
|
-
// 节点操作 -删除所有子行
|
|
89
|
-
clickDeleteChilds (operationItem, row, rowIndex, col) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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"
|
package/src/utils/table.js
CHANGED