Merge branch 'develop' into devTee

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