fix(04): group & type path

This commit is contained in:
puriphatt 2024-08-21 13:09:58 +07:00
parent 972a2a5348
commit ea95191037

View file

@ -1330,11 +1330,13 @@ onMounted(async () => {
flowStore.rotate(); flowStore.rotate();
}); });
watch(productMode, () => { watch(
() => expandedTree.value,
() => {
inputSearch.value = ''; inputSearch.value = '';
currentStatus.value = 'All'; currentStatus.value = 'All';
const tmp: typeof utilsStore.currentTitle.path = [ let tmp: typeof utilsStore.currentTitle.path = [
{ {
text: 'manage', text: 'manage',
i18n: true, i18n: true,
@ -1347,7 +1349,11 @@ watch(productMode, () => {
}, },
]; ];
if (productMode.value === 'type' || productMode.value === 'service') { if (
productMode.value === 'group' ||
productMode.value === 'type' ||
productMode.value === 'service'
) {
tmp.push({ tmp.push({
text: 'productGroup', text: 'productGroup',
i18n: true, i18n: true,
@ -1357,8 +1363,14 @@ watch(productMode, () => {
filterStat.value = filterStat.value.filter((item) => { filterStat.value = filterStat.value.filter((item) => {
return item !== 'type'; return item !== 'type';
}); });
expandedTree.value.pop();
utilsStore.currentTitle.path.pop();
}, },
}); });
if (expandedTree.value.length === 0) {
utilsStore.currentTitle.path = [{ text: 'manage', i18n: true }];
return;
}
} }
if (productMode.value === 'service') { if (productMode.value === 'service') {
tmp.push({ tmp.push({
@ -1369,7 +1381,9 @@ watch(productMode, () => {
} }
utilsStore.currentTitle.path = tmp; utilsStore.currentTitle.path = tmp;
}); },
{ deep: true },
);
watch(currentStatus, async () => { watch(currentStatus, async () => {
if (productMode.value === 'group') { if (productMode.value === 'group') {