ข้อมูลหลัก => fix bug
This commit is contained in:
parent
0531cf2bb3
commit
0d04f6a3b5
13 changed files with 336 additions and 320 deletions
|
|
@ -1,12 +1,25 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePersonalDataStore } from "@/modules/01_metadata/stores/personalStore";
|
||||
import { useQuasar } from "quasar";
|
||||
import DialogForm from "@/modules/01_metadata/components/personal/DialogForm.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogForm from "@/modules/01_metadata/components/personal/DialogForm.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { usePersonalDataStore } from "@/modules/01_metadata/stores/personalStore";
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = usePersonalDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
|
||||
/** Table*/
|
||||
const TABLE_COLUMNS = [
|
||||
{
|
||||
name: "prefix",
|
||||
|
|
@ -53,11 +66,12 @@ const TABLE_COLUMNS = [
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
] as const satisfies QTableProps["columns"];
|
||||
|
||||
const $q = useQuasar();
|
||||
const store = usePersonalDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
|
||||
const visibleColumns = ref<string[]>([
|
||||
"prefix",
|
||||
"createdAt",
|
||||
"lastUpdatedAt",
|
||||
"lastUpdateFullName",
|
||||
]);
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const dialog = ref<boolean>(false);
|
||||
|
|
@ -65,12 +79,6 @@ const prefix = ref<string>("");
|
|||
const editId = ref<string>("");
|
||||
const dialogStatus = ref<string>("");
|
||||
const personalName = ref<string>("คำนำหน้าชื่อ");
|
||||
const visibleColumns = ref<string[]>([
|
||||
"prefix",
|
||||
"createdAt",
|
||||
"lastUpdatedAt",
|
||||
"lastUpdateFullName",
|
||||
]);
|
||||
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import dialogHeader from "@/components/DialogHeader.vue";
|
||||
import { QInput, useQuasar } from "quasar";
|
||||
|
||||
/** importComponents*/
|
||||
import dialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm } = mixin;
|
||||
|
||||
const dataRef = ref<QInput | null>(null);
|
||||
const zipCodeRef = ref<QInput | null>(null);
|
||||
const educationRankRef = ref<QInput | null>(null);
|
||||
/** props*/
|
||||
const data = defineModel<string>("data", {
|
||||
required: true,
|
||||
});
|
||||
|
|
@ -34,8 +37,13 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const dataRef = ref<QInput | null>(null);
|
||||
const zipCodeRef = ref<QInput | null>(null);
|
||||
const educationRankRef = ref<QInput | null>(null);
|
||||
|
||||
function closeDialog() {
|
||||
dialog.value = false;
|
||||
data.value = "";
|
||||
}
|
||||
|
||||
function validateForm() {
|
||||
|
|
@ -54,7 +62,6 @@ async function onSubmit() {
|
|||
? props.addData()
|
||||
: props.editData(editId.value);
|
||||
closeDialog();
|
||||
data.value = "";
|
||||
educationRank.value = undefined;
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
|
|
@ -109,6 +116,7 @@ async function onSubmit() {
|
|||
min="1"
|
||||
:rules="[(val) => val != undefined || 'กรุณากรอกลำดับ']"
|
||||
hide-bottom-space
|
||||
class="inputgreen"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue