mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
perf: 优化应用菜单
This commit is contained in:
parent
a562bfdb08
commit
a3649c04e2
@ -288,10 +288,10 @@ export default {
|
|||||||
this.userSelectOptions.value = params.value
|
this.userSelectOptions.value = params.value
|
||||||
delete params.value
|
delete params.value
|
||||||
this.userSelectOptions.config = params
|
this.userSelectOptions.config = params
|
||||||
return await new Promise(resolve => {
|
return await new Promise((resolve, reject) => {
|
||||||
this.$refs.userSelect.onSelection((res) => {
|
this.$refs.userSelect.onSelection((res) => {
|
||||||
return resolve(res)
|
resolve(res)
|
||||||
})
|
}, reject)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
nextZIndex: () => {
|
nextZIndex: () => {
|
||||||
|
|||||||
@ -328,6 +328,7 @@ export default {
|
|||||||
values: [],
|
values: [],
|
||||||
selects: [],
|
selects: [],
|
||||||
callback: null,
|
callback: null,
|
||||||
|
closeCallback: null,
|
||||||
|
|
||||||
recents: [],
|
recents: [],
|
||||||
contacts: [],
|
contacts: [],
|
||||||
@ -373,6 +374,7 @@ export default {
|
|||||||
this.upTitleWidth()
|
this.upTitleWidth()
|
||||||
} else {
|
} else {
|
||||||
this.searchKey = ""
|
this.searchKey = ""
|
||||||
|
this.closeCallback && this.closeCallback()
|
||||||
}
|
}
|
||||||
this.$emit("on-show-change", v)
|
this.$emit("on-show-change", v)
|
||||||
//
|
//
|
||||||
@ -764,13 +766,14 @@ export default {
|
|||||||
}, this.searchCache.length > 0 ? 300 : 0)
|
}, this.searchCache.length > 0 ? 300 : 0)
|
||||||
},
|
},
|
||||||
|
|
||||||
onSelection(callback = null) {
|
onSelection(callback = null, closeCallback = null) {
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$nextTick(_ => {
|
this.$nextTick(_ => {
|
||||||
this.selects = $A.cloneJSON(this.values)
|
this.selects = $A.cloneJSON(this.values)
|
||||||
this.callback = typeof callback === 'function' ? callback : null
|
this.callback = typeof callback === 'function' ? callback : null
|
||||||
|
this.closeCallback = typeof closeCallback === 'function' ? closeCallback : null
|
||||||
this.showModal = true
|
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) => {
|
filterMicroAppsMenus: (state) => {
|
||||||
return state.microAppsMenus.filter(item => {
|
return state.microAppsMenus.filter(item => {
|
||||||
if (item.only_admin === true && !state.userIsAdmin) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return item.location === 'application'
|
return item.location === 'application'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -303,9 +300,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
filterMicroAppsMenusAdmin: (state) => {
|
filterMicroAppsMenusAdmin: (state) => {
|
||||||
return state.microAppsMenus.filter(item => {
|
return state.microAppsMenus.filter(item => {
|
||||||
if (item.only_admin === true && !state.userIsAdmin) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return item.location === 'application/admin'
|
return item.location === 'application/admin'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -319,9 +313,6 @@ export default {
|
|||||||
*/
|
*/
|
||||||
filterMicroAppsMenusMain: (state) => {
|
filterMicroAppsMenusMain: (state) => {
|
||||||
return state.microAppsMenus.filter(item => {
|
return state.microAppsMenus.filter(item => {
|
||||||
if (item.only_admin === true && !state.userIsAdmin) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return item.location === 'main/menu'
|
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) {
|
'microApps/data': function(state, data) {
|
||||||
// 添加应用商店
|
// 添加应用商店
|
||||||
data.unshift({
|
if (state.userIsAdmin) {
|
||||||
id: 'appstore',
|
data.unshift({
|
||||||
version: '1.0.0',
|
id: 'appstore',
|
||||||
menu_items: [{
|
version: '1.0.0',
|
||||||
location: "application/admin",
|
menu_items: [{
|
||||||
label: $A.L("应用商店"),
|
location: "application/admin",
|
||||||
icon: $A.mainUrl("images/application/appstore.svg"),
|
label: $A.L("应用商店"),
|
||||||
url: 'appstore/internal?language={system_lang}&theme={system_theme}',
|
icon: $A.mainUrl("images/application/appstore.svg"),
|
||||||
only_admin: true,
|
url: 'appstore/internal?language={system_lang}&theme={system_theme}',
|
||||||
disable_scope_css: true,
|
disable_scope_css: true,
|
||||||
auto_dark_theme: false,
|
auto_dark_theme: false,
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
}
|
||||||
// 找出已卸载的应用和版本更新的应用
|
// 找出已卸载的应用和版本更新的应用
|
||||||
const updatedOrUninstalledApps = state.microAppsInstalled
|
const updatedOrUninstalledApps = state.microAppsInstalled
|
||||||
.filter((oldApp) => !data.some((newApp) => newApp.id === oldApp.id))
|
.filter((oldApp) => !data.some((newApp) => newApp.id === oldApp.id))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user