โครงสร้างตัวชี้วัด
This commit is contained in:
parent
5664b31fe4
commit
3ad54cf99f
5 changed files with 112 additions and 155 deletions
|
|
@ -14,6 +14,7 @@ const { showLoader, hideLoader, messageError } = useCounterMixin();
|
|||
export const useStructureTree = defineStore("structureTree", () => {
|
||||
const activeId = ref<string>("");
|
||||
const dataStore = ref<{ [key: string]: DataStructureTree[] }>({});
|
||||
const dataStrategy = ref<any[]>([]);
|
||||
|
||||
/**
|
||||
* fetch ข้อมูลโครงสร้างตามคีย์ของระบบ
|
||||
|
|
@ -71,7 +72,27 @@ export const useStructureTree = defineStore("structureTree", () => {
|
|||
}
|
||||
}
|
||||
|
||||
/** function fetchTree ยุทธศาสตร์ / แผน*/
|
||||
async function fetchTreeStrategy() {
|
||||
dataStrategy.value;
|
||||
if (dataStrategy.value.length > 0) {
|
||||
return dataStrategy.value;
|
||||
} else {
|
||||
try {
|
||||
const res = await http.get(config.API.devStrategy + `/edit/indicator`);
|
||||
const data = res.data.result;
|
||||
dataStrategy.value = data;
|
||||
return data;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
fetchStructureTree,
|
||||
fetchTreeStrategy,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue