Merge branch 'oat' into develop

This commit is contained in:
oat 2024-02-06 11:23:33 +07:00
commit 4858ff8024
9 changed files with 1069 additions and 16 deletions

View file

@ -13,6 +13,8 @@ const positionStatus = `${env.API_URI}/metadata/position-status/`;
const positionLine = `${env.API_URI}/metadata/position-line/`;
const positionExecutive = `${env.API_URI}/metadata/position-executive/`;
const orgPosType = `${env.API_URI}/org/pos/type/`;
const orgPosLevel = `${env.API_URI}/org/pos/level/`;
export default {
position: `${position}position`,
/**
@ -95,4 +97,9 @@ export default {
`${positionExecutive}history/${id}`,
listPositionExecutivePublished: `${positionExecutive}history/published`,
listPositionExecutivePublishedHistory: `${positionExecutive}history/published-history`,
orgPosType,
orgPosTypeId: (id: string) => `${orgPosType}${id}`,
orgPosLevel,
orgPosLevelId: (id: string) => `${orgPosLevel}${id}`,
};

View file

@ -1,8 +1,418 @@
<script setup lang="ts">
import pageLevel from "@/modules/01_metadataNew/components/position/03ListLevel.vue";
import { ref, onMounted } from "vue";
import type { QInput, QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter } from "vue-router";
import { usePositionTypeDataStore } from "@/modules/01_metadataNew/stores/positionTypeStore";
import dialogHeader from "@/components/DialogHeader.vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const store = usePositionTypeDataStore();
const router = useRouter();
const mixin = useCounterMixin();
const {
dialogRemove,
dialogConfirm,
success,
messageError,
showLoader,
hideLoader,
} = mixin;
const columns = [
{
name: "posTypeName",
align: "left",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "posTypeName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posTypeRank",
align: "left",
label: "ระดับตำแหน่ง",
sortable: true,
field: "posTypeRank",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
align: "left",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
] as const satisfies QTableProps["columns"];
const $q = useQuasar();
const editId = ref<string>("");
const filterKeyword = ref<string>("");
const dialog = ref<boolean>(false);
const posTypeName = ref<string>("");
const posTypeNameRef = ref<QInput | null>(null);
const posTypeRank = ref<number | undefined>();
const posTypeRankRef = ref<QInput | null>(null);
const dialogStatus = ref<string>("");
const visibleColumns = ref<string[]>([
"posTypeName",
"posTypeRank",
// "createdAt",
// "lastUpdatedAt",
// "lastUpdateFullName",
]);
async function fetchData() {
showLoader();
await http
.get(config.API.orgPosType)
.then(async (res) => {
store.save(res.data.result);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
async function addData() {
await http.post(config.API.orgPosType, {
posTypeName: posTypeName.value,
posTypeRank: posTypeRank.value,
});
fetchData();
}
async function editData(id: string) {
await http.put(config.API.orgPosTypeId(id), {
posTypeName: posTypeName.value,
posTypeRank: posTypeRank.value,
});
fetchData();
}
async function deleteData(id: string) {
await http.delete(config.API.orgPosTypeId(id));
fetchData();
}
onMounted(async () => {
fetchData();
});
function closeDialog() {
dialog.value = false;
}
function onclickDetail(id: string) {
router.push(`/master-data/position/level/${id}`);
}
function validateForm() {
posTypeNameRef.value?.validate();
posTypeRankRef.value?.validate();
onSubmit();
}
async function onSubmit() {
if (posTypeName.value.length > 0) {
dialogConfirm(
$q,
async () => {
dialogStatus.value === "create" ? addData() : editData(editId.value);
closeDialog();
posTypeName.value = "";
posTypeRank.value = undefined;
},
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
);
}
}
</script>
<template>
ประเภท
<br />
<pageLevel />
<q-toolbar style="padding: 0">
<q-btn
flat
round
color="primary"
icon="add"
@click.stop="
() => {
dialogStatus = 'create';
dialog = true;
}
"
>
<q-tooltip> เพมขอม </q-tooltip>
</q-btn>
<q-space />
<div class="row q-gutter-sm">
<q-input outlined dense v-model="filterKeyword" label="ค้นหา"></q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
</q-toolbar>
<d-table
ref="table"
:columns="columns"
:rows="store.row"
:filter="filterKeyword"
row-key="name"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr
:props="props"
class="cursor-pointer"
@click.stop="onclickDetail(props.row.id)"
>
<q-td v-for="col in props.cols" :key="col.id">
{{ col.value }}
</q-td>
<q-td auto-width>
<q-btn
color="grey"
flat
dense
round
size="14px"
icon="more_vert"
@click.stop
>
<q-menu>
<q-list dense>
<q-item
v-close-popup
clickable
@click.stop="
() => {
dialogStatus = 'edit';
dialog = true;
editId = props.row.id;
posTypeName = props.row.posTypeName;
posTypeRank = props.row.posTypeRank;
}
"
>
<q-item-section>
<div class="row items-center white">
<q-icon name="o_edit" color="positive" />
<span class="q-ml-sm">แกไข</span>
</div>
</q-item-section>
</q-item>
<q-item clickable>
<q-item-section
@click="
dialogRemove(
$q,
async () => await deleteData(props.row.id)
)
"
v-close-popup
>
<div class="row items-center white">
<q-icon name="mdi-trash-can-outline" color="negative" />
<span class="q-ml-sm">ลบ</span>
</div>
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="min-width: 350px" class="bg-grey-11">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus === 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="q-pa-none">
<q-input
ref="posTypeNameRef"
outlined
v-model="posTypeName"
label="ประเภทตำแหน่ง"
dense
lazy-rules
borderless
class="col-12 bg-white q-ma-md"
:rules="[(val) => val.length > 0 || 'กรุณากรอกประเภทตำแหน่ง']"
hide-bottom-space
/>
<q-input
ref="posTypeRankRef"
outlined
v-model="posTypeRank"
label="ระดับ"
dense
type="number"
lazy-rules
borderless
min="1"
class="col-12 bg-white q-ma-md"
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
hide-bottom-space
/>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</template>
<style scoped lang="scss">
.border_custom {
border-radius: 6px !important;
border: 1px solid #e1e1e1;
}
$toggle-background-color-on: #06884d;
$toggle-background-color-off: darkgray;
$toggle-control-color: white;
$toggle-width: 40px;
$toggle-height: 25px;
$toggle-gutter: 3px;
$toggle-radius: 50%;
$toggle-control-speed: 0.15s;
$toggle-control-ease: ease-in;
// These are our computed variables
// change at your own risk.
$toggle-radius: $toggle-height / 2;
$toggle-control-size: $toggle-height - ($toggle-gutter * 2);
.toggle-control {
display: block;
position: relative;
padding-left: $toggle-width;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
user-select: none;
input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
input:checked ~ .control {
background-color: $toggle-background-color-on;
&:after {
left: $toggle-width - $toggle-control-size - $toggle-gutter;
}
}
.control {
position: absolute;
top: -7px;
left: -15px;
height: $toggle-height;
width: $toggle-width;
border-radius: $toggle-radius;
background-color: $toggle-background-color-off;
transition: background-color $toggle-control-speed $toggle-control-ease;
&:after {
content: "";
position: absolute;
left: $toggle-gutter;
top: $toggle-gutter;
width: $toggle-control-size;
height: $toggle-control-size;
border-radius: $toggle-radius;
background: $toggle-control-color;
transition: left $toggle-control-speed $toggle-control-ease;
}
}
}
</style>

View file

@ -1,3 +1,30 @@
<script setup lang="ts">
import { ref } from "vue";
import { useRouter } from "vue-router";
import ListLevelDetail from "@/modules/01_metadataNew/components/position/05ListLevelDetail.vue";
const router = useRouter();
const posName = ref<string>("");
</script>
<template>
ระดบตำแหน
</template>
<div class="toptitle text-dark col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="router.go(-1)"
/>
รายการระดบตำแหนงของ {{ posName }}
</div>
<q-card flat bordered>
<ListLevelDetail v-model:posName="posName" />
</q-card>
</template>
<style scoped></style>

View file

@ -0,0 +1,509 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type { QInput, QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter, useRoute } from "vue-router";
import { usePositionDataStore } from "@/modules/01_metadataNew/stores/positionListStore";
import { usePositionTypeDataStore } from "@/modules/01_metadataNew/stores/positionTypeStore";
import dialogHeader from "@/components/DialogHeader.vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const store = usePositionDataStore();
const storeName = usePositionTypeDataStore();
const router = useRouter();
const mixin = useCounterMixin();
const posName = defineModel<string>("posName", {
required: true,
});
const { dialogRemove, dialogConfirm, showLoader, hideLoader, messageError } =
mixin;
const $q = useQuasar();
const columns = [
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px; width:0px",
style: "font-size: 14px",
},
{
name: "posLevelName",
align: "left",
label: "ชื่อระดับตำแหน่ง",
sortable: true,
field: "posLevelName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posTypeName",
align: "left",
label: "ประเภทตำแหน่ง",
sortable: true,
field: "posTypeName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posLevelRank",
align: "left",
label: "ระดับของระดับตำแหน่ง",
sortable: true,
field: "posLevelRank",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "posLevelAuthority",
align: "left",
label: "ผู้มีอำนาจสั่งบรรจุ",
sortable: true,
field: "posLevelAuthority",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
align: "center",
label: "วันที่สร้าง",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdatedAt",
align: "center",
label: "วันที่แก้ไข",
sortable: true,
field: "lastUpdatedAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "lastUpdateFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "lastUpdateFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
] as const satisfies QTableProps["columns"];
const route = useRoute();
const id = ref<string>(route.params.id.toString());
const filterKeyword = ref<string>("");
const dialog = ref<boolean>(false);
const dialogStatus = ref<string>("");
const editId = ref<string>("");
const posLevelName = ref<string>("");
const posLevelRank = ref<number>();
const posLevelAuthority = ref<string>("");
const posTypeId = ref<null>();
const posLevelNameRef = ref<QInput | null>(null);
const posLevelRankRef = ref<QInput | null>(null);
const posTypeIdRef = ref<QInput | null>(null);
const name = ref<string>("");
const visibleColumns = ref<string[]>([
"no",
"posTypeName",
"posLevelName",
"posLevelRank",
"posLevelAuthority",
// "createdAt",
// "lastUpdatedAt",
// "lastUpdateFullName",
]);
async function fetchData() {
showLoader();
await http
.get(config.API.orgPosLevel)
.then(async (res) => {
store.save(res.data.result, id.value);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
async function addData() {
await http.post(config.API.orgPosLevel, {
posLevelName: posLevelName.value,
posLevelRank: posLevelRank.value,
posLevelAuthority:
posLevelAuthority.value == "" ? "" : posLevelAuthority.value,
posTypeId: id.value,
});
fetchData();
}
async function editData(editId: string) {
await http.put(config.API.orgPosLevelId(editId), {
posLevelName: posLevelName.value,
posLevelRank: posLevelRank.value,
posLevelAuthority:
posLevelAuthority.value == "" ? "" : posLevelAuthority.value,
posTypeId: id.value,
});
fetchData();
}
async function deleteData(id: string) {
await http.delete(config.API.orgPosLevelId(id));
fetchData();
}
onMounted(async () => {
fetchName();
storeName.row.forEach((e) => {
if (e.id === id.value) {
posName.value = e.posTypeName ? e.posTypeName : "";
}
});
fetchData();
});
function closeDialog() {
dialog.value = false;
}
function validateForm() {
posLevelNameRef.value?.validate();
posLevelRankRef.value?.validate();
posTypeIdRef.value?.validate();
onSubmit();
}
async function onSubmit() {
if (posLevelName.value.length > 0) {
dialogConfirm(
$q,
async () => {
dialogStatus.value === "create" ? addData() : editData(editId.value);
closeDialog();
},
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
);
}
}
async function fetchName() {
showLoader();
await http
.get(config.API.orgPosType)
.then(async (res) => {
storeName.save(res.data.result);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
</script>
<template>
<div class="q-pa-md">
<q-toolbar style="padding: 0">
<q-btn
flat
round
color="primary"
icon="add"
@click.stop="
() => {
dialogStatus = 'create';
dialog = true;
posLevelName = '';
posLevelRank = undefined;
posLevelAuthority = '';
}
"
>
<q-tooltip> เพมขอม </q-tooltip>
</q-btn>
<q-space />
<div class="row q-gutter-sm">
<q-input outlined dense v-model="filterKeyword" label="ค้นหา"></q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
</q-toolbar>
<d-table
ref="table"
:columns="columns"
:rows="store.row"
:filter="filterKeyword"
row-key="name"
flat
bordered
:paging="true"
dense
class="custom-header-table"
:visible-columns="visibleColumns"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-bold">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="(col, index) in props.cols" :key="col.id">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>
<q-td auto-width>
<q-btn
color="grey"
flat
dense
round
size="14px"
icon="more_vert"
@click.stop
>
<q-menu>
<q-list dense>
<q-item
v-close-popup
clickable
@click.stop="
() => {
dialogStatus = 'edit';
dialog = true;
editId = props.row.id;
posLevelName = props.row.posLevelName;
posLevelRank = props.row.posLevelRank;
posLevelAuthority = props.row.posLevelAuthority;
}
"
>
<q-item-section>
<div class="row items-center white">
<q-icon name="o_edit" color="positive" />
<span class="q-ml-sm">แกไข</span>
</div>
</q-item-section>
</q-item>
<q-item clickable>
<q-item-section
@click="
dialogRemove(
$q,
async () => await deleteData(props.row.id)
)
"
v-close-popup
>
<div class="row items-center white">
<q-icon name="mdi-trash-can-outline" color="negative" />
<span class="q-ml-sm">ลบ</span>
</div>
</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-td>
</q-tr>
</template>
</d-table>
<q-dialog v-model="dialog" class="dialog" persistent>
<q-card style="min-width: 350px" class="bg-grey-11">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<dialog-header
:tittle="dialogStatus == 'edit' ? 'แก้ไขข้อมูล' : 'เพิ่มข้อมูล'"
:close="closeDialog"
/>
</q-card-section>
<q-separator color="grey-4" />
<q-card-section class="q-pa-none">
<q-input
outlined
ref="posLevelNameRef"
v-model="posLevelName"
label="ชื่อระดับตำแหน่ง"
dense
lazy-rules
borderless
class="col-12 bg-white q-ma-md"
hide-bottom-space
:rules="[(val) => val.length > 0 || 'กรุณากรอกระดับตำแหน่ง']"
/>
<q-input
ref="posLevelRankRef"
outlined
v-model="posLevelRank"
label="ระดับ"
dense
type="number"
lazy-rules
borderless
min="1"
class="col-12 bg-white q-ma-md"
:rules="[(val) => val != undefined || 'กรุณากรอกระดับ']"
hide-bottom-space
/>
<q-input
outlined
v-model="posLevelAuthority"
label="ผู้มีอำนาจสั่งบรรจุ"
dense
lazy-rules
borderless
class="col-12 bg-white q-ma-md"
hide-bottom-space
/>
<q-select
ref="posTypeIdRef"
v-model="posName"
label="ประเภทตำแหน่ง"
outlined
dense
class="col-12 bg-white q-ma-md"
options-cover
hide-bottom-space
readonly
/>
</q-card-section>
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</div>
</template>
<style scoped lang="scss">
.border_custom {
border-radius: 6px !important;
border: 1px solid #e1e1e1;
}
$toggle-background-color-on: #06884d;
$toggle-background-color-off: darkgray;
$toggle-control-color: white;
$toggle-width: 40px;
$toggle-height: 25px;
$toggle-gutter: 3px;
$toggle-radius: 50%;
$toggle-control-speed: 0.15s;
$toggle-control-ease: ease-in;
// These are our computed variables
// change at your own risk.
$toggle-radius: $toggle-height / 2;
$toggle-control-size: $toggle-height - ($toggle-gutter * 2);
.toggle-control {
display: block;
position: relative;
padding-left: $toggle-width;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
user-select: none;
input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
input:checked ~ .control {
background-color: $toggle-background-color-on;
&:after {
left: $toggle-width - $toggle-control-size - $toggle-gutter;
}
}
.control {
position: absolute;
top: -7px;
left: -15px;
height: $toggle-height;
width: $toggle-width;
border-radius: $toggle-radius;
background-color: $toggle-background-color-off;
transition: background-color $toggle-control-speed $toggle-control-ease;
&:after {
content: "";
position: absolute;
left: $toggle-gutter;
top: $toggle-gutter;
width: $toggle-control-size;
height: $toggle-control-size;
border-radius: $toggle-radius;
background: $toggle-control-color;
transition: left $toggle-control-speed $toggle-control-ease;
}
}
}
</style>

View file

@ -0,0 +1,30 @@
interface DataResponse {
createdAt: Date;
id: string;
lastUpdateFullName: String;
lastUpdatedAt: Date;
posTypes?: {
id: string;
posTypeName: string;
posTypeRank: number;
};
posTypeName?: string;
posLevelName?: string;
posLevelRank?: number;
posLevelAuthority?: string;
}
interface DataRow {
createdAt: string | null;
id: string;
lastUpdateFullName: String;
lastUpdatedAt: string | null;
posTypeName?: string;
posTypeRank?: number;
posTypeId?: string;
posLevelName?: string;
posLevelRank?: number;
posLevelAuthority?: string;
}
export type { DataResponse, DataRow };

View file

@ -2,12 +2,14 @@ const calendarWorkPage = () =>
import("@/modules/01_metadataNew/views/calendar.vue");
const masterInsignia = () =>
import("@/modules/01_metadataNew/views/insignia.vue");
const dateilInsignia = () =>
const detailInsignia = () =>
import("@/modules/01_metadataNew/components/insignia/InsigniaDetail.vue");
const personalPage = () =>
const personalPage = () =>
import("@/modules/01_metadataNew/views/personal.vue");
const positionPage = () =>
const positionPage = () =>
import("@/modules/01_metadataNew/views/position.vue");
const positionLevelPage = () =>
import("@/modules/01_metadataNew/components/position/03ListLevel.vue");
export default [
{
@ -33,7 +35,7 @@ export default [
{
path: "/master-data/insignia/detail/:id",
name: "masterInsigniadetail",
component: dateilInsignia,
component: detailInsignia,
meta: {
Auth: true,
Key: [7],
@ -60,4 +62,14 @@ export default [
Role: "metadata",
},
},
{
path: "/master-data/position/level/:id",
name: "masterPositionLevel",
component: positionLevelPage,
meta: {
Auth: true,
Key: [7],
Role: "metadata",
},
},
];

View file

@ -0,0 +1,30 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type {
DataResponse,
DataRow,
} from "../interface/response/position/ListType";
import { useCounterMixin } from "@/stores/mixin";
const { date2Thai } = useCounterMixin();
export const usePositionDataStore = defineStore("PositionData", () => {
const row = ref<DataRow[]>([]);
const name = ref<any>([]);
function save(data: DataResponse[], id: string) {
const list = data.map((e) => ({
...e,
posTypes: undefined,
posTypeId: e.posTypes?.id,
posTypeName: e.posTypes?.posTypeName,
posTypeRank: e.posTypes?.posTypeRank,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
})) satisfies DataRow[];
row.value = list.filter((e) => e.posTypeId === id);
}
return {
save,
row,
};
});

View file

@ -0,0 +1,28 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type {
DataResponse,
DataRow,
} from "../interface/response/position/ListType";
import { useCounterMixin } from "@/stores/mixin";
const { date2Thai } = useCounterMixin();
export const usePositionTypeDataStore = defineStore("PositionTypeData", () => {
const row = ref<DataRow[]>([]);
function save(data: DataResponse[]) {
const list = data.map((e) => ({
...e,
posTypes: undefined,
posTypeId: e.posTypes?.id,
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
})) satisfies DataRow[];
row.value = list;
}
return {
save,
row,
};
});

View file

@ -10,7 +10,7 @@ const tabs = ref<Array<any>>([]);
onMounted(() => {
const tabsPerson = [
{ label: "ตำแหน่ง", value: "list_position" },
{ label: "ประเภทและระดับตำแหน่ง", value: "list_type" },
{ label: "รายการประเภทตำแหน่ง", value: "list_type" },
{ label: "ตำแหน่งทางการบริหาร", value: "list_executive" },
];
tabs.value = tabsPerson;
@ -20,7 +20,7 @@ onMounted(() => {
<template>
<div class="toptitle text-dark col-12 row items-center">อมลตำแหน</div>
<q-card flat bordered >
<q-card flat bordered>
<q-tabs
dense
v-model="currentTab"
@ -41,10 +41,10 @@ onMounted(() => {
</q-tabs>
<q-separator size="2px" />
<div class="q-pa-md">
<ListPosition v-if="currentTab == 'list_position'"/>
<ListType v-if="currentTab == 'list_type'"/>
<ListExecutive v-if="currentTab == 'list_executive'"/>
</div>
<ListPosition v-if="currentTab == 'list_position'" />
<ListType v-if="currentTab == 'list_type'" />
<ListExecutive v-if="currentTab == 'list_executive'" />
</div>
</q-card>
</template>