จัดโค้ดวินัย
This commit is contained in:
parent
71d3b54ef0
commit
7262000680
37 changed files with 492 additions and 697 deletions
|
|
@ -1,12 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch, watchEffect } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
/** import Type */
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { FormData, MyObjectComplaintsRef, ArrayFileList } from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type {
|
||||
FormData,
|
||||
MyObjectComplaintsRef,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
/** importStroe*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
|
|
@ -18,12 +19,15 @@ import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
|||
|
||||
const $q = useQuasar();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
const channelOptions = ref<DataOption[]>([]);
|
||||
/** เรียกใช้ store */
|
||||
const mixin = useCounterMixin();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const mainStore = useDisciplineMainStore();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
||||
const modal = ref<boolean>(false);
|
||||
const toggleModal = () => (modal.value = !modal.value);
|
||||
const {
|
||||
date2Thai,
|
||||
dialogConfirm,
|
||||
|
|
@ -108,22 +112,6 @@ const objectComplaintsRef: MyObjectComplaintsRef = {
|
|||
result: resultRef,
|
||||
};
|
||||
|
||||
// /**
|
||||
// * รับค่าผู้ถูกร้องเรียน
|
||||
// * @param val บุคคล หน่วยงาน กทม
|
||||
// */
|
||||
// async function selectComplainant(val: string) {
|
||||
// formData.organizationId = "";
|
||||
// formData.consideredAgency = "";
|
||||
|
||||
// if (val === "1") {
|
||||
// await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
// }
|
||||
// }
|
||||
|
||||
// /** เรียกโครงสร้างสำนักงาน */
|
||||
// async function fetchOffice() {}
|
||||
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param documentFile ไฟล์ที่รับมา
|
||||
|
|
@ -192,10 +180,6 @@ function onSubmit() {
|
|||
);
|
||||
}
|
||||
|
||||
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
||||
const modal = ref<boolean>(false);
|
||||
const toggleModal = () => (modal.value = !modal.value);
|
||||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
|
|
@ -326,7 +310,7 @@ function deletePerson(id: string) {
|
|||
}
|
||||
|
||||
/** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/
|
||||
const channelOptions = ref<DataOption[]>([]);
|
||||
|
||||
function getListChannel() {
|
||||
http.get(config.API.complaintListOp()).then((res) => {
|
||||
channelOptions.value = res.data.result.data;
|
||||
|
|
@ -900,7 +884,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- อัพโหลดไฟล์ -->
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<q-card flat class="q-pa-md" bordered>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ function redirectToPageadd() {
|
|||
|
||||
function filterFn() {
|
||||
getList();
|
||||
console.log("enter", filterKeyword.value);
|
||||
}
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
// import type
|
||||
import type { QTableProps } from "quasar";
|
||||
// importStroe
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const router = useRouter();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
filterTable: {
|
||||
|
|
@ -29,7 +29,18 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
"dateReceived",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"createdAt",
|
||||
"levelConsideration",
|
||||
"dateConsideration",
|
||||
"status",
|
||||
]);
|
||||
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -107,34 +118,22 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
"dateReceived",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"createdAt",
|
||||
"levelConsideration",
|
||||
"dateConsideration",
|
||||
"status",
|
||||
]);
|
||||
|
||||
/** แสดงจำนวนในตาราง */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: Number(props.page),
|
||||
rowsPerPage: props.rowsPerPage,
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังชั่นสำหรับ เปลี่ยน route ตาม id ที่รับมา
|
||||
* @param id ไอดีระบุ
|
||||
*/
|
||||
function OpenEdit(id: string) {
|
||||
console.log(id);
|
||||
router.push(`/discipline/complaints/${id}`);
|
||||
}
|
||||
|
||||
/** ส่งค่ากลับไปหน้าหลัก */
|
||||
function updateProp(newPagination: any, page: number){
|
||||
// ส่ง event ไปยัง parent component เพื่ออัพเดทค่า props
|
||||
emit("update:pagination", newPagination, page);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue