evui 3.3.36 → 3.3.39
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/LICENSE +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
|
@@ -1,275 +1,275 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<tr
|
|
3
|
-
:data-index="node.index"
|
|
4
|
-
:class="getRowClass(node)"
|
|
5
|
-
@click="onClick($event, node)"
|
|
6
|
-
@dblclick="onDblClick($event, node)"
|
|
7
|
-
>
|
|
8
|
-
<td
|
|
9
|
-
v-if="useCheckbox.use"
|
|
10
|
-
:class="checkboxClass"
|
|
11
|
-
:style="`
|
|
12
|
-
width: ${minWidth}px;
|
|
13
|
-
height: ${rowHeight}px;`"
|
|
14
|
-
>
|
|
15
|
-
<ev-checkbox
|
|
16
|
-
v-model="node.checked"
|
|
17
|
-
:disabled="node._disabled"
|
|
18
|
-
class="row-checkbox-input"
|
|
19
|
-
@change="onCheck($event, node)"
|
|
20
|
-
/>
|
|
21
|
-
</td>
|
|
22
|
-
<template
|
|
23
|
-
v-for="(column, cellIndex) in orderedColumns"
|
|
24
|
-
:key="cellIndex"
|
|
25
|
-
>
|
|
26
|
-
<td
|
|
27
|
-
v-if="!column.hide"
|
|
28
|
-
:data-name="column.field"
|
|
29
|
-
:data-index="node.index"
|
|
30
|
-
:class="getColumnClass(column, cellIndex)"
|
|
31
|
-
:style="getColumnStyle(column)"
|
|
32
|
-
>
|
|
33
|
-
<div>
|
|
34
|
-
<!--Level Depth-->
|
|
35
|
-
<span
|
|
36
|
-
v-if="cellIndex === 0"
|
|
37
|
-
:style="getDepthStyle(node.level)"
|
|
38
|
-
>
|
|
39
|
-
</span>
|
|
40
|
-
<!--Expand Icon-->
|
|
41
|
-
<span
|
|
42
|
-
v-if="cellIndex === 0"
|
|
43
|
-
:class="{
|
|
44
|
-
expand: node.expand,
|
|
45
|
-
'ev-tree-toggle': true
|
|
46
|
-
}"
|
|
47
|
-
>
|
|
48
|
-
<template v-if="node.hasChild">
|
|
49
|
-
<ev-icon
|
|
50
|
-
v-if="expandIconClasses(node)"
|
|
51
|
-
:icon="expandIconClasses(node)"
|
|
52
|
-
style="display: block;"
|
|
53
|
-
@click="onExpand(node)"
|
|
54
|
-
/>
|
|
55
|
-
<button
|
|
56
|
-
v-else
|
|
57
|
-
class="tree-expand-icon"
|
|
58
|
-
@click="onExpand(node)"
|
|
59
|
-
>
|
|
60
|
-
<i></i>
|
|
61
|
-
</button>
|
|
62
|
-
</template>
|
|
63
|
-
</span>
|
|
64
|
-
<!--Data Icon-->
|
|
65
|
-
<span
|
|
66
|
-
v-if="cellIndex === 0 && isDataIcon"
|
|
67
|
-
:title="node[column.field]"
|
|
68
|
-
:class="{
|
|
69
|
-
expand: node.expand,
|
|
70
|
-
'ev-tree-toggle': true,
|
|
71
|
-
}"
|
|
72
|
-
>
|
|
73
|
-
<span
|
|
74
|
-
:class="node.hasChild ? parentIconMV : childIconMV"
|
|
75
|
-
>
|
|
76
|
-
<i></i>
|
|
77
|
-
</span>
|
|
78
|
-
</span>
|
|
79
|
-
<!-- cell renderer -->
|
|
80
|
-
<template v-if="!!$slots[column.field + 'Node']">
|
|
81
|
-
<slot
|
|
82
|
-
:name="column.field + 'Node'"
|
|
83
|
-
:item="{
|
|
84
|
-
data: node.data,
|
|
85
|
-
}"
|
|
86
|
-
/>
|
|
87
|
-
</template>
|
|
88
|
-
</div>
|
|
89
|
-
</td>
|
|
90
|
-
</template>
|
|
91
|
-
</tr>
|
|
92
|
-
</template>
|
|
93
|
-
|
|
94
|
-
<script>
|
|
95
|
-
import { computed } from 'vue';
|
|
96
|
-
|
|
97
|
-
export default {
|
|
98
|
-
name: 'TreeGridNode',
|
|
99
|
-
props: {
|
|
100
|
-
dataIndex: {
|
|
101
|
-
type: Number,
|
|
102
|
-
default: 0,
|
|
103
|
-
},
|
|
104
|
-
nodeData: {
|
|
105
|
-
type: Object,
|
|
106
|
-
default: () => ({}),
|
|
107
|
-
},
|
|
108
|
-
selectedData: {
|
|
109
|
-
type: Object,
|
|
110
|
-
default: () => ({}),
|
|
111
|
-
},
|
|
112
|
-
useCheckbox: {
|
|
113
|
-
type: Object,
|
|
114
|
-
default: () => ({}),
|
|
115
|
-
},
|
|
116
|
-
orderedColumns: {
|
|
117
|
-
type: [Array],
|
|
118
|
-
default: () => [],
|
|
119
|
-
},
|
|
120
|
-
expandIcon: {
|
|
121
|
-
type: String,
|
|
122
|
-
default: '',
|
|
123
|
-
},
|
|
124
|
-
collapseIcon: {
|
|
125
|
-
type: String,
|
|
126
|
-
default: '',
|
|
127
|
-
},
|
|
128
|
-
parentIcon: {
|
|
129
|
-
type: String,
|
|
130
|
-
default: '',
|
|
131
|
-
},
|
|
132
|
-
childIcon: {
|
|
133
|
-
type: String,
|
|
134
|
-
default: '',
|
|
135
|
-
},
|
|
136
|
-
rowHeight: {
|
|
137
|
-
type: Number,
|
|
138
|
-
default: 35,
|
|
139
|
-
},
|
|
140
|
-
minWidth: {
|
|
141
|
-
type: Number,
|
|
142
|
-
default: 40,
|
|
143
|
-
},
|
|
144
|
-
borderStyle: {
|
|
145
|
-
type: String,
|
|
146
|
-
default: '',
|
|
147
|
-
},
|
|
148
|
-
highlightIndex: {
|
|
149
|
-
type: Number,
|
|
150
|
-
default: -1,
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
emits: {
|
|
154
|
-
'check-tree-data': null,
|
|
155
|
-
'expand-tree-data': null,
|
|
156
|
-
'click-tree-data': null,
|
|
157
|
-
'dbl-click-tree-data': null,
|
|
158
|
-
},
|
|
159
|
-
setup(props, { emit }) {
|
|
160
|
-
const onCheck = ($event, data) => {
|
|
161
|
-
emit('check-tree-data', $event, data);
|
|
162
|
-
};
|
|
163
|
-
const onExpand = (data) => {
|
|
164
|
-
emit('expand-tree-data', data);
|
|
165
|
-
};
|
|
166
|
-
const onClick = ($event, data) => {
|
|
167
|
-
emit('click-tree-data', $event, data);
|
|
168
|
-
};
|
|
169
|
-
const onDblClick = ($event, data) => {
|
|
170
|
-
emit('dbl-click-tree-data', $event, data);
|
|
171
|
-
};
|
|
172
|
-
const expandIconClasses = (node) => {
|
|
173
|
-
const expandIcon = props.expandIcon ? props.expandIcon : '';
|
|
174
|
-
const collapseIcon = props.expandIcon ? props.collapseIcon : '';
|
|
175
|
-
return node.expand ? collapseIcon : expandIcon;
|
|
176
|
-
};
|
|
177
|
-
const node = computed(() => (props.nodeData || {}));
|
|
178
|
-
const parentIconMV = computed(() => (props.parentIcon || 'tree-parent-icon'));
|
|
179
|
-
const childIconMV = computed(() => (props.childIcon || 'tree-child-icon'));
|
|
180
|
-
const isDataIcon = computed(() => ((parentIconMV.value !== 'none' || childIconMV.value !== 'none')));
|
|
181
|
-
|
|
182
|
-
const getRowClass = nodeInfo => ({
|
|
183
|
-
row: true,
|
|
184
|
-
'tree-row': true,
|
|
185
|
-
[`tree-row--level-${nodeInfo?.level}`]: true,
|
|
186
|
-
highlight: nodeInfo?.index === props.highlightIndex,
|
|
187
|
-
selected: nodeInfo.selected,
|
|
188
|
-
'non-border': !!props.borderStyle && props.borderStyle !== 'rows',
|
|
189
|
-
});
|
|
190
|
-
const checkboxClass = computed(() => ({
|
|
191
|
-
cell: true,
|
|
192
|
-
'row-checkbox': true,
|
|
193
|
-
'non-border': !!props.borderStyle,
|
|
194
|
-
}));
|
|
195
|
-
const getColumnClass = (column, cellIndex) => ({
|
|
196
|
-
cell: true,
|
|
197
|
-
'tree-td': cellIndex === 0,
|
|
198
|
-
[column.type]: column.type,
|
|
199
|
-
[column.align]: column.align,
|
|
200
|
-
'non-border': !!props.borderStyle,
|
|
201
|
-
});
|
|
202
|
-
const getColumnStyle = column => ({
|
|
203
|
-
width: `${column.width}px`,
|
|
204
|
-
height: `${props.rowHeight}px`,
|
|
205
|
-
'line-height': `${props.rowHeight}px`,
|
|
206
|
-
'min-width': `${props.minWidth}px`,
|
|
207
|
-
});
|
|
208
|
-
const getDepthStyle = (nodeLevel) => {
|
|
209
|
-
const depthSize = nodeLevel * 13;
|
|
210
|
-
return {
|
|
211
|
-
'margin-left': `${depthSize}px`,
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
return {
|
|
215
|
-
parentIconMV,
|
|
216
|
-
childIconMV,
|
|
217
|
-
node,
|
|
218
|
-
isDataIcon,
|
|
219
|
-
checkboxClass,
|
|
220
|
-
onCheck,
|
|
221
|
-
onExpand,
|
|
222
|
-
onClick,
|
|
223
|
-
onDblClick,
|
|
224
|
-
expandIconClasses,
|
|
225
|
-
getRowClass,
|
|
226
|
-
getColumnClass,
|
|
227
|
-
getColumnStyle,
|
|
228
|
-
getDepthStyle,
|
|
229
|
-
};
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
</script>
|
|
233
|
-
|
|
234
|
-
<style lang="scss" scoped>
|
|
235
|
-
@import './style/treeGrid.scss';
|
|
236
|
-
.ev-tree-toggle {
|
|
237
|
-
display: inline-block;
|
|
238
|
-
width: 13px;
|
|
239
|
-
margin-right: 4px;
|
|
240
|
-
text-align: center;
|
|
241
|
-
vertical-align: middle;
|
|
242
|
-
.tree-expand-icon {
|
|
243
|
-
border: none;
|
|
244
|
-
background: transparent;
|
|
245
|
-
outline: none;
|
|
246
|
-
cursor: pointer;
|
|
247
|
-
}
|
|
248
|
-
.tree-expand-icon i {
|
|
249
|
-
display: inline-block;
|
|
250
|
-
top: -3px;
|
|
251
|
-
width: 11px;
|
|
252
|
-
height: 10px;
|
|
253
|
-
background: url('./tree_icon.png') no-repeat -43px -61px;
|
|
254
|
-
}
|
|
255
|
-
&.expand > .tree-expand-icon i {
|
|
256
|
-
height: 8px;
|
|
257
|
-
background-position: -15px -63px;
|
|
258
|
-
}
|
|
259
|
-
.tree-parent-icon i, .tree-child-icon i {
|
|
260
|
-
display: inline-block;
|
|
261
|
-
top: -3px;
|
|
262
|
-
width: 14px;
|
|
263
|
-
height: 14px;
|
|
264
|
-
}
|
|
265
|
-
.tree-parent-icon i {
|
|
266
|
-
background: url('./tree_icon.png') no-repeat -39px -35px;
|
|
267
|
-
}
|
|
268
|
-
&.expand > .tree-parent-icon i {
|
|
269
|
-
background-position: -65px -35px;
|
|
270
|
-
}
|
|
271
|
-
.tree-child-icon i {
|
|
272
|
-
background: url('./tree_icon.png') no-repeat -14px -35px;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<tr
|
|
3
|
+
:data-index="node.index"
|
|
4
|
+
:class="getRowClass(node)"
|
|
5
|
+
@click="onClick($event, node)"
|
|
6
|
+
@dblclick="onDblClick($event, node)"
|
|
7
|
+
>
|
|
8
|
+
<td
|
|
9
|
+
v-if="useCheckbox.use"
|
|
10
|
+
:class="checkboxClass"
|
|
11
|
+
:style="`
|
|
12
|
+
width: ${minWidth}px;
|
|
13
|
+
height: ${rowHeight}px;`"
|
|
14
|
+
>
|
|
15
|
+
<ev-checkbox
|
|
16
|
+
v-model="node.checked"
|
|
17
|
+
:disabled="node._disabled"
|
|
18
|
+
class="row-checkbox-input"
|
|
19
|
+
@change="onCheck($event, node)"
|
|
20
|
+
/>
|
|
21
|
+
</td>
|
|
22
|
+
<template
|
|
23
|
+
v-for="(column, cellIndex) in orderedColumns"
|
|
24
|
+
:key="cellIndex"
|
|
25
|
+
>
|
|
26
|
+
<td
|
|
27
|
+
v-if="!column.hide"
|
|
28
|
+
:data-name="column.field"
|
|
29
|
+
:data-index="node.index"
|
|
30
|
+
:class="getColumnClass(column, cellIndex)"
|
|
31
|
+
:style="getColumnStyle(column)"
|
|
32
|
+
>
|
|
33
|
+
<div>
|
|
34
|
+
<!--Level Depth-->
|
|
35
|
+
<span
|
|
36
|
+
v-if="cellIndex === 0"
|
|
37
|
+
:style="getDepthStyle(node.level)"
|
|
38
|
+
>
|
|
39
|
+
</span>
|
|
40
|
+
<!--Expand Icon-->
|
|
41
|
+
<span
|
|
42
|
+
v-if="cellIndex === 0"
|
|
43
|
+
:class="{
|
|
44
|
+
expand: node.expand,
|
|
45
|
+
'ev-tree-toggle': true
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
<template v-if="node.hasChild">
|
|
49
|
+
<ev-icon
|
|
50
|
+
v-if="expandIconClasses(node)"
|
|
51
|
+
:icon="expandIconClasses(node)"
|
|
52
|
+
style="display: block;"
|
|
53
|
+
@click="onExpand(node)"
|
|
54
|
+
/>
|
|
55
|
+
<button
|
|
56
|
+
v-else
|
|
57
|
+
class="tree-expand-icon"
|
|
58
|
+
@click="onExpand(node)"
|
|
59
|
+
>
|
|
60
|
+
<i></i>
|
|
61
|
+
</button>
|
|
62
|
+
</template>
|
|
63
|
+
</span>
|
|
64
|
+
<!--Data Icon-->
|
|
65
|
+
<span
|
|
66
|
+
v-if="cellIndex === 0 && isDataIcon"
|
|
67
|
+
:title="node[column.field]"
|
|
68
|
+
:class="{
|
|
69
|
+
expand: node.expand,
|
|
70
|
+
'ev-tree-toggle': true,
|
|
71
|
+
}"
|
|
72
|
+
>
|
|
73
|
+
<span
|
|
74
|
+
:class="node.hasChild ? parentIconMV : childIconMV"
|
|
75
|
+
>
|
|
76
|
+
<i></i>
|
|
77
|
+
</span>
|
|
78
|
+
</span>
|
|
79
|
+
<!-- cell renderer -->
|
|
80
|
+
<template v-if="!!$slots[column.field + 'Node']">
|
|
81
|
+
<slot
|
|
82
|
+
:name="column.field + 'Node'"
|
|
83
|
+
:item="{
|
|
84
|
+
data: node.data,
|
|
85
|
+
}"
|
|
86
|
+
/>
|
|
87
|
+
</template>
|
|
88
|
+
</div>
|
|
89
|
+
</td>
|
|
90
|
+
</template>
|
|
91
|
+
</tr>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script>
|
|
95
|
+
import { computed } from 'vue';
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
name: 'TreeGridNode',
|
|
99
|
+
props: {
|
|
100
|
+
dataIndex: {
|
|
101
|
+
type: Number,
|
|
102
|
+
default: 0,
|
|
103
|
+
},
|
|
104
|
+
nodeData: {
|
|
105
|
+
type: Object,
|
|
106
|
+
default: () => ({}),
|
|
107
|
+
},
|
|
108
|
+
selectedData: {
|
|
109
|
+
type: Object,
|
|
110
|
+
default: () => ({}),
|
|
111
|
+
},
|
|
112
|
+
useCheckbox: {
|
|
113
|
+
type: Object,
|
|
114
|
+
default: () => ({}),
|
|
115
|
+
},
|
|
116
|
+
orderedColumns: {
|
|
117
|
+
type: [Array],
|
|
118
|
+
default: () => [],
|
|
119
|
+
},
|
|
120
|
+
expandIcon: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: '',
|
|
123
|
+
},
|
|
124
|
+
collapseIcon: {
|
|
125
|
+
type: String,
|
|
126
|
+
default: '',
|
|
127
|
+
},
|
|
128
|
+
parentIcon: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: '',
|
|
131
|
+
},
|
|
132
|
+
childIcon: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: '',
|
|
135
|
+
},
|
|
136
|
+
rowHeight: {
|
|
137
|
+
type: Number,
|
|
138
|
+
default: 35,
|
|
139
|
+
},
|
|
140
|
+
minWidth: {
|
|
141
|
+
type: Number,
|
|
142
|
+
default: 40,
|
|
143
|
+
},
|
|
144
|
+
borderStyle: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: '',
|
|
147
|
+
},
|
|
148
|
+
highlightIndex: {
|
|
149
|
+
type: Number,
|
|
150
|
+
default: -1,
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
emits: {
|
|
154
|
+
'check-tree-data': null,
|
|
155
|
+
'expand-tree-data': null,
|
|
156
|
+
'click-tree-data': null,
|
|
157
|
+
'dbl-click-tree-data': null,
|
|
158
|
+
},
|
|
159
|
+
setup(props, { emit }) {
|
|
160
|
+
const onCheck = ($event, data) => {
|
|
161
|
+
emit('check-tree-data', $event, data);
|
|
162
|
+
};
|
|
163
|
+
const onExpand = (data) => {
|
|
164
|
+
emit('expand-tree-data', data);
|
|
165
|
+
};
|
|
166
|
+
const onClick = ($event, data) => {
|
|
167
|
+
emit('click-tree-data', $event, data);
|
|
168
|
+
};
|
|
169
|
+
const onDblClick = ($event, data) => {
|
|
170
|
+
emit('dbl-click-tree-data', $event, data);
|
|
171
|
+
};
|
|
172
|
+
const expandIconClasses = (node) => {
|
|
173
|
+
const expandIcon = props.expandIcon ? props.expandIcon : '';
|
|
174
|
+
const collapseIcon = props.expandIcon ? props.collapseIcon : '';
|
|
175
|
+
return node.expand ? collapseIcon : expandIcon;
|
|
176
|
+
};
|
|
177
|
+
const node = computed(() => (props.nodeData || {}));
|
|
178
|
+
const parentIconMV = computed(() => (props.parentIcon || 'tree-parent-icon'));
|
|
179
|
+
const childIconMV = computed(() => (props.childIcon || 'tree-child-icon'));
|
|
180
|
+
const isDataIcon = computed(() => ((parentIconMV.value !== 'none' || childIconMV.value !== 'none')));
|
|
181
|
+
|
|
182
|
+
const getRowClass = nodeInfo => ({
|
|
183
|
+
row: true,
|
|
184
|
+
'tree-row': true,
|
|
185
|
+
[`tree-row--level-${nodeInfo?.level}`]: true,
|
|
186
|
+
highlight: nodeInfo?.index === props.highlightIndex,
|
|
187
|
+
selected: nodeInfo.selected,
|
|
188
|
+
'non-border': !!props.borderStyle && props.borderStyle !== 'rows',
|
|
189
|
+
});
|
|
190
|
+
const checkboxClass = computed(() => ({
|
|
191
|
+
cell: true,
|
|
192
|
+
'row-checkbox': true,
|
|
193
|
+
'non-border': !!props.borderStyle,
|
|
194
|
+
}));
|
|
195
|
+
const getColumnClass = (column, cellIndex) => ({
|
|
196
|
+
cell: true,
|
|
197
|
+
'tree-td': cellIndex === 0,
|
|
198
|
+
[column.type]: column.type,
|
|
199
|
+
[column.align]: column.align,
|
|
200
|
+
'non-border': !!props.borderStyle,
|
|
201
|
+
});
|
|
202
|
+
const getColumnStyle = column => ({
|
|
203
|
+
width: `${column.width}px`,
|
|
204
|
+
height: `${props.rowHeight}px`,
|
|
205
|
+
'line-height': `${props.rowHeight}px`,
|
|
206
|
+
'min-width': `${props.minWidth}px`,
|
|
207
|
+
});
|
|
208
|
+
const getDepthStyle = (nodeLevel) => {
|
|
209
|
+
const depthSize = nodeLevel * 13;
|
|
210
|
+
return {
|
|
211
|
+
'margin-left': `${depthSize}px`,
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
return {
|
|
215
|
+
parentIconMV,
|
|
216
|
+
childIconMV,
|
|
217
|
+
node,
|
|
218
|
+
isDataIcon,
|
|
219
|
+
checkboxClass,
|
|
220
|
+
onCheck,
|
|
221
|
+
onExpand,
|
|
222
|
+
onClick,
|
|
223
|
+
onDblClick,
|
|
224
|
+
expandIconClasses,
|
|
225
|
+
getRowClass,
|
|
226
|
+
getColumnClass,
|
|
227
|
+
getColumnStyle,
|
|
228
|
+
getDepthStyle,
|
|
229
|
+
};
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
</script>
|
|
233
|
+
|
|
234
|
+
<style lang="scss" scoped>
|
|
235
|
+
@import './style/treeGrid.scss';
|
|
236
|
+
.ev-tree-toggle {
|
|
237
|
+
display: inline-block;
|
|
238
|
+
width: 13px;
|
|
239
|
+
margin-right: 4px;
|
|
240
|
+
text-align: center;
|
|
241
|
+
vertical-align: middle;
|
|
242
|
+
.tree-expand-icon {
|
|
243
|
+
border: none;
|
|
244
|
+
background: transparent;
|
|
245
|
+
outline: none;
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
}
|
|
248
|
+
.tree-expand-icon i {
|
|
249
|
+
display: inline-block;
|
|
250
|
+
top: -3px;
|
|
251
|
+
width: 11px;
|
|
252
|
+
height: 10px;
|
|
253
|
+
background: url('./tree_icon.png') no-repeat -43px -61px;
|
|
254
|
+
}
|
|
255
|
+
&.expand > .tree-expand-icon i {
|
|
256
|
+
height: 8px;
|
|
257
|
+
background-position: -15px -63px;
|
|
258
|
+
}
|
|
259
|
+
.tree-parent-icon i, .tree-child-icon i {
|
|
260
|
+
display: inline-block;
|
|
261
|
+
top: -3px;
|
|
262
|
+
width: 14px;
|
|
263
|
+
height: 14px;
|
|
264
|
+
}
|
|
265
|
+
.tree-parent-icon i {
|
|
266
|
+
background: url('./tree_icon.png') no-repeat -39px -35px;
|
|
267
|
+
}
|
|
268
|
+
&.expand > .tree-parent-icon i {
|
|
269
|
+
background-position: -65px -35px;
|
|
270
|
+
}
|
|
271
|
+
.tree-child-icon i {
|
|
272
|
+
background: url('./tree_icon.png') no-repeat -14px -35px;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
</style>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ObserveVisibility from 'vue3-observe-visibility';
|
|
2
|
-
import EvTreeGrid from './TreeGrid';
|
|
3
|
-
|
|
4
|
-
EvTreeGrid.install = (app) => {
|
|
5
|
-
app.component(EvTreeGrid.name, EvTreeGrid);
|
|
6
|
-
app.use(ObserveVisibility);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default EvTreeGrid;
|
|
1
|
+
import ObserveVisibility from 'vue3-observe-visibility';
|
|
2
|
+
import EvTreeGrid from './TreeGrid';
|
|
3
|
+
|
|
4
|
+
EvTreeGrid.install = (app) => {
|
|
5
|
+
app.component(EvTreeGrid.name, EvTreeGrid);
|
|
6
|
+
app.use(ObserveVisibility);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default EvTreeGrid;
|