chore: demo
This commit is contained in:
parent
b68d746fdd
commit
1c8c1848be
@ -1,12 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
import type { Recordable } from '@vben/types';
|
||||||
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
|
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { Page, useVbenDrawer, useVbenModal } from '@vben/common-ui';
|
import { Page, useVbenDrawer, useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
import { Card, Table } from 'ant-design-vue';
|
import { Card, Space, Table } from 'ant-design-vue';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter';
|
import { useVbenForm } from '#/adapter';
|
||||||
import { roleList } from '#/api/system/role';
|
import { roleList } from '#/api/system/role';
|
||||||
@ -43,7 +44,7 @@ function handleAdd() {
|
|||||||
drawerApi.open();
|
drawerApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns: ColumnsType = [
|
||||||
{
|
{
|
||||||
dataIndex: 'roleName',
|
dataIndex: 'roleName',
|
||||||
title: '角色名称',
|
title: '角色名称',
|
||||||
@ -69,6 +70,7 @@ const columns = [
|
|||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align: 'center',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
},
|
},
|
||||||
@ -107,16 +109,14 @@ function handleAuthEdit(record: Recordable<any>) {
|
|||||||
<Table :columns="columns" :data-source="dataSource">
|
<Table :columns="columns" :data-source="dataSource">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
|
<Space>
|
||||||
<a-button size="small" type="primary" @click="handleEdit(record)">
|
<a-button size="small" type="primary" @click="handleEdit(record)">
|
||||||
编辑
|
编辑
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button size="small" @click="handleAuthEdit(record)">
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAuthEdit(record)"
|
|
||||||
>
|
|
||||||
数据权限
|
数据权限
|
||||||
</a-button>
|
</a-button>
|
||||||
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
Loading…
Reference in New Issue
Block a user