ปรับ วินัย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-12-10 11:11:57 +07:00
parent 89bedf5251
commit 2adbbc9b24
22 changed files with 416 additions and 411 deletions

View file

@ -6,12 +6,11 @@ import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
import { title } from "process";
const modal = defineModel<boolean>("modal", { required: true });
const mixin = useCounterMixin();
const $q = useQuasar();
const { dialogConfirm, dialogMessageNotify } = mixin;
const { dialogConfirm, dialogMessageNotify, onSearchDataTable } = mixin;
const dataMapToSend = computed(() => {
return selected.value.map((i: any) => ({
@ -24,6 +23,7 @@ const dataMapToSend = computed(() => {
}));
});
const rowsMain = ref<any[]>([]);
const rows = ref<any[]>([]);
const props = defineProps({
title: {
@ -114,11 +114,21 @@ function onClickClose() {
selected.value = [];
}
function serchDataTable() {
rows.value = onSearchDataTable(
filter.value,
rowsMain.value,
props.columns ? props.columns : []
);
}
watch(
() => modal.value,
() => {
if (modal.value) {
inspectionResults.value = modal ? "" : "";
rows.value = props.rows;
rowsMain.value = props.rows;
selected.value = [];
}
}
@ -126,7 +136,7 @@ watch(
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="width: 820px; max-width: 80vw">
<q-card style="min-width: 70%">
<DialogHeader :tittle="props.title" :close="onClickClose" />
<q-separator />
<q-card-section class="q-pt-none q-mt-md">
@ -140,10 +150,10 @@ watch(
dense
v-model="filter"
outlined
debounce="300"
placeholder="ค้นหา"
style="max-width: 200px"
class="q-ml-sm"
@keydown.enter.pervent="serchDataTable"
>
<template v-slot:append>
<q-icon name="search" />
@ -170,8 +180,7 @@ watch(
<d-table
ref="table"
:columns="props.columns"
:rows="props.rows"
:filter="filter.trim()"
:rows="rows"
row-key="personId"
flat
bordered
@ -205,9 +214,7 @@ watch(
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'salary'">
{{ props.row.salary.toLocaleString() }}
</div>
<div v-else>
{{ col.value }}
</div>