issue: add menu issue
This commit is contained in:
parent
7daf29d974
commit
af54914bbb
5 changed files with 391 additions and 186 deletions
|
|
@ -51,7 +51,12 @@ const optionsStatus = computed(() =>
|
|||
statusOptions.value.filter((item) => item.value !== "")
|
||||
);
|
||||
const splitterModel = computed({
|
||||
get: () => (isEdit.value ? 70 : 100),
|
||||
get: () => {
|
||||
if (!isEdit.value) return 100;
|
||||
// สำหรับหน้าจอเล็ก ใช้ horizontal splitter และแบ่งเป็น 60:40
|
||||
if ($q.screen.lt.md) return 60;
|
||||
return 70;
|
||||
},
|
||||
set: (val: number) => {},
|
||||
});
|
||||
|
||||
|
|
@ -205,187 +210,290 @@ watch(
|
|||
|
||||
<template>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card class="overflow-hidden" style="min-width: 900px; max-width: 90vw">
|
||||
<q-card
|
||||
class="overflow-hidden"
|
||||
style="width: 100%; max-width: min(900px, 95vw); min-width: 320px"
|
||||
>
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<DialogHeader :tittle="title" :close="onClose" />
|
||||
<q-separator />
|
||||
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
:limits="isEdit ? [70, 70] : [100, 100]"
|
||||
style="height: 800px"
|
||||
:separator-class="!isEdit ? 'hidden' : ''"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-pa-lg">
|
||||
<div class="q-gutter-y-md text-body2">
|
||||
<div class="row">
|
||||
<div class="col-3 text-grey-7">รหัส:</div>
|
||||
<div class="col-9 text-weight-bold">
|
||||
{{ data?.codeIssue || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">หัวข้อ:</div>
|
||||
<div class="col-9">{{ data?.title || "-" }}</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">รายละเอียด:</div>
|
||||
<div class="col-9">{{ data?.description || "-" }}</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">ระบบ/เมนู:</div>
|
||||
<div class="col-9">
|
||||
{{ convertSystem(data?.system || "") }} / {{ data?.menu }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">ผู้แจ้ง:</div>
|
||||
<div class="col-9">{{ data?.createdFullName || "-" }}</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">วันที่แจ้ง:</div>
|
||||
<div class="col-9">
|
||||
{{
|
||||
data?.createdAt
|
||||
? date2Thai(data?.createdAt, false, true)
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-3 text-grey-7">สถานะ:</div>
|
||||
<div class="col-9">
|
||||
{{ convertStatus(data?.status || "") }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="data?.remark"
|
||||
class="row q-mt-sm bg-grey-2 q-pa-sm rounded-borders"
|
||||
>
|
||||
<div class="col-12 text-grey-7 text-caption">หมายเหตุ:</div>
|
||||
<div class="col-12">{{ data?.remark }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="images.length > 0" class="q-mt-xl">
|
||||
<div class="text-subtitle2 q-mb-sm">
|
||||
<q-icon name="image" /> รูปภาพประกอบ
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
v-for="(img, index) in images"
|
||||
:key="index"
|
||||
class="col-4"
|
||||
>
|
||||
<q-img
|
||||
:src="img.downloadUrl"
|
||||
:ratio="1"
|
||||
fit="cover"
|
||||
class="rounded-borders shadow-1 cursor-pointer image-hover"
|
||||
@click="openPreview(img.downloadUrl)"
|
||||
<q-card-section style="max-height: 70vh; padding: 0">
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
:limits="
|
||||
isEdit && !$q.screen.lt.md
|
||||
? [70, 70]
|
||||
: isEdit && $q.screen.lt.md
|
||||
? [50, 80]
|
||||
: [100, 100]
|
||||
"
|
||||
:style="`height: ${
|
||||
$q.screen.height > 700 ? '500px' : 'calc(60vh - 100px)'
|
||||
}`"
|
||||
:separator-class="!isEdit ? 'hidden' : ''"
|
||||
:horizontal="$q.screen.lt.md && isEdit"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div :class="$q.screen.xs ? 'q-pa-md' : 'q-pa-lg'">
|
||||
<div class="q-gutter-y-md text-body2">
|
||||
<div class="row">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
<div class="absolute-full flex flex-center view-overlay">
|
||||
<q-icon name="visibility" size="sm" />
|
||||
</div>
|
||||
<div class="absolute-top-right btn-overlay q-pa-xs">
|
||||
รหัส:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9 text-weight-bold">
|
||||
{{ data?.codeIssue || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
หัวข้อ:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.title || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
รายละเอียด:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.description || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
ระบบ/เมนู:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ convertSystem(data?.system || "") }} / {{ data?.menu }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
สังกัด:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.org || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
อีเมลติดต่อกลับ:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.email || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
เบอร์ติดต่อกลับ:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.phone || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
ผู้แจ้ง:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ data?.createdFullName || "-" }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
วันที่แจ้ง:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{
|
||||
data?.createdAt
|
||||
? date2Thai(data?.createdAt, false, true)
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 text-grey-7"
|
||||
:class="{ 'q-mb-xs': $q.screen.xs }"
|
||||
>
|
||||
สถานะ:
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
{{ convertStatus(data?.status || "") }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="data?.remark"
|
||||
class="row q-mt-sm bg-grey-2 q-pa-sm rounded-borders"
|
||||
>
|
||||
<div class="col-12 text-grey-7 text-caption">หมายเหตุ:</div>
|
||||
<div class="col-12">{{ data?.remark }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="images.length > 0" class="q-mt-xl">
|
||||
<div class="text-subtitle2 q-mb-sm">
|
||||
<q-icon name="image" /> รูปภาพประกอบ
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div
|
||||
v-for="(img, index) in images"
|
||||
:key="index"
|
||||
class="col-xs-6 col-sm-4 col-md-3"
|
||||
>
|
||||
<q-img
|
||||
:src="img.downloadUrl"
|
||||
:ratio="1"
|
||||
fit="cover"
|
||||
class="rounded-borders shadow-1 cursor-pointer image-hover"
|
||||
@click="openPreview(img.downloadUrl)"
|
||||
>
|
||||
<div
|
||||
class="absolute-full flex flex-center view-overlay"
|
||||
>
|
||||
<q-icon name="visibility" size="sm" />
|
||||
</div>
|
||||
<div class="absolute-top-right btn-overlay q-pa-xs">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="download"
|
||||
color="white"
|
||||
size="sm"
|
||||
class="bg-black-op"
|
||||
@click.stop="
|
||||
downloadImage(img.downloadUrl, img.fileName)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</q-img>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="fileList.length > 0" class="q-mt-lg">
|
||||
<div class="text-subtitle2 q-mb-sm">
|
||||
<q-icon name="attachment" /> ไฟล์เอกสารแนบ
|
||||
</div>
|
||||
<q-list bordered separator class="rounded-borders">
|
||||
<q-item v-for="file in fileList" :key="file.fileName" dense>
|
||||
<q-item-section avatar
|
||||
><q-icon name="description" color="blue"
|
||||
/></q-item-section>
|
||||
<q-item-section class="text-caption ellipsis">{{
|
||||
file.fileName
|
||||
}}</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="download"
|
||||
color="white"
|
||||
color="blue"
|
||||
size="sm"
|
||||
class="bg-black-op"
|
||||
@click.stop="
|
||||
downloadImage(img.downloadUrl, img.fileName)
|
||||
"
|
||||
@click="downloadFile(file.fileName)"
|
||||
/>
|
||||
</div>
|
||||
</q-img>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:after v-if="isEdit">
|
||||
<div
|
||||
:class="[
|
||||
$q.screen.xs ? 'q-pa-md' : 'q-pa-lg',
|
||||
'full-height bg-grey-1',
|
||||
]"
|
||||
>
|
||||
<div class="col-12 q-pa-none q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
dense
|
||||
outlined
|
||||
v-model="form.status"
|
||||
:options="optionsStatus"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
map-options
|
||||
label="สถานะ"
|
||||
emit-value
|
||||
:rules="[ (val: string) => !!val || 'กรุณาเลือกสถานะ' ]"
|
||||
hide-bottom-space
|
||||
class="inputgreen bg-white"
|
||||
:readonly="isEdit ? false : true"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isEdit ? false : true"
|
||||
dense
|
||||
outlined
|
||||
label="หมายเหตุ"
|
||||
v-model="form.remark"
|
||||
class="inputgreen bg-white"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="fileList.length > 0" class="q-mt-lg">
|
||||
<div class="text-subtitle2 q-mb-sm">
|
||||
<q-icon name="attachment" /> ไฟล์เอกสารแนบ
|
||||
</div>
|
||||
<q-list bordered separator class="rounded-borders">
|
||||
<q-item v-for="file in fileList" :key="file.fileName" dense>
|
||||
<q-item-section avatar
|
||||
><q-icon name="description" color="blue"
|
||||
/></q-item-section>
|
||||
<q-item-section class="text-caption ellipsis">{{
|
||||
file.fileName
|
||||
}}</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="download"
|
||||
color="blue"
|
||||
size="sm"
|
||||
@click="downloadFile(file.fileName)"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:after v-if="isEdit">
|
||||
<div class="q-pa-lg bg-grey-1 full-height">
|
||||
<div class="col-12 q-pa-none q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
dense
|
||||
outlined
|
||||
v-model="form.status"
|
||||
:options="optionsStatus"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
map-options
|
||||
label="สถานะ"
|
||||
emit-value
|
||||
:rules="[ (val: string) => !!val || 'กรุณาเลือกสถานะ' ]"
|
||||
hide-bottom-space
|
||||
class="inputgreen"
|
||||
:readonly="isEdit ? false : true"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="isEdit ? false : true"
|
||||
dense
|
||||
outlined
|
||||
label="หมายเหตุ"
|
||||
v-model="form.remark"
|
||||
class="inputgreen"
|
||||
hide-bottom-space
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator v-if="isEdit" />
|
||||
<q-card-actions align="right" class="q-pa-md" v-if="isEdit">
|
||||
<q-card-actions
|
||||
:align="$q.screen.xs ? 'center' : 'right'"
|
||||
:class="$q.screen.xs ? 'q-pa-md' : 'q-pa-md'"
|
||||
v-if="isEdit"
|
||||
>
|
||||
<q-btn
|
||||
type="submit"
|
||||
class="q-px-md items-center"
|
||||
:class="$q.screen.xs ? 'full-width q-px-md' : 'q-px-md'"
|
||||
class="items-center"
|
||||
color="public"
|
||||
label="บันทึก"
|
||||
>
|
||||
|
|
@ -396,18 +504,6 @@ watch(
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- <q-dialog v-model="imageModal">
|
||||
<q-btn
|
||||
icon="close"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
v-close-popup
|
||||
class="absolute-top-right z-top text-white"
|
||||
/>
|
||||
|
||||
<q-img :src="selectedImg" />
|
||||
</q-dialog> -->
|
||||
<q-dialog v-model="imageModal">
|
||||
<q-btn
|
||||
icon="close"
|
||||
|
|
@ -416,6 +512,7 @@ watch(
|
|||
dense
|
||||
v-close-popup
|
||||
class="absolute-top-right z-top text-white"
|
||||
style="margin: 16px"
|
||||
/>
|
||||
<q-card
|
||||
style="
|
||||
|
|
@ -460,4 +557,31 @@ watch(
|
|||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Responsive styles */
|
||||
@media (max-width: 599px) {
|
||||
.q-card {
|
||||
margin: 8px !important;
|
||||
}
|
||||
|
||||
.q-splitter--horizontal .q-splitter__panel:first-child {
|
||||
max-height: calc(50vh - 50px) !important;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.text-body2 {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.q-img {
|
||||
min-height: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) and (min-width: 600px) {
|
||||
.q-splitter--horizontal .q-splitter__panel:first-child {
|
||||
max-height: calc(55vh - 50px) !important;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ interface IssueData {
|
|||
status: "IN_PROGRESS" | "RESOLVED" | "CLOSED" | "NEW";
|
||||
system: "mgt" | "user" | "checkin";
|
||||
title: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
}
|
||||
|
||||
interface IssueAttachment {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ export default [
|
|||
component: Main,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "REPORT_ORG",
|
||||
Role: "STAFF",
|
||||
Key: "ISSUE",
|
||||
Role: "ISSUE",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import { storeToRefs } from "pinia";
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useIssueStore } from "@/modules/22_issues/store";
|
||||
|
||||
|
|
@ -27,6 +26,9 @@ const visibleColumns = ref<string[]>([
|
|||
"description",
|
||||
"system",
|
||||
"menu",
|
||||
"org",
|
||||
"email",
|
||||
"phone",
|
||||
"createdAt",
|
||||
"createdFullName",
|
||||
"status",
|
||||
|
|
@ -69,6 +71,35 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "org",
|
||||
align: "left",
|
||||
label: "หน่วยงาน",
|
||||
sortable: false,
|
||||
field: "org",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
align: "left",
|
||||
label: "อีเมลติดต่อกลับ",
|
||||
sortable: false,
|
||||
field: "email",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "phone",
|
||||
align: "left",
|
||||
label: "เบอร์ติดต่อกลับ",
|
||||
sortable: false,
|
||||
field: "phone",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
|
|
@ -283,7 +314,6 @@ onMounted(async () => {
|
|||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
round
|
||||
color="info"
|
||||
flat
|
||||
|
|
@ -294,10 +324,6 @@ onMounted(async () => {
|
|||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
checkPermission($route)?.attrIsGet
|
||||
"
|
||||
round
|
||||
color="edit"
|
||||
flat
|
||||
|
|
@ -310,7 +336,11 @@ onMounted(async () => {
|
|||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div
|
||||
:class="col.name === 'description' ? 'table_ellipsis' : ''"
|
||||
:class="
|
||||
col.name === 'description' || col.name === 'org'
|
||||
? 'table_ellipsis'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ const resize = ref<number>(0);
|
|||
const drawerL = ref<boolean>(false);
|
||||
const fullname = ref<string>("");
|
||||
const notiTrigger = ref<boolean>(false);
|
||||
const text = ref<string>("");
|
||||
|
||||
const notiList = ref<notiType[]>([]);
|
||||
const modalLoginLinkage = ref<boolean>(false); //เข้าสู่ระบบ Linkage Center
|
||||
|
|
@ -216,6 +215,7 @@ const activeBtn = () => {
|
|||
};
|
||||
|
||||
const isSsoToken = ref<boolean>(false);
|
||||
const isIssueRole = ref<boolean>(false);
|
||||
// const interval = ref<any>(null);
|
||||
/**
|
||||
* เมื่อเริ่มต้นโปรแกรมให้ฟัง event resize และ function myEventHandler
|
||||
|
|
@ -225,12 +225,17 @@ const isSsoToken = ref<boolean>(false);
|
|||
*/
|
||||
onMounted(async () => {
|
||||
miniState.value = localStorage.getItem("miniState") === "true";
|
||||
const user = await tokenParsed();
|
||||
if (user.role.includes("ISSUE")) {
|
||||
isIssueRole.value = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// if (user && user.role) return;
|
||||
await fetchSys();
|
||||
await fetchPermissionsSys();
|
||||
fetchKeycloakPosition();
|
||||
|
||||
const user = await tokenParsed();
|
||||
const SSO_TOKEN = await getCookie("SSO");
|
||||
isSsoToken.value = SSO_TOKEN === "y" ? true : false;
|
||||
if (user) {
|
||||
|
|
@ -1015,6 +1020,28 @@ function onViewDetailNoti(url: string) {
|
|||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
<!-- add menu issue for role ISSUE -->
|
||||
<q-item
|
||||
v-if="isIssueRole"
|
||||
class="text-weight-medium menu"
|
||||
:active="activeMenu('issuesMain')"
|
||||
active-class="text-primary active-item text-weight-bold menuActive"
|
||||
:to="{ name: 'issuesMain' }"
|
||||
clickable
|
||||
v-ripple
|
||||
dense
|
||||
exact
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-avatar size="md" font-size="20px">
|
||||
<q-icon name="mdi-bug-check" />
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>จัดการปัญหาการใช้งานระบบ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<!-- end add menu issue for role ISSUE -->
|
||||
</q-list>
|
||||
</q-scroll-area>
|
||||
</template>
|
||||
|
|
@ -1147,6 +1174,28 @@ function onViewDetailNoti(url: string) {
|
|||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
<!-- add menu issue for role ISSUE -->
|
||||
<q-item
|
||||
v-if="isIssueRole"
|
||||
class="text-weight-medium menu"
|
||||
:active="activeMenu('issuesMain')"
|
||||
active-class="text-primary active-item text-weight-bold menuActive"
|
||||
:to="{ name: 'issuesMain' }"
|
||||
clickable
|
||||
v-ripple
|
||||
dense
|
||||
exact
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-avatar size="md" font-size="20px">
|
||||
<q-icon name="mdi-bug-check" />
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>จัดการปัญหาการใช้งานระบบ</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<!-- end add menu issue for role ISSUE -->
|
||||
</q-list>
|
||||
</q-scroll-area>
|
||||
</q-drawer>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue