mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-29 22:56:41 +08:00
Merge branch 'example' into feature/gavin/example
* example: feat(projects): 添加插件示例:剪贴板 docs(projects): update CHANGELOG chore(projects): release v1.1.0-beta.2 fix(projects): fix menu data when role is changed. fixed #391 feat(projects): useTable adds expand to display # Conflicts: # src/locales/langs/en-us.ts # src/locales/langs/zh-cn.ts # src/router/elegant/imports.ts # src/router/elegant/routes.ts # src/router/elegant/transform.ts # src/typings/elegant-router.d.ts
This commit is contained in:
commit
fa7db5d4d2
25
CHANGELOG.md
25
CHANGELOG.md
@ -1,6 +1,31 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## [v1.1.0-beta.2](https://github.com/honghuangdc/soybean-admin/compare/v1.1.0-beta.1...v1.1.0-beta.2) (2024-05-07)
|
||||||
|
|
||||||
|
### 🚀 Features
|
||||||
|
|
||||||
|
- **projects**: useTable adds expand to display - by **paynezhuang** [<samp>(0a90d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/0a90dd3)
|
||||||
|
|
||||||
|
### 🐞 Bug Fixes
|
||||||
|
|
||||||
|
- **projects**:
|
||||||
|
- fix manage_menu modal style - by @honghuangdc [<samp>(60f3b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/60f3b14)
|
||||||
|
- fix menu data when role is changed. fixed #391 - by @honghuangdc in https://github.com/honghuangdc/soybean-admin/issues/391 [<samp>(3b47b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/3b47b5a)
|
||||||
|
|
||||||
|
### 🛠 Optimizations
|
||||||
|
|
||||||
|
- **projects**: remove deprecated code - by @honghuangdc [<samp>(72ccb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/72ccb6b)
|
||||||
|
|
||||||
|
### 📖 Documentation
|
||||||
|
|
||||||
|
- **projects**: add CHANGELOG.zh_CN.md - by @honghuangdc [<samp>(18b3f)</samp>](https://github.com/honghuangdc/soybean-admin/commit/18b3f05)
|
||||||
|
|
||||||
|
### ❤️ Contributors
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
[paynezhuang](mailto:paynezhuang@gmail.com)
|
||||||
|
|
||||||
## [v1.1.0-beta.1](https://github.com/soybeanjs/soybean-admin/compare/v1.0.9...v1.1.0-beta.1) (2024-05-07)
|
## [v1.1.0-beta.1](https://github.com/soybeanjs/soybean-admin/compare/v1.0.9...v1.1.0-beta.1) (2024-05-07)
|
||||||
|
|
||||||
### 🚀 Features
|
### 🚀 Features
|
||||||
|
@ -1,5 +1,30 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## [v1.1.0-beta.2](https://github.com/honghuangdc/soybean-admin/compare/v1.1.0-beta.1...v1.1.0-beta.2) (2024-05-07)
|
||||||
|
|
||||||
|
### 🚀 特性
|
||||||
|
|
||||||
|
- **项目**: useTable添加展开以显示 - 由 **paynezhuang** [<samp>(0a90d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/0a90dd3) 提供
|
||||||
|
|
||||||
|
### 🐞 修复的错误
|
||||||
|
|
||||||
|
- **项目**:
|
||||||
|
- 修复 manage_menu 模态样式 - 由 @honghuangdc [<samp>(60f3b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/60f3b14) 提供
|
||||||
|
- 当角色改变时修复菜单数据。修复了 #391 - 由 @honghuangdc 在 https://github.com/honghuangdc/soybean-admin/issues/391 [<samp>(3b47b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/3b47b5a) 提供
|
||||||
|
|
||||||
|
### 🛠 优化
|
||||||
|
|
||||||
|
- **项目**: 删除废弃的代码 - 由 @honghuangdc [<samp>(72ccb)</samp>](https://github.com/honghuangdc/soybean-admin/commit/72ccb6b) 提供
|
||||||
|
|
||||||
|
### 📖 文档
|
||||||
|
|
||||||
|
- **项目**: 添加 CHANGELOG.zh_CN.md - 由 @honghuangdc [<samp>(18b3f)</samp>](https://github.com/honghuangdc/soybean-admin/commit/18b3f05) 提供
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/honghuangdc)
|
||||||
|
[paynezhuang](mailto:paynezhuang@gmail.com)
|
||||||
|
|
||||||
|
|
||||||
## [v1.1.0-beta.1](https://github.com/soybeanjs/soybean-admin/compare/v1.0.9...v1.1.0-beta.1) (2024-05-07)
|
## [v1.1.0-beta.1](https://github.com/soybeanjs/soybean-admin/compare/v1.0.9...v1.1.0-beta.1) (2024-05-07)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Soybean",
|
"name": "Soybean",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color",
|
"name": "@sa/color",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/uno-preset",
|
"name": "@sa/uno-preset",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.1.0-beta.1",
|
"version": "1.1.0-beta.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@ -20,6 +20,8 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
|
|
||||||
const SELECTION_KEY = '__selection__';
|
const SELECTION_KEY = '__selection__';
|
||||||
|
|
||||||
|
const EXPAND_KEY = '__expand__';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
loading,
|
loading,
|
||||||
empty,
|
empty,
|
||||||
@ -68,6 +70,12 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
title: $t('common.check'),
|
title: $t('common.check'),
|
||||||
checked: true
|
checked: true
|
||||||
});
|
});
|
||||||
|
} else if (column.type === 'expand') {
|
||||||
|
checks.push({
|
||||||
|
key: EXPAND_KEY,
|
||||||
|
title: $t('common.expandColumn'),
|
||||||
|
checked: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -81,6 +89,8 @@ export function useTable<A extends NaiveUI.TableApiFn>(config: NaiveUI.NaiveTabl
|
|||||||
columnMap.set(column.key as string, column);
|
columnMap.set(column.key as string, column);
|
||||||
} else if (column.type === 'selection') {
|
} else if (column.type === 'selection') {
|
||||||
columnMap.set(SELECTION_KEY, column);
|
columnMap.set(SELECTION_KEY, column);
|
||||||
|
} else if (column.type === 'expand') {
|
||||||
|
columnMap.set(EXPAND_KEY, column);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ const local: App.I18n.Schema = {
|
|||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
close: 'Close',
|
close: 'Close',
|
||||||
check: 'Check',
|
check: 'Check',
|
||||||
|
expandColumn: 'Expand Column',
|
||||||
columnSetting: 'Column Setting',
|
columnSetting: 'Column Setting',
|
||||||
config: 'Config',
|
config: 'Config',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
@ -179,7 +180,8 @@ const local: App.I18n.Schema = {
|
|||||||
exception_500: '500',
|
exception_500: '500',
|
||||||
'plugins-example': 'Plugin-Example',
|
'plugins-example': 'Plugin-Example',
|
||||||
'plugins-example_charts': 'Charts',
|
'plugins-example_charts': 'Charts',
|
||||||
'plugins-example_charts_echarts': 'ECharts'
|
'plugins-example_charts_echarts': 'ECharts',
|
||||||
|
'plugins-example_copy': 'copy'
|
||||||
},
|
},
|
||||||
page: {
|
page: {
|
||||||
login: {
|
login: {
|
||||||
|
@ -11,6 +11,7 @@ const local: App.I18n.Schema = {
|
|||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
close: '关闭',
|
close: '关闭',
|
||||||
check: '勾选',
|
check: '勾选',
|
||||||
|
expandColumn: '展开列',
|
||||||
columnSetting: '列设置',
|
columnSetting: '列设置',
|
||||||
config: '配置',
|
config: '配置',
|
||||||
confirm: '确认',
|
confirm: '确认',
|
||||||
@ -179,7 +180,8 @@ const local: App.I18n.Schema = {
|
|||||||
exception_500: '500',
|
exception_500: '500',
|
||||||
'plugins-example': '插件示例',
|
'plugins-example': '插件示例',
|
||||||
'plugins-example_charts': '图表',
|
'plugins-example_charts': '图表',
|
||||||
'plugins-example_charts_echarts': 'ECharts'
|
'plugins-example_charts_echarts': 'ECharts',
|
||||||
|
'plugins-example_copy': '剪贴板'
|
||||||
},
|
},
|
||||||
page: {
|
page: {
|
||||||
login: {
|
login: {
|
||||||
|
@ -37,5 +37,6 @@ export const views: Record<LastLevelRouteKey, RouteComponent | (() => Promise<Ro
|
|||||||
"multi-menu_first_child": () => import("@/views/multi-menu/first_child/index.vue"),
|
"multi-menu_first_child": () => import("@/views/multi-menu/first_child/index.vue"),
|
||||||
"multi-menu_second_child_home": () => import("@/views/multi-menu/second_child_home/index.vue"),
|
"multi-menu_second_child_home": () => import("@/views/multi-menu/second_child_home/index.vue"),
|
||||||
"plugins-example_charts_echarts": () => import("@/views/plugins-example/charts_echarts/index.vue"),
|
"plugins-example_charts_echarts": () => import("@/views/plugins-example/charts_echarts/index.vue"),
|
||||||
|
"plugins-example_copy": () => import("@/views/plugins-example/copy/index.vue"),
|
||||||
"user-center": () => import("@/views/user-center/index.vue"),
|
"user-center": () => import("@/views/user-center/index.vue"),
|
||||||
};
|
};
|
||||||
|
@ -362,6 +362,15 @@ export const generatedRoutes: GeneratedRoute[] = [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'plugins-example_copy',
|
||||||
|
path: '/plugins-example/copy',
|
||||||
|
component: 'view.plugins-example_copy',
|
||||||
|
meta: {
|
||||||
|
title: 'plugins-example_copy',
|
||||||
|
i18nKey: 'route.plugins-example_copy'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -186,6 +186,7 @@ const routeMap: RouteMap = {
|
|||||||
"plugins-example": "/plugins-example",
|
"plugins-example": "/plugins-example",
|
||||||
"plugins-example_charts": "/plugins-example/charts",
|
"plugins-example_charts": "/plugins-example/charts",
|
||||||
"plugins-example_charts_echarts": "/plugins-example/charts/echarts",
|
"plugins-example_charts_echarts": "/plugins-example/charts/echarts",
|
||||||
|
"plugins-example_copy": "/plugins-example/copy",
|
||||||
"user-center": "/user-center"
|
"user-center": "/user-center"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
|||||||
const constantRoutes = shallowRef<ElegantConstRoute[]>([]);
|
const constantRoutes = shallowRef<ElegantConstRoute[]>([]);
|
||||||
|
|
||||||
function addConstantRoutes(routes: ElegantConstRoute[]) {
|
function addConstantRoutes(routes: ElegantConstRoute[]) {
|
||||||
const constantRoutesMap = new Map(constantRoutes.value.map(route => [route.name, route]));
|
const constantRoutesMap = new Map<string, ElegantConstRoute>([]);
|
||||||
|
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
constantRoutesMap.set(route.name, route);
|
constantRoutesMap.set(route.name, route);
|
||||||
@ -69,7 +69,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
|||||||
const authRoutes = shallowRef<ElegantConstRoute[]>([]);
|
const authRoutes = shallowRef<ElegantConstRoute[]>([]);
|
||||||
|
|
||||||
function addAuthRoutes(routes: ElegantConstRoute[]) {
|
function addAuthRoutes(routes: ElegantConstRoute[]) {
|
||||||
const authRoutesMap = new Map(authRoutes.value.map(route => [route.name, route]));
|
const authRoutesMap = new Map<string, ElegantConstRoute>([]);
|
||||||
|
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
authRoutesMap.set(route.name, route);
|
authRoutesMap.set(route.name, route);
|
||||||
|
1
src/typings/app.d.ts
vendored
1
src/typings/app.d.ts
vendored
@ -261,6 +261,7 @@ declare namespace App {
|
|||||||
cancel: string;
|
cancel: string;
|
||||||
close: string;
|
close: string;
|
||||||
check: string;
|
check: string;
|
||||||
|
expandColumn: string;
|
||||||
columnSetting: string;
|
columnSetting: string;
|
||||||
config: string;
|
config: string;
|
||||||
confirm: string;
|
confirm: string;
|
||||||
|
2
src/typings/elegant-router.d.ts
vendored
2
src/typings/elegant-router.d.ts
vendored
@ -60,6 +60,7 @@ declare module "@elegant-router/types" {
|
|||||||
"plugins-example": "/plugins-example";
|
"plugins-example": "/plugins-example";
|
||||||
"plugins-example_charts": "/plugins-example/charts";
|
"plugins-example_charts": "/plugins-example/charts";
|
||||||
"plugins-example_charts_echarts": "/plugins-example/charts/echarts";
|
"plugins-example_charts_echarts": "/plugins-example/charts/echarts";
|
||||||
|
"plugins-example_copy": "/plugins-example/copy";
|
||||||
"user-center": "/user-center";
|
"user-center": "/user-center";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -156,6 +157,7 @@ declare module "@elegant-router/types" {
|
|||||||
| "multi-menu_first_child"
|
| "multi-menu_first_child"
|
||||||
| "multi-menu_second_child_home"
|
| "multi-menu_second_child_home"
|
||||||
| "plugins-example_charts_echarts"
|
| "plugins-example_charts_echarts"
|
||||||
|
| "plugins-example_copy"
|
||||||
| "user-center"
|
| "user-center"
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
31
src/views/plugins-example/copy/index.vue
Normal file
31
src/views/plugins-example/copy/index.vue
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useClipboard } from '@vueuse/core';
|
||||||
|
|
||||||
|
const source = ref('');
|
||||||
|
const { copy, isSupported } = useClipboard();
|
||||||
|
|
||||||
|
function handleCopy() {
|
||||||
|
if (!isSupported) {
|
||||||
|
window.$message?.error('您的浏览器不支持Clipboard API');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!source.value) {
|
||||||
|
window.$message?.error('请输入要复制的内容');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
copy(source.value);
|
||||||
|
window.$message?.success(`复制成功:${source.value}`);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="h-full">
|
||||||
|
<NCard title="文本复制" :bordered="false" class="h-full rounded-8px shadow-sm">
|
||||||
|
<NInputGroup>
|
||||||
|
<NInput v-model:value="source" placeholder="请输入要复制的内容吧" />
|
||||||
|
<NButton type="primary" @click="handleCopy">复制</NButton>
|
||||||
|
</NInputGroup>
|
||||||
|
</NCard>
|
||||||
|
</div>
|
||||||
|
</template>
|
Loading…
Reference in New Issue
Block a user