mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 优化应用菜单
This commit is contained in:
parent
a562bfdb08
commit
a3649c04e2
@ -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: () => {
|
||||
|
||||
@ -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
|
||||
})
|
||||
},
|
||||
|
||||
9
resources/assets/js/store/getters.js
vendored
9
resources/assets/js/store/getters.js
vendored
@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
27
resources/assets/js/store/mutations.js
vendored
27
resources/assets/js/store/mutations.js
vendored
@ -337,19 +337,20 @@ export default {
|
||||
|
||||
'microApps/data': function(state, data) {
|
||||
// 添加应用商店
|
||||
data.unshift({
|
||||
id: 'appstore',
|
||||
version: '1.0.0',
|
||||
menu_items: [{
|
||||
location: "application/admin",
|
||||
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,
|
||||
}]
|
||||
})
|
||||
if (state.userIsAdmin) {
|
||||
data.unshift({
|
||||
id: 'appstore',
|
||||
version: '1.0.0',
|
||||
menu_items: [{
|
||||
location: "application/admin",
|
||||
label: $A.L("应用商店"),
|
||||
icon: $A.mainUrl("images/application/appstore.svg"),
|
||||
url: 'appstore/internal?language={system_lang}&theme={system_theme}',
|
||||
disable_scope_css: true,
|
||||
auto_dark_theme: false,
|
||||
}]
|
||||
})
|
||||
}
|
||||
// 找出已卸载的应用和版本更新的应用
|
||||
const updatedOrUninstalledApps = state.microAppsInstalled
|
||||
.filter((oldApp) => !data.some((newApp) => newApp.id === oldApp.id))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user