สิทธิ์ / rating เปลี่ยนเป็น btn group
This commit is contained in:
parent
c6d4f5f0e3
commit
006a492834
22 changed files with 2248 additions and 2718 deletions
|
|
@ -16,6 +16,7 @@ import type { ResAssignment } from "@/modules/01_masterdata/interface/response/M
|
|||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -256,7 +257,7 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th auto-width v-if="checkPermission($route)?.attrIsGet || checkPermission($route)?.attrIsDelete"/>
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
|
|
@ -264,8 +265,9 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-td auto-width v-if="checkPermission($route)?.attrIsGet || checkPermission($route)?.attrIsDelete">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
|
|
@ -276,6 +278,7 @@ onMounted(() => {
|
|||
<q-tooltip>ดูข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import type { DataStrategic } from "@/modules/01_masterdata/interface/response/S
|
|||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
const $q = useQuasar();
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -198,6 +198,7 @@ onMounted(() => {
|
|||
<div class="row q-col-gutter-sm q-pl-sm">
|
||||
<q-toolbar class="text-primary">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -256,57 +257,64 @@ onMounted(() => {
|
|||
round
|
||||
>
|
||||
<q-menu>
|
||||
<q-list
|
||||
dense
|
||||
v-for="(item, index) in prop.node.level !== 4
|
||||
? ListMenu
|
||||
: ListMenu.slice(1, 4)"
|
||||
:key="index"
|
||||
style="min-width: 100px"
|
||||
>
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-item
|
||||
v-if="
|
||||
prop.node.level !== 4 &&
|
||||
checkPermission($route)?.attrIsCreate
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickAction(item.value, prop.node)"
|
||||
@click.stop="onClickAction('ADD', prop.node)"
|
||||
>
|
||||
<q-item-section avatar style="min-width: 20px">
|
||||
<q-icon
|
||||
size="17px"
|
||||
:color="item.color"
|
||||
:name="item.icon"
|
||||
/>
|
||||
<q-icon size="17px" :color="'primary'" :name="'add'" />
|
||||
</q-item-section>
|
||||
|
||||
<div v-if="item.value === 'ADD'">
|
||||
<q-item-section v-if="prop.node.level === 1">
|
||||
{{ `${item.label}ยุทธศาสตร์ที่ 1` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 2">
|
||||
{{ `${item.label}ยุทธศาสตร์ย่อย` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 3">
|
||||
{{ `${item.label}กลยุทธ์ที่/เป้าประสงค์` }}
|
||||
</q-item-section>
|
||||
</div>
|
||||
|
||||
<div v-else-if="item.value === 'EDIT'">
|
||||
<q-item-section v-if="prop.node.level === 1">
|
||||
{{ `${item.label}ยุทธศาสตร์/แผน` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 2">
|
||||
{{ `${item.label}ยุทธศาสตร์ที่` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 3">
|
||||
{{ `${item.label}ยุทธศาสตร์ย่อย` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 4">
|
||||
{{ `${item.label}กลยุทธ์ที่/เป้าประสงค์` }}
|
||||
</q-item-section>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<q-item-section>{{ item.label }}</q-item-section>
|
||||
</div>
|
||||
<q-item-section v-if="prop.node.level === 1">
|
||||
{{ `เพิ่มยุทธศาสตร์ที่ 1` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 2">
|
||||
{{ `เพิ่มยุทธศาสตร์ย่อย` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 3">
|
||||
{{ `เพิ่มกลยุทธ์ที่/เป้าประสงค์` }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickAction('EDIT', prop.node)"
|
||||
>
|
||||
<q-item-section avatar style="min-width: 20px">
|
||||
<q-icon size="17px" :color="'edit'" :name="'edit'" />
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 1">
|
||||
{{ `แก้ไขยุทธศาสตร์/แผน` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 2">
|
||||
{{ `แก้ไขยุทธศาสตร์ที่ 1` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 3">
|
||||
{{ `แก้ไขยุทธศาสตร์ย่อย` }}
|
||||
</q-item-section>
|
||||
<q-item-section v-if="prop.node.level === 4">
|
||||
{{ `แก้ไขกลยุทธ์ที่/เป้าประสงค์` }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop="onClickAction('DEL', prop.node)"
|
||||
>
|
||||
<q-item-section avatar style="min-width: 20px">
|
||||
<q-icon size="17px" :color="'red'" :name="'delete'" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ `ลบข้อมูล` }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogH
|
|||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
/** use*/
|
||||
const dataHistory = ref<any[]>([]);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
|
|
@ -329,6 +329,7 @@ onMounted(() => {
|
|||
</q-select>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -424,6 +425,7 @@ onMounted(() => {
|
|||
<q-menu>
|
||||
<q-list style="min-width: 180px">
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onClickAddOrView(true, props.row.id)"
|
||||
|
|
@ -443,6 +445,7 @@ onMounted(() => {
|
|||
<q-item-section>แก้ไขข้อมูล</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onClickHistory(props.row.id)"
|
||||
|
|
@ -458,6 +461,7 @@ onMounted(() => {
|
|||
<q-item-section>ประวัติการแก้ไข</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="deleteData(props.row.id)"
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import DialogHistory from "@/modules/01_masterdata/components/Indicators/DialogH
|
|||
|
||||
/** importStore*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
/** use*/
|
||||
const dataHistory = ref<any[]>([]);
|
||||
|
|
@ -330,6 +331,7 @@ onMounted(async () => {
|
|||
</q-select>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -429,6 +431,7 @@ onMounted(async () => {
|
|||
<q-menu>
|
||||
<q-list style="min-width: 180px">
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onClickAddOrView(true, props.row.id)"
|
||||
|
|
@ -448,6 +451,7 @@ onMounted(async () => {
|
|||
<q-item-section>แก้ไขข้อมูล</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onClickHistory(props.row.id)"
|
||||
|
|
@ -463,6 +467,7 @@ onMounted(async () => {
|
|||
<q-item-section>ประวัติการแก้ไข</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onClickDelete(props.row.id)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue