feat: okr1.1 兼容开发

This commit is contained in:
weifashi 2023-12-11 15:17:43 +08:00
parent 6bed109f97
commit 66b9e7e9b3
4 changed files with 61 additions and 13 deletions

View File

@ -5,18 +5,18 @@
<Loading/>
</div>
</transition>
<micro-app v-if="url && !loading"
:name='name'
:url='url'
inline
<micro-app v-if="url && !loading"
:name='name'
:url='url'
inline
keep-alive
disableSandbox
disableSandbox
:data='appData'
@created='handleCreate'
@beforemount='handleBeforeMount'
@mounted='handleMount'
@created='handleCreate'
@beforemount='handleBeforeMount'
@mounted='handleMount'
@unmount='handleUnmount'
@error='handleError'
@error='handleError'
@datachange='handleDataChange'
></micro-app>
</div>
@ -94,7 +94,7 @@ export default {
},
'$route': {
handler(to) {
if(to.name == 'manage-apps'){
if(to.name == 'manage-apps' || to.name == 'single-apps'){
this.appData = {
path: to.hash || to.fullPath
}
@ -136,7 +136,8 @@ export default {
languageType,
},
userInfo: this.userInfo,
path: this.path
path: this.path,
electron: this.$Electron
}
}
},
@ -172,4 +173,4 @@ export default {
}
}
}
</script>
</script>

View File

@ -37,4 +37,4 @@ export default {
}
}
}
</script>
</script>

View File

@ -0,0 +1,42 @@
<template>
<div class="electron-single-micro-apps">
<MicroApps :url="appUrl" :path="path" v-if="!loading && $route.name == 'single-apps'" />
</div>
</template>
<script>
import MicroApps from "../../components/MicroApps.vue";
export default {
components: { MicroApps },
data() {
return {
loading: false,
appUrl: '',
path: '',
}
},
deactivated() {
this.loading = true;
},
watch: {
'$route': {
handler(to) {
this.loading = true;
if (to.name == 'single-apps') {
this.$nextTick(() => {
this.loading = false;
this.appUrl = import.meta.env.VITE_OKR_WEB_URL || $A.apiUrl("../apps/okr")
this.path = this.$route.query.path || '';
})
}else{
this.appUrl = '';
}
},
immediate: true
}
}
}
</script>

View File

@ -148,6 +148,11 @@ export default [
path: '/single/task/:taskId',
component: () => import('./pages/single/task.vue'),
},
{
name: 'single-apps',
path: '/single/apps/*',
component: () => import('./pages/single/apps.vue')
},
{
name: 'valid-email',
path: '/single/valid/email',