ปรับ code ประเมิน
This commit is contained in:
parent
ab4189e6ed
commit
53cd8e593c
10 changed files with 171 additions and 226 deletions
|
|
@ -1,26 +1,55 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect, watch, type PropType } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<directorType[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
const currentPage = ref<number>(1);
|
||||
/** ค้นหาคอลัม */
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"name",
|
||||
"position",
|
||||
"duty",
|
||||
"email",
|
||||
"phone",
|
||||
"role",
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
clickClose: Function,
|
||||
getData: Function,
|
||||
rows2: Array,
|
||||
filterKeyword2: String,
|
||||
filterTable: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
maxPage: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
rowsPerPage: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
getList: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
selectedRow: {
|
||||
type: Array as PropType<directorType[]>,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
/** emit*/
|
||||
const emit = defineEmits([
|
||||
"update:filterKeyword2",
|
||||
"update:selected",
|
||||
"update:pagination",
|
||||
"returnDirector",
|
||||
]);
|
||||
|
||||
/**ข้อมูลหัว ตาราง*/
|
||||
|
|
@ -72,39 +101,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
clickClose: Function,
|
||||
getData: Function,
|
||||
rows2: Array,
|
||||
filterKeyword2: String,
|
||||
filterTable: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
maxPage: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
rowsPerPage: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
require: true,
|
||||
},
|
||||
getList: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
},
|
||||
selectedRow: {
|
||||
type: Array as PropType<directorType[]>,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
/** แสดงจำนวนในตาราง */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
|
|
@ -118,13 +114,6 @@ const checkSelected = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:filterKeyword2",
|
||||
"update:selected",
|
||||
"update:pagination",
|
||||
"returnDirector",
|
||||
]);
|
||||
|
||||
/** เลือกกรรมการ */
|
||||
async function onClickAddMeet() {
|
||||
emit("returnDirector", selected.value);
|
||||
|
|
@ -148,7 +137,6 @@ function updateProp(newPagination: any, page: number) {
|
|||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = props.selectedRow;
|
||||
props.getList();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue