mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 11:08:13 -05:00
🐛 Fix: fix some bugs of manage page
This commit is contained in:
parent
e56bd78096
commit
6f40c0912e
@ -1,4 +1,4 @@
|
||||
ea/*
|
||||
/*
|
||||
*UI布局和部分样式代码参考了https://github.com/willnewii/qiniuClient
|
||||
*感谢作者@willnewii
|
||||
*/
|
||||
|
@ -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'
|
||||
}
|
||||
)
|
||||
|
@ -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 () {
|
||||
|
@ -1160,4 +1160,3 @@ export default {
|
||||
color #ddd
|
||||
margin-bottom 10px
|
||||
</style>
|
||||
@/apis
|
||||
|
@ -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?',
|
||||
|
Loading…
Reference in New Issue
Block a user