evui 3.1.50 → 3.1.51
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/dist/evui.common.js +267 -215
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +267 -215
- 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/package.json +1 -1
- package/src/components/chart/Chart.vue +5 -1
- package/src/components/chart/chart.core.js +11 -0
- package/src/components/textField/TextField.vue +4 -2
- package/src/components/treeGrid/TreeGrid.vue +13 -14
- package/src/components/treeGrid/uses.js +64 -28
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script>
|
|
11
|
-
|
|
11
|
+
import { onMounted, onBeforeUnmount, watch, onDeactivated } from 'vue';
|
|
12
12
|
import { cloneDeep, isEqual, debounce } from 'lodash-es';
|
|
13
13
|
import EvChart from './chart.core';
|
|
14
14
|
import { useModel, useWrapper } from './uses';
|
|
@@ -98,6 +98,10 @@
|
|
|
98
98
|
evChart.destroy();
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
onDeactivated(() => {
|
|
102
|
+
evChart.hideTooltip();
|
|
103
|
+
});
|
|
104
|
+
|
|
101
105
|
const redrawChart = () => {
|
|
102
106
|
if (isInit) {
|
|
103
107
|
evChart.update({
|
|
@@ -714,6 +714,17 @@ class EvChart {
|
|
|
714
714
|
target.removeChild(target.firstChild);
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* hide chart tooltip
|
|
720
|
+
*
|
|
721
|
+
* @returns {undefined}
|
|
722
|
+
*/
|
|
723
|
+
hideTooltip() {
|
|
724
|
+
if (this.options.tooltip.use) {
|
|
725
|
+
this.tooltipDOM.style.display = 'none';
|
|
726
|
+
}
|
|
727
|
+
}
|
|
717
728
|
}
|
|
718
729
|
|
|
719
730
|
export default EvChart;
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</template>
|
|
102
102
|
|
|
103
103
|
<script>
|
|
104
|
-
import { ref, computed } from 'vue';
|
|
104
|
+
import { ref, computed, nextTick } from 'vue';
|
|
105
105
|
|
|
106
106
|
export default {
|
|
107
107
|
name: 'EvTextField',
|
|
@@ -205,7 +205,9 @@ export default {
|
|
|
205
205
|
if (mv.value !== inputValue) {
|
|
206
206
|
mv.value = inputValue;
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
nextTick(() => {
|
|
209
|
+
emit('input', mv.value, e);
|
|
210
|
+
});
|
|
209
211
|
};
|
|
210
212
|
const changeMv = (e) => {
|
|
211
213
|
emit('change', mv.value, e);
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
</template>
|
|
163
163
|
|
|
164
164
|
<script>
|
|
165
|
-
import { reactive, toRefs, computed, watch
|
|
165
|
+
import { reactive, toRefs, computed, watch } from 'vue';
|
|
166
166
|
import treeGridNode from './TreeGridNode';
|
|
167
167
|
import Toolbar from './treeGrid.toolbar';
|
|
168
168
|
import {
|
|
@@ -227,9 +227,8 @@ export default {
|
|
|
227
227
|
'update:checked': null,
|
|
228
228
|
'check-row': null,
|
|
229
229
|
'check-all': null,
|
|
230
|
-
'update-tree-data': null,
|
|
231
230
|
},
|
|
232
|
-
setup(props
|
|
231
|
+
setup(props) {
|
|
233
232
|
const {
|
|
234
233
|
isRenderer,
|
|
235
234
|
getComponentName,
|
|
@@ -246,7 +245,8 @@ export default {
|
|
|
246
245
|
const stores = reactive({
|
|
247
246
|
treeStore: [],
|
|
248
247
|
viewStore: [],
|
|
249
|
-
|
|
248
|
+
filterStore: [],
|
|
249
|
+
treeRows: props.rows,
|
|
250
250
|
showTreeStore: computed(() => stores.treeStore.filter(item => item.show)),
|
|
251
251
|
orderedColumns: computed(() =>
|
|
252
252
|
props.columns.map((column, index) => ({ index, ...column }))),
|
|
@@ -324,7 +324,7 @@ export default {
|
|
|
324
324
|
} = contextMenuEvent({ contextInfo, stores, selectInfo });
|
|
325
325
|
|
|
326
326
|
const {
|
|
327
|
-
|
|
327
|
+
setTreeNodeStore,
|
|
328
328
|
handleExpand,
|
|
329
329
|
} = treeEvent({ stores, onResize });
|
|
330
330
|
|
|
@@ -359,17 +359,16 @@ export default {
|
|
|
359
359
|
checkInfo.isHeaderChecked = false;
|
|
360
360
|
},
|
|
361
361
|
);
|
|
362
|
+
stores.treeStore = setTreeNodeStore();
|
|
363
|
+
|
|
362
364
|
watch(
|
|
363
365
|
() => props.rows,
|
|
364
|
-
() => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
emit('update-tree-data', stores.treeRows);
|
|
371
|
-
});
|
|
372
|
-
}, { deep: true, immediate: true },
|
|
366
|
+
(newData) => {
|
|
367
|
+
stores.treeRows = newData;
|
|
368
|
+
stores.treeStore = setTreeNodeStore();
|
|
369
|
+
onResize();
|
|
370
|
+
updateVScroll();
|
|
371
|
+
}, { deep: true },
|
|
373
372
|
);
|
|
374
373
|
watch(
|
|
375
374
|
() => [props.width, props.height, resizeInfo.adjust, props.option.columnWidth],
|
|
@@ -550,35 +550,71 @@ export const contextMenuEvent = (params) => {
|
|
|
550
550
|
|
|
551
551
|
export const treeEvent = (params) => {
|
|
552
552
|
const { stores, onResize } = params;
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
node
|
|
569
|
-
node
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
553
|
+
const setTreeNodeStore = () => {
|
|
554
|
+
let nodeIndex = 0;
|
|
555
|
+
const nodeList = [];
|
|
556
|
+
|
|
557
|
+
function getDataObj(nodeObj) {
|
|
558
|
+
const newObj = {};
|
|
559
|
+
Object.keys(nodeObj).forEach((key) => {
|
|
560
|
+
if (key !== 'children') {
|
|
561
|
+
newObj[key] = nodeObj[key];
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
return newObj;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function setNodeData(nodeInfo) {
|
|
568
|
+
const { node, level, isShow, parent } = nodeInfo;
|
|
569
|
+
if (node !== null && typeof node === 'object') {
|
|
570
|
+
node.index = nodeIndex++;
|
|
571
|
+
node.level = level;
|
|
572
|
+
|
|
573
|
+
if (!Object.hasOwnProperty.call(node, 'checked')) {
|
|
574
|
+
node.checked = false;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
if (!Object.hasOwnProperty.call(node, 'show')) {
|
|
578
|
+
node.show = isShow;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (!Object.hasOwnProperty.call(node, 'expand')) {
|
|
582
|
+
node.expand = true;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (!Object.hasOwnProperty.call(node, 'isFilter')) {
|
|
586
|
+
node.isFilter = false;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
if (!Object.hasOwnProperty.call(node, 'data')) {
|
|
590
|
+
node.data = getDataObj(node);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
nodeList.push(node);
|
|
594
|
+
|
|
595
|
+
if (typeof parent !== 'undefined') {
|
|
596
|
+
node.parent = parent;
|
|
597
|
+
}
|
|
598
|
+
if (node.children) {
|
|
599
|
+
node.hasChild = true;
|
|
600
|
+
node.children.forEach(child =>
|
|
601
|
+
setNodeData({
|
|
602
|
+
node: child,
|
|
603
|
+
level: level + 1,
|
|
604
|
+
isShow: node.show && node.expand,
|
|
605
|
+
parent: node,
|
|
606
|
+
}),
|
|
607
|
+
);
|
|
608
|
+
}
|
|
580
609
|
}
|
|
610
|
+
}
|
|
611
|
+
setNodeData({
|
|
612
|
+
node: stores.treeRows[0],
|
|
613
|
+
level: 0,
|
|
614
|
+
isShow: true,
|
|
615
|
+
parent: undefined,
|
|
581
616
|
});
|
|
617
|
+
return nodeList;
|
|
582
618
|
};
|
|
583
619
|
const setExpandNode = (children, isShow, isFilter) => {
|
|
584
620
|
children.forEach((nodeObj) => {
|
|
@@ -595,7 +631,7 @@ export const treeEvent = (params) => {
|
|
|
595
631
|
setExpandNode(data.children, data.expand, data.isFilter);
|
|
596
632
|
onResize();
|
|
597
633
|
};
|
|
598
|
-
return {
|
|
634
|
+
return { setTreeNodeStore, handleExpand };
|
|
599
635
|
};
|
|
600
636
|
|
|
601
637
|
export const filterEvent = (params) => {
|