สิทธิ์ / rating เปลี่ยนเป็น btn group
This commit is contained in:
parent
c6d4f5f0e3
commit
006a492834
22 changed files with 2248 additions and 2718 deletions
|
|
@ -95,6 +95,10 @@ async function onViewDetail(id: string) {
|
|||
router.push(`/masterdata/competency/${id}`);
|
||||
}
|
||||
|
||||
async function onViewDetailPage(id: string) {
|
||||
router.push(`/masterdata/competency-detail/${id}`);
|
||||
}
|
||||
|
||||
function deleteData(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
http
|
||||
|
|
@ -229,6 +233,20 @@ onMounted(() => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-eye"
|
||||
clickable
|
||||
@click.stop="onViewDetailPage(props.row.id)"
|
||||
v-close-popup
|
||||
>
|
||||
<q-tooltip>รายละเอียด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import type {
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const total = ref<number>();
|
||||
const modal = ref<boolean>(false);
|
||||
const rows = ref<any[]>([]);
|
||||
|
|
@ -204,7 +206,14 @@ onMounted(async () => {
|
|||
|
||||
<template>
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-btn flat round color="primary" icon="add" @click="onAdd()">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="add"
|
||||
@click="onAdd()"
|
||||
>
|
||||
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -268,6 +277,7 @@ onMounted(async () => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -281,6 +291,7 @@ onMounted(async () => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -299,7 +310,6 @@ onMounted(async () => {
|
|||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
{{ col.value }}
|
||||
</q-td>
|
||||
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import type {
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const total = ref<number>();
|
||||
const id = ref<string>("");
|
||||
const modal = ref<boolean>(false);
|
||||
|
|
@ -343,7 +345,14 @@ onMounted(async () => {
|
|||
|
||||
<template>
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-btn flat round color="primary" icon="add" @click="onAdd()">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsCreate"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="add"
|
||||
@click="onAdd()"
|
||||
>
|
||||
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -398,7 +407,7 @@ onMounted(async () => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th auto-width v-if="checkPermission($route)?.attrIsUpdate || 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>
|
||||
|
|
@ -406,8 +415,9 @@ onMounted(async () => {
|
|||
</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)?.attrIsUpdate || checkPermission($route)?.attrIsDelete ">
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
flat
|
||||
dense
|
||||
|
|
@ -421,6 +431,7 @@ onMounted(async () => {
|
|||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataLevel = ref<any>();
|
||||
const { showLoader, hideLoader, success } = useCounterMixin();
|
||||
|
|
@ -92,6 +94,7 @@ onMounted(() => {
|
|||
>
|
||||
<template #control>
|
||||
<q-editor
|
||||
:readonly="checkPermission($route)?.attrIsUpdate == false"
|
||||
class="full-width"
|
||||
v-model="field.description"
|
||||
:dense="$q.screen.lt.md"
|
||||
|
|
@ -151,7 +154,7 @@ onMounted(() => {
|
|||
<q-separator />
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
<q-btn v-if="checkPermission($route)?.attrIsUpdate" label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import Main from "@/modules/01_masterdata/components/competency/Forms/Main.vue";
|
||||
|
||||
|
|
@ -10,8 +10,10 @@ import type { DataOption } from "@/modules/01_masterdata/interface/index/Main";
|
|||
import type { FormCompetency } from "@/modules/01_masterdata/interface/request/Main";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const store = useKPIDataStore();
|
||||
|
||||
const checkRoute = ref<boolean>(route.name == "KPICompetencyDetailByid");
|
||||
const formData = reactive<FormCompetency>({
|
||||
competencyType: "",
|
||||
competencyName: "",
|
||||
|
|
@ -82,13 +84,17 @@ function onSubmit() {
|
|||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
<span class="toptitle text-dark">เพิ่ม/แก้ไขสมรรถนะ</span>
|
||||
|
||||
<span class="toptitle text-dark">{{
|
||||
checkRoute ? "รายละเอียดสมรรถนะ" : "เพิ่ม/แก้ไขสมรรถนะ"
|
||||
}}</span>
|
||||
</div>
|
||||
<q-card>
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<q-select
|
||||
:readonly="checkRoute"
|
||||
v-model="store.competencyTypeVal"
|
||||
outlined
|
||||
label="เลือกประเภทสมรรถนะ"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const router = useRouter();
|
|||
const route = useRoute();
|
||||
const store = useKPIDataStore();
|
||||
|
||||
const checkRoute = ref<boolean>(route.name == "KPICompetencyDetailByid");
|
||||
const competencyId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
);
|
||||
|
|
@ -110,6 +111,7 @@ onMounted(() => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
:readonly="checkRoute"
|
||||
v-model="formData.competencyName"
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -132,6 +134,7 @@ onMounted(() => {
|
|||
>
|
||||
<template #control>
|
||||
<q-editor
|
||||
:readonly="checkRoute"
|
||||
class="full-width"
|
||||
v-model="formData.definition"
|
||||
:dense="$q.screen.lt.md"
|
||||
|
|
@ -174,6 +177,7 @@ onMounted(() => {
|
|||
<div class="row items-center">
|
||||
<div class="col-1">
|
||||
<q-btn
|
||||
v-if="!checkRoute"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -230,6 +234,7 @@ onMounted(() => {
|
|||
>
|
||||
<template #control>
|
||||
<q-editor
|
||||
:readonly="checkRoute"
|
||||
class="full-width"
|
||||
v-model="formData.levels[index].description"
|
||||
:dense="$q.screen.lt.md"
|
||||
|
|
@ -258,7 +263,7 @@ onMounted(() => {
|
|||
color="red"
|
||||
icon="delete"
|
||||
@click="onDeleteLevels(index)"
|
||||
v-if="
|
||||
v-if="!checkRoute &&
|
||||
(store.competencyTypeVal === 'HEAD' && index > 4) ||
|
||||
(store.competencyTypeVal === 'GROUP' && index > 4) ||
|
||||
((store.competencyTypeVal === 'EXECUTIVE' ||
|
||||
|
|
@ -282,7 +287,13 @@ onMounted(() => {
|
|||
<div class="col-12"><q-separator /></div>
|
||||
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="public" class="q-px-md" type="submit">
|
||||
<q-btn
|
||||
v-if="!checkRoute"
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
class="q-px-md"
|
||||
type="submit"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const competencyPage = () =>
|
|||
import("@/modules/01_masterdata/views/competency.vue");
|
||||
const competencyAddPage = () =>
|
||||
import("@/modules/01_masterdata/components/competency/AddPage.vue");
|
||||
const competencyDetailPage = () =>
|
||||
import("@/modules/01_masterdata/components/competency/AddPage.vue");
|
||||
const StrategicView = () =>
|
||||
import("@/modules/01_masterdata/views/Strategic.vue");
|
||||
const AssignmentView = () =>
|
||||
|
|
@ -115,6 +117,16 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/masterdata/competency-detail/:id",
|
||||
name: "KPICompetencyDetailByid",
|
||||
component: competencyDetailPage,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: "SYS_EVA_COMPETENCY",
|
||||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
path: "/masterdata/strategic",
|
||||
|
|
|
|||
|
|
@ -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