Merge branch 'develop' into devTee
This commit is contained in:
commit
61e06096bf
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 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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue