fix
This commit is contained in:
parent
7f3eb5225f
commit
4c35662eed
22 changed files with 632 additions and 343 deletions
|
|
@ -6,6 +6,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { usePermissionsStore } from "@/modules/02_users/stores/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -69,6 +70,15 @@ const expanded = ref<string[]>([]); // แสดงข้อมูลในโ
|
|||
const nodeId = ref<string>(""); // id โหนด
|
||||
|
||||
/** Table*/
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"posMasterNo",
|
||||
"positionName",
|
||||
"posTypeName",
|
||||
"posLevelName",
|
||||
"positionIsSelected",
|
||||
"authRoleName",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -277,6 +287,11 @@ async function fetchOrganizationActive() {
|
|||
* @param id id โครงสร้าง
|
||||
*/
|
||||
async function fetchDataTree(id: string) {
|
||||
const tokenParsedData = await tokenParsed();
|
||||
const isSuperAdmin = tokenParsedData.role.includes("SUPER_ADMIN");
|
||||
if (!isSuperAdmin) {
|
||||
nodes.value = [];
|
||||
}
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgByid(id.toString()))
|
||||
|
|
@ -284,6 +299,7 @@ async function fetchDataTree(id: string) {
|
|||
const data = await res.data.result;
|
||||
nodes.value.push(...data);
|
||||
nodes.value[0].orgRevisionId = id;
|
||||
nodeId.value = nodes.value[0].orgTreeId;
|
||||
await fetchDataTable(reqMaster.id, id, reqMaster.type);
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -622,6 +638,22 @@ onMounted(() => {
|
|||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
style="min-width: 140px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-toolbar>
|
||||
<d-table
|
||||
|
|
@ -636,6 +668,7 @@ onMounted(() => {
|
|||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
@update:pagination="updatePagination"
|
||||
v-model:pagination="pagination"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue