set permission menu master data of evaluation

This commit is contained in:
Warunee Tamkoo 2024-08-05 10:20:48 +07:00
parent a0ebb23f1f
commit d1be4b077b
17 changed files with 322 additions and 508 deletions

View file

@ -3,7 +3,7 @@ import { ref, onMounted, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
@ -20,6 +20,7 @@ import { checkPermission } from "@/utils/permissions";
const total = ref<number>();
const store = useKPIDataStore();
const router = useRouter();
const route = useRoute();
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogRemove, messageError, showLoader, hideLoader, success } = mixin;
@ -143,7 +144,7 @@ watch(
);
onMounted(() => {
fetchList();
if (checkPermission(route)?.attrIsList) fetchList();
});
</script>
@ -231,7 +232,7 @@ onMounted(() => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsGet"
@ -239,7 +240,6 @@ onMounted(() => {
flat
dense
round
size="12px"
icon="mdi-eye"
clickable
@click.stop="onViewDetailPage(props.row.id)"
@ -248,18 +248,20 @@ onMounted(() => {
<q-tooltip>รายละเอยด</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
color="edit"
flat
dense
round
size="12px"
icon="edit"
clickable
@click.stop="onViewDetail(props.row.id)"
v-close-popup
>
<q-tooltip>แกไข</q-tooltip>
<q-tooltip>แกไขอม</q-tooltip>
</q-btn>
<q-btn
v-if="checkPermission($route)?.attrIsDelete"
@ -267,7 +269,6 @@ onMounted(() => {
flat
dense
round
size="12px"
icon="mdi-delete"
clickable
@click.stop="deleteData(props.row.id)"

View file

@ -14,36 +14,38 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { checkPermission } from "@/utils/permissions";
import { useRoute } from "vue-router";
const total = ref<number>();
const modal = ref<boolean>(false);
const rows = ref<any[]>([]);
const groupName = ref<string>("");
const route = useRoute();
const editStatus = ref<boolean>(false);
const editId = ref<string>("");
const competencyTypeOp = ref<DataOption[]>([
{
id: "ID1",
name: "สมรรถนะหลัก",
},
{
id: "ID2",
name: "สมรรถนะประจำกลุ่มงาน",
},
{
id: "ID3",
name: "สมรรถนะประจำผู้บริหารกรุงเทพมหานคร",
},
{
id: "ID4",
name: "สมรรถนะเฉพาะสำหรับตำแหน่ง ผอ.เขต ผช.ผอ.เขต และหัวหน้าฝ่ายในสังกัด สนง.เขต",
},
{
id: "ID5",
name: "สมรรถนะเฉพาะสำหรับตำแหน่งผู้ตรวจราชการ กทม. และผู้ตรวจราชการ",
},
]);
// const competencyTypeOp = ref<DataOption[]>([
// {
// id: "ID1",
// name: "",
// },
// {
// id: "ID2",
// name: "",
// },
// {
// id: "ID3",
// name: "",
// },
// {
// id: "ID4",
// name: " . .. .",
// },
// {
// id: "ID5",
// name: " . ",
// },
// ]);
const columns = ref<QTableProps["columns"]>([
{
name: "nameGroupKPI",
@ -200,7 +202,7 @@ watch(
);
onMounted(async () => {
fetchData();
if (checkPermission(route)?.attrIsList) fetchData();
});
</script>
@ -274,16 +276,18 @@ onMounted(async () => {
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-tr :props="props">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
color="edit"
flat
dense
round
class="q-mr-xs"
size="12px"
icon="edit"
clickable
@click="onEdit(props.row)"
@ -296,7 +300,6 @@ onMounted(async () => {
flat
dense
round
size="12px"
icon="mdi-delete"
clickable
@click.stop="
@ -355,7 +358,9 @@ onMounted(async () => {
class="q-px-md items-center"
color="public"
label="บันทึก"
/>
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>

View file

@ -3,7 +3,7 @@ import { ref, onMounted, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useRoute, useRouter } from "vue-router";
import Header from "@/components/DialogHeader.vue";
@ -24,6 +24,7 @@ const editStatus = ref<boolean>(false);
const groupName = ref<any>();
const position = ref<any>();
const competency = ref<any>();
const route = useRoute();
const groupNameOp = ref<DataOption[]>([]);
const groupNameOpMain = ref<DataOption[]>([]);
@ -339,7 +340,7 @@ watch(
);
onMounted(async () => {
getData();
if (checkPermission(route)?.attrIsList) getData();
});
</script>
@ -407,23 +408,25 @@ onMounted(async () => {
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th auto-width v-if="checkPermission($route)?.attrIsUpdate || checkPermission($route)?.attrIsDelete "/>
<q-th auto-width />
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td auto-width v-if="checkPermission($route)?.attrIsUpdate || checkPermission($route)?.attrIsDelete ">
<q-tr :props="props">
<q-td auto-width>
<q-btn
v-if="checkPermission($route)?.attrIsUpdate"
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
color="edit"
flat
dense
round
class="q-mr-xs"
size="12px"
icon="edit"
clickable
@click="onEdit(props.row.id)"
@ -436,7 +439,6 @@ onMounted(async () => {
flat
dense
round
size="12px"
icon="mdi-delete"
clickable
@click.stop="
@ -589,7 +591,9 @@ onMounted(async () => {
class="q-px-md items-center"
color="public"
label="บันทึก"
/>
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>

View file

@ -7,9 +7,11 @@ import config from "@/app.config";
import { useQuasar } from "quasar";
import { checkPermission } from "@/utils/permissions";
import { useRoute } from "vue-router";
const $q = useQuasar();
const dataLevel = ref<any>();
const route = useRoute();
const { showLoader, hideLoader, success } = useCounterMixin();
const fieldLabels = {
score5: "5",
@ -64,7 +66,7 @@ function getData() {
});
}
onMounted(() => {
getData();
if (checkPermission(route)?.attrIsGet) getData();
});
</script>
@ -94,7 +96,9 @@ onMounted(() => {
>
<template #control>
<q-editor
:readonly="checkPermission($route)?.attrIsUpdate == false"
:readonly="
checkPermission($route)?.attrIsUpdate == false
"
class="full-width"
v-model="field.description"
:dense="$q.screen.lt.md"
@ -154,9 +158,17 @@ onMounted(() => {
<q-separator />
<q-card-actions align="right">
<q-btn v-if="checkPermission($route)?.attrIsUpdate" label="บันทึก" color="secondary" type="submit"
><q-tooltip>นทกขอม</q-tooltip></q-btn
<q-btn
v-if="
checkPermission($route)?.attrIsGet &&
checkPermission($route)?.attrIsUpdate
"
label="บันทึก"
color="secondary"
type="submit"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</q-form>
</q-card>