fix: Disable
This commit is contained in:
parent
c33b218455
commit
a3ddff981a
2 changed files with 24 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -8,6 +9,7 @@ import { useRouter } from "vue-router";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { updateCurrentPage } from "@/utils/functions";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
import { usekeycloakPosition } from "@/stores/keycloakPosition";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -25,6 +27,7 @@ import DialogAddUser from "@/modules/02_users/components/Users/DialogFormUser.vu
|
|||
/** use*/
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const { dataPosition } = storeToRefs(usekeycloakPosition());
|
||||
const {
|
||||
dialogRemove,
|
||||
messageError,
|
||||
|
|
@ -71,6 +74,11 @@ const nodeTree = ref<Array<NodeTree>>([
|
|||
totalRootPositionNextVacant: 0,
|
||||
children: [] as NodeTree[],
|
||||
isOfficer: false,
|
||||
orgRootDnaId: "",
|
||||
orgChild1DnaId: "",
|
||||
orgChild2DnaId: "",
|
||||
orgChild3DnaId: "",
|
||||
orgChild4DnaId: "",
|
||||
},
|
||||
]);
|
||||
const lazy = ref(nodeTree);
|
||||
|
|
@ -428,6 +436,19 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ตรวจสอบการแสดงปุ่ม action
|
||||
* @param keycloakID keycloakID รหัสผู้ใช้งาน
|
||||
* @returns true หากผู้ใช้งานมีสิทธิ์ในการดำเนินการ
|
||||
*/
|
||||
function checkhideBtnAction(keycloakID: string) {
|
||||
if (dataPosition.value?.keycloak === keycloakID) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* hook ทำงานเมื่อมีการเรียกใช้งาน Components
|
||||
* ดึงข้อมูลรายชื่อผู้ใช้งาน
|
||||
|
|
@ -667,8 +688,9 @@ onMounted(async () => {
|
|||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkhideBtnAction(props.row.id)"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ watch(modal, async (val) => {
|
|||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
:disable="isAPIKey"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue