🐛 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
*感谢作者@willnewii
*/

View File

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

View File

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

View File

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

View File

@ -54,7 +54,7 @@ export default createRouter({
{
path: '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?',