@@ -754,7 +689,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
flat
round
color="teal"
- @click="() => ((modalAdd = true), (dataCopy = null))"
+ @click="() => ((modalAdd = true), (dataCopy = undefined))"
>สร้างตำแหน่ง
@@ -777,16 +712,15 @@ async function emitSearch(keyword: string, typeSelect: string) {
@@ -929,7 +863,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
>
บันทึก
-
+
diff --git a/src/modules/02_organization/components/DialogHistory.vue b/src/modules/02_organization/components/DialogHistory.vue
index 0433109e7..de6458110 100644
--- a/src/modules/02_organization/components/DialogHistory.vue
+++ b/src/modules/02_organization/components/DialogHistory.vue
@@ -1,8 +1,10 @@
diff --git a/src/modules/02_organization/components/DialogNewStructure.vue b/src/modules/02_organization/components/DialogNewStructure.vue
index e3c5def52..31ae5f228 100644
--- a/src/modules/02_organization/components/DialogNewStructure.vue
+++ b/src/modules/02_organization/components/DialogNewStructure.vue
@@ -1,8 +1,11 @@
diff --git a/src/modules/02_organization/components/DialogSortAgency.vue b/src/modules/02_organization/components/DialogSortAgency.vue
index ebb7377a1..0df57ec48 100644
--- a/src/modules/02_organization/components/DialogSortAgency.vue
+++ b/src/modules/02_organization/components/DialogSortAgency.vue
@@ -1,8 +1,11 @@
diff --git a/src/modules/02_organization/components/StructureMain.vue b/src/modules/02_organization/components/StructureMain.vue
index 375cc20ac..c6da85fa5 100644
--- a/src/modules/02_organization/components/StructureMain.vue
+++ b/src/modules/02_organization/components/StructureMain.vue
@@ -1,46 +1,45 @@
diff --git a/src/modules/02_organization/components/StructureOrgMain.vue b/src/modules/02_organization/components/StructureOrgMain.vue
index 25900001b..b976f7927 100644
--- a/src/modules/02_organization/components/StructureOrgMain.vue
+++ b/src/modules/02_organization/components/StructureOrgMain.vue
@@ -1,12 +1,12 @@
diff --git a/src/modules/02_organization/interface/index/Main.ts b/src/modules/02_organization/interface/index/Main.ts
index bc69b1890..284caa057 100644
--- a/src/modules/02_organization/interface/index/Main.ts
+++ b/src/modules/02_organization/interface/index/Main.ts
@@ -7,6 +7,11 @@ interface DataOption {
name: string;
}
+interface DataDocument {
+ name: string;
+ val: string;
+}
+
interface ListMenu {
label: string;
icon: string;
@@ -121,6 +126,7 @@ interface RowDetailPositions {
posLevelId: string;
posExecutiveId: string;
isSpecial: boolean;
+ positionIsSelected: string;
}
interface NewPagination {
@@ -147,4 +153,5 @@ export type {
HistoryPostType,
FormPositionSelectRef,
NewPagination,
+ DataDocument,
};
diff --git a/src/modules/02_organization/interface/response/Main.ts b/src/modules/02_organization/interface/response/Main.ts
index 696a5b0f7..8a8d51f88 100644
--- a/src/modules/02_organization/interface/response/Main.ts
+++ b/src/modules/02_organization/interface/response/Main.ts
@@ -8,10 +8,10 @@ interface DataPosType {
interface DataLevel {
id: string;
- posLevelName: number;
+ posLevelName: number | string;
posTypeName: string;
posTypeId: string;
posLevelAuthority: string;
}
-export type { DataPosType };
+export type { DataPosType, DataLevel };
diff --git a/src/modules/02_organization/store/organizational.ts b/src/modules/02_organization/store/organizational.ts
index aafd96375..3b0ff5230 100644
--- a/src/modules/02_organization/store/organizational.ts
+++ b/src/modules/02_organization/store/organizational.ts
@@ -9,17 +9,17 @@ import type {
} from "@/modules/02_organization/interface/response/organizational";
export const useOrganizational = defineStore("organizationalStore", () => {
- const typeOrganizational = ref("current");
- const statusView = ref("list");
+ const typeOrganizational = ref("current"); // ประเภทโครงสร้าง
+ const statusView = ref("list"); // การแสดงผล รายการ,map
- const dataActive = ref();
- const activeId = ref();
- const draftId = ref();
- const historyId = ref();
- const treeId = ref();
- const level = ref();
- const isPublic = ref(false);
- const orgPublishDate = ref(null);
+ const dataActive = ref(); //ข้อมูลโครงสร้าง
+ const activeId = ref(); // id โครงสร้างปัจจุบัน
+ const draftId = ref(); // id แบบร่างโครงสร้าง
+ const historyId = ref(); // id ประวัติโครงสร้าง
+ const isPublic = ref(false); // การเผยแพร่
+ const treeId = ref(); // id โหนด
+ const level = ref(); // ระดับโหนด
+ const orgPublishDate = ref(null); // วันเผยแพร่
const sumPosition = reactive({
total: 0,
use: 0,
@@ -29,6 +29,10 @@ export const useOrganizational = defineStore("organizationalStore", () => {
vacantRoot: 0,
});
+ /**
+ * ฟังก์ชันกำหนดจำนวนข้อมูลตำแหน่ง
+ * @param data ข้อมุลจำนวนตำแหน่ง
+ */
function getSumPosition(data: SumPosition) {
sumPosition.total = data.totalPosition;
sumPosition.totalRoot = data.totalRootPosition ? data.totalRootPosition : 0;
@@ -56,14 +60,23 @@ export const useOrganizational = defineStore("organizationalStore", () => {
}
}
- function fetchDataActive(data: DataActive) {
+ /**
+ * ฟังก์ชันกำหนดข้อมูลโครงสร้าง
+ * @param data ข้อมูลโครงสร้าง
+ */
+ async function fetchDataActive(data: DataActive) {
+ dataActive.value = data;
activeId.value = data.activeId;
draftId.value = data.draftId;
- dataActive.value = data;
isPublic.value = data.isPublic;
orgPublishDate.value = data.orgPublishDate;
}
+ /**
+ * ฟังก์ชันประมวลผลข้อมูลตำแหน่ง
+ * @param data ข้อมูลตำแหน่ง
+ * @returns ข้อมูลตำแหน่งที่ผ่านการประมวลผลแล้ว
+ */
function fetchPosMaster(data: PosMaster[]) {
const newPosMaster = data.map((e: PosMaster) => ({
...e,
@@ -89,7 +102,12 @@ export const useOrganizational = defineStore("organizationalStore", () => {
return newPosMaster;
}
- function checkLevel(type: number) {
+ /**
+ * ฟังก์ชันตรวจสอบและแปลงค่าประเภทระดับ
+ * @param type ประเภทระดับ
+ * @returns ชื่อประเภทระดับ
+ */
+ async function checkLevel(type: number) {
switch (type) {
case 0:
return "Root";
@@ -104,6 +122,11 @@ export const useOrganizational = defineStore("organizationalStore", () => {
}
}
+ /**
+ * ฟังก์ชันตรวจสอบและแปลงค่าระดับหน่วยงาน
+ * @param type ระดับหน่วยงาน
+ * @returns ชื่อประระดับหน่วยงาน
+ */
function convertType(type: string) {
switch (type) {
case "DEPARTMENT":
diff --git a/src/modules/02_organization/views/ExampleSearchTree.vue b/src/modules/02_organization/views/ExampleSearchTree.vue
deleted file mode 100644
index c47e063b9..000000000
--- a/src/modules/02_organization/views/ExampleSearchTree.vue
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ prop.node.orgTreeName }}
-
-
- {{ prop.node.orgCode == null ? null : prop.node.orgCode }}
- {{
- prop.node.orgTreeShortName == null
- ? null
- : prop.node.orgTreeShortName
- }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.label }}หน่วยงาน
-
-
-
-
-
-
-
-
-
orgRootId = {{ idVal }}
-
- {{ dataObject }}
-
-
-
-
-
diff --git a/src/modules/02_organization/views/main.vue b/src/modules/02_organization/views/main.vue
index 40056bae8..ff58ff683 100644
--- a/src/modules/02_organization/views/main.vue
+++ b/src/modules/02_organization/views/main.vue
@@ -1,9 +1,12 @@
@@ -370,11 +368,8 @@ onMounted(async () => {
-
-
-