+
+
-import { ref, onMounted, watch } from "vue";
-import router from "@/router";
-import { useCounterMixin } from "@/stores/mixin";
+import { ref, onMounted } from "vue";
+import { checkPermission } from "@/utils/permissions";
import { useQuasar } from "quasar";
-import { useEvaluateDirectorDataStore } from "@/modules/12_evaluatePersonal/store/DirectorStore";
-
+import router from "@/router";
import http from "@/plugins/http";
import config from "@/app.config";
+/**
+ * importComponents
+ */
+import DialogDetail from "@/modules/12_evaluatePersonal/components/Director/DialogDetail.vue";
+
+/**
+ * importStore
+ */
+import { useEvaluateDirectorDataStore } from "@/modules/12_evaluatePersonal/store/DirectorStore";
+import { useCounterMixin } from "@/stores/mixin";
+
+/**
+ * use
+ */
const $q = useQuasar();
const dataStore = useEvaluateDirectorDataStore();
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader, dialogRemove, success } = mixin;
-// const currentPage = ref(1);
-// const maxPage = ref(1);
-// const page = ref(1);
-// const rowsPerPage = ref(10);
+const modalDetail = ref(false);
+const directorId = ref("");
+const actionType = ref("");
/**
*pagination ของตาราง
@@ -27,23 +38,6 @@ const pagination = ref({
rowsPerPage: 10,
});
-// watch(
-// () => currentPage.value,
-// () => {
-// rowsPerPage.value = pagination.value.rowsPerPage;
-// getList();
-// }
-// );
-
-// watch(
-// () => pagination.value.rowsPerPage,
-// () => {
-// rowsPerPage.value = pagination.value.rowsPerPage;
-// currentPage.value = 1;
-// getList();
-// }
-// );
-
function getList() {
showLoader();
http
@@ -72,21 +66,28 @@ function clickDelete(id: string) {
* ลบข้อมูล
* @param id type
*/
-async function deleteData(id: string) {
+function deleteData(id: string) {
showLoader();
- await http
+ http
.delete(config.API.evaluateDirectorById(id))
- .then(() => {
+ .then(async () => {
+ getList();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
- .finally(async () => {
- await getList();
+ .finally(() => {
+ hideLoader();
});
}
+function onOpenDetail(id: string, type: string) {
+ directorId.value = id;
+ actionType.value = type;
+ modalDetail.value = true;
+}
+
/**
* ค้นหาในตาราง
*/
@@ -114,7 +115,7 @@ onMounted(() => {
-
+
{
v-model:pagination="pagination"
:visible-columns="dataStore.visibleColumns"
>
-
@@ -200,26 +190,47 @@ onMounted(() => {
-
+
+ รายละเอียด
+
+
+ แก้ไขข้อมูล
+
+
ลบข้อมูล
-
+
{{ props.rowIndex + 1 }}
@@ -227,10 +238,17 @@ onMounted(() => {
{{ col.value }}
-
+
+
+
diff --git a/src/modules/12_evaluatePersonal/views/MainPage.vue b/src/modules/12_evaluatePersonal/views/MainPage.vue
index a9cc7255d..19a94e769 100644
--- a/src/modules/12_evaluatePersonal/views/MainPage.vue
+++ b/src/modules/12_evaluatePersonal/views/MainPage.vue
@@ -2,6 +2,7 @@
import { onMounted, ref, watch, computed } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
+import { checkPermission } from "@/utils/permissions";
import http from "@/plugins/http";
import config from "@/app.config";
@@ -249,19 +250,28 @@ onMounted(async () => {
>
+
{{ col.label }}
-
-
+
+
+
+ รายละเอียด
+
+
+
{{ (page - 1) * pageSize + props.rowIndex + 1 }}