feat:issue
This commit is contained in:
parent
c132b077c0
commit
f4b7767476
7 changed files with 902 additions and 0 deletions
52
src/modules/07_issues/store.ts
Normal file
52
src/modules/07_issues/store.ts
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import { ref } from "vue";
|
||||
import { defineStore } from "pinia";
|
||||
import type { Options } from "@/modules/07_issues/interface/Main";
|
||||
|
||||
export const useIssueStore = defineStore("issue", () => {
|
||||
const systemOptions = ref<Options[]>([
|
||||
{ label: "ทั้งหมด", value: "" },
|
||||
{ label: "ระบบบริหารจัดการ", value: "MGT" },
|
||||
{ label: "ระบบผู้ใช้งาน", value: "USER" },
|
||||
{ label: "ระบบลงเวลา", value: "CHECKIN" },
|
||||
]);
|
||||
|
||||
const statusOptions = ref<Options[]>([
|
||||
{ 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 "-";
|
||||
}
|
||||
}
|
||||
|
||||
function convertSystem(system: string) {
|
||||
let val = system.toUpperCase();
|
||||
switch (val) {
|
||||
case "MGT":
|
||||
return "ระบบบริหารจัดการ";
|
||||
case "USER":
|
||||
return "ระบบผู้ใช้งาน";
|
||||
case "CHECKIN":
|
||||
return "ระบบลงเวลา";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
return { systemOptions, statusOptions, convertStatus, convertSystem };
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue