mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 02:40:23 +08:00
修复部门和角色树列表部分情况无法自动展开问题
This commit is contained in:
parent
90d09deeff
commit
5538d9b720
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="n-layout-page-header">
|
||||
<n-card :bordered="false" title="通知公告">
|
||||
在这里你可以发送通知、公告、私信到平台中的用户
|
||||
在这里,您可以向平台中的用户发送通知、公告和私信消息
|
||||
</n-card>
|
||||
</div>
|
||||
<n-card :bordered="false" class="proCard">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="n-layout-page-header">
|
||||
<n-card :bordered="false" title="我的消息">
|
||||
在这里你可以查看平台中通知、公告和与你相关的私信
|
||||
在这里,您可以方便地查看平台中的通知、公告和与您相关的私信消息
|
||||
</n-card>
|
||||
</div>
|
||||
<n-card :bordered="false" class="proCard">
|
||||
@ -13,9 +13,9 @@
|
||||
animated
|
||||
@before-leave="handleBeforeLeave"
|
||||
>
|
||||
<n-tab-pane name="1" tab="系统通知"> <List :type="defaultTab" /></n-tab-pane>
|
||||
<n-tab-pane name="2" tab="系统公告"> <List :type="defaultTab" /> </n-tab-pane>
|
||||
<n-tab-pane name="3" tab="私信消息"> <List :type="defaultTab" /> </n-tab-pane>
|
||||
<n-tab-pane name="1" tab="通知"> <List :type="defaultTab" /></n-tab-pane>
|
||||
<n-tab-pane name="2" tab="公告"> <List :type="defaultTab" /> </n-tab-pane>
|
||||
<n-tab-pane name="3" tab="私信"> <List :type="defaultTab" /> </n-tab-pane>
|
||||
</n-tabs>
|
||||
</n-card>
|
||||
</div>
|
||||
|
@ -25,6 +25,7 @@
|
||||
</n-space>
|
||||
|
||||
<n-data-table
|
||||
v-if="data.length > 0 || !loading"
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
:row-key="rowKey"
|
||||
@ -317,6 +318,10 @@
|
||||
return h(TableAction as any, {
|
||||
style: 'button',
|
||||
actions: [
|
||||
{
|
||||
label: '添加',
|
||||
onClick: handleAddSub.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
@ -341,6 +346,12 @@
|
||||
optionsDefaultValue.value = 0;
|
||||
}
|
||||
|
||||
function handleAddSub(record: Recordable) {
|
||||
showModal.value = true;
|
||||
formParams.value = cloneDeep(defaultState);
|
||||
optionsDefaultValue.value = record.id;
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
showModal.value = true;
|
||||
formParams.value = cloneDeep(record);
|
||||
|
@ -1,20 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="n-layout-page-header">
|
||||
<n-card :bordered="false" title="角色管理"> 在这里可以管理你权限下的角色权限</n-card>
|
||||
</div>
|
||||
<n-card :bordered="false" class="mt-4 proCard">
|
||||
<BasicTable
|
||||
:columns="columns"
|
||||
:request="loadDataTable"
|
||||
:row-key="(row) => row.id"
|
||||
ref="actionRef"
|
||||
:actionColumn="actionColumn"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
:pagination="false"
|
||||
:resizeHeightOffset="-20000"
|
||||
>
|
||||
<template #tableTitle>
|
||||
<n-card :bordered="false" title="角色管理">
|
||||
<n-space vertical :size="12">
|
||||
<n-space>
|
||||
<n-button type="primary" @click="addTable">
|
||||
<template #icon>
|
||||
<n-icon>
|
||||
@ -23,8 +11,18 @@
|
||||
</template>
|
||||
添加角色
|
||||
</n-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</n-space>
|
||||
|
||||
<n-data-table
|
||||
v-if="data.length > 0 || !loading"
|
||||
:columns="columns.concat(actionColumn)"
|
||||
:data="data"
|
||||
:row-key="(row) => row.id"
|
||||
:loading="loading"
|
||||
:resizeHeightOffset="-20000"
|
||||
default-expand-all
|
||||
/>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-modal v-model:show="showModal" :show-icon="false" preset="dialog" :title="editRoleTitle">
|
||||
@ -155,8 +153,8 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
import { useDialog, useMessage } from 'naive-ui';
|
||||
import { BasicColumn, BasicTable, TableAction } from '@/components/Table';
|
||||
import { NButton, useDialog, useMessage } from 'naive-ui';
|
||||
import { BasicColumn, TableAction } from '@/components/Table';
|
||||
import {
|
||||
Delete,
|
||||
Edit,
|
||||
@ -195,6 +193,8 @@
|
||||
const dataFormBtnLoading = ref(false);
|
||||
const showDataModal = ref(false);
|
||||
const dataForm = ref<any>();
|
||||
const loading = ref(false);
|
||||
const data = ref<any>([]);
|
||||
|
||||
const rules = {
|
||||
name: {
|
||||
@ -270,12 +270,18 @@
|
||||
});
|
||||
|
||||
const loadDataTable = async (res: any) => {
|
||||
return await getRoleList({ ...res, ...{ pageSize: 100, page: 1 } });
|
||||
loading.value = true;
|
||||
const tmp = await getRoleList({ ...res, ...{ pageSize: 100, page: 1 } });
|
||||
data.value = tmp?.list;
|
||||
if (data.value === undefined || data.value === null) {
|
||||
data.value = [];
|
||||
}
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
function onCheckedRow(rowKeys: any[]) {
|
||||
console.log(rowKeys);
|
||||
}
|
||||
onMounted(async () => {
|
||||
await loadDataTable({});
|
||||
});
|
||||
|
||||
function reloadTable() {
|
||||
actionRef.value.reload();
|
||||
|
Loading…
Reference in New Issue
Block a user