perf: 优化应用菜单

This commit is contained in:
kuaifan 2025-07-30 08:32:19 +08:00
parent a562bfdb08
commit a3649c04e2
4 changed files with 21 additions and 26 deletions

View File

@ -288,10 +288,10 @@ export default {
this.userSelectOptions.value = params.value
delete params.value
this.userSelectOptions.config = params
return await new Promise(resolve => {
return await new Promise((resolve, reject) => {
this.$refs.userSelect.onSelection((res) => {
return resolve(res)
})
resolve(res)
}, reject)
})
},
nextZIndex: () => {

View File

@ -328,6 +328,7 @@ export default {
values: [],
selects: [],
callback: null,
closeCallback: null,
recents: [],
contacts: [],
@ -373,6 +374,7 @@ export default {
this.upTitleWidth()
} else {
this.searchKey = ""
this.closeCallback && this.closeCallback()
}
this.$emit("on-show-change", v)
//
@ -764,13 +766,14 @@ export default {
}, this.searchCache.length > 0 ? 300 : 0)
},
onSelection(callback = null) {
onSelection(callback = null, closeCallback = null) {
if (this.disabled) {
return
}
this.$nextTick(_ => {
this.selects = $A.cloneJSON(this.values)
this.callback = typeof callback === 'function' ? callback : null
this.closeCallback = typeof closeCallback === 'function' ? closeCallback : null
this.showModal = true
})
},

View File

@ -287,9 +287,6 @@ export default {
*/
filterMicroAppsMenus: (state) => {
return state.microAppsMenus.filter(item => {
if (item.only_admin === true && !state.userIsAdmin) {
return false
}
return item.location === 'application'
})
},
@ -303,9 +300,6 @@ export default {
*/
filterMicroAppsMenusAdmin: (state) => {
return state.microAppsMenus.filter(item => {
if (item.only_admin === true && !state.userIsAdmin) {
return false
}
return item.location === 'application/admin'
})
},
@ -319,9 +313,6 @@ export default {
*/
filterMicroAppsMenusMain: (state) => {
return state.microAppsMenus.filter(item => {
if (item.only_admin === true && !state.userIsAdmin) {
return false
}
return item.location === 'main/menu'
})
}

View File

@ -337,6 +337,7 @@ export default {
'microApps/data': function(state, data) {
// 添加应用商店
if (state.userIsAdmin) {
data.unshift({
id: 'appstore',
version: '1.0.0',
@ -345,11 +346,11 @@ export default {
label: $A.L("应用商店"),
icon: $A.mainUrl("images/application/appstore.svg"),
url: 'appstore/internal?language={system_lang}&theme={system_theme}',
only_admin: true,
disable_scope_css: true,
auto_dark_theme: false,
}]
})
}
// 找出已卸载的应用和版本更新的应用
const updatedOrUninstalledApps = state.microAppsInstalled
.filter((oldApp) => !data.some((newApp) => newApp.id === oldApp.id))