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/> <Loading/>
</div> </div>
</transition> </transition>
<micro-app v-if="url && !loading" <micro-app v-if="url && !loading"
:name='name' :name='name'
:url='url' :url='url'
inline inline
keep-alive keep-alive
disableSandbox disableSandbox
:data='appData' :data='appData'
@created='handleCreate' @created='handleCreate'
@beforemount='handleBeforeMount' @beforemount='handleBeforeMount'
@mounted='handleMount' @mounted='handleMount'
@unmount='handleUnmount' @unmount='handleUnmount'
@error='handleError' @error='handleError'
@datachange='handleDataChange' @datachange='handleDataChange'
></micro-app> ></micro-app>
</div> </div>
@ -94,7 +94,7 @@ export default {
}, },
'$route': { '$route': {
handler(to) { handler(to) {
if(to.name == 'manage-apps'){ if(to.name == 'manage-apps' || to.name == 'single-apps'){
this.appData = { this.appData = {
path: to.hash || to.fullPath path: to.hash || to.fullPath
} }
@ -136,7 +136,8 @@ export default {
languageType, languageType,
}, },
userInfo: this.userInfo, 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', path: '/single/task/:taskId',
component: () => import('./pages/single/task.vue'), component: () => import('./pages/single/task.vue'),
}, },
{
name: 'single-apps',
path: '/single/apps/*',
component: () => import('./pages/single/apps.vue')
},
{ {
name: 'valid-email', name: 'valid-email',
path: '/single/valid/email', path: '/single/valid/email',