|
@@ -227,25 +227,29 @@ const getHiddenGroups = () => {
|
|
|
|
|
|
const getActived = () => {
|
|
|
data.actived = [];
|
|
|
- if (meta2d.store.active) {
|
|
|
+ if (meta2d.store.active && meta2d.store.active.length) {
|
|
|
+ let pens = meta2d.store.data.pens.filter((pen) => !pen.parentId);
|
|
|
+ let index = pens.findIndex((item) => item.id === meta2d.store.active[0].id);
|
|
|
+ tree.value?.scrollToElement({index:index - 5});
|
|
|
+
|
|
|
for (const pen of meta2d.store.active) {
|
|
|
data.actived.push(pen.id);
|
|
|
}
|
|
|
|
|
|
- const element = document.body.querySelector(
|
|
|
- `[data-value="${data.actived[0]}"]`
|
|
|
- );
|
|
|
-
|
|
|
- if (element) {
|
|
|
- element.scrollIntoView({ block: 'center' });
|
|
|
- } else {
|
|
|
- setTimeout(() => {
|
|
|
- const element = document.body.querySelector(
|
|
|
- `[data-value="${data.actived[0]}"]`
|
|
|
- );
|
|
|
- element && element.scrollIntoView({ block: 'center' });
|
|
|
- }, 500);
|
|
|
- }
|
|
|
+ // const element = document.body.querySelector(
|
|
|
+ // `[data-value="${data.actived[0]}"]`
|
|
|
+ // );
|
|
|
+
|
|
|
+ // if (element) {
|
|
|
+ // element.scrollIntoView({ block: 'center' });
|
|
|
+ // } else {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // const element = document.body.querySelector(
|
|
|
+ // `[data-value="${data.actived[0]}"]`
|
|
|
+ // );
|
|
|
+ // element && element.scrollIntoView({ block: 'center' });
|
|
|
+ // }, 500);
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
|