bri-components 1.0.5 → 1.1.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/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -0
- package/lib/8.bri-components.min.js +1 -0
- package/lib/9.bri-components.min.js +1 -0
- package/lib/bri-components.min.js +13 -5
- package/lib/styles/bundle.css +0 -2
- package/package.json +2 -1
- package/src/components/controls/base/BriLabels.vue +117 -0
- package/src/components/controls/base/DshCascader.vue +23 -38
- package/src/components/controls/base/DshCascaderMultiple.vue +1 -1
- package/src/components/controls/base/DshCheckbox.vue +14 -4
- package/src/components/controls/base/DshCoordinates.vue +5 -9
- package/src/components/controls/base/DshDate.vue +10 -34
- package/src/components/controls/base/DshDivider.vue +1 -1
- package/src/components/controls/base/DshEditor.vue +52 -44
- package/src/components/controls/base/DshInput.vue +18 -45
- package/src/components/controls/base/DshLabels.vue +8 -4
- package/src/components/controls/base/DshNumber/DshNumber.vue +6 -20
- package/src/components/controls/base/DshNumberange.vue +1 -1
- package/src/components/controls/base/DshPackage.vue +7 -1
- package/src/components/controls/base/DshSelect.vue +15 -5
- package/src/components/controls/base/DshSwitch.vue +2 -6
- package/src/components/controls/base/YSerialNumber.vue +0 -1
- package/src/components/controls/base/ZUpload/index.vue +16 -10
- package/src/components/controls/base/ZUpload/upload-list.vue +17 -12
- package/src/components/controls/base/ZUpload/uploadMixin.js +1 -5
- package/src/components/controls/base/controlShow.vue +52 -0
- package/src/components/controls/base/textMultiple/DshTextMultiple.vue +1 -1
- package/src/components/controls/controlMap.js +4 -0
- package/src/components/controls/controlMixin.js +18 -12
- package/src/components/controls/senior/cascaderTable.vue +188 -0
- package/src/components/controls/senior/flatTable.vue +131 -0
- package/src/components/form/DshForm.vue +0 -3
- package/src/components/list/BriFlatTable.vue +430 -0
- package/src/components/list/BriTable.vue +184 -0
- package/src/components/list/DshBox/DshPanel.vue +4 -9
- package/src/components/list/DshBox/DshTable.vue +29 -39
- package/src/components/list/DshCascaderTable.vue +6 -11
- package/src/components/other/BriTransfer.vue +71 -0
- package/src/components/small/BriButton.vue +65 -0
- package/src/components/small/BriTree.vue +42 -0
- package/src/components/small/Ctooltip.vue +1 -1
- package/src/components/small/DshButtons.vue +12 -42
- package/src/components/unit/DshFormItem.vue +0 -2
- package/src/components/unit/DshUnit.vue +1 -1
- package/src/components/unit/unitMixin.js +4 -1
- package/src/index.js +24 -4
- package/src/styles/bundle.css +0 -2
- package/src/styles/common/common.less +2 -2
- package/src/styles/common/control.less +53 -0
- package/src/styles/common/index.less +1 -0
- package/src/styles/components/controls/BriLabels.less +23 -0
- package/src/styles/components/controls/DshCascader.less +3 -3
- package/src/styles/components/controls/DshCheckbox.less +1 -1
- package/src/styles/components/controls/DshCoordinates.less +3 -3
- package/src/styles/components/controls/DshDate.less +54 -0
- package/src/styles/components/controls/DshDaterange.less +1 -1
- package/src/styles/components/controls/DshEditor.less +27 -9
- package/src/styles/components/controls/DshInput.less +5 -5
- package/src/styles/components/controls/DshLabels.less +1 -1
- package/src/styles/components/controls/DshSelect.less +46 -30
- package/src/styles/components/controls/ZUpload.less +82 -91
- package/src/styles/components/controls/cascaderTable.less +33 -0
- package/src/styles/components/controls/controlShow.less +12 -0
- package/src/styles/components/controls/flatTable.less +33 -0
- package/src/styles/components/form/DshAdvSearchForm.less +6 -6
- package/src/styles/components/index.less +10 -0
- package/src/styles/components/list/BriFlatTable.less +8 -0
- package/src/styles/components/list/BriTable.less +155 -0
- package/src/styles/components/list/DshFlatTable.less +3 -8
- package/src/styles/components/list/evTable.less +1 -1
- package/src/styles/components/other/BriTransfer.less +65 -0
- package/src/styles/components/other/DshEditPanel.less +2 -2
- package/src/styles/components/other/DshMenuNav.less +5 -5
- package/src/styles/components/other/ZGantt.less +5 -5
- package/src/styles/components/small/BriButton.less +259 -0
- package/src/styles/components/small/BriTree.less +57 -0
- package/src/styles/components/small/Ctooltip.less +14 -0
- package/src/styles/components/small/DshButtons.less +1 -1
- package/src/styles/components/small/DshControlDefine.less +2 -2
- package/src/styles/components/small/DshDropdown.less +1 -1
- package/src/styles/components/small/DshPage.less +1 -1
- package/src/styles/components/small/DshTabs.less +2 -2
- package/src/styles/components/unit/DshFormItem.less +5 -6
- package/src/styles/index.less +1 -5
- package/src/styles/plugin/easytable.less +22 -0
- package/src/styles/plugin/index.less +2 -0
- package/src/styles/plugin/iview.less +33 -0
- package/src/styles/variables.less +71 -88
- package/src/utils/table.js +72 -978
- package/src/styles/define.less +0 -374
- package/src/styles/view_reset.less +0 -452
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bri-table">
|
|
3
|
+
<ve-table
|
|
4
|
+
class="bri-table-content"
|
|
5
|
+
:class="[selfClassName, selfPropsObj.className]"
|
|
6
|
+
:table-data="data"
|
|
7
|
+
:footer-data="footerData"
|
|
8
|
+
:columns="columnsList"
|
|
9
|
+
:show-header="selfPropsObj.showHeader"
|
|
10
|
+
:fixed-header="selfPropsObj.fixedHeader"
|
|
11
|
+
:fixed-footer="selfPropsObj.fixedFooter"
|
|
12
|
+
:scroll-width="selfPropsObj.scrollWidth"
|
|
13
|
+
:max-height="selfPropsObj.maxHeight"
|
|
14
|
+
:row-key-field-name="selfPropsObj.rowKeyFieldName"
|
|
15
|
+
:border-around="selfPropsObj.borderAround"
|
|
16
|
+
:border-x="selfPropsObj.borderX"
|
|
17
|
+
:border-y="selfPropsObj.borderY"
|
|
18
|
+
:cellSpanOption="selfPropsObj.cellSpanOption"
|
|
19
|
+
:columnHiddenOption="selfPropsObj.columnHiddenOption"
|
|
20
|
+
:cellStyleOption="cellStyleOption"
|
|
21
|
+
:rowStyleOption="rowStyleOption"
|
|
22
|
+
:expandOption="selfPropsObj.expandOption"
|
|
23
|
+
:checkbox-option="checkboxOption"
|
|
24
|
+
:radioOption="selfPropsObj.radioOption"
|
|
25
|
+
:sortOption="sortOption"
|
|
26
|
+
:cellSelectionOption="selfPropsObj.cellSelectionOption"
|
|
27
|
+
:editOption="selfPropsObj.editOption"
|
|
28
|
+
:contextmenuHeaderOption="selfPropsObj.contextmenuHeaderOption"
|
|
29
|
+
:contextmenuBodyOption="selfPropsObj.contextmenuBodyOption"
|
|
30
|
+
:event-custom-option="eventCustomOption"
|
|
31
|
+
:cellAutofillOption="selfPropsObj.cellAutofillOption"
|
|
32
|
+
:clipboardOption="selfPropsObj.clipboardOption"
|
|
33
|
+
:columnWidthResizeOption="columnWidthResizeOption"
|
|
34
|
+
></ve-table>
|
|
35
|
+
<!-- loading -->
|
|
36
|
+
<div v-if="isLoading" class="bri-table-empty bri-table-loading">
|
|
37
|
+
<slot name="loading">正在加载中,请稍后...</slot>
|
|
38
|
+
</div>
|
|
39
|
+
<!-- empty -->
|
|
40
|
+
<div v-else-if="!data.length" class="bri-table-empty">
|
|
41
|
+
<slot name="empty">{{ noDataText }}</slot>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
export default {
|
|
48
|
+
name: "BriTable",
|
|
49
|
+
props: {
|
|
50
|
+
propsObj: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default () {
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
isLoading: Boolean,
|
|
57
|
+
noDataText: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "暂无数据"
|
|
60
|
+
},
|
|
61
|
+
columns: Array,
|
|
62
|
+
data: Array,
|
|
63
|
+
footerData: Array
|
|
64
|
+
},
|
|
65
|
+
data () {
|
|
66
|
+
// 中文文档https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/api
|
|
67
|
+
return {
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
selfPropsObj () {
|
|
72
|
+
return {
|
|
73
|
+
rowKeyFieldName: "_id",
|
|
74
|
+
scrollWidth: "0",
|
|
75
|
+
borderY: true,
|
|
76
|
+
cellSelectionOption: {
|
|
77
|
+
enable: false
|
|
78
|
+
},
|
|
79
|
+
...this.propsObj
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
columnsList () {
|
|
83
|
+
return this.columns;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// 当前表格状态
|
|
87
|
+
currentState () {
|
|
88
|
+
return this.propsObj.state || this.state;
|
|
89
|
+
},
|
|
90
|
+
selfClassName () {
|
|
91
|
+
if (this.loading || !this.data.length) {
|
|
92
|
+
return "bri-table-onlyhead";
|
|
93
|
+
} else {
|
|
94
|
+
return "";
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
rowStyleOption () {
|
|
99
|
+
return {
|
|
100
|
+
clickHighlight: false,
|
|
101
|
+
...(this.propsObj.rowStyleOption || {})
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
cellStyleOption () {
|
|
106
|
+
return {
|
|
107
|
+
headerCellClass: () => {
|
|
108
|
+
return "bri-table-th";
|
|
109
|
+
},
|
|
110
|
+
bodyCellClass: ({rowIndex}) => {
|
|
111
|
+
return "bri-table-td";
|
|
112
|
+
},
|
|
113
|
+
...(this.propsObj.cellStyleOption || {})
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
// 自定义表格事件,也可配置鼠标事件
|
|
117
|
+
eventCustomOption () {
|
|
118
|
+
return {
|
|
119
|
+
bodyRowEvents: ({ row, rowIndex }) => {
|
|
120
|
+
return {
|
|
121
|
+
click: (event) => {
|
|
122
|
+
this.$emit("click-row", row, rowIndex, event);
|
|
123
|
+
},
|
|
124
|
+
dblclick: (event) => {
|
|
125
|
+
this.$emit("db-click-row", row, rowIndex, event);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
...(this.propsObj.eventCustomOption || {})
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
// 全选配置项
|
|
133
|
+
checkboxOption () {
|
|
134
|
+
return {
|
|
135
|
+
// 行选择改变事件
|
|
136
|
+
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
137
|
+
this.$emit(
|
|
138
|
+
"selectChange",
|
|
139
|
+
this.data.filter(dataItem => selectedRowKeys.includes(dataItem[this.selfPropsObj.rowKeyFieldName])),
|
|
140
|
+
{ row, isSelected, selectedRowKeys }
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
// 全选改变事件
|
|
144
|
+
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
145
|
+
this.$emit(
|
|
146
|
+
"selectAll",
|
|
147
|
+
this.data.filter(dataItem => selectedRowKeys.includes(dataItem[this.selfPropsObj.rowKeyFieldName])),
|
|
148
|
+
{ isSelected, selectedRowKeys }
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
...(this.propsObj.checkboxOption || {})
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
// 列宽改变设置项
|
|
155
|
+
columnWidthResizeOption () {
|
|
156
|
+
return {
|
|
157
|
+
enable: true,
|
|
158
|
+
minWidth: 80,
|
|
159
|
+
sizeChange: ({ column, differWidth, columnWidth }) => {
|
|
160
|
+
this.$emit("size-change", column, differWidth, columnWidth);
|
|
161
|
+
},
|
|
162
|
+
...(this.propsObj.columnWidthResizeOption || {})
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
sortOption () {
|
|
166
|
+
return {
|
|
167
|
+
sortChange: (params) => {
|
|
168
|
+
let sortObj =
|
|
169
|
+
Object.keys(params)
|
|
170
|
+
.filter(attr => !!params[attr])
|
|
171
|
+
.reduce((obj, attr) => {
|
|
172
|
+
return { sortType: params[attr], field: attr };
|
|
173
|
+
}, {});
|
|
174
|
+
this.$emit("sort-change", sortObj);
|
|
175
|
+
},
|
|
176
|
+
...(this.propsObj.sortOption || {})
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
mounted () {
|
|
181
|
+
},
|
|
182
|
+
methods: {}
|
|
183
|
+
};
|
|
184
|
+
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="DshPanel">
|
|
3
3
|
<div
|
|
4
|
-
class="DshPanel-group"
|
|
5
4
|
v-for="(groupItem, groupIndex) in data"
|
|
6
5
|
:key="groupIndex"
|
|
6
|
+
class="DshPanel-group"
|
|
7
7
|
>
|
|
8
8
|
<!-- 组 标头 -->
|
|
9
9
|
<div
|
|
@@ -192,10 +192,9 @@
|
|
|
192
192
|
|
|
193
193
|
getBgColor (groupItem) {
|
|
194
194
|
return this.groupFieldObj._useColor
|
|
195
|
-
?
|
|
196
|
-
: "color-default";
|
|
197
|
-
}
|
|
198
|
-
colorMap: resourceData.colorMap
|
|
195
|
+
? resourceData.colorMap[(this.groupFieldObj._data.find(item => item._key === groupItem._key) || { color: "color-default" }).color]
|
|
196
|
+
: resourceData.colorMap["color-default"];
|
|
197
|
+
}
|
|
199
198
|
};
|
|
200
199
|
},
|
|
201
200
|
computed: {
|
|
@@ -385,10 +384,6 @@
|
|
|
385
384
|
height: 40px;
|
|
386
385
|
padding: 0px 10px;
|
|
387
386
|
text-align: center;
|
|
388
|
-
|
|
389
|
-
.ivu-btn {
|
|
390
|
-
background: transparent;
|
|
391
|
-
}
|
|
392
387
|
}
|
|
393
388
|
}
|
|
394
389
|
}
|
|
@@ -3,26 +3,18 @@
|
|
|
3
3
|
class="DshTable"
|
|
4
4
|
style="width: 100%; height: 100%;"
|
|
5
5
|
>
|
|
6
|
-
<
|
|
6
|
+
<bri-table
|
|
7
7
|
:className="propsObj.className"
|
|
8
8
|
:data="data"
|
|
9
|
-
:
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:odd-bg-color="propsObj.oddBgColor"
|
|
16
|
-
:even-bg-color="propsObj.evenBgColor"
|
|
17
|
-
:row-hover-color="propsObj.rowHoverColor"
|
|
18
|
-
:row-click-color="propsObj.rowClickColor"
|
|
19
|
-
:noDataText="propsObj.noDataText"
|
|
20
|
-
:is-loading="propsObj.isLoading"
|
|
21
|
-
:selectChange="changeSelect"
|
|
22
|
-
:selectAll="changeSelect"
|
|
9
|
+
:columns="selfColumns"
|
|
10
|
+
:propsObj="propsObj"
|
|
11
|
+
:isLoading="isLoading"
|
|
12
|
+
:noDataText="noDataText"
|
|
13
|
+
@selectChange="changeSelect"
|
|
14
|
+
@selectAll="changeSelect"
|
|
23
15
|
@click-row="clickRow"
|
|
24
16
|
@sort-change="changeSort"
|
|
25
|
-
></
|
|
17
|
+
></bri-table>
|
|
26
18
|
</div>
|
|
27
19
|
</template>
|
|
28
20
|
|
|
@@ -59,7 +51,9 @@
|
|
|
59
51
|
default () {
|
|
60
52
|
return {};
|
|
61
53
|
}
|
|
62
|
-
}
|
|
54
|
+
},
|
|
55
|
+
isLoading: Boolean,
|
|
56
|
+
noDataText: String
|
|
63
57
|
},
|
|
64
58
|
data () {
|
|
65
59
|
return {};
|
|
@@ -99,26 +93,24 @@
|
|
|
99
93
|
...(
|
|
100
94
|
this.multiple
|
|
101
95
|
? [{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
type: "
|
|
105
|
-
width:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
isFrozen: true
|
|
96
|
+
field: "selection",
|
|
97
|
+
key: "selection",
|
|
98
|
+
type: "checkbox",
|
|
99
|
+
width: 66,
|
|
100
|
+
align: "center",
|
|
101
|
+
fixed: "left"
|
|
109
102
|
}]
|
|
110
103
|
: []
|
|
111
104
|
),
|
|
112
105
|
{
|
|
113
|
-
field: "custome",
|
|
114
106
|
title: "序号",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return rowIndex
|
|
107
|
+
field: "custome",
|
|
108
|
+
key: "customes",
|
|
109
|
+
width: 78,
|
|
110
|
+
align: "center",
|
|
111
|
+
fixed: "left",
|
|
112
|
+
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
113
|
+
return ++rowIndex;
|
|
122
114
|
}
|
|
123
115
|
},
|
|
124
116
|
|
|
@@ -129,8 +121,10 @@
|
|
|
129
121
|
? [
|
|
130
122
|
{
|
|
131
123
|
title: "操作",
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
field: "operation",
|
|
125
|
+
key: "operation",
|
|
126
|
+
align: "center",
|
|
127
|
+
fixed: "right",
|
|
134
128
|
width: Math.max(
|
|
135
129
|
// 漏在外部按钮的宽度
|
|
136
130
|
this.selfOperationList
|
|
@@ -141,11 +135,7 @@
|
|
|
141
135
|
4 // 留出4px空间,避免麻烦问题
|
|
142
136
|
, 80
|
|
143
137
|
),
|
|
144
|
-
|
|
145
|
-
columnAlign: "center",
|
|
146
|
-
componentName: "dsh-td-render",
|
|
147
|
-
isFrozenRight: true,
|
|
148
|
-
render: (h, params) => {
|
|
138
|
+
renderBodyCell: (params, h) => {
|
|
149
139
|
const totalOperationList = this.selfOperationList.map(operationItem => {
|
|
150
140
|
return {
|
|
151
141
|
...operationItem,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
|
|
3
|
+
class="DshCascaderTable"
|
|
4
4
|
ref="DshCascaderTable"
|
|
5
5
|
>
|
|
6
6
|
<div :class="{
|
|
@@ -149,7 +149,6 @@
|
|
|
149
149
|
:style="getTdStyle(col, row)"
|
|
150
150
|
>
|
|
151
151
|
<dsh-unit
|
|
152
|
-
:mode="mode"
|
|
153
152
|
:canEdit="canEdit && (col.canEdit === undefined ? true : col.canEdit)"
|
|
154
153
|
:formData="row[col.nodeKey]"
|
|
155
154
|
:formItem="col"
|
|
@@ -186,10 +185,6 @@
|
|
|
186
185
|
DshUnit
|
|
187
186
|
},
|
|
188
187
|
props: {
|
|
189
|
-
mode: {
|
|
190
|
-
type: String,
|
|
191
|
-
default: "default"
|
|
192
|
-
},
|
|
193
188
|
useCol: {
|
|
194
189
|
type: Boolean,
|
|
195
190
|
default: false
|
|
@@ -232,7 +227,7 @@
|
|
|
232
227
|
},
|
|
233
228
|
data () {
|
|
234
229
|
return {
|
|
235
|
-
widthMap: this.$getModFieldPropertyMap("
|
|
230
|
+
widthMap: this.$getModFieldPropertyMap("width"),
|
|
236
231
|
boxWidth: 0,
|
|
237
232
|
getColOperationNames (col) {
|
|
238
233
|
return [
|
|
@@ -342,7 +337,7 @@
|
|
|
342
337
|
},
|
|
343
338
|
|
|
344
339
|
treeData () {
|
|
345
|
-
return this.
|
|
340
|
+
return this.transforBriTreeData();
|
|
346
341
|
},
|
|
347
342
|
columns () {
|
|
348
343
|
return this.transformColumns(this.treeColumns);
|
|
@@ -520,7 +515,7 @@
|
|
|
520
515
|
deleteSelfAndChildNodes (operationItem, row, rowIndex, col) {
|
|
521
516
|
let nodeData = this.getNodeData(row, rowIndex, col);
|
|
522
517
|
nodeData.brotherList.splice(nodeData.index, 1);
|
|
523
|
-
// 此处应该判断子节点是否是最后一个,是的话就要添加一个一直到叶子节点,不过现在只需要添加一个子节点,
|
|
518
|
+
// 此处应该判断子节点是否是最后一个,是的话就要添加一个一直到叶子节点,不过现在只需要添加一个子节点,transforBriTreeData会捎带着处理了
|
|
524
519
|
if (!nodeData.brotherList.length) {
|
|
525
520
|
let newNode = this.getNewNode(nodeData.level, nodeData.brotherList);
|
|
526
521
|
nodeData.brotherList.push(newNode);
|
|
@@ -532,7 +527,7 @@
|
|
|
532
527
|
deleteChildNodes (operationItem, row, rowIndex, col) {
|
|
533
528
|
let nodeData = this.getNodeData(row, rowIndex, col);
|
|
534
529
|
nodeData.childList.splice(0);
|
|
535
|
-
// 删除完应该添加一个子节点一直到叶子节点,不过现在只需要添加一个子节点,
|
|
530
|
+
// 删除完应该添加一个子节点一直到叶子节点,不过现在只需要添加一个子节点,transforBriTreeData会捎带着处理了
|
|
536
531
|
let newNode = this.getNewNode(nodeData.level + 1, nodeData.childList);
|
|
537
532
|
nodeData.childList.push(newNode);
|
|
538
533
|
|
|
@@ -589,7 +584,7 @@
|
|
|
589
584
|
);
|
|
590
585
|
},
|
|
591
586
|
// 转化树数据
|
|
592
|
-
|
|
587
|
+
transforBriTreeData (treeForm = this.treeColumns, subForm = this.subColumns) {
|
|
593
588
|
treeForm.forEach((treeFormItem, treeFormIndex) => {
|
|
594
589
|
treeFormItem.canDelete = true; // 每次计算,重置一下
|
|
595
590
|
treeFormItem.level = treeFormIndex + 1; // treeColumns更新,缺少level
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BriTransfer">
|
|
3
|
+
<Transfer
|
|
4
|
+
:data="selfData"
|
|
5
|
+
:target-keys="targetKeys"
|
|
6
|
+
:filterable="filterable"
|
|
7
|
+
:filter-method="filterMethod"
|
|
8
|
+
:titles="titles"
|
|
9
|
+
not-found-text="暂无数据"
|
|
10
|
+
@on-change="handleChange"
|
|
11
|
+
></Transfer>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: "BriTransfer",
|
|
18
|
+
props: {
|
|
19
|
+
data: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
value: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: () => {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
filterMethod: {
|
|
32
|
+
type: Function,
|
|
33
|
+
default: () => {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
titles: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => {
|
|
40
|
+
return ["源列表", "目的列表"];
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
filterable: Boolean
|
|
44
|
+
},
|
|
45
|
+
data () {
|
|
46
|
+
return {
|
|
47
|
+
targetKeys: []
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
selfData () {
|
|
52
|
+
return this.data.map(item => {
|
|
53
|
+
return {
|
|
54
|
+
key: item._key,
|
|
55
|
+
label: item._name || item.name || item.realname
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
created () {
|
|
61
|
+
this.targetKeys = this.value;
|
|
62
|
+
},
|
|
63
|
+
methods: {
|
|
64
|
+
handleChange (newTargetKeys) {
|
|
65
|
+
this.targetKeys = newTargetKeys;
|
|
66
|
+
this.$emit("input", this.targetKeys);
|
|
67
|
+
this.$emit("change", this.targetKeys);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Button
|
|
3
|
+
class="BriButton"
|
|
4
|
+
:class="selfPropsObj.class"
|
|
5
|
+
:type="selfPropsObj.btnType"
|
|
6
|
+
:shape="selfPropsObj.shape || shape"
|
|
7
|
+
:size="selfPropsObj.size || size"
|
|
8
|
+
:loading="selfPropsObj.loading"
|
|
9
|
+
:disabled="selfPropsObj.disabled"
|
|
10
|
+
:htmlType="selfPropsObj.htmlType"
|
|
11
|
+
:icon="selfPropsObj.icon || icon"
|
|
12
|
+
:customIcon="selfPropsObj.customIcon || customIcon"
|
|
13
|
+
:long="selfPropsObj.long"
|
|
14
|
+
:ghost="selfPropsObj.ghost"
|
|
15
|
+
@click="dispatchEvent"
|
|
16
|
+
>
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</Button>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import controlMixin from "../controls/controlMixin.js";
|
|
23
|
+
export default {
|
|
24
|
+
name: "BriButton",
|
|
25
|
+
mixins: [controlMixin],
|
|
26
|
+
props: {
|
|
27
|
+
type: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "primary"
|
|
30
|
+
},
|
|
31
|
+
icon: String,
|
|
32
|
+
shape: String,
|
|
33
|
+
size: String,
|
|
34
|
+
customIcon: String
|
|
35
|
+
},
|
|
36
|
+
data () {
|
|
37
|
+
return {};
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
selfPropsObj () {
|
|
41
|
+
let defaultType = this.propsObj.btnType || this.type;
|
|
42
|
+
let setType = this.propsObj.btnType || this.type;
|
|
43
|
+
if (["cancel"].includes(defaultType)) {
|
|
44
|
+
setType = "primary";
|
|
45
|
+
} else if (["errorLine"].includes(defaultType)) {
|
|
46
|
+
setType = "default";
|
|
47
|
+
} else if (["linkText", "primaryText", "errorText"].includes(defaultType)) {
|
|
48
|
+
setType = "text";
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
class: ["cancel", "linkText", "primaryText", "errorLine", "errorText"].includes(defaultType) ? `ivu-btn-${defaultType}` : "",
|
|
52
|
+
...this.propsObj,
|
|
53
|
+
btnType: setType,
|
|
54
|
+
customIcon: this.propsObj.customIcon ? `bico-font ${this.propsObj.customIcon}` : undefined
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
created () {},
|
|
59
|
+
methods: {
|
|
60
|
+
dispatchEvent () {
|
|
61
|
+
this.$emit("click", this.selfPropsObj);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Tree
|
|
3
|
+
class="BriTree"
|
|
4
|
+
:data="val"
|
|
5
|
+
:multiple="propsObj.multiple"
|
|
6
|
+
:showCheckbox="propsObj.showCheckbox"
|
|
7
|
+
:checkStrictly="propsObj.checkStrictly"
|
|
8
|
+
:checkDirectly="propsObj.checkDirectly"
|
|
9
|
+
:emptyText="propsObj.emptyText"
|
|
10
|
+
:childrenKey="propsObj.childrenKey"
|
|
11
|
+
:loadData="propsObj.loadData"
|
|
12
|
+
:render="propsObj.render"
|
|
13
|
+
:selectNode="propsObj.selectNode"
|
|
14
|
+
:expandNode="propsObj.expandNode"
|
|
15
|
+
></Tree>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import controlMixin from "../controls/controlMixin.js";
|
|
20
|
+
export default {
|
|
21
|
+
name: "BriTree",
|
|
22
|
+
mixins: [controlMixin],
|
|
23
|
+
props: {
|
|
24
|
+
},
|
|
25
|
+
data () {
|
|
26
|
+
return {};
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
selfPropsObj () {
|
|
30
|
+
return {
|
|
31
|
+
...this.propsObj
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
val () {
|
|
35
|
+
return this.value[this.propsObj._key];
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
created () {},
|
|
39
|
+
methods: {
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
</script>
|