delete const $q = useQuasar(); .ts

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-06-06 13:56:05 +07:00
parent af4bae0b8a
commit 685191c74b
7 changed files with 51 additions and 84 deletions

View file

@ -13,14 +13,8 @@ import type {
zipCodeOption,
} from "@/modules/04_registryPerson/interface/index/Main";
const $q = useQuasar();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
} = mixin;
const { showLoader, hideLoader } = mixin;
export const useAddressDataStore = defineStore("addess", () => {
const profileIdBefore = ref<string>("");
@ -89,7 +83,7 @@ export const useAddressDataStore = defineStore("addess", () => {
OpsFilter.value.provinceOps = option;
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
hideLoader();
@ -122,7 +116,7 @@ export const useAddressDataStore = defineStore("addess", () => {
return option;
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
hideLoader();
@ -158,7 +152,7 @@ export const useAddressDataStore = defineStore("addess", () => {
}
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
hideLoader();

View file

@ -1,13 +1,10 @@
import { ref } from "vue";
import { defineStore } from "pinia";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Address";
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Address";
import type {
DataOption,
AddressOps,
@ -15,14 +12,8 @@ import type {
zipCodeOption,
} from "@/modules/04_registryPerson/interface/index/Main";
const $q = useQuasar();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
} = mixin;
const { showLoader, hideLoader } = mixin;
export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
const retireDate = ref<Date>();
@ -174,10 +165,11 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
OpsPersonFilter.value.religionOps = optionreligions;
})
.catch((e) => {
messageError($q, e);
hideLoader();
console.log(e);
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
/** -----(จังหวัด-อำเภอ-ตำบล)----- */
@ -198,7 +190,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
OpsAddressFilter.value.provinceOps = option;
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
isLoad && hideLoader();
@ -235,7 +227,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
return option;
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
isLoad && hideLoader();
@ -275,7 +267,7 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
}
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
isLoad && hideLoader();
@ -337,22 +329,22 @@ export const useDataLinkCenter = defineStore("DataLinkCenter", () => {
}
/**
* function fetch
*/
function fetchDataRelationship() {
http
.get(config.API.orgRelationship)
.then((res) => {
const list = res.data.result.map((e: any) => ({
id: e.id,
name: e.name,
}));
optionRelationshipMain.value = list;
})
.catch((err) => {
messageError($q, err);
});
}
* function fetch
*/
function fetchDataRelationship() {
http
.get(config.API.orgRelationship)
.then((res) => {
const list = res.data.result.map((e: any) => ({
id: e.id,
name: e.name,
}));
optionRelationshipMain.value = list;
})
.catch((e) => {
console.log(e);
});
}
return {
fetchPerson,
OpsPersonFilter,
@ -366,6 +358,6 @@ function fetchDataRelationship() {
fetchSubDistrict,
optionRelationshipMain,
optionRelationship,
fetchDataRelationship
fetchDataRelationship,
};
});

View file

@ -1,15 +1,8 @@
import { ref } from "vue";
import { defineStore } from "pinia";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
const $q = useQuasar();
const mixin = useCounterMixin();
const {} = mixin;
export const useGovernmentPosDataStore = defineStore("GovernmentPos", () => {
// commandCode ขอตำแหน่ง
const positionCode = ref<number[]>([

View file

@ -1,6 +1,5 @@
import { ref } from "vue";
import { defineStore } from "pinia";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
@ -12,14 +11,8 @@ import type {
InformationOps,
} from "@/modules/04_registryPerson/interface/index/Main";
const $q = useQuasar();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
} = mixin;
const { showLoader, hideLoader } = mixin;
export const useProfileDataStore = defineStore("profile", () => {
const retireDate = ref<Date>();
@ -172,7 +165,7 @@ export const useProfileDataStore = defineStore("profile", () => {
OpsFilter.value.religionOps = optionreligions;
})
.catch((e) => {
messageError($q, e);
console.log(e);
})
.finally(() => {
setTimeout(() => {