รายงานทะเบียนประวัติ ==> fetch Tree
This commit is contained in:
parent
7d485c5fad
commit
9da91f202c
2 changed files with 27 additions and 7 deletions
|
|
@ -6,7 +6,7 @@ import * as XLSX from "xlsx";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { checkPermission, checkPermissionGet } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useReportStore } from "@/modules/21_report/store";
|
||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||
|
|
@ -22,6 +22,8 @@ import type {
|
|||
ResOptionPerson,
|
||||
DataEducationLevel,
|
||||
} from "@/modules/21_report/interface/Main";
|
||||
import type { DataRoles } from "@/interface/response/main";
|
||||
import type { DataStructureTree } from "@/interface/main";
|
||||
|
||||
import DialogOrg from "@/modules/21_report/components/01_org/DialogOrg.vue";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||
|
|
@ -637,15 +639,29 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
const node = ref<any[]>([]);
|
||||
const node = ref<DataStructureTree[]>([]);
|
||||
const filterTree = ref<string>("");
|
||||
const expanded = ref<string[]>([]);
|
||||
const expandedModal = ref<boolean>(false);
|
||||
// const sysName = ref<bo>
|
||||
|
||||
async function fetchTree() {
|
||||
const data = await fetchStructureTree('SYS_REGISTRY_OFFICER' as string, true);
|
||||
if (data) {
|
||||
node.value = data;
|
||||
try {
|
||||
const res = await http.get(config.API.orgPermissionsSys);
|
||||
const response = res.data.result.roles;
|
||||
|
||||
const sysName = response.find(
|
||||
(e: DataRoles) =>
|
||||
e.authSysId === "SYS_REGISTRY_OFFICER" ||
|
||||
e.authSysId === "REPORT_REGISTRY"
|
||||
)?.authSysId;
|
||||
|
||||
const data = await fetchStructureTree(sysName ?? "REPORT_REGISTRY", true);
|
||||
if (data) {
|
||||
node.value = data;
|
||||
}
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1601,8 +1617,12 @@ onMounted(async () => {
|
|||
<div v-else-if="col.name === 'fullName'">
|
||||
{{ col.value }}
|
||||
<q-btn
|
||||
v-if="
|
||||
props.row.empType === 'employee'
|
||||
? checkPermissionGet('SYS_REGISTRY_EMP')
|
||||
: checkPermissionGet('SYS_REGISTRY_OFFICER')
|
||||
"
|
||||
size="sm"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
dense
|
||||
icon="info"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue