Refactoring code module 11_discipline

This commit is contained in:
STW_TTTY\stwtt 2024-09-19 16:37:16 +07:00
parent 202fbf27b6
commit 9653ae78cb
58 changed files with 1021 additions and 1305 deletions

View file

@ -1,22 +1,20 @@
<script setup lang="ts">
import { ref, computed, watchEffect, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import type { DataListRow } from "@/modules/11_discipline/interface/request/result";
import { useRoute } from "vue-router";
import DialogHeader from "@/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
const route = useRoute();
const optionsType = ref<[]>([]);
const idPath = ref<string>(route.params.id as string);
const type = ref<string>("");
const rows = ref<DataListRow[]>([]);
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const selected = ref<ResponseData[]>([]);
const route = useRoute();
const mixin = useCounterMixin();
const {
showLoader,
@ -27,6 +25,12 @@ const {
dialogMessageNotify,
} = mixin;
const optionsType = ref<[]>([]);
const idPath = ref<string>(route.params.id as string);
const type = ref<string>("");
const rows = ref<DataListRow[]>([]);
const selected = ref<ResponseData[]>([]);
const props = defineProps({
data: {
type: Object,
@ -90,25 +94,6 @@ async function Ordersave() {
props.getData?.();
hideLoader();
});
// } else if (props.title == "/") {
// const body = {
// persons,
// };
// showLoader();
// await http
// .put(config.API.discardResult(idPath.value, type.value as string), body)
// .then((res: any) => {
// success($q, `${props.title}`);
// props.closeModal?.();
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// props.getData?.();
// hideLoader();
// });
// }
}
const emit = defineEmits([
@ -132,7 +117,6 @@ async function fecthTypeOption() {
await http
.get(config.API.typeOrder())
.then((res) => {
// if (props.title == "") {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-19" ||
@ -143,13 +127,6 @@ async function fecthTypeOption() {
e.commandCode === "C-PM-30" ||
e.commandCode === "C-PM-31"
);
// }
// else {
// optionsType.value = res.data.result.filter(
// (e: OpType) =>
// e.commandCode === "C-PM-30" || e.commandCode === "C-PM-31"
// );
// }
})
.catch((e) => {
messageError($q, e);
@ -166,15 +143,6 @@ watchEffect(() => {
rows.value = props.data.persons.filter(
(item: any) => item.status === "NEW"
);
// if (props.title == "") {
// rows.value = props.data.persons.filter(
// (item: any) => item.status !== "REPORT"
// );
// } else if (props.title == "/") {
// rows.value = props.data.persons.filter(
// (item: any) => item.status == "REPORT" && item.statusDiscard == "NEW"
// );
// }
}
});