feat:优化资源缓存

This commit is contained in:
weifashi 2023-08-02 17:04:52 +08:00
parent d3182f278f
commit 7eef3e7989
5 changed files with 34 additions and 17 deletions

View File

@ -1250,5 +1250,5 @@ Markdown 格式发送
退出 退出
会议组件加载失败! 会议组件加载失败!
OkR管理 OKR管理
OkR结果分析 OKR结果分析

View File

@ -9,7 +9,6 @@
:name='name' :name='name'
:url='url' :url='url'
inline inline
destroy
keep-alive keep-alive
disableSandbox disableSandbox
:data='appData' :data='appData'
@ -68,7 +67,11 @@ export default {
this.loading = true; this.loading = true;
this.$nextTick(() => { this.$nextTick(() => {
this.loading = false; this.loading = false;
this.appUrl = val let url = $A.apiUrl(val)
if (url.indexOf('http') == -1) {
url = window.location.origin + url
}
this.appUrl = import.meta.env.VITE_OKR_WEB_URL || url
}) })
}, },
path(val) { path(val) {
@ -80,6 +83,16 @@ export default {
}, },
deep: true, deep: true,
}, },
'$route': {
handler(to) {
if(to.name == 'manage-apps'){
this.appData = {
path: to.hash
}
}
},
immediate: true,
},
}, },
computed: { computed: {
...mapState([ ...mapState([

View File

@ -85,7 +85,7 @@ export default {
[ [
{icon: '', name: 'workReport', label: '工作报告'}, {icon: '', name: 'workReport', label: '工作报告'},
{icon: '', name: 'approve', label: '审批中心'}, {icon: '', name: 'approve', label: '审批中心'},
{icon: '', name: 'okrManage', label: 'OkR管理'}, {icon: '', name: 'okrManage', label: 'OKR管理'},
] ]
], ],
@ -101,7 +101,7 @@ export default {
} }
if (this.userIsAdmin) { if (this.userIsAdmin) {
this.navMore[2].splice(0, 0, {icon: '', name: 'allUser', label: '团队管理'}) this.navMore[2].splice(0, 0, {icon: '', name: 'allUser', label: '团队管理'})
this.navMore[2].push({icon: '', name: 'okrAnalyze', label: 'OkR结果分析'}) this.navMore[2].push({icon: '', name: 'okrAnalyze', label: 'OKR结果分析'})
} }
}, },

View File

@ -402,8 +402,6 @@ export default {
operateItem: {}, operateItem: {},
needStartHome: false, needStartHome: false,
okrUrl: import.meta.env.VITE_OKR_WEB_URL || $.apiUrl(location.origin + "/apps/okr")
} }
}, },
@ -477,6 +475,15 @@ export default {
return this.$route.name return this.$route.name
}, },
// okr
okrUrl() {
let url = $A.apiUrl("/apps/okr")
if (url.indexOf('http') == -1) {
url = window.location.origin + url
}
return import.meta.env.VITE_OKR_WEB_URL || url
},
/** /**
* 综合数未读提及待办 * 综合数未读提及待办
* @returns {string|string} * @returns {string|string}
@ -575,14 +582,14 @@ export default {
{path: 'team', name: '团队管理', divided: true}, {path: 'team', name: '团队管理', divided: true},
{path: 'approve', name: '审批中心'}, {path: 'approve', name: '审批中心'},
{path: 'okrManage', name: 'OkR管理'}, {path: 'okrManage', name: 'OKR管理'},
{path: 'okrAnalyze', name: 'OkR结果分析'}, {path: 'okrAnalyze', name: 'OKR结果分析'},
]) ])
} else { } else {
array.push(...[ array.push(...[
{path: 'personal', name: '个人设置', divided: true}, {path: 'personal', name: '个人设置', divided: true},
{path: 'approve', name: '审批中心'}, {path: 'approve', name: '审批中心'},
{path: 'okrManage', name: 'OkR管理'}, {path: 'okrManage', name: 'OKR管理'},
{path: 'version', name: '更新版本', divided: true, visible: !!this.clientNewVersion}, {path: 'version', name: '更新版本', divided: true, visible: !!this.clientNewVersion},
{path: 'workReport', name: '工作报告', divided: true}, {path: 'workReport', name: '工作报告', divided: true},
@ -793,9 +800,6 @@ export default {
case 'okrAnalyze': case 'okrAnalyze':
this.goForward({ this.goForward({
path:'/manage/apps/' + ( path == 'okrManage' ? '/#/list' : '/#/analysis'), path:'/manage/apps/' + ( path == 'okrManage' ? '/#/list' : '/#/analysis'),
query: {
baseUrl: this.okrUrl
}
}); });
return; return;
case 'logout': case 'logout':

View File

@ -26,11 +26,11 @@ export default {
this.loading = true; this.loading = true;
this.$nextTick(() => { this.$nextTick(() => {
this.loading = false; this.loading = false;
let url = $A.apiUrl(this.$route.query.baseUrl) let url = $A.apiUrl("/apps/okr")
if (url.indexOf('http') == -1) { if (url.indexOf('http') == -1) {
url = window.location.origin + url url = window.location.origin + url
} }
this.appUrl = url this.appUrl = import.meta.env.VITE_OKR_WEB_URL || url
this.path = this.$route.query.path || ''; this.path = this.$route.query.path || '';
}) })
} }