refactor code

This commit is contained in:
Kittapath 2023-05-16 22:23:32 +07:00
parent d2c352de17
commit 92fc21033d
50 changed files with 652 additions and 2170 deletions

View file

@ -12,12 +12,6 @@
:editOnly="false"
:editData="editData"
/>
<!-- 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> -->
<q-space />
<div class="items-center q-col-gutter-x-sm" style="display: flex">
<!-- นหาขอความใน table -->
@ -90,15 +84,6 @@ import { ref, useAttrs, watch } from 'vue'
import HeaderTop from '@/components/top.vue'
import type { Pagination } from '@/modules/01_exam/interface/index/Main'
const attrs = ref<any>(useAttrs())
const table = ref<any>(null)
const filterRef = ref<any>(null)
const editBtn = ref<boolean>(true)
const initialPagination = ref<Pagination>({
// descending: false,
rowsPerPage: 0
})
const props = defineProps({
inputfilter: String,
name: String,
@ -135,13 +120,18 @@ const props = defineProps({
const emit = defineEmits(['update:inputfilter', 'update:inputvisible', 'update:editvisible'])
const attrs = ref<any>(useAttrs())
const table = ref<any>(null)
const filterRef = ref<any>(null)
const editBtn = ref<boolean>(true)
const initialPagination = ref<Pagination>({
rowsPerPage: 0
})
watch(props, (count: any, prevCount: any) => {
editBtn.value = props.editvisible
})
const updateEdit = (value: Boolean) => {
emit('update:editvisible', value)
}
const updateInput = (value: string | number | null) => {
emit('update:inputfilter', value)
}
@ -154,27 +144,14 @@ const paginationLabel = (start: string, end: string, total: string) => {
}
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()
}
const cancel = async () => {
updateEdit(!props.editvisible)
props.cancel()
}
@ -183,10 +160,6 @@ const resetFilter = () => {
emit('update:inputfilter', '')
filterRef.value.focus()
}
const add = () => {
props.add()
}
</script>
<style lang="scss">
.icon-color {