diff --git a/io.sc.engine.mv.frontend/.prettierignore b/io.sc.engine.mv.frontend/.prettierignore new file mode 100644 index 00000000..b5c08636 --- /dev/null +++ b/io.sc.engine.mv.frontend/.prettierignore @@ -0,0 +1,3 @@ +build +dist +node_modules \ No newline at end of file diff --git a/io.sc.engine.mv.frontend/.prettierrc.json b/io.sc.engine.mv.frontend/.prettierrc.json new file mode 100644 index 00000000..f9e9ce41 --- /dev/null +++ b/io.sc.engine.mv.frontend/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": true, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 160, + "trailingComma": "all" +} \ No newline at end of file diff --git a/io.sc.engine.mv.frontend/babel.config.cjs b/io.sc.engine.mv.frontend/babel.config.cjs new file mode 100644 index 00000000..0ff56db5 --- /dev/null +++ b/io.sc.engine.mv.frontend/babel.config.cjs @@ -0,0 +1,16 @@ +module.exports = { + presets: [ + "@babel/preset-env", + [ + "@babel/preset-typescript", + { + allExtensions: true, //支持所有文件扩展名 + }, + ], + ], + plugins: [ + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-object-rest-spread", + "@vue/babel-plugin-jsx", + ] +} diff --git a/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf b/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf new file mode 100644 index 00000000..5a582b18 Binary files /dev/null and b/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf differ diff --git a/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png b/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png new file mode 100644 index 00000000..89a612f6 Binary files /dev/null and b/io.sc.engine.mv.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png differ diff --git a/io.sc.engine.mv.frontend/src/boostrap.ts b/io.sc.engine.mv.frontend/src/boostrap.ts new file mode 100644 index 00000000..ec695b46 --- /dev/null +++ b/io.sc.engine.mv.frontend/src/boostrap.ts @@ -0,0 +1,46 @@ +import packageJson from '../package.json'; +import { createApp } from 'vue'; +import platform from 'platform-core'; +import { ApplicationInitializer, ComponentManager } from 'platform-core'; +import localMocks from './mock'; +import localI18nMessages from './i18n'; +import localMenus from './menus/menus.json'; +import localRoutes from './routes/routes.json'; +import localComponents from './components'; +import App from './App.vue'; + +import 'platform-core/dist/css/platform-core.css'; +import './css/tailwind.css'; + +// 设置远程组件加载器 +// 覆盖 platform-core 包中的 remoteComponentLoader 函数 +// 只有在主前端项目中编写如下的 remoteComponentLoader 函数才能实现 webpack MF 的 shared 功能 +ComponentManager.setRemoteComponentLoader((moduleName: string, componentName: string): any => { + return async () => { + await __webpack_init_sharing__('default'); + const container = window[moduleName]; + if (container) { + await container.init(__webpack_share_scopes__.default); + const factory = await window[moduleName].get(componentName); + return factory(); + } else { + throw new Error('window["' + moduleName + '"] is undefined!'); + } + }; +}); + +//初始化平台 +ApplicationInitializer.initialize({ + moduleName: packageJson.name, + moduleVersion: packageJson.version, + localMocks: localMocks, + localI18nMessages: localI18nMessages, + localMenus: localMenus, + localRoutes: localRoutes, + localComponents: localComponents, + callback: () => { + const app = createApp(App); + app.use(platform); + app.mount('#app'); + }, +}); diff --git a/io.sc.engine.mv.frontend/src/views/config/binomial.vue b/io.sc.engine.mv.frontend/src/views/config/binomial.vue new file mode 100644 index 00000000..d181890f --- /dev/null +++ b/io.sc.engine.mv.frontend/src/views/config/binomial.vue @@ -0,0 +1,54 @@ + +