เพิม่ปุ่มลบ ประวัติการศึกษา

This commit is contained in:
Kittapath 2023-03-20 13:01:27 +07:00
parent e7198525a2
commit 6b78719b59
16 changed files with 432 additions and 147 deletions

View file

@ -5,15 +5,18 @@
v-model:edit="editBtn"
:header="name"
:icon="icon"
:add="checkAdd"
:add="clickAdd"
:editBtn="clickEdit"
:cancel="clickCancel"
:history="false"
v-if="nameHeader"
:addData="false"
/>
<div class="q-pl-sm">
<!-- v-if="nameHeader" -->
<!-- <div class="q-pl-sm">
<q-btn size="12px" flat round color="add" @click="add" icon="mdi-plus" v-if="addData">
<q-tooltip>เพมขอม</q-tooltip>
</q-btn>
</div>
</div> -->
<q-space />
<div class="items-center" style="display: flex">
<!-- นหาขอความใน table -->
@ -75,6 +78,7 @@
<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 v-if="editBtn == true" />
</q-tr>
</template>
<template #body="props">
@ -83,7 +87,7 @@
</q-table>
</template>
<script setup lang="ts">
import { ref, useAttrs } from 'vue'
import { ref, useAttrs, watch } from 'vue'
import HeaderTop from '@/components/top.vue'
import type { Pagination } from '@/modules/01_exam/interface/index/Main'
@ -127,6 +131,10 @@ const props = defineProps({
const emit = defineEmits(['update:inputfilter', 'update:inputvisible', 'update:editvisible'])
watch(props, (count: any, prevCount: any) => {
editBtn.value = props.editvisible
})
const updateEdit = (value: Boolean) => {
emit('update:editvisible', value)
}
@ -141,11 +149,21 @@ const paginationLabel = (start: string, end: string, total: string) => {
return start + '-' + end + ' ใน ' + total
}
const checkAdd = () => {
const clickAdd = () => {
// props.validate();
props.add()
}
const clickEdit = () => {
// props.validate();
props.edit()
}
const clickCancel = () => {
// props.validate();
props.cancel()
}
const edit = async () => {
updateEdit(!props.editvisible)
props.edit()