แก้ space ขึ้นบรรทัดใหม่ เเก้คำ พ้นราชการ

This commit is contained in:
setthawutttty 2025-03-19 17:41:35 +07:00
parent 90ed596dec
commit b8f971e251
23 changed files with 377 additions and 170 deletions

View file

@ -33,7 +33,7 @@ const dataMapToSend = computed(() => {
}));
});
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
const { dialogConfirm, date2Thai, onSearchDataTable, textTranForm } = mixin;
/** props*/
const props = defineProps({
@ -41,11 +41,11 @@ const props = defineProps({
closeModal: { type: Function, requreid: true },
fecthList: { type: Function, requreid: true },
rows: { type: Array as PropType<ResponseItems[]>, requreid: true },
filterKeyword2: { type: String, requreid: true },
mainTabs: { type: String, requreid: true },
});
//Table
const filterKeyword = defineModel<string>("filterKeyword", { required: true });
const rowsData = ref<ResponseItems[]>([]);
const rowsDataMain = ref<ResponseItems[]>([]);
const columns = ref<QTableProps["columns"]>([
@ -84,7 +84,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -104,7 +104,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionNumberOld",
align: "left",
label: "เลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "positionNumberOld",
headerStyle: "font-size: 14px",
@ -118,6 +118,9 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
},
{
name: "datetext",
@ -161,7 +164,6 @@ const modalCommand = ref<boolean>(false);
/** popup ยืนยันส่งัว */
function saveOrder() {
console.log(selected.value);
dialogConfirm(
$q,
@ -181,7 +183,7 @@ function updateInput(value: any) {
async function onSearch() {
rowsData.value = onSearchDataTable(
props.filterKeyword2 ? props.filterKeyword2 : "",
filterKeyword.value,
rowsDataMain.value,
columns.value ? columns.value : []
);
@ -214,8 +216,7 @@ watch(
borderless
outlined
dense
:model-value="filterKeyword2"
@update:model-value="updateInput"
v-model="filterKeyword"
@keydown.enter="onSearch"
placeholder="ค้นหา"
>
@ -269,14 +270,17 @@ watch(
</q-td>
<q-td v-for="col in props.cols" :key="col.id">
<div
:class="
col.name === 'organizationPositionOld' ||
col.name === 'organization'
? 'table_ellipsis2'
: ''
"
v-if="col.name == 'organizationPositionOld'"
class="text-html"
>
{{ col.value ? col.value : "" }}
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>

View file

@ -1274,9 +1274,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]"
hide-bottom-space
:label="`${'เลขที่'}`"
:label="`${'เลขที่ตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -636,9 +636,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="posNo"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]"
hide-bottom-space
:label="`${'เลขที่'}`"
:label="`${'เลขที่ตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -23,8 +23,15 @@ const stroeResign = useDataStore();
const { statusText } = stroe;
const router = useRouter();
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } =
mixin;
const {
messageError,
date2Thai,
showLoader,
hideLoader,
onSearchDataTable,
findOrgName,
textTranForm,
} = mixin;
/** Table */
const rows = ref<ResponseItems[]>([]);
@ -65,7 +72,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -85,7 +92,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionNumberOld",
align: "left",
label: "เลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "positionNumberOld",
headerStyle: "font-size: 14px",
@ -99,6 +106,9 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
},
{
name: "datetext",
@ -377,7 +387,19 @@ onMounted(async () => {
: ''
"
>
{{ col.value ? col.value : "-" }}
<div
v-if="col.name == 'organizationPositionOld'"
class="text-html"
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</div>
</q-td>
</q-tr>
@ -389,7 +411,7 @@ onMounted(async () => {
<DialogSendToCommand
v-model:modal="modal"
v-model:filter-keyword2="filterKeyword2"
v-model:filter-keyword="filterKeyword2"
:close-modal="closeModal"
:rows="rowsSendToCommand"
:fecth-list="fecthlist"