Merge branch 'nice_dev' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-15 15:48:17 +07:00
commit 7a8668271b

View file

@ -42,7 +42,13 @@ onMounted(async () => {
id && (await fetchStructChart(id, "0"));
});
async function fetchStructChart(id: string, type: string) {
async function fetchStructChart(
id: string,
type: string,
status: boolean = false
) {
console.log(status);
showLoader();
await http
.get(config.API.orgStructChart(id, type))
@ -52,7 +58,7 @@ async function fetchStructChart(id: string, type: string) {
const struct = [];
struct.push({ ...data, officer: [], heads: [] });
dataSource.value = struct[0];
if (dataSourceLock.value === undefined)
if (dataSourceLock.value === undefined || status)
dataSourceLock.value = dataSource.value;
breadcrumbsGen();
}
@ -181,7 +187,6 @@ const findPath = (id: any) => {
id: dataSourceLock.value.deptID,
type: dataSourceLock.value.type,
});
console.log(_path);
if (dataSourceLock.value.deptID === id) return _path;
if (dataSourceLock.value.children.length > 0) {
@ -213,14 +218,14 @@ watch(
? store.draftId
: "";
id && (await fetchStructChart(id, "0"));
id && (await fetchStructChart(id, "0", true));
}
);
watch(
() => store.historyId,
async () => {
store.historyId && (await fetchStructChart(store.historyId, "0"));
store.historyId && (await fetchStructChart(store.historyId, "0", true));
}
);
</script>