edit permission of placement pass

This commit is contained in:
Warunee Tamkoo 2024-08-09 15:24:11 +07:00
parent 63a1b2c629
commit 015b861340
5 changed files with 98 additions and 162 deletions

View file

@ -1,5 +1,11 @@
<!-- วนหวของ อมลสวนต และ อย -->
<script setup lang="ts">
import { checkPermission } from "@/utils/permissions";
import { ref } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
const props = defineProps({
header: {
type: String,
@ -56,6 +62,9 @@ const props = defineProps({
});
const emit = defineEmits(["update:edit"]);
const isEdit = ref<boolean>(
checkPermission(route)?.attrIsUpdate ? true : false
);
const updateEdit = (value: any) => {
emit("update:edit", value);
@ -83,6 +92,7 @@ const add = () => {
props.add();
};
</script>
<template>
<div class="flex items-center">
<div class="flex items-center">
@ -100,7 +110,7 @@ const add = () => {
{{ header }}
</div>
</div>
<div class="q-gutter-sm q-mx-sm" v-if="addData == false">
<div class="q-gutter-sm q-mx-sm" v-if="addData == false && isEdit">
<q-btn
size="12px"
v-if="!edit"
@ -136,7 +146,7 @@ const add = () => {
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
<div class="q-pl-sm" v-else>
<div class="q-pl-sm" v-else-if="isEdit">
<q-btn
size="12px"
flat