โครงสร้างอัตรากำลัง => router

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-23 11:11:03 +07:00
parent 134af49f25
commit d024c05416
3 changed files with 58 additions and 39 deletions

View file

@ -0,0 +1,17 @@
interface DataPosType {
id: string;
posLevels: DataLevel[];
posTypeName: string;
posTypeRank: number;
posTypeShortName: string;
}
interface DataLevel {
id: string;
posLevelName: number;
posTypeName: string;
posTypeId: string;
posLevelAuthority: string;
}
export type { DataPosType };

View file

@ -1,5 +1,4 @@
const mainPage = () => import("@/modules/02_organizationalNew/views/main.vue");
const testPage = () => import("@/modules/02_organizationalNew/views/ExampleSearchTree.vue");
export default [
{
@ -12,15 +11,4 @@ export default [
Role: "organization",
},
},
{
path: "/organization-new/test",
name: "organizationalNewTest",
component: testPage,
meta: {
Auth: true,
Key: [7],
Role: "organization",
},
},
];

View file

@ -4,34 +4,49 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType*/
/**
* importType
*/
import type { DataOption } from "@/modules/02_organizationalNew/interface/index/Main";
import type { OrgRevision } from "@/modules/02_organizationalNew/interface/response/organizational";
/** importComponents*/
/**
* importComponents
*/
import TreeView from "@/modules/02_organizationalNew/components/TreeView.vue";
import StructureView from "@/modules/02_organizationalNew/components/StructureMain.vue";
import DialogFormNewStructure from "@/modules/02_organizationalNew/components/DialogNewStructure.vue";
import DialogDateTime from "@/modules/02_organizationalNew/components/DialogFormDateTime.vue";
/** importStore*/
/**
* importStore
*/
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
import { useCounterMixin } from "@/stores/mixin";
/** use*/
/**
* use
*/
const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const store = useOrganizational();
/** modalDialog*/
/**
* วแปร
*/
const modalNewStructure = ref<boolean>(false); //
const modalDateTime = ref<boolean>(false); //
/** สถานะ*/
const isStatusData = ref<boolean>(false); //
// const ishasActive = ref<boolean>(false); //
// const ishasDraft = ref<boolean>(false); //
/** List เพิ่มโครงสร้าง*/
const typeStructure = ref<string>(""); //
/** ประวัติโครงสร้าง*/
const itemHistory = ref<DataOption[]>([]); // List
const historyId = ref<string>(""); // ID
const labelHistory = ref<string>("ประวัติโครงสร้าง"); //
const count = ref<number>(0);
/**
* List เพมโครงสราง
*/
const itemStructure = ref<DataOption[]>([
{
id: "NEW",
@ -50,18 +65,13 @@ const itemStructure = ref<DataOption[]>([
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
},
]);
const typeStructure = ref<string>(""); //
/** ประวัติโครงสร้าง*/
const itemHistory = ref<DataOption[]>([]); // List
const historyId = ref<string>(""); // ID
const labelHistory = ref<string>("ประวัติโครงสร้าง"); //
const count = ref<number>(0);
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
async function fetchOrganizationActive() {
/**
* function เรยกขอมลโครงสราง แบบปนและ แบบราง
*/
function fetchOrganizationActive() {
showLoader();
await http
http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
@ -73,10 +83,8 @@ async function fetchOrganizationActive() {
isStatusData.value = true;
if (isStatusData.value) {
if (data.activeName === null) {
// ishasActive.value = true;
store.typeOrganizational = "draft";
} else if (data.draftName === null) {
// ishasDraft.value = true;
store.typeOrganizational = "current";
}
}
@ -89,9 +97,11 @@ async function fetchOrganizationActive() {
});
}
/** function เรียกข้อมูลประวัติโครงสร้าง*/
async function fetchHistory() {
await http
/**
* function เรยกขอมลประวโครงสราง
*/
function fetchHistory() {
http
.get(config.API.organizationHistoryNew)
.then((res) => {
const data = res.data.result;
@ -118,7 +128,9 @@ function ocClickAddStructure(type: string) {
typeStructure.value = type;
}
/** function openPopup ตั้งเวลาเผยแพร่*/
/**
* function openPopup งเวลาเผยแพร
*/
function onClickDateTime() {
modalDateTime.value = !modalDateTime.value;
}
@ -135,7 +147,9 @@ function onClickHistory(id: string, name: string) {
count.value++;
}
/** lifecycleHook */
/**
* lifecycleHook
*/
onMounted(async () => {
store.typeOrganizational = "current";
await fetchOrganizationActive();