Skip to content

Commit

Permalink
fix: 🐛修复某些权限码传参错误
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed Dec 15, 2021
1 parent 5538d38 commit 47071ef
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 121 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@

`rootadmin` 默认开放多点登录,其他新建的账号默认都是单点登录。建议自己拉后端代码到本地跑,避免多人同时操作时产生冲突和误解。

### todolist

- [x] 动态表格(完善中)
- [x] 动态表单(完善中)
- [ ] 电商 SKU 功能演示
- [ ] 纯前端导出 PDF 动态分页
- [ ] 其他...

## Project setup

```shell
Expand All @@ -30,7 +38,7 @@ yarn install
yarn --frozen-lockfile
```

## 捐赠
## 赞赏

如果你觉得这个项目对你有帮助,你可以帮作者买一杯咖啡表示支持!

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@types/lodash": "^4.14.178",
"@types/node": "^16.11.12",
"@types/node": "^16.11.13",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"@vitejs/plugin-legacy": "^1.6.4",
Expand Down
2 changes: 1 addition & 1 deletion src/core/permission/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TreeDataItem as ATreeDataItem } from 'ant-design-vue/lib/tree/Tree';

interface TreeDataItem extends ATreeDataItem {
export interface TreeDataItem extends ATreeDataItem {
children: any;
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/system/permission/menu/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const getColumns = (columnParams: ColumnsParams): TableColumn<TableListIt
{
label: '编辑',
auth: {
perm: 'sys/menu/delete',
perm: 'sys/menu/update',
effect: 'disable',
},
onClick: () => openMenuModal(record),
Expand Down
4 changes: 3 additions & 1 deletion src/views/system/permission/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
:scroll="{ x: 2000 }"
>
<template #toolbar>
<a-button type="primary" @click="openMenuModal({})"> 新增 </a-button>
<a-button type="primary" :disabled="!$auth('sys/menu/add')" @click="openMenuModal({})">
新增
</a-button>
</template>
</DynamicTable>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/views/system/permission/role/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
size="small"
>
<template #toolbar>
<a-button type="primary" @click="openMenuModal({})"> 新增 </a-button>
<a-button type="primary" :disabled="!$auth('sys/role/add')" @click="openMenuModal({})">
新增
</a-button>
</template>
</DynamicTable>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/views/system/permission/user/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ export const getColumns = (columnParams: ColumnsParams): TableColumn<TableListIt
{
label: '编辑',
auth: {
perm: 'sys/user/delete',
perm: 'sys/user/update',
effect: 'disable',
},
onClick: () => openUserModal(record),
},
{
label: '改密',
auth: 'sys/user/update',
auth: 'sys/user/password',
onClick: () => openUpdatePasswordModal(record),
},
{
Expand Down
30 changes: 21 additions & 9 deletions src/views/system/permission/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="flex justify-between">
<div>组织架构</div>
<Space>
<Tooltip placement="top">
<Tooltip v-if="$auth('sys/dept/add')" placement="top">
<template #title>新增部门 </template>
<PlusOutlined @click="openDeptModal({})" />
</Tooltip>
Expand All @@ -24,12 +24,18 @@
<Dropdown :trigger="['contextmenu']">
<span>{{ title }}</span>
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="openDeptModal(formData)">
<Menu>
<Menu.Item
key="1"
:disabled="!$auth('sys/dept/update')"
@click="openDeptModal(formData)"
>
编辑 <EditOutlined />
</Menu.Item>
<a-menu-item key="2" :disabled="!$auth('sys/dept/delete')" @click="delDept(key)">
删除 <DeleteOutlined />
</a-menu-item>
<a-menu-item key="2" @click="delDept(key)"> 删除 <DeleteOutlined /> </a-menu-item>
</a-menu>
</Menu>
</template>
</Dropdown>
</template>
Expand All @@ -53,13 +59,19 @@
</Alert>
</template>
<template #toolbar>
<a-button type="primary" @click="openUserModal({})"> <PlusOutlined /> 新增 </a-button>
<a-button type="success" :disabled="!isCheckRows" @click="openTransferUserModal">
<a-button type="primary" :disabled="!$auth('sys/user/add')" @click="openUserModal({})">
<PlusOutlined /> 新增
</a-button>
<a-button
type="success"
:disabled="!isCheckRows || !$auth('sys/dept/transfer')"
@click="openTransferUserModal"
>
<SwapOutlined /> 转移
</a-button>
<a-button
type="danger"
:disabled="!isCheckRows"
:disabled="!isCheckRows || !$auth('sys/user/delete')"
@click="delRowConfirm(rowSelection.selectedRowKeys)"
>
<DeleteOutlined /> 删除
Expand All @@ -76,7 +88,7 @@

<script setup lang="tsx">
import { ref, reactive, computed } from 'vue';
import { Tree, Dropdown, Space, Tooltip, Modal, Alert } from 'ant-design-vue';
import { Tree, Dropdown, Space, Tooltip, Modal, Alert, Menu } from 'ant-design-vue';
import {
SyncOutlined,
PlusOutlined,
Expand Down
Loading

0 comments on commit 47071ef

Please sign in to comment.