edit permission of placement pass
This commit is contained in:
parent
63a1b2c629
commit
015b861340
5 changed files with 98 additions and 162 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue