🐛 Fix: fix some bugs of manage page

This commit is contained in:
萌萌哒赫萝 2023-08-12 06:40:11 -07:00
parent e56bd78096
commit 6f40c0912e
5 changed files with 27 additions and 30 deletions

View File

@ -1,4 +1,4 @@
ea/* /*
*UI布局和部分样式代码参考了https://github.com/willnewii/qiniuClient *UI布局和部分样式代码参考了https://github.com/willnewii/qiniuClient
*感谢作者@willnewii *感谢作者@willnewii
*/ */

View File

@ -317,22 +317,19 @@ const importedNewConfig: IStringKeyMap = {}
function ruleMap (options: IStringKeyMap) { function ruleMap (options: IStringKeyMap) {
const rule:any = {} const rule:any = {}
for (const key in options) { Object.keys(options).forEach((key) => {
const { options: itemOptions, configOptions } = options[key] const item = options[key].options
item.forEach((option: string) => {
for (const option of itemOptions) { const configOptions = options[key].configOptions[option]
const keyName = `${key}.${option}` const keyName = `${key}.${option}`
const configOption = configOptions[option] if (configOptions.rule) {
rule[keyName] = configOptions.rule
if (configOption.rule) {
rule[keyName] = configOption.rule
}
if (configOption.default) {
configResult[keyName] = configOption.default
}
} }
if (configOptions.default) {
configResult[keyName] = configOptions.default
} }
})
})
return rule return rule
} }
@ -483,16 +480,19 @@ const handleConfigReset = (name: string) => {
} }
const handleConfigRemove = (name: string) => { const handleConfigRemove = (name: string) => {
const commonNoticeConfig = {
title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'),
duration: 2000,
customClass: 'notification',
offset: 100
}
try { try {
removeConfig('picBed', name) removeConfig('picBed', name)
ElNotification( ElNotification(
{ {
title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'), ...commonNoticeConfig,
message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C')}${name}`, message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_C')}${name}`,
type: 'success', type: 'success',
duration: 2000,
customClass: 'notification',
offset: 100,
position: 'bottom-right' position: 'bottom-right'
} }
) )
@ -501,12 +501,9 @@ const handleConfigRemove = (name: string) => {
} catch (error) { } catch (error) {
ElNotification( ElNotification(
{ {
title: $T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_NAME'), ...commonNoticeConfig,
message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D')}${name}${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E')}`, message: `${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_D')}${name}${$T('MANAGE_LOGIN_PAGE_PANE_CONFIG_CHANGE_NOTICE_MESSAGE_E')}`,
type: 'error', type: 'error',
duration: 2000,
customClass: 'notification',
offset: 100,
position: 'bottom-right' position: 'bottom-right'
} }
) )

View File

@ -501,13 +501,14 @@ function switchPicBed (picBedAlias:string) {
allPicBedConfigure: JSON.stringify(allPicBedConfigure) allPicBedConfigure: JSON.stringify(allPicBedConfigure)
} }
}) })
} } else {
currentAlias.value = picBedAlias currentAlias.value = picBedAlias
currentPicBedName.value = allPicBedConfigure[picBedAlias].picBedName currentPicBedName.value = allPicBedConfigure[picBedAlias].picBedName
currentPagePicBedConfig = allPicBedConfigure[picBedAlias] currentPagePicBedConfig = allPicBedConfigure[picBedAlias]
picBedSwitchDialogVisible.value = false picBedSwitchDialogVisible.value = false
currentSelectedBucket.value = '' currentSelectedBucket.value = ''
getBucketList() getBucketList()
}
} }
function changePicBed () { function changePicBed () {

View File

@ -1160,4 +1160,3 @@ export default {
color #ddd color #ddd
margin-bottom 10px margin-bottom 10px
</style> </style>
@/apis

View File

@ -54,7 +54,7 @@ export default createRouter({
{ {
path: 'manage-login-page', path: 'manage-login-page',
name: config.MANAGE_LOGIN_PAGE, name: config.MANAGE_LOGIN_PAGE,
component: () => import(/* webpackChunkName: "ManageLogeinPage" */ '@/manage/pages/logIn.vue') component: () => import(/* webpackChunkName: "ManageLoginPage" */ '@/manage/pages/logIn.vue')
}, },
{ {
path: 'picbeds/:type/:configId?', path: 'picbeds/:type/:configId?',