Refactoring code module 01_masterdata
This commit is contained in:
parent
82f5380f3e
commit
71be6d095f
22 changed files with 272 additions and 209 deletions
|
|
@ -1,40 +1,42 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
import type { FormListMainByRole } from "@/modules/01_masterdata/interface/request/Main";
|
||||
import type {
|
||||
DataOption,
|
||||
NewPagination,
|
||||
KpiRoleData,
|
||||
IndicatorType,
|
||||
IndicatorTotal,
|
||||
} from "@/modules/01_masterdata/interface/index/Main";
|
||||
|
||||
import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogHistory.vue";
|
||||
import Summary from "@/modules/01_masterdata/components/Indicators/Summary.vue";
|
||||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** use*/
|
||||
const dataHistory = ref<any[]>([]);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const total = ref<number>();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { showLoader, hideLoader, dialogRemove, success, messageError } =
|
||||
useCounterMixin();
|
||||
|
||||
/** use*/
|
||||
const dataHistory = ref<KpiRoleData[]>([]);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const total = ref<number>();
|
||||
|
||||
const positionOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||
const positionMainOp = ref<DataOption[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
/** หัวตาราง */
|
||||
const rows = ref<any[]>([]);
|
||||
const rows = ref<IndicatorType[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "including",
|
||||
|
|
@ -70,7 +72,7 @@ const pagination = ref({
|
|||
rowsPerPage: formFilter.pageSize,
|
||||
});
|
||||
|
||||
const indicatorTotal = ref<any[]>([
|
||||
const indicatorTotal = ref<IndicatorTotal[]>([
|
||||
{
|
||||
value: "kpiPlan",
|
||||
label: "ตัวชี้วัดตามแผน",
|
||||
|
|
@ -103,7 +105,6 @@ const roundOp = ref<DataOption[]>([
|
|||
async function fetchList() {
|
||||
await http
|
||||
.post(config.API.kpiRoleMainList + `/search-edit`, {
|
||||
// ?page=${formFilter.page}&pageSize=${formFilter.pageSize}&period=${formFilter.round}&position=${formFilter.position}&keyword=${formFilter.keyword}&year=${formFilter.year}
|
||||
keyword: formFilter.keyword,
|
||||
position: formFilter.position,
|
||||
period: formFilter.round,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue