chore: 悦码v1增加环境配置
This commit is contained in:
parent
eecc2b1893
commit
9b2c728d4c
@ -1,7 +1,6 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const apiBase = import.meta.env.VITE_BASE_API_URL;
|
const apiBase = import.meta.env.VITE_BASE_API_URL;
|
||||||
console.log('apiBase', apiBase);
|
|
||||||
|
|
||||||
// 创建独立实例
|
// 创建独立实例
|
||||||
const instance = axios.create({
|
const instance = axios.create({
|
||||||
|
@ -16,17 +16,12 @@ onMounted(async () => {
|
|||||||
url: ''
|
url: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
const handshake = new Postmate.Model({});
|
|
||||||
await handshake.then((parent) => {
|
|
||||||
parent.emit('sync-context', 'Hello, World!');
|
|
||||||
Object.assign(model, parent.model);
|
|
||||||
console.log('model', model);
|
|
||||||
const engine = new Engine({
|
const engine = new Engine({
|
||||||
container,
|
container,
|
||||||
service,
|
service,
|
||||||
project: {
|
project: {
|
||||||
id: model.applicationId,
|
id: 4,
|
||||||
name: model.name
|
name: 'test'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
widgetManager.set('Previewer', {
|
widgetManager.set('Previewer', {
|
||||||
@ -37,7 +32,29 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
// const handshake = new Postmate.Model({});
|
||||||
|
// await handshake.then((parent) => {
|
||||||
|
// parent.emit('sync-context', 'Hello, World!');
|
||||||
|
// Object.assign(model, parent.model);
|
||||||
|
// console.log('model', model);
|
||||||
|
// const engine = new Engine({
|
||||||
|
// container,
|
||||||
|
// service,
|
||||||
|
// project: {
|
||||||
|
// id: model.applicationId,
|
||||||
|
// name: model.name
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// widgetManager.set('Previewer', {
|
||||||
|
// props: {
|
||||||
|
// path: (block: any) => {
|
||||||
|
// const pathname = location.pathname;
|
||||||
|
// return `${pathname}#/preview/${block.id}`;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -14,3 +14,4 @@ VITE_DEBUG_MODE = true
|
|||||||
Y_CODE_PLATFORM_URL = 'https://localhost:10010/'
|
Y_CODE_PLATFORM_URL = 'https://localhost:10010/'
|
||||||
Y_CODE_DESIGNER_URL = 'https://localhost:10011/'
|
Y_CODE_DESIGNER_URL = 'https://localhost:10011/'
|
||||||
Y_CODE_RENDERER_URL = 'https://localhost:10012/'
|
Y_CODE_RENDERER_URL = 'https://localhost:10012/'
|
||||||
|
Y_CODE_V1_URL = 'https://localhost:10013/'
|
@ -9,3 +9,4 @@ VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
|
|||||||
Y_CODE_PLATFORM_URL = 'https://y-code-platform.shiyuegame.com/'
|
Y_CODE_PLATFORM_URL = 'https://y-code-platform.shiyuegame.com/'
|
||||||
Y_CODE_DESIGNER_URL = 'https://y-code-designer.shiyuegame.com/'
|
Y_CODE_DESIGNER_URL = 'https://y-code-designer.shiyuegame.com/'
|
||||||
Y_CODE_RENDERER_URL = 'https://y-code-renderer.shiyuegame.com/'
|
Y_CODE_RENDERER_URL = 'https://y-code-renderer.shiyuegame.com/'
|
||||||
|
Y_CODE_V1_URL = 'https://custom-chart.shiyuegame.com/'
|
@ -10,3 +10,4 @@ VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
|
|||||||
Y_CODE_PLATFORM_URL = 'https://y-code-platform-pre.shiyue.com/'
|
Y_CODE_PLATFORM_URL = 'https://y-code-platform-pre.shiyue.com/'
|
||||||
Y_CODE_DESIGNER_URL = 'https://y-code-designer-pre.shiyue.com/'
|
Y_CODE_DESIGNER_URL = 'https://y-code-designer-pre.shiyue.com/'
|
||||||
Y_CODE_RENDERER_URL = 'https://y-code-renderer-pre.shiyue.com/'
|
Y_CODE_RENDERER_URL = 'https://y-code-renderer-pre.shiyue.com/'
|
||||||
|
Y_CODE_V1_URL = 'https://custom-chart.shiyue.com/'
|
@ -29,9 +29,11 @@
|
|||||||
"@ant-design/icons-vue": "~7.0.1",
|
"@ant-design/icons-vue": "~7.0.1",
|
||||||
"@iconify/vue": "^4.3.0",
|
"@iconify/vue": "^4.3.0",
|
||||||
"@iframe-resizer/parent": "^5.3.3",
|
"@iframe-resizer/parent": "^5.3.3",
|
||||||
|
"@sy/unified-login": "1.0.29",
|
||||||
"@sy/y-code-renderer-adapter": "workspace:*",
|
"@sy/y-code-renderer-adapter": "workspace:*",
|
||||||
"@tanstack/query-core": "^5.66.4",
|
"@tanstack/query-core": "^5.66.4",
|
||||||
"@tanstack/vue-query": "^5.66.9",
|
"@tanstack/vue-query": "^5.66.9",
|
||||||
|
"@vue/runtime-core": "^3.5.13",
|
||||||
"@vueuse/core": "~11.1.0",
|
"@vueuse/core": "~11.1.0",
|
||||||
"ant-design-vue": "~4.2.6",
|
"ant-design-vue": "~4.2.6",
|
||||||
"axios": "~1.8.1",
|
"axios": "~1.8.1",
|
||||||
@ -51,11 +53,10 @@
|
|||||||
"vue": "~3.5.13",
|
"vue": "~3.5.13",
|
||||||
"vue-i18n": "^11.1.1",
|
"vue-i18n": "^11.1.1",
|
||||||
"vue-router": "~4.4.5",
|
"vue-router": "~4.4.5",
|
||||||
"vue-types": "~5.1.3",
|
"vue-types": "~6.0.0",
|
||||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||||
"wujie": "^1.0.25",
|
"wujie-vue3": "^1.0.25",
|
||||||
"xlsx": "~0.18.5",
|
"xlsx": "~0.18.5"
|
||||||
"@sy/unified-login": "1.0.29"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "~19.5.0",
|
"@commitlint/cli": "~19.5.0",
|
||||||
@ -63,9 +64,9 @@
|
|||||||
"@iconify-json/ant-design": "^1.2.5",
|
"@iconify-json/ant-design": "^1.2.5",
|
||||||
"@iconify-json/ep": "^1.2.2",
|
"@iconify-json/ep": "^1.2.2",
|
||||||
"@iconify/json": "^2.2.307",
|
"@iconify/json": "^2.2.307",
|
||||||
"@sy/y-code-designer": "workspace:*",
|
|
||||||
"@sy/low-code-shared": "workspace:*",
|
"@sy/low-code-shared": "workspace:*",
|
||||||
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
"@sy/vite-plugin-http2-proxy": "workspace:*",
|
||||||
|
"@sy/y-code-designer": "workspace:*",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/lodash-es": "~4.17.12",
|
"@types/lodash-es": "~4.17.12",
|
||||||
"@types/node": "~22.7.9",
|
"@types/node": "~22.7.9",
|
||||||
@ -75,8 +76,8 @@
|
|||||||
"@typescript-eslint/parser": "~8.11.0",
|
"@typescript-eslint/parser": "~8.11.0",
|
||||||
"@umijs/openapi": "^1.13.0",
|
"@umijs/openapi": "^1.13.0",
|
||||||
"@vitejs/plugin-vue": "~5.1.5",
|
"@vitejs/plugin-vue": "~5.1.5",
|
||||||
"@vitejs/plugin-vue-jsx": "~4.0.1",
|
"@vitejs/plugin-vue-jsx": "~4.1.1",
|
||||||
"@vue/tsconfig": "^0.5.1",
|
"@vue/tsconfig": "^0.7.0",
|
||||||
"commitizen": "~4.3.1",
|
"commitizen": "~4.3.1",
|
||||||
"conventional-changelog-cli": "~4.1.0",
|
"conventional-changelog-cli": "~4.1.0",
|
||||||
"cross-env": "~7.0.3",
|
"cross-env": "~7.0.3",
|
||||||
@ -91,9 +92,9 @@
|
|||||||
"lint-staged": "~15.2.11",
|
"lint-staged": "~15.2.11",
|
||||||
"msw": "^2.7.0",
|
"msw": "^2.7.0",
|
||||||
"postcss": "~8.4.49",
|
"postcss": "~8.4.49",
|
||||||
"postcss-html": "~1.7.0",
|
"postcss-html": "~1.8.0",
|
||||||
"postcss-less": "~6.0.0",
|
"postcss-less": "~6.0.0",
|
||||||
"prettier": "~3.3.3",
|
"prettier": "~3.5.3",
|
||||||
"rimraf": "~6.0.1",
|
"rimraf": "~6.0.1",
|
||||||
"stylelint": "~16.10.0",
|
"stylelint": "~16.10.0",
|
||||||
"stylelint-config-property-sort-order-smacss": "^10.0.0",
|
"stylelint-config-property-sort-order-smacss": "^10.0.0",
|
||||||
@ -102,7 +103,7 @@
|
|||||||
"stylelint-config-standard": "~36.0.1",
|
"stylelint-config-standard": "~36.0.1",
|
||||||
"stylelint-order": "~6.0.4",
|
"stylelint-order": "~6.0.4",
|
||||||
"stylelint-prettier": "^5.0.3",
|
"stylelint-prettier": "^5.0.3",
|
||||||
"typescript": "~5.6.3",
|
"typescript": "~5.8.2",
|
||||||
"unocss": "^65.5.0",
|
"unocss": "^65.5.0",
|
||||||
"unplugin-vue-components": "~0.27.5",
|
"unplugin-vue-components": "~0.27.5",
|
||||||
"vite": "~6.2.0",
|
"vite": "~6.2.0",
|
||||||
@ -111,8 +112,8 @@
|
|||||||
"vite-plugin-mkcert": "^1.17.6",
|
"vite-plugin-mkcert": "^1.17.6",
|
||||||
"vite-plugin-svg-icons": "~2.0.1",
|
"vite-plugin-svg-icons": "~2.0.1",
|
||||||
"vite-plugin-vue-inspector": "^5.3.1",
|
"vite-plugin-vue-inspector": "^5.3.1",
|
||||||
"vue-eslint-parser": "~9.4.3",
|
"vue-eslint-parser": "~10.1.1",
|
||||||
"vue-tsc": "~2.1.10"
|
"vue-tsc": "~2.2.8"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"vue",
|
"vue",
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { theme } from 'ant-design-vue';
|
import { theme } from 'ant-design-vue';
|
||||||
|
|
||||||
import { LockScreen } from '@/components/basic/lockscreen';
|
import { LockScreen } from '@/components/basic/lockscreen';
|
||||||
import { useRoute } from 'vue-router';
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
@ -1,21 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- <div id="container" /> -->
|
<!-- <div id="container" /> -->
|
||||||
<iframe
|
<!-- <iframe
|
||||||
ref="iframeRef"
|
ref="iframeRef"
|
||||||
width="100%"
|
width="100%"
|
||||||
style="border: none"
|
style="border: none"
|
||||||
height="100%"
|
height="100%"
|
||||||
:src="route.meta?.app?.url"
|
:src="route.meta?.app?.url"
|
||||||
/>
|
/> -->
|
||||||
<!-- <component :is="WujieVue" v-bind="route.meta?.app" /> -->
|
<WujieVue width="100%" height="100%" v-bind="route.meta?.app" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from 'vue';
|
import { onMounted } from 'vue';
|
||||||
import { setupApp, startApp } from 'wujie';
|
// import { setupApp, startApp } from 'wujie';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
import WujieVue from 'wujie-vue3';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
console.log(route.meta?.app);
|
// console.log(route.meta?.app);
|
||||||
// onMounted(() => {
|
// onMounted(() => {
|
||||||
// setupApp({
|
// setupApp({
|
||||||
// el: '#container',
|
// el: '#container',
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
// import { Spin, Alert, Button } from 'ant-design-vue';
|
// import { Spin, Alert, Button } from 'ant-design-vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const MAX_RETRIES = 3;
|
// const MAX_RETRIES = 3;
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const errorMessage = ref('');
|
const errorMessage = ref('');
|
||||||
const retryCount = ref(0);
|
// const retryCount = ref(0);
|
||||||
|
|
||||||
const initPostmate = async () => {
|
const initPostmate = async () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -21,7 +21,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const handle = new Postmate({
|
const connection = new Postmate({
|
||||||
container,
|
container,
|
||||||
url: route.meta?.app?.url,
|
url: route.meta?.app?.url,
|
||||||
name: 'y-code-renderer',
|
name: 'y-code-renderer',
|
||||||
@ -35,23 +35,27 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
handle
|
connection.then((child) => {
|
||||||
.then((instance) => {
|
console.log('Postmate 连接成功', child);
|
||||||
console.log('Postmate连接成功', instance);
|
child.on('some-event', (data) => console.log(data)); // Logs "Hello, World!"
|
||||||
retryCount.value = 0; // 重置重试计数器
|
child.call('sayHi', {
|
||||||
})
|
name: route.meta?.app?.name,
|
||||||
.catch((err) => {
|
|
||||||
retryCount.value++;
|
|
||||||
errorMessage.value = `连接失败: ${err.message}`;
|
|
||||||
if (retryCount.value < MAX_RETRIES) {
|
|
||||||
initPostmate(); // 自动重试
|
|
||||||
} else {
|
|
||||||
errorMessage.value = '已达到最大重试次数,请检查网络连接';
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// retryCount.value = 0; // 重置重试计数器
|
||||||
|
});
|
||||||
|
// .catch((err) => {
|
||||||
|
// retryCount.value++;
|
||||||
|
// errorMessage.value = `连接失败: ${err.message}`;
|
||||||
|
// if (retryCount.value < MAX_RETRIES) {
|
||||||
|
// initPostmate(); // 自动重试
|
||||||
|
// } else {
|
||||||
|
// errorMessage.value = '已达到最大重试次数,请检查网络连接';
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// loading.value = false;
|
||||||
|
// });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@ -60,18 +64,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="iframe-container">
|
|
||||||
<div id="low-code-adapter" />
|
<div id="low-code-adapter" />
|
||||||
|
|
||||||
<!-- <div v-if="loading" class="loading-overlay">
|
|
||||||
<Spin :tip="`正在连接应用(${retryCount + 1}/${MAX_RETRIES})`" />
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- <div v-if="errorMessage" class="error-overlay">
|
|
||||||
<Alert type="error" :message="errorMessage" show-icon />
|
|
||||||
<Button v-if="retryCount < MAX_RETRIES" @click="initPostmate">重新连接</Button>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -84,39 +77,8 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.iframe-container {
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#low-code-adapter {
|
#low-code-adapter {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 99%;
|
||||||
}
|
|
||||||
|
|
||||||
.loading-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: rgba(255, 255, 255, 0.8);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error-overlay {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: rgba(255, 255, 255, 0.8);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1001;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -14,3 +14,4 @@ export const isStagingMode = import.meta.env.MODE === stagingMode;
|
|||||||
export const Y_CODE_RENDERER_URL = currentEnv.Y_CODE_RENDERER_URL;
|
export const Y_CODE_RENDERER_URL = currentEnv.Y_CODE_RENDERER_URL;
|
||||||
export const Y_CODE_DESIGNER_URL = currentEnv.Y_CODE_DESIGNER_URL;
|
export const Y_CODE_DESIGNER_URL = currentEnv.Y_CODE_DESIGNER_URL;
|
||||||
export const Y_CODE_PLATFORM_URL = currentEnv.Y_CODE_PLATFORM_URL;
|
export const Y_CODE_PLATFORM_URL = currentEnv.Y_CODE_PLATFORM_URL;
|
||||||
|
export const Y_CODE_V1_URL = currentEnv.Y_CODE_V1_URL;
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
// export * from '@sy/low-code-shared/constants';
|
// export * from '@sy/low-code-shared/constants';
|
||||||
export * from './env';
|
export * from './env';
|
||||||
|
export * from './low-code';
|
||||||
|
2
apps/platform/src/constants/low-code.ts
Normal file
2
apps/platform/src/constants/low-code.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export const LOW_CODE_APPLICATION_ID = 0;
|
||||||
|
export const LOW_CODE_PROJECT_ID = 4;
|
@ -1,7 +1,6 @@
|
|||||||
import type { RouteRecordRaw } from 'vue-router';
|
import type { RouteRecordRaw } from 'vue-router';
|
||||||
import { Y_CODE_DESIGNER_URL } from '@/constants';
|
import { Y_CODE_DESIGNER_URL, Y_CODE_V1_URL } from '@/constants';
|
||||||
|
|
||||||
// 微前端路由
|
|
||||||
const moduleName = 'micro';
|
const moduleName = 'micro';
|
||||||
|
|
||||||
const routes: Array<RouteRecordRaw> = [
|
const routes: Array<RouteRecordRaw> = [
|
||||||
@ -18,54 +17,36 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
name: `${moduleName}-designer`,
|
name: `${moduleName}-designer`,
|
||||||
meta: {
|
meta: {
|
||||||
title: '低代码编辑器',
|
title: '低代码编辑器',
|
||||||
|
keepAlive: true,
|
||||||
icon: 'ant-design:edit-outlined',
|
icon: 'ant-design:edit-outlined',
|
||||||
app: {
|
app: {
|
||||||
url: Y_CODE_DESIGNER_URL,
|
url: Y_CODE_DESIGNER_URL,
|
||||||
name: 'y-code-designer',
|
name: 'y-code-designer',
|
||||||
applicationId: 4,
|
applicationId: 4,
|
||||||
// sync: true,
|
sync: true,
|
||||||
// alive: true,
|
alive: true,
|
||||||
// degrade: true,
|
degrade: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
component: () => import('@/components/renderer-adapter/index.vue'),
|
component: () => import('@/components/renderer-adapter/index.vue'),
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// path: 'renderer',
|
|
||||||
// name: `${moduleName}-renderer`,
|
|
||||||
// meta: {
|
|
||||||
// title: '低代码渲染器',
|
|
||||||
// keepAlive: true,
|
|
||||||
// // hideInMenu: true,
|
|
||||||
// icon: 'ant-design:eye-outlined',
|
|
||||||
// app: {
|
|
||||||
// url: 'https://localhost:10010',
|
|
||||||
// name: 'y-code-renderer',
|
|
||||||
// applicationId: 4,
|
|
||||||
// // sync: true,
|
|
||||||
// // alive: true,
|
|
||||||
// // degrade: true,
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// component: () => import('@/components/renderer-adapter/index.vue'),
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
path: 'y-code-v1',
|
path: 'y-code-v1',
|
||||||
name: `${moduleName}-y-code-v1`,
|
name: `${moduleName}-y-code-v1`,
|
||||||
meta: {
|
meta: {
|
||||||
title: '悦码 1.0',
|
title: '悦码 1.0',
|
||||||
// keepAlive: true,
|
keepAlive: true,
|
||||||
// hideInMenu: true,
|
// hideInMenu: true,
|
||||||
icon: 'ant-design:delete-outlined',
|
icon: 'ant-design:delete-outlined',
|
||||||
app: {
|
app: {
|
||||||
url: 'http://localhost:10012',
|
url: Y_CODE_V1_URL,
|
||||||
name: 'y-code-v1',
|
name: 'y-code-v1',
|
||||||
// sync: true,
|
// sync: true,
|
||||||
// alive: true,
|
// alive: true,
|
||||||
degrade: true,
|
degrade: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
component: () => import('@/components/micro-container/index.vue'),
|
component: () => import('@/components/renderer-adapter/index.vue'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import type { RouteRecordRaw } from 'vue-router';
|
import type { RouteRecordRaw } from 'vue-router';
|
||||||
import { Y_CODE_RENDERER_URL } from '@/constants';
|
import { Y_CODE_RENDERER_URL } from '@/constants';
|
||||||
|
import { LOW_CODE_APPLICATION_ID, LOW_CODE_PROJECT_ID } from '@/constants/low-code';
|
||||||
|
|
||||||
// 微前端路由
|
// 微前端路由
|
||||||
const moduleName = 'project';
|
const moduleName = 'project';
|
||||||
@ -26,8 +27,8 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
// sync: true,
|
// sync: true,
|
||||||
// alive: true,
|
// alive: true,
|
||||||
// degrade: true,
|
// degrade: true,
|
||||||
applicationId: 0,
|
applicationId: LOW_CODE_APPLICATION_ID,
|
||||||
projectId: 4,
|
projectId: LOW_CODE_PROJECT_ID,
|
||||||
fileId: '4g4mz6qi8u',
|
fileId: '4g4mz6qi8u',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import type { RouteRecordRaw } from 'vue-router';
|
import type { RouteRecordRaw } from 'vue-router';
|
||||||
|
import { Y_CODE_RENDERER_URL } from '@/constants';
|
||||||
|
import { LOW_CODE_APPLICATION_ID, LOW_CODE_PROJECT_ID } from '@/constants/low-code';
|
||||||
|
|
||||||
// 微前端路由
|
// 微前端路由
|
||||||
const moduleName = 'static-file';
|
const moduleName = 'static-file';
|
||||||
@ -20,11 +22,11 @@ const routes: Array<RouteRecordRaw> = [
|
|||||||
keepAlive: true,
|
keepAlive: true,
|
||||||
icon: 'ant-design:list',
|
icon: 'ant-design:list',
|
||||||
app: {
|
app: {
|
||||||
url: 'https://localhost:10010',
|
url: Y_CODE_RENDERER_URL,
|
||||||
name: 'y-code-platform-application-list',
|
name: 'y-code-platform-application-list',
|
||||||
sync: true,
|
applicationId: LOW_CODE_APPLICATION_ID,
|
||||||
alive: true,
|
projectId: LOW_CODE_PROJECT_ID,
|
||||||
degrade: true,
|
fileId: '7pfr394d6',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
component: () => import('@/components/renderer-adapter/index.vue'),
|
component: () => import('@/components/renderer-adapter/index.vue'),
|
||||||
|
0
apps/platform/src/store/modules/application.ts
Normal file
0
apps/platform/src/store/modules/application.ts
Normal file
@ -5,8 +5,7 @@ interface KeepAliveState {
|
|||||||
list: string[];
|
list: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useKeepAliveStore = defineStore({
|
export const useKeepAliveStore = defineStore('keep-alive', {
|
||||||
id: 'keep-alive',
|
|
||||||
state: (): KeepAliveState => ({
|
state: (): KeepAliveState => ({
|
||||||
list: [],
|
list: [],
|
||||||
}),
|
}),
|
||||||
|
0
apps/platform/src/store/modules/project.ts
Normal file
0
apps/platform/src/store/modules/project.ts
Normal file
@ -32,7 +32,7 @@
|
|||||||
"strictFunctionTypes": false,
|
"strictFunctionTypes": false,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"lib": ["dom", "esnext", "DOM.Iterable"],
|
"lib": ["dom", "esnext", "DOM.Iterable"],
|
||||||
"types": ["node", "vite/client"],
|
"types": ["node", "vite/client", "vue"],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
}
|
||||||
|
1
apps/platform/types/shims/shims-vue.d.ts
vendored
1
apps/platform/types/shims/shims-vue.d.ts
vendored
@ -14,6 +14,7 @@ declare module 'vue' {
|
|||||||
Reflect: Reflect;
|
Reflect: Reflect;
|
||||||
suspenseStatus: '' | 'pending' | 'resolve' | 'fallback';
|
suspenseStatus: '' | 'pending' | 'resolve' | 'fallback';
|
||||||
}
|
}
|
||||||
|
export * from '@vue/runtime-core';
|
||||||
}
|
}
|
||||||
|
|
||||||
declare type Nullable<T> = T | null;
|
declare type Nullable<T> = T | null;
|
||||||
|
@ -47,6 +47,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
|
|||||||
server: {
|
server: {
|
||||||
open: true,
|
open: true,
|
||||||
host: true,
|
host: true,
|
||||||
|
cors: true,
|
||||||
port: Number(env.VITE_PORT),
|
port: Number(env.VITE_PORT),
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
|
@ -13,7 +13,11 @@ const renderer = ref()
|
|||||||
const lowCodeService = new LowCodeService()
|
const lowCodeService = new LowCodeService()
|
||||||
|
|
||||||
// Postmate 握手协议
|
// Postmate 握手协议
|
||||||
const handshake = new Postmate.Model({})
|
const postmate = new Postmate.Model({
|
||||||
|
sayHi: (data: any) => {
|
||||||
|
console.log('sayHi',data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// 数据模型
|
// 数据模型
|
||||||
const model = {
|
const model = {
|
||||||
@ -28,8 +32,12 @@ const model = {
|
|||||||
const { data: file, isFetching } = useQuery({
|
const { data: file, isFetching } = useQuery({
|
||||||
queryKey: ['getFile'],
|
queryKey: ['getFile'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
await handshake.then((parent) => {
|
await postmate.then((parent) => {
|
||||||
// parent.emit('sync-context', 'Hello, World!')
|
parent.emit('some-event', 'sync-context!')
|
||||||
|
parent.emit('some-event', 'sync-context!')
|
||||||
|
parent.emit('some-event', 'sync-context!')
|
||||||
|
parent.emit('some-event', 'sync-context!')
|
||||||
|
|
||||||
Object.assign(model, parent.model)
|
Object.assign(model, parent.model)
|
||||||
|
|
||||||
// console.log('model', model)
|
// console.log('model', model)
|
||||||
|
@ -12,7 +12,6 @@ const app = createApp(App);
|
|||||||
|
|
||||||
// 批量注册组件
|
// 批量注册组件
|
||||||
Object.entries(VtjUI).forEach(([name, component]) => {
|
Object.entries(VtjUI).forEach(([name, component]) => {
|
||||||
console.log("name", name, component);
|
|
||||||
app.component(name, component);
|
app.component(name, component);
|
||||||
});
|
});
|
||||||
app
|
app
|
||||||
|
@ -43,11 +43,11 @@
|
|||||||
"eslint-plugin-vue": "^9.32.0",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"less": "^4.2.2",
|
"less": "^4.2.2",
|
||||||
"semantic-release": "^24.2.2",
|
"semantic-release": "^24.2.2",
|
||||||
"typescript": "~5.3.3",
|
"typescript": "~5.8.2",
|
||||||
"unplugin-vue-components": "^0.26.0",
|
"unplugin-vue-components": "^0.26.0",
|
||||||
"vite": "^6.2.0",
|
"vite": "^6.2.0",
|
||||||
"vite-plugin-qiankun": "^1.0.15",
|
"vite-plugin-qiankun": "^1.0.15",
|
||||||
"vue-tsc": "^2.2.0",
|
"vue-tsc": "^2.2.8",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.4.1"
|
"packageManager": "pnpm@10.4.1"
|
||||||
|
13
package.json
13
package.json
@ -38,7 +38,9 @@
|
|||||||
"eslint-plugin-prettier": "~5.2.3",
|
"eslint-plugin-prettier": "~5.2.3",
|
||||||
"eslint-plugin-unused-imports": "^4.1.4",
|
"eslint-plugin-unused-imports": "^4.1.4",
|
||||||
"husky": "~9.1.7",
|
"husky": "~9.1.7",
|
||||||
|
"inquirer": "^12.4.2",
|
||||||
"lint-staged": "~15.2.11",
|
"lint-staged": "~15.2.11",
|
||||||
|
"ora": "^8.2.0",
|
||||||
"postcss-html": "~1.7.0",
|
"postcss-html": "~1.7.0",
|
||||||
"prettier": "~3.3.3",
|
"prettier": "~3.3.3",
|
||||||
"stylelint": "~16.10.0",
|
"stylelint": "~16.10.0",
|
||||||
@ -48,11 +50,8 @@
|
|||||||
"stylelint-config-standard": "~36.0.1",
|
"stylelint-config-standard": "~36.0.1",
|
||||||
"stylelint-order": "~6.0.4",
|
"stylelint-order": "~6.0.4",
|
||||||
"stylelint-prettier": "^5.0.3",
|
"stylelint-prettier": "^5.0.3",
|
||||||
"typescript": "~5.6.3",
|
"typescript": "~5.8.2",
|
||||||
"vue-eslint-parser": "~9.4.3",
|
"vue-eslint-parser": "~10.1.1",
|
||||||
"vue-tsc": "~2.1.10",
|
"vue-tsc": "~2.2.8"
|
||||||
"inquirer": "^12.4.2",
|
}
|
||||||
"ora": "^8.2.0"
|
|
||||||
},
|
|
||||||
"dependencies": {}
|
|
||||||
}
|
}
|
@ -16,6 +16,6 @@
|
|||||||
"clean": "rimraf node_modules"
|
"clean": "rimraf node_modules"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.8.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
941
pnpm-lock.yaml
generated
941
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user