ย้าย tab ไว้ใน store เเก้ column
This commit is contained in:
parent
df0d9f9131
commit
bc7fa07f1f
5 changed files with 40 additions and 21 deletions
|
|
@ -9,7 +9,7 @@ import DialogForm from "@/modules/01_metadataNew/components/personal/DialogForm.
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
const store = usePersonalDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
|
@ -17,7 +17,7 @@ const columns = [
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ",
|
||||
label: "จังหวัด",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -109,7 +109,7 @@ async function addData() {
|
|||
|
||||
async function editData(id: string) {
|
||||
await http
|
||||
.put(config.API.orgProvince+`/${id}`, {
|
||||
.put(config.API.orgProvince + `/${id}`, {
|
||||
name: province.value,
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -126,7 +126,7 @@ async function editData(id: string) {
|
|||
|
||||
async function deleteData(id: string) {
|
||||
await http
|
||||
.delete(config.API.orgProvince+`/${id}`)
|
||||
.delete(config.API.orgProvince + `/${id}`)
|
||||
.then(() => {
|
||||
fetchData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
|
|
@ -139,8 +139,8 @@ async function deleteData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function nextPage(id:string){
|
||||
router.push(`/master-data/personal/district/${id}`)
|
||||
function nextPage(id: string) {
|
||||
router.push(`/master-data/personal/district/${id}`);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -208,7 +208,11 @@ onMounted(async () => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.id" @click="nextPage(props.row.id)">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.id"
|
||||
@click="nextPage(props.row.id)"
|
||||
>
|
||||
<div>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const columns = [
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ",
|
||||
label: "เขต/อำเภอ",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ const columns = [
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ",
|
||||
label: "แขวง/ตำบล",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -37,6 +37,17 @@ const columns = [
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "zipCode",
|
||||
align: "left",
|
||||
label: "รหัสไปรษณีย์",
|
||||
sortable: true,
|
||||
field: "zipCode",
|
||||
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",
|
||||
|
|
@ -83,6 +94,7 @@ const dialogStatus = ref<string>("");
|
|||
const personalName = ref<string>("แขวง/ตำบล");
|
||||
const visibleColumns = ref<string[]>([
|
||||
"name",
|
||||
"zipCode",
|
||||
"createdAt",
|
||||
"lastUpdatedAt",
|
||||
"lastUpdateFullName",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue