perf: 优化应用中心菜单排序

This commit is contained in:
Pang 2023-12-16 21:22:06 +08:00
parent dbb9162267
commit ab3a82300c

View File

@ -310,17 +310,22 @@ export default {
{value: "signin", label: "签到"}, {value: "signin", label: "签到"},
{value: "meeting", label: "会议"} {value: "meeting", label: "会议"}
]; ];
// wap if (this.windowOrientation == 'landscape') {
const appApplyList = this.windowOrientation != 'portrait' ? [ //
{value: "scan", label: "扫一扫", show: $A.isEEUiApp}, applyList.push({value: "scan", label: "扫一扫", show: $A.isEEUiApp})
] : [ } else {
{value: "calendar", label: "日历"}, //
{value: "file", label: "文件"}, applyList.unshift(...[
{value: "addProject", label: "创建项目"}, {value: "calendar", label: "日历"},
{value: "addTask", label: "添加任务"}, {value: "file", label: "文件"}
{value: "scan", label: "扫一扫", show: $A.isEEUiApp}, ])
{value: "setting", label: "设置"} applyList.push(...[
]; {value: "addProject", label: "创建项目"},
{value: "addTask", label: "添加任务"},
{value: "scan", label: "扫一扫", show: $A.isEEUiApp},
{value: "setting", label: "设置"}
])
}
// //
const adminApplyList = !this.userIsAdmin ? [] : [ const adminApplyList = !this.userIsAdmin ? [] : [
{value: "okrAnalyze", label: "OKR结果"}, {value: "okrAnalyze", label: "OKR结果"},
@ -333,7 +338,7 @@ export default {
return h; return h;
}); });
// //
this.applyList = [...applyList, ...appApplyList, ...adminApplyList]; this.applyList = [...applyList, ...adminApplyList];
}, },
getLogoPath(name) { getLogoPath(name) {
name = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); name = name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
@ -410,10 +415,10 @@ export default {
} }
}) })
if (dialogId) { if (dialogId) {
if (this.windowOrientation == 'portrait') { if (this.windowOrientation == 'landscape') {
this.$store.dispatch("openDialog", dialogId)
} else {
this.goForward({ name: 'manage-messenger', params: { dialog_id: dialogId } }); this.goForward({ name: 'manage-messenger', params: { dialog_id: dialogId } });
} else {
this.$store.dispatch("openDialog", dialogId)
} }
this.aibotShow = false; this.aibotShow = false;
} else { } else {
@ -428,7 +433,7 @@ export default {
return; return;
} }
this.$store.dispatch("openDialogUserid", data[0]?.dialog_user.userid).then(_ => { this.$store.dispatch("openDialogUserid", data[0]?.dialog_user.userid).then(_ => {
if (this.windowOrientation != 'portrait') { if (this.windowOrientation == 'landscape') {
this.goForward({ name: 'manage-messenger' }) this.goForward({ name: 'manage-messenger' })
} }
this.aibotShow = false; this.aibotShow = false;