updated get tree by system

This commit is contained in:
Warunee Tamkoo 2024-08-20 10:39:17 +07:00
parent af56b950b1
commit ffde0fe79c
27 changed files with 128 additions and 72 deletions

View file

@ -23,6 +23,7 @@ import Header from "@/components/DialogHeader.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
import { useRoute } from "vue-router";
/** use*/
const $q = useQuasar();
@ -35,6 +36,7 @@ const {
dialogMessageNotify,
success,
} = useCounterMixin();
const route = useRoute();
/** props*/
const modal = defineModel<boolean>("modal", { required: true });
@ -56,7 +58,7 @@ async function fetchTree() {
showLoader();
const id: string = store.activeId ? store.activeId?.toString() : "";
await http
.get(config.API.orgByid(id))
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
.then((res) => {
nodeTree.value = res.data.result;
})

View file

@ -20,11 +20,13 @@ import TreeTable from "@/modules/16_positionEmployee/components/TreeTable.vue";
/** importStore*/
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
/** use*/
const store = usePositionEmp();
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const route = useRoute();
const nodeTree = ref<OrgTree[]>([]); // Tree
const nodeId = ref<string>(""); // id Tree
@ -56,7 +58,7 @@ function fetchDataTree(id: string) {
isLoadTree.value = false;
showLoader();
http
.get(config.API.orgByid(id.toString()))
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
.then((res) => {
const data = res.data.result;
nodeTree.value = data;