Pre Merge pull request !38 from 玲娜贝er/dev

This commit is contained in:
玲娜贝er 2025-05-16 02:07:35 +00:00 committed by Gitee
commit 5ea6db07ff
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 32 additions and 7 deletions

View File

@ -1,3 +1,10 @@
# 1.3.6
**BUG FIX**
- oss配置switch切换 导致报错`存储类型找不到`
- 文件上传无法正确清除(innerList)
# 1.3.5 # 1.3.5
**BUG FIX** **BUG FIX**

View File

@ -1,6 +1,6 @@
{ {
"name": "@vben/web-antd", "name": "@vben/web-antd",
"version": "1.3.5", "version": "1.3.6",
"homepage": "https://vben.pro", "homepage": "https://vben.pro",
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
"repository": { "repository": {

View File

@ -40,6 +40,7 @@ export function ossConfigChangeStatus(data: any) {
const requestData = { const requestData = {
ossConfigId: data.ossConfigId, ossConfigId: data.ossConfigId,
status: data.status, status: data.status,
configKey: data.configKey,
}; };
return requestClient.putWithMsg(Api.ossConfigChangeStatus, requestData); return requestClient.putWithMsg(Api.ossConfigChangeStatus, requestData);
} }

View File

@ -322,6 +322,8 @@ export function useUpload(
() => bindValue.value, () => bindValue.value,
async (value) => { async (value) => {
if (value.length === 0) { if (value.length === 0) {
// 清空绑定值时同时清空innerFileList避免外部使用时还能读取到
innerFileList.value = [];
return; return;
} }

View File

@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) {
// 记录已经加载的页面 // 记录已经加载的页面
const loadedPaths = new Set<string>(); const loadedPaths = new Set<string>();
router.beforeEach(async (to) => { router.beforeEach((to) => {
to.meta.loaded = loadedPaths.has(to.path); to.meta.loaded = loadedPaths.has(to.path);
// 页面加载进度条 // 页面加载进度条

View File

@ -40,8 +40,8 @@ export function useTabs() {
await tabbarStore.toggleTabPin(tab || route); await tabbarStore.toggleTabPin(tab || route);
} }
async function refreshTab() { async function refreshTab(name?: string) {
await tabbarStore.refresh(router); await tabbarStore.refresh(name || router);
} }
async function openTabInNewWindow(tab?: RouteLocationNormalized) { async function openTabInNewWindow(tab?: RouteLocationNormalized) {

View File

@ -158,7 +158,7 @@ export function useTabbar() {
}, },
{ {
disabled: disabledRefresh, disabled: disabledRefresh,
handler: refreshTab, handler: () => refreshTab(),
icon: RotateCw, icon: RotateCw,
key: 'reload', key: 'reload',
text: $t('preferences.tabbar.contextMenu.reload'), text: $t('preferences.tabbar.contextMenu.reload'),

View File

@ -334,7 +334,13 @@ export const useTabbarStore = defineStore('core-tabbar', {
/** /**
* *
*/ */
async refresh(router: Router) { async refresh(router: Router | string) {
// 如果是Router路由那么就根据当前路由刷新
// 如果是string字符串为路由名称则定向刷新指定标签页不能是当前路由名称否则不会刷新
if (typeof router === 'string') {
return await this.refreshByName(router);
}
const { currentRoute } = router; const { currentRoute } = router;
const { name } = currentRoute.value; const { name } = currentRoute.value;
@ -349,6 +355,15 @@ export const useTabbarStore = defineStore('core-tabbar', {
stopProgress(); stopProgress();
}, },
/**
*
*/
async refreshByName(name: string) {
this.excludeCachedTabs.add(name);
await new Promise((resolve) => setTimeout(resolve, 200));
this.excludeCachedTabs.delete(name);
},
/** /**
* @zh_CN * @zh_CN
*/ */

View File

@ -18,7 +18,7 @@ function setupCommonGuard(router: Router) {
// 记录已经加载的页面 // 记录已经加载的页面
const loadedPaths = new Set<string>(); const loadedPaths = new Set<string>();
router.beforeEach(async (to) => { router.beforeEach((to) => {
to.meta.loaded = loadedPaths.has(to.path); to.meta.loaded = loadedPaths.has(to.path);
// 页面加载进度条 // 页面加载进度条