mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2026-01-12 09:55:57 +08:00
Compare commits
3 Commits
v1.3.4
...
d5fa33d7fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5fa33d7fe | ||
|
|
a8f923eb38 | ||
|
|
d6973a4c9d |
@@ -111,6 +111,7 @@ pnpm build
|
||||
|
||||
## Ecosystem
|
||||
|
||||
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): SoybeanAdmin based version of React.
|
||||
- [electron-mock-admin](https://github.com/lixin59/electron-mock-api): A Mock Api management system that helps front-end developers quickly implement interface mocks.
|
||||
- [T-Shell](https://github.com/TheBlindM/T-Shell): A terminal emulator and SSH client with configurable command prompts.
|
||||
- [pea](https://github.com/haitang1894/pea) : Adopting SpringBoot3.2 + JDK21, MyBatis-Plus, SpringSecurity security framework, etc., suitable for the simple permission system developed by [soybean-admin](https://gitee.com/honghuangdc/soybean-admin).
|
||||
|
||||
@@ -109,6 +109,7 @@ pnpm build
|
||||
|
||||
## 周边生态
|
||||
|
||||
- [react-soybean-admin](https://github.com/mufeng889/react-soybean-admin): 基于SoybeanAdmin的React版本.
|
||||
- [electron-mock-admin](https://github.com/lixin59/electron-mock-api): 一个 Mock Api 管理系统,帮助前端开发伙伴快速实现接口的 mock。
|
||||
- [T-Shell](https://github.com/TheBlindM/T-Shell): 是一个可配置命令提示的终端模拟器和 SSH 客户端。
|
||||
- [pea](https://github.com/haitang1894/pea) : 采用SpringBoot3.2 + JDK21、MyBatis-Plus、SpringSecurity安全框架等,适配 [soybean-admin](https://gitee.com/honghuangdc/soybean-admin) 开发的简单权限系统。
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watchEffect } from 'vue';
|
||||
import { useAuth } from '@/hooks/business/auth';
|
||||
import { $t } from '@/locales';
|
||||
|
||||
defineOptions({
|
||||
@@ -9,9 +11,21 @@ interface Props {
|
||||
itemAlign?: NaiveUI.Align;
|
||||
disabledDelete?: boolean;
|
||||
loading?: boolean;
|
||||
showAdd?: boolean;
|
||||
addCode?: string; // Button Add Permission Code
|
||||
showDelete?: boolean;
|
||||
deleteCode?: string; // Button Delete Permission Code
|
||||
}
|
||||
|
||||
defineProps<Props>();
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
itemAlign: 'center',
|
||||
disabledDelete: false,
|
||||
loading: false,
|
||||
showAdd: true,
|
||||
addCode: '',
|
||||
showDelete: true,
|
||||
deleteCode: ''
|
||||
});
|
||||
|
||||
interface Emits {
|
||||
(e: 'add'): void;
|
||||
@@ -19,6 +33,17 @@ interface Emits {
|
||||
(e: 'refresh'): void;
|
||||
}
|
||||
|
||||
const { hasAuth } = useAuth();
|
||||
|
||||
const showAddButton = ref(false);
|
||||
const showDeleteButton = ref(false);
|
||||
|
||||
// Monitor changes in permission codes and update the display status of buttons
|
||||
watchEffect(() => {
|
||||
showAddButton.value = props.showAdd && (!props.addCode || hasAuth(props.addCode));
|
||||
showDeleteButton.value = props.showDelete && (!props.deleteCode || hasAuth(props.deleteCode));
|
||||
});
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
const columns = defineModel<NaiveUI.TableColumnCheck[]>('columns', {
|
||||
@@ -42,13 +67,13 @@ function refresh() {
|
||||
<NSpace :align="itemAlign" wrap justify="end" class="lt-sm:w-200px">
|
||||
<slot name="prefix"></slot>
|
||||
<slot name="default">
|
||||
<NButton size="small" ghost type="primary" @click="add">
|
||||
<NButton v-if="showAddButton" size="small" ghost type="primary" @click="add">
|
||||
<template #icon>
|
||||
<icon-ic-round-plus class="text-icon" />
|
||||
</template>
|
||||
{{ $t('common.add') }}
|
||||
</NButton>
|
||||
<NPopconfirm @positive-click="batchDelete">
|
||||
<NPopconfirm v-if="showDeleteButton" @positive-click="batchDelete">
|
||||
<template #trigger>
|
||||
<NButton size="small" ghost type="error" :disabled="disabledDelete">
|
||||
<template #icon>
|
||||
|
||||
Reference in New Issue
Block a user