โครงสร้างตัวชี้วัด

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-13 17:59:36 +07:00
parent 5664b31fe4
commit 3ad54cf99f
5 changed files with 112 additions and 155 deletions

View file

@ -7,6 +7,7 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useStructureTree } from "@/stores/structureTree";
import type {
DataOption,
@ -21,6 +22,7 @@ import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
const $q = useQuasar();
const router = useRouter();
const route = useRoute();
const { fetchStructureTree } = useStructureTree();
const { showLoader, hideLoader, dialogRemove, success, messageError } =
useCounterMixin();
@ -118,34 +120,22 @@ function onClickView(id: string = "") {
}
function fetchActive() {
showLoader();
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
fetchTree(data.activeId);
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
// showLoader();
// http
// .get(config.API.activeOrganization)
// .then((res) => {
// const data = res.data.result;
// // fetchTree(data.activeId);
// })
// .catch((err) => {
// messageError($q, err);
// hideLoader();
// });
}
/** ดึงข้อมูลโครงสรร้าง */
async function fetchTree(id: string) {
showLoader();
http
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
.then((res) => {
const data = res.data.result;
node.value = data;
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
async function fetchTree() {
node.value = await fetchStructureTree(route.meta.Key as string, true);
}
/** เรียกข้อมูลตาม row โครงสร้าง*/
@ -187,7 +177,6 @@ async function deleteData(idData: string) {
/** clear input filter */
function clearFilter() {
nodeData.keyword = "";
fetchActive();
fetchListProjectNew();
}
@ -211,9 +200,8 @@ function onClickHistory(id: string) {
hideLoader();
});
}
onMounted(() => {
fetchActive();
fetchTree();
});
</script>
@ -537,7 +525,7 @@ onMounted(() => {
<!-- </q-btn> -->
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div class="table_ellipsis">
<div class="table_ellipsis2">
{{ col.value ? col.value : "-" }}
</div>
</q-td>