feat:page issues
This commit is contained in:
parent
8b303f7b0d
commit
a79a5858b6
5 changed files with 810 additions and 0 deletions
49
src/modules/22_issues/store.ts
Normal file
49
src/modules/22_issues/store.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useIssueStore = defineStore("issue", () => {
|
||||
const systemOptions = ref<any[]>([
|
||||
{ label: "ทั้งหมด", value: "" },
|
||||
{ label: "ระบบบริหารจัดการ", value: "MGT" },
|
||||
{ label: "ระบบผู้ใช้งาน", value: "USER" },
|
||||
{ label: "ระบบลงเวลา", value: "CHECKIN" },
|
||||
]);
|
||||
|
||||
const statusOptions = ref<any[]>([
|
||||
{ label: "ทั้งหมด", value: "" },
|
||||
{ label: "ใหม่", value: "NEW" },
|
||||
{ label: "กำลังดำเนินการ", value: "IN_PROGRESS" },
|
||||
{ label: "แก้ไขแล้ว", value: "RESOLVED" },
|
||||
{ label: "ปิดแล้ว", value: "CLOSED" },
|
||||
]);
|
||||
|
||||
function convertStatus(status: string) {
|
||||
let val = status.toUpperCase();
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "ใหม่";
|
||||
case "IN_PROGRESS":
|
||||
return "กำลังดำเนินการ";
|
||||
case "RESOLVED":
|
||||
return "แก้ไขแล้ว";
|
||||
case "CLOSED":
|
||||
return "ปิดแล้ว";
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
function convertSystem(system: string) {
|
||||
let val = system.toUpperCase();
|
||||
switch (val) {
|
||||
case "MGT":
|
||||
return "ระบบบริหารจัดการ";
|
||||
case "USER":
|
||||
return "ระบบผู้ใช้งาน";
|
||||
case "CHECKIN":
|
||||
return "ระบบลงเวลา";
|
||||
}
|
||||
}
|
||||
|
||||
return { systemOptions, statusOptions, convertStatus, convertSystem };
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue