โครงสร้างอัตรากำลัง => router
This commit is contained in:
parent
134af49f25
commit
d024c05416
3 changed files with 58 additions and 39 deletions
17
src/modules/02_organizationalNew/interface/response/Main.ts
Normal file
17
src/modules/02_organizationalNew/interface/response/Main.ts
Normal 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 };
|
||||
|
|
@ -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",
|
||||
},
|
||||
},
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue