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,46 +1330,60 @@ onMounted(async () => {
flowStore.rotate(); flowStore.rotate();
}); });
watch(productMode, () => { watch(
inputSearch.value = ''; () => expandedTree.value,
currentStatus.value = 'All'; () => {
inputSearch.value = '';
currentStatus.value = 'All';
const tmp: typeof utilsStore.currentTitle.path = [ let tmp: typeof utilsStore.currentTitle.path = [
{ {
text: 'manage', text: 'manage',
i18n: true, i18n: true,
handler: () => { handler: () => {
productMode.value = 'group'; productMode.value = 'group';
expandedTree.value = []; expandedTree.value = [];
currentIdGrop.value = ''; currentIdGrop.value = '';
filterStat.value = []; filterStat.value = [];
},
}, },
}, ];
];
if (productMode.value === 'type' || productMode.value === 'service') { if (
tmp.push({ productMode.value === 'group' ||
text: 'productGroup', productMode.value === 'type' ||
i18n: true, productMode.value === 'service'
argsi18n: { name: pathGroupName.value }, ) {
handler: () => { tmp.push({
productMode.value = 'type'; text: 'productGroup',
filterStat.value = filterStat.value.filter((item) => { i18n: true,
return item !== 'type'; argsi18n: { name: pathGroupName.value },
}); handler: () => {
}, productMode.value = 'type';
}); filterStat.value = filterStat.value.filter((item) => {
} return item !== 'type';
if (productMode.value === 'service') { });
tmp.push({ expandedTree.value.pop();
text: 'productType', utilsStore.currentTitle.path.pop();
i18n: true, },
argsi18n: { name: pathTypeName.value }, });
}); if (expandedTree.value.length === 0) {
} utilsStore.currentTitle.path = [{ text: 'manage', i18n: true }];
return;
}
}
if (productMode.value === 'service') {
tmp.push({
text: 'productType',
i18n: true,
argsi18n: { name: pathTypeName.value },
});
}
utilsStore.currentTitle.path = tmp; utilsStore.currentTitle.path = tmp;
}); },
{ deep: true },
);
watch(currentStatus, async () => { watch(currentStatus, async () => {
if (productMode.value === 'group') { if (productMode.value === 'group') {