Refactoring code module 14_KPI

This commit is contained in:
STW_TTTY\stwtt 2024-09-20 13:02:15 +07:00
parent bd33093d3e
commit 76118a8d11
37 changed files with 827 additions and 1675 deletions

View file

@ -1,20 +1,19 @@
<script setup lang="ts">
import DialogHeader from "@/components/DialogHeader.vue";
import type { QTableProps } from "quasar";
import { ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useKpiDataStore } from "@/modules/14_KPI/store";
import DialogHeader from "@/components/DialogHeader.vue";
const store = useKpiDataStore();
const $q = useQuasar();
const mixin = useCounterMixin();
const {
dialogConfirm,
success,
showLoader,
hideLoader,
messageError,
@ -23,9 +22,6 @@ const {
date2Thai,
} = mixin;
const route = useRoute();
const router = useRouter();
const id = ref<string>(route.params.id as string);
const modal = defineModel<boolean>("modal", { required: true });
const filterKeyword = ref<string>("");
const rows = ref<any[]>([]);
@ -164,6 +160,7 @@ const columns = ref<QTableProps["columns"]>([
format: (val) => statusText(val),
},
]);
const visibleColumns = ref<string[]>([
"no",
"name",
@ -179,7 +176,8 @@ const visibleColumns = ref<string[]>([
"commandNo",
]);
const statusText = (val: string) => {
/** แปลง สถานะเป็น text */
function statusText(val: string) {
switch (val) {
case "WAITTING":
return "รอดำเนินการ";
@ -197,12 +195,14 @@ const statusText = (val: string) => {
default:
return "-";
}
};
}
/** ปิด popup */
function close() {
modal.value = false;
}
/** ดึงข้อมูล */
function getData() {
showLoader();
http
@ -271,20 +271,6 @@ watch(
</q-td>
</q-tr>
</template>
<!-- <template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="formQuery.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="fetchList"
></q-pagination>
</template> -->
</d-table>
</div>
</div>