เพิ่มส่งข้อความ inbox

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-11 13:45:24 +07:00
parent 90568eac79
commit 1e718bb5fc
2 changed files with 55 additions and 5 deletions

View file

@ -1,8 +1,9 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
import http from "@/plugins/http";
import config from "@/app.config";
@ -37,6 +38,8 @@ const thaiOptions: Intl.DateTimeFormatOptions = {
};
const isLoadInbox = ref<boolean>(false); //
const modalReply = ref<boolean>(false); //
const modalAdministrator = ref<boolean>(false); //
const isSuperAdmin = ref<boolean>(false);
/**
* โหลดรายการกลองของความ
@ -156,6 +159,7 @@ function dialogRepleOpen() {
*/
function modalReplyClose() {
modalReply.value = false;
modalAdministrator.value = false;
}
/**
@ -176,6 +180,11 @@ function onLoad(index: number, done: Function) {
onMounted(async () => {
await getData(1);
// keycloak
const tokenParsedData = await tokenParsed();
if (tokenParsedData != null) {
isSuperAdmin.value = tokenParsedData.role.includes("SUPER_ADMIN");
}
});
</script>
@ -197,7 +206,21 @@ onMounted(async () => {
:style="$q.screen.gt.xs ? 'height: 80vh' : 'height: auto;'"
>
<div class="q-px-md q-py-sm row col-12 items-center">
<div class="text-subtitle1 text-weight-medium">กลองขอความ</div>
<div class="text-subtitle1 text-weight-medium">
กลองขอความ
<q-btn
v-if="isSuperAdmin"
flat
round
dense
icon="add"
size="10px"
color="add"
@click="modalAdministrator = true"
>
<q-tooltip>งขอความไปยงผแลระบบของหนวยงาน</q-tooltip>
</q-btn>
</div>
<q-space />
<div v-if="totalInbox" class="text-grey-5" style="font-size: 12px">
งหมด {{ totalInbox }} อความ
@ -387,6 +410,12 @@ onMounted(async () => {
</q-card>
</template>
</q-splitter>
<PopupReplyInbox
:modal="modalAdministrator"
:click-close="modalReplyClose"
type="Administrator"
/>
</template>
<style>