refacrot: (01) edit path

This commit is contained in:
Net 2024-07-24 14:44:57 +07:00
parent 0bd2c0b3a0
commit 377a82b9dd

View file

@ -164,6 +164,8 @@ onMounted(async () => {
};
},
},
// track of the currently selected HQ branch, so when we reset it to an empty
// object, we are effectively unselecting any HQ branch.
];
await branchStore.fetchList({ pageSize: 99999 });
@ -539,6 +541,29 @@ watch(
if (v) modeView.value = true;
},
);
watch(currentHq, () => {
const tmp: typeof utilsStore.currentTitle.path = [
{
text: 'branchManagementCaption',
handler: () => {
fieldSelectedBranch.value.value = 'branchHQLabel';
currentHq.value = {
id: '',
code: '',
};
},
},
];
if (currentHq.value.id !== '') {
tmp.push({
text: currentHq.value.code,
});
}
utilsStore.currentTitle.path = tmp;
});
</script>
<template>