API โครงสร้าง
This commit is contained in:
parent
0fbf803a26
commit
44d9eb569a
4 changed files with 62 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import env from "../index";
|
import env from "../index";
|
||||||
|
|
||||||
const organization = `${env.API_URI}/organization`;
|
const organization = `${env.API_URI}/org`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
/** โครงสร้างอัตรากำลัง*/
|
/** โครงสร้างอัตรากำลัง*/
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,17 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
|
|
||||||
|
/** importType*/
|
||||||
|
import type { DataActive } from "@/modules/02_organizationalNew/interface/response/organizational";
|
||||||
|
|
||||||
import TreeView from "@/modules/02_organizationalNew/components/mainTree.vue";
|
import TreeView from "@/modules/02_organizationalNew/components/mainTree.vue";
|
||||||
import TableView from "@/modules/02_organizationalNew/components/tableTree.vue";
|
import TableView from "@/modules/02_organizationalNew/components/tableTree.vue";
|
||||||
|
|
||||||
const showData = ref<boolean>(false);
|
const showData = ref<boolean>(false);
|
||||||
const nodeTree = ref<any>();
|
const nodeTree = ref<any>();
|
||||||
|
|
||||||
|
// defineProps<{ dataActive: DataActive }>();
|
||||||
|
|
||||||
async function fetchDataTree() {
|
async function fetchDataTree() {
|
||||||
const data = [
|
const data = [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
interface DataActive {
|
||||||
|
activeId: string;
|
||||||
|
activeName: string;
|
||||||
|
draftId: string;
|
||||||
|
draftName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataActive };
|
||||||
|
|
@ -4,6 +4,9 @@ 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*/
|
||||||
|
import type { DataActive } from "@/modules/02_organizationalNew/interface/response/organizational";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
||||||
import StructureView from "@/modules/02_organizationalNew/components/structureView.vue";
|
import StructureView from "@/modules/02_organizationalNew/components/structureView.vue";
|
||||||
|
|
@ -22,6 +25,8 @@ const modalNewStructure = ref<boolean>(false);
|
||||||
const stroe = useOrganizational();
|
const stroe = useOrganizational();
|
||||||
|
|
||||||
const isStatusData = ref<boolean>(false);
|
const isStatusData = ref<boolean>(false);
|
||||||
|
const ishasActive = ref<boolean>(false);
|
||||||
|
const ishasDraft = ref<boolean>(false);
|
||||||
const itemStructure = ref<any>([
|
const itemStructure = ref<any>([
|
||||||
{
|
{
|
||||||
val: "NEW",
|
val: "NEW",
|
||||||
|
|
@ -40,21 +45,48 @@ const itemStructure = ref<any>([
|
||||||
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
|
name: "ทำสำเนาโครงสร้าง ตำแหน่งและคนครอง",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
const dataActive = ref<DataActive>();
|
||||||
|
|
||||||
async function fetchOrganizationActive() {
|
async function fetchOrganizationActive() {
|
||||||
// showLoader();
|
const data = {
|
||||||
// await http
|
activeId: null,
|
||||||
// .get(config.API.activeOrganization)
|
activeName: "null",
|
||||||
// .then((res) => {
|
draftId: null,
|
||||||
// console.log(res);
|
draftName: null,
|
||||||
// })
|
};
|
||||||
// .catch((err) => {
|
|
||||||
// messageError($q, err);
|
// dataActive.value = data;
|
||||||
// console.log(err);
|
|
||||||
// })
|
showLoader();
|
||||||
// .finally(() => {
|
await http
|
||||||
// hideLoader();
|
.get(config.API.activeOrganization)
|
||||||
// });
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
// if (data) {
|
||||||
|
// if (data.activeName === null && data.draftName === null) {
|
||||||
|
// isStatusData.value = false;
|
||||||
|
// } else {
|
||||||
|
// isStatusData.value = true;
|
||||||
|
// }
|
||||||
|
// if (isStatusData.value) {
|
||||||
|
// if (data.activeName === null) {
|
||||||
|
// ishasActive.value = true;
|
||||||
|
// stroe.typeOrganizational = "draft";
|
||||||
|
// } else if (data.draftName === null) {
|
||||||
|
// ishasDraft.value = true;
|
||||||
|
// stroe.typeOrganizational = "current";
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const modalDateTime = ref<boolean>(false);
|
const modalDateTime = ref<boolean>(false);
|
||||||
|
|
@ -134,12 +166,14 @@ onMounted(async () => {
|
||||||
color="blue"
|
color="blue"
|
||||||
label="ปัจจุบัน"
|
label="ปัจจุบัน"
|
||||||
@click="stroe.typeOrganizational = 'current'"
|
@click="stroe.typeOrganizational = 'current'"
|
||||||
|
:disable="ishasActive"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
:outline="stroe.typeOrganizational === 'draft' ? false : true"
|
:outline="stroe.typeOrganizational === 'draft' ? false : true"
|
||||||
color="blue"
|
color="blue"
|
||||||
label="แบบร่าง"
|
label="แบบร่าง"
|
||||||
@click="stroe.typeOrganizational = 'draft'"
|
@click="stroe.typeOrganizational = 'draft'"
|
||||||
|
:disable="ishasDraft"
|
||||||
/>
|
/>
|
||||||
</q-btn-group>
|
</q-btn-group>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue