Permission Command
This commit is contained in:
parent
5a05bccf0a
commit
8964ea708a
2 changed files with 34 additions and 8 deletions
|
|
@ -2,11 +2,12 @@
|
|||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useCommandListStore } from "@/modules/18_command/store/ListStore";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { Pagination } from "@/modules/18_command/interface/index/Main";
|
||||
|
|
@ -234,6 +235,18 @@ onMounted(() => {
|
|||
round
|
||||
color="secondary"
|
||||
icon="mdi-dots-horizontal-circle-outline"
|
||||
v-if="
|
||||
store.tabsMain === 'DRAFT' ||
|
||||
store.tabsMain === 'PENDING' ||
|
||||
store.tabsMain === 'CANCEL'
|
||||
? checkPermission($route)?.attrIsGet ||
|
||||
checkPermission($route)?.attrIsCreate ||
|
||||
checkPermission($route)?.attrIsDelete
|
||||
: store.tabsMain === 'WAITING' || store.tabsMain === 'REPORTED'
|
||||
? checkPermission($route)?.attrIsGet ||
|
||||
checkPermission($route)?.attrIsCreate
|
||||
: ''
|
||||
"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list dense style="min-width: 200px">
|
||||
|
|
@ -242,7 +255,9 @@ onMounted(() => {
|
|||
v-if="
|
||||
store.tabsMain !== 'WAITING' &&
|
||||
store.tabsMain !== 'CANCEL' &&
|
||||
store.tabsMain !== 'REPORTED'
|
||||
store.tabsMain !== 'REPORTED' &&
|
||||
checkPermission($route)?.attrIsGet &&
|
||||
checkPermission($route)?.attrIsCreate
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -263,6 +278,7 @@ onMounted(() => {
|
|||
|
||||
<!-- รายละเอียด -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.pervent="onRedirectToDetail('view', props.row.id)"
|
||||
|
|
@ -282,6 +298,7 @@ onMounted(() => {
|
|||
|
||||
<!-- ทำสำเนาคำสั่ง -->
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.pervent="onCopy(props.row.id)"
|
||||
|
|
@ -303,7 +320,8 @@ onMounted(() => {
|
|||
v-if="
|
||||
store.tabsMain !== 'WAITING' &&
|
||||
store.tabsMain !== 'CANCEL' &&
|
||||
store.tabsMain !== 'REPORTED'
|
||||
store.tabsMain !== 'REPORTED' &&
|
||||
checkPermission($route)?.attrIsDelete
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -324,9 +342,12 @@ onMounted(() => {
|
|||
|
||||
<!-- ดึงไปทำคำสั่งใหม่ แสดงแค่ Tabs ยกเลิก -->
|
||||
<q-item
|
||||
v-if="
|
||||
store.tabsMain === 'CANCEL' &&
|
||||
checkPermission($route)?.attrIsCreate
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
v-if="store.tabsMain === 'CANCEL'"
|
||||
@click.pervent="onReCommand(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
|
|
@ -340,7 +361,10 @@ onMounted(() => {
|
|||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
v-if="store.tabsMain === 'CANCEL'"
|
||||
v-if="
|
||||
store.tabsMain === 'CANCEL' &&
|
||||
checkPermission($route)?.attrIsDelete
|
||||
"
|
||||
@click.pervent="onDeleteCommand(props.row.id)"
|
||||
>
|
||||
<q-item-section>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
import { reactive, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useCommandListStore } from "@/modules/18_command/store/ListStore";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { ItemTabs } from "@/modules/18_command/interface/index/Main";
|
||||
import type { FormQuery } from "@/modules/18_command/interface/request/Main";
|
||||
|
|
@ -101,6 +102,7 @@ async function fetchListCommand() {
|
|||
</datepicker>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue