@macrowing/inbiz-codegen 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +592 -2
- package/bin/inbiz-codegen.mjs +7 -0
- package/package.json +32 -4
- package/scripts/prepare-templates.mjs +35 -0
- package/src/backend/init.mjs +170 -0
- package/src/config.mjs +150 -0
- package/src/favicon.mjs +100 -0
- package/src/generate.mjs +935 -0
- package/src/generated-output.mjs +107 -0
- package/src/index.mjs +346 -0
- package/src/menu/build.mjs +252 -0
- package/src/menu/check.mjs +163 -0
- package/src/menu/command.mjs +179 -0
- package/src/migrate-runtime.mjs +106 -0
- package/src/platform/client.mjs +167 -0
- package/src/platform/command.mjs +386 -0
- package/src/platform/pack.mjs +591 -0
- package/src/platform/recover.mjs +236 -0
- package/src/platform/startup.mjs +343 -0
- package/src/platform/state.mjs +116 -0
- package/src/platform/update.mjs +157 -0
- package/src/platform/zip.mjs +134 -0
- package/src/pull.mjs +284 -0
- package/src/scaffold/commands.mjs +349 -0
- package/src/scaffold/init.mjs +370 -0
- package/src/scaffold/template-files.mjs +40 -0
- package/src/scaffold/template-source.mjs +235 -0
- package/src/scaffold/template-sync.mjs +335 -0
- package/src/transform/heaviness.mjs +380 -0
- package/src/transform/preview-props.mjs +108 -0
- package/src/transform/published-page-links.mjs +61 -0
- package/src/transform/published-script.mjs +110 -0
- package/src/transform/registry.mjs +781 -0
- package/src/transform/schema-to-jsx.mjs +1708 -0
- package/src/util/des.mjs +10 -0
- package/templates/README.md +34 -0
- package/templates/backend/Directory.Build.props +19 -0
- package/templates/backend/Directory.Packages.props +49 -0
- package/templates/backend/Macrowing.Scaffold.slnx +13 -0
- package/templates/backend/host/Macrowing.Start/Init/app.json +8 -0
- package/templates/backend/host/Macrowing.Start/Init/menus.json +4 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationDefinition.cs +245 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationEndpoints.cs +57 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationHostedService.cs +63 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationOptions.cs +44 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationRunner.cs +294 -0
- package/templates/backend/host/Macrowing.Start/Initialization/InitializationState.cs +72 -0
- package/templates/backend/host/Macrowing.Start/Initialization/MenuFactory.cs +118 -0
- package/templates/backend/host/Macrowing.Start/Initialization/PackageBuilder.cs +317 -0
- package/templates/backend/host/Macrowing.Start/Initialization/PlatformAppImporter.cs +371 -0
- package/templates/backend/host/Macrowing.Start/Macrowing.Start.csproj +26 -0
- package/templates/backend/host/Macrowing.Start/Program.cs +33 -0
- package/templates/backend/host/Macrowing.Start/StartModule.cs +67 -0
- package/templates/backend/host/Macrowing.Start/appsettings.json +38 -0
- package/templates/backend/modules/Macrowing.Generated/Application/GeneratedApplicationAutoMapperProfile.cs +42 -0
- package/templates/backend/modules/Macrowing.Generated/Domain/Entities/GeneratedEntityBase.cs +72 -0
- package/templates/backend/modules/Macrowing.Generated/Domain/GeneratedConsts.cs +50 -0
- package/templates/backend/modules/Macrowing.Generated/EntityFrameworkCore/GeneratedDbContext.cs +55 -0
- package/templates/backend/modules/Macrowing.Generated/EntityFrameworkCore/GeneratedDbContextModelBuilderExtensions.cs +61 -0
- package/templates/backend/modules/Macrowing.Generated/EntityFrameworkCore/IGeneratedDbContext.cs +32 -0
- package/templates/backend/modules/Macrowing.Generated/GeneratedModule.cs +89 -0
- package/templates/backend/modules/Macrowing.Generated/Macrowing.Generated.csproj +22 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Cms/CmsClient.cs +95 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Cms/CmsModels.cs +81 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Dictionary/DictionaryClient.cs +44 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/InBizSdkModule.cs +16 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/InterfaceEngine/InterfaceEngineClient.cs +50 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Localization/LocalizationClient.cs +28 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Macrowing.InBiz.SDK.csproj +16 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Message/MessageClient.cs +99 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Message/MessageModels.cs +63 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Model/ModelClient.cs +131 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Model/ModelQuery.cs +108 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Model/ModelWrite.cs +44 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Permission/PermissionClient.cs +86 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Platform/InBizPlatformException.cs +42 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Platform/InBizPlatformRegistration.cs +60 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Platform/InBizPlatformTransport.cs +96 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/Platform/InBizRequestContext.cs +27 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/README.md +117 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Details/WorkFlowDetailsClient.cs +35 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Details/WorkFlowDetailsQuery.cs +20 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Operations/WorkFlowOperationRequests.cs +105 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Operations/WorkFlowOperationsClient.cs +53 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/README.md +132 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Tracking/WorkFlowTrackingClient.cs +50 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Upgrade/WorkFlowUpgradeClient.cs +78 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Upgrade/WorkFlowUpgradeModels.cs +34 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/WorkFlowContracts.cs +88 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/WorkFlowRegistration.cs +59 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/WorkFlowTransport.cs +163 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Workbench/WorkFlowWorkbenchClient.cs +59 -0
- package/templates/backend/modules/Macrowing.InBiz.SDK/WorkFlow/Workbench/WorkFlowWorkbenchModels.cs +76 -0
- package/templates/backend/modules/Macrowing.OC.SDK/Macrowing.OC.SDK.csproj +20 -0
- package/templates/backend/modules/Macrowing.OC.SDK/OcSdkModule.cs +18 -0
- package/templates/backend/modules/Macrowing.OC.SDK/Protos/README.md +22 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/Macrowing.InBiz.SDK.Tests.csproj +14 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/PlatformContractTests.cs +288 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/PlatformLiveTests.cs +173 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowHttpServer.cs +113 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowLiveTests.cs +269 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowOperationsTests.cs +80 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowQueryTests.cs +163 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowTransportTests.cs +111 -0
- package/templates/backend/tests/Macrowing.InBiz.SDK.Tests/WorkFlowUpgradeTests.cs +87 -0
- package/templates/frontend/components/README.md +39 -0
- package/templates/frontend/components/app-components/README.md +33 -0
- package/templates/frontend/components/app-components/common/.gitkeep +0 -0
- package/templates/frontend/components/app-components/components/.gitkeep +0 -0
- package/templates/frontend/components/app-components/package.json +20 -0
- package/templates/frontend/mgt/.umirc.ts +574 -0
- package/templates/frontend/mgt/package.json +96 -0
- package/templates/frontend/mgt/src/app-extends.ts +9 -0
- package/templates/frontend/mgt/src/app.tsx +20 -0
- package/templates/frontend/mgt/src/config/app.ts +31 -0
- package/templates/frontend/mgt/src/layout/header.tsx +14 -0
- package/templates/frontend/mgt/src/layout/index.tsx +11 -0
- package/templates/frontend/mgt/src/layout/sidebar.tsx +14 -0
- package/templates/frontend/mgt/src/locales.ts +8 -0
- package/templates/frontend/mgt/src/pages/.gitkeep +0 -0
- package/templates/frontend/mgt/src/root.tsx +12 -0
- package/templates/frontend/mgt/src/route-view.tsx +3 -0
- package/templates/frontend/mgt/src/runtime.ts +21 -0
- package/templates/frontend/mgt/src/styles/app.css +1 -0
- package/templates/frontend/mgt/src/styles/layout.less +79 -0
- package/templates/frontend/mgt/tsconfig.json +65 -0
- package/templates/frontend/mgt/typings.d.ts +57 -0
- package/templates/frontend/wap/.umirc.ts +574 -0
- package/templates/frontend/wap/package.json +73 -0
- package/templates/frontend/wap/src/app-extends.ts +9 -0
- package/templates/frontend/wap/src/app.tsx +28 -0
- package/templates/frontend/wap/src/config/app.ts +31 -0
- package/templates/frontend/wap/src/layout/header.tsx +14 -0
- package/templates/frontend/wap/src/layout/index.tsx +18 -0
- package/templates/frontend/wap/src/layout/sidebar.tsx +14 -0
- package/templates/frontend/wap/src/locales.ts +8 -0
- package/templates/frontend/wap/src/pages/.gitkeep +0 -0
- package/templates/frontend/wap/src/root.tsx +12 -0
- package/templates/frontend/wap/src/route-view.tsx +3 -0
- package/templates/frontend/wap/src/runtime.ts +21 -0
- package/templates/frontend/wap/src/styles/adaptation.less +190 -0
- package/templates/frontend/wap/src/styles/app.css +7 -0
- package/templates/frontend/wap/src/styles/global.less +81 -0
- package/templates/frontend/wap/src/styles/layout.less +92 -0
- package/templates/frontend/wap/tsconfig.json +66 -0
- package/templates/frontend/wap/typings.d.ts +24 -0
- package/templates/frontend/web/.umirc.ts +574 -0
- package/templates/frontend/web/package.json +26 -0
- package/templates/frontend/web/src/app-extends.ts +9 -0
- package/templates/frontend/web/src/app.tsx +25 -0
- package/templates/frontend/web/src/config/app.ts +31 -0
- package/templates/frontend/web/src/layout/header.tsx +14 -0
- package/templates/frontend/web/src/layout/index.tsx +11 -0
- package/templates/frontend/web/src/layout/sidebar.tsx +14 -0
- package/templates/frontend/web/src/locales.ts +8 -0
- package/templates/frontend/web/src/root.tsx +12 -0
- package/templates/frontend/web/src/route-view.tsx +3 -0
- package/templates/frontend/web/src/runtime.ts +21 -0
- package/templates/frontend/web/src/styles/app.css +104 -0
- package/templates/frontend/web/src/styles/layout.less +124 -0
- package/templates/frontend/web/tsconfig.json +91 -0
- package/templates/frontend/web/typings.d.ts +46 -0
- package/templates/package.json +14 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WebLayout } from '@macrowing/inbiz-runtime/web';
|
|
3
|
+
import { DEFAULT_HIDE_LAYOUT, findPageRoute } from '@/pages/routes';
|
|
4
|
+
import { Header } from './header';
|
|
5
|
+
import { Sidebar } from './sidebar';
|
|
6
|
+
|
|
7
|
+
export function Layout({ children }: { children?: React.ReactNode }) {
|
|
8
|
+
return <WebLayout top={Header} left={Sidebar} defaultHidden={DEFAULT_HIDE_LAYOUT} findPageRoute={findPageRoute}>{children}</WebLayout>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default Layout;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 应用框架的「left」区域。
|
|
5
|
+
*
|
|
6
|
+
* 初始工程只有空壳,保证首次 generate 之前页面能渲染。
|
|
7
|
+
* `inbiz-codegen generate` 会用平台布局重写这个文件(VerticalMenu 及插件插槽),
|
|
8
|
+
* 业务内容不进模板。
|
|
9
|
+
*/
|
|
10
|
+
export function Sidebar() {
|
|
11
|
+
return <div className="app-sidebar-content" />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default Sidebar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// 应用级文案目录。
|
|
2
|
+
//
|
|
3
|
+
// `inbiz-codegen generate` 会把平台上的应用词条(组件包 locale 之外的)追加到这里。
|
|
4
|
+
// 初始工程没有任何业务词条,保持空表即可;组件库自己的词条由 app.tsx 里的
|
|
5
|
+
// `@inbiz/entry/locales/index` 统一注册。
|
|
6
|
+
import type { PreviewCatalog } from '@macrowing/inbiz-runtime';
|
|
7
|
+
|
|
8
|
+
export const customLocales: Record<string, PreviewCatalog> = {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createWebRuntime } from '@macrowing/inbiz-runtime/web';
|
|
2
|
+
import { APP_CONFIG } from '@/config/app';
|
|
3
|
+
import { PAGES } from '@/pages/routes';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 运行时装配。
|
|
7
|
+
*
|
|
8
|
+
* 这里只做「把配置和页面清单交给运行时」这一件事:
|
|
9
|
+
* - `config` 来自 .env,由 init 写入、pull 回填站点信息;
|
|
10
|
+
* - `pages` 是 generate 产出的页面清单,首次 generate 前是空表;
|
|
11
|
+
* - `importPage` 按页面目录懒加载,`loadExtensions` 加载应用扩展。
|
|
12
|
+
*
|
|
13
|
+
* 应用特有的能力(宿主对象、私有组件、业务扩展)不写在模板里:
|
|
14
|
+
* 组件包通过自己的入口暴露契约,应用侧在 generate 产物或 src/app-extends.ts 中接入。
|
|
15
|
+
*/
|
|
16
|
+
export const runtime = createWebRuntime({
|
|
17
|
+
config: APP_CONFIG,
|
|
18
|
+
pages: PAGES,
|
|
19
|
+
importPage: (dir) => import(`./pages/${dir}`),
|
|
20
|
+
loadExtensions: () => import('@/app-extends'),
|
|
21
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
html,
|
|
3
|
+
body {
|
|
4
|
+
--ant-primary-1: #e6f7ff;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.inbiz-InbizMenu .logo img {
|
|
8
|
+
margin-left: 20px;
|
|
9
|
+
margin-right: 20px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.react-fine-uploader-gallery-file-footer{
|
|
13
|
+
margin: 0px !important;
|
|
14
|
+
display: flex !important;
|
|
15
|
+
align-items: center !important;
|
|
16
|
+
height: 62px !important;
|
|
17
|
+
line-height: 62px !important;
|
|
18
|
+
}
|
|
19
|
+
.react-fine-uploader-gallery-progress-text-list{
|
|
20
|
+
display: none !important;
|
|
21
|
+
}
|
|
22
|
+
.react-fine-uploader-gallery-files-list{
|
|
23
|
+
position: relative !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* 菜单 */
|
|
27
|
+
.isoNav{
|
|
28
|
+
padding: 0px 0px 0px 20px !important;
|
|
29
|
+
box-sizing: border-box !important;
|
|
30
|
+
}
|
|
31
|
+
.isoNav .logo{
|
|
32
|
+
width: 200px !important;
|
|
33
|
+
height: 34px !important;
|
|
34
|
+
img{
|
|
35
|
+
width: auto !important;
|
|
36
|
+
height: 100% !important;
|
|
37
|
+
max-width: 200px !important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.isoNav .edocMenu{
|
|
41
|
+
align-items: center !important;
|
|
42
|
+
}
|
|
43
|
+
.isoNav .edocMenu-normalItem{
|
|
44
|
+
padding: 0px 20px !important;
|
|
45
|
+
}
|
|
46
|
+
.isoNav .edocMenu-normalItem, .isoNav p{
|
|
47
|
+
height: 32px !important;
|
|
48
|
+
margin-top: 2px !important;
|
|
49
|
+
line-height: 32px !important;
|
|
50
|
+
color: #fff !important;
|
|
51
|
+
}
|
|
52
|
+
.isoNav .edocMenu .header-dev{
|
|
53
|
+
background-color: #165DFF !important;
|
|
54
|
+
color: #fff !important;
|
|
55
|
+
border-radius: 16px !important;
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
.isoNav .edocMenu .header-dev p{
|
|
59
|
+
color: #fff !important;
|
|
60
|
+
font-weight: bold !important;
|
|
61
|
+
}
|
|
62
|
+
.isoNav .edocMenu .header-dev::after{
|
|
63
|
+
background: transparent !important;
|
|
64
|
+
}
|
|
65
|
+
.isoNav .edocMenu .edocMenu-normalItem:hover, .edocMenu .edocMenu-popoverItem:hover {
|
|
66
|
+
background-color: #165DFF !important;
|
|
67
|
+
color: #fff !important;
|
|
68
|
+
border-radius: 16px !important;
|
|
69
|
+
}
|
|
70
|
+
.isoNav .edocMenu .edocMenu-normalItem:hover p,.isoNav .edocMenu .edocMenu-popoverItem:hover p{
|
|
71
|
+
color: #fff !important;
|
|
72
|
+
font-weight: bold !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
.isoTable .search-items{
|
|
78
|
+
margin-bottom: 20px !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.SearchEntry .ecm-searchentry-smallview-icon .anticon{
|
|
82
|
+
color: #fff !important;
|
|
83
|
+
}
|
|
84
|
+
.Message .anticon{
|
|
85
|
+
color: #fff !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.edocMenu-popMenu-content .ant-popover-inner{
|
|
89
|
+
background: #0B3699 !important;
|
|
90
|
+
}
|
|
91
|
+
.edocMenu-popMenu-content .edocMenu-normalItem:hover{
|
|
92
|
+
background-color: #165DFF !important;
|
|
93
|
+
color: #fff !important;
|
|
94
|
+
border-radius: 0px !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
.inbiz-InbizMenu .headerContainer{
|
|
99
|
+
background: transparent !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.inbiz-InbizMenu .menuContainer{
|
|
103
|
+
background: transparent !important;
|
|
104
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 容器组件的「平台有、产物没有」的补充样式。
|
|
3
|
+
*
|
|
4
|
+
* 这一组全部来自实测对比:平台同页同一个元素的 computed style 有、产物没有。
|
|
5
|
+
* 只补样式能兜住的;结构性的差异(子节点没渲染出来)在 runtime 的
|
|
6
|
+
* compat 容器里解决,不在这里硬凑。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Formily 栅格的列宽兜底。
|
|
11
|
+
*
|
|
12
|
+
* 平台 FormGrid 的列宽是**内联**写在 `.ant-formily-grid-layout` 上的
|
|
13
|
+
* (package/@formily/grid 的 `grid.templateColumns`,实测首页是
|
|
14
|
+
* `repeat(11, minmax(0px, 1fr))`)。产物里这条内联样式缺失时,元素退化成
|
|
15
|
+
* `display:grid` + 隐式列,每个 GridColumn 的 `grid-column: span 3` 会撑满整行,
|
|
16
|
+
* 表现就是「本该并排的三块卡片竖着摞起来,而且整页拉得很长」。
|
|
17
|
+
*
|
|
18
|
+
* 内联样式的优先级高于样式表,所以这条规则只在 Formily 没写上时生效,
|
|
19
|
+
* 不会覆盖它自己算出来的列数。12 列是 InBiz FormGrid 的默认 maxColumns
|
|
20
|
+
* (组件库 preview/web/index.tsx 里 `useState(12)`),与平台默认一致。
|
|
21
|
+
*/
|
|
22
|
+
.ant-formily-grid-layout {
|
|
23
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 装饰容器(平台 `Container` 装饰器的产物类)。
|
|
28
|
+
*
|
|
29
|
+
* 平台每个组件外面都裹一层 `<div class="inbiz-decorator-container XxxContainer">`。
|
|
30
|
+
* 这个类的样式来自两处,组件库的 less 里**没有** min-height:
|
|
31
|
+
*
|
|
32
|
+
* 1. 组件库 Decorators/Container.tsx:38/42
|
|
33
|
+
* className 固定带 `inbiz-decorator-container`(设计器另加 -edit-view 变体,
|
|
34
|
+
* 运行态的 getEditor() 为假,不出现);style 固定内联 `position: relative`,
|
|
35
|
+
* 且写在 schema 的 style 之后 —— 即使 schema 配了别的 position 也会被覆盖。
|
|
36
|
+
* 2. 应用主题(业务工程自己的全局 less)
|
|
37
|
+
* `.inbiz-decorator-container { min-height: 20px }`,注释「容器最小高度 30>20」,
|
|
38
|
+
* 有意压过平台基底的 30px(平台设计器 global.less)。
|
|
39
|
+
*
|
|
40
|
+
* 平台实测(首页,34 个装饰 div):计算值全部是
|
|
41
|
+
* min-height: 20px / position: relative / box-sizing: border-box / display: block,
|
|
42
|
+
* padding 来自各节点自己的内联 style,类本身不设 padding / border / margin。
|
|
43
|
+
* box-sizing 来自 antd 全局 reset(`*,:after,:before{box-sizing:border-box}`),
|
|
44
|
+
* 产物同样引了 antd 样式,不在这里重复。
|
|
45
|
+
*
|
|
46
|
+
* min-height 是布局的一部分,不是可有可无的兜底:装饰 div 在 flex 列里是
|
|
47
|
+
* flex item,缺这个类时 `min-height: auto`(= 内容高度)让它压不下去。
|
|
48
|
+
* 首页欢迎条的 Html 装饰层内容高 150.8px、容器只有 38px,被
|
|
49
|
+
* `justify-content: center` 顶到容器上方(实测文字 y=16.6,平台 y=73)。
|
|
50
|
+
* 生成器已把这个类写进每个装饰 div(cli/src/transform/schema-to-jsx.mjs
|
|
51
|
+
* 的 containerAttrs),这里补上平台用内联样式给的两条声明即可。
|
|
52
|
+
*/
|
|
53
|
+
.inbiz-decorator-container {
|
|
54
|
+
position: relative;
|
|
55
|
+
min-height: 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* FormGrid 的装饰容器(schema 里显式配了 className: "FormGridContainer web")。
|
|
60
|
+
*
|
|
61
|
+
* 平台实测:这个 div 的内联样式是 `margin: 17px 32px 0px; position: relative;`
|
|
62
|
+
* —— margin 生成器已经内联了,position 没有。缺了它,栅格内部的绝对定位
|
|
63
|
+
* 元素(卡片角标、加载遮罩)会相对更外层定位。
|
|
64
|
+
*/
|
|
65
|
+
.FormGridContainer {
|
|
66
|
+
position: relative;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* FormSiderLayout 四个栏的装饰容器。
|
|
71
|
+
*
|
|
72
|
+
* 平台每个 LayoutColumn 外面那层是
|
|
73
|
+
* <div class="inbiz-decorator-container FormSiderLayout.LayoutColumnContainer"
|
|
74
|
+
* style="height:100%; position:relative">
|
|
75
|
+
* 出码把装饰器翻成了裸 div(`decorate={(control) => <div style="height:100%" data-title="左侧">}`),
|
|
76
|
+
* 类名带不过来,`.inbiz-decorator-container` 上的两条声明就丢了:
|
|
77
|
+
* - position:relative —— 栏内绝对定位的浮层以它定位,缺了会跑到 Sider 上去;
|
|
78
|
+
* - min-height:20px —— 空栏也占 20px,和平台一致。
|
|
79
|
+
* 这里按结构选择器补回来(只命中四个栏的第一层装饰 div,不会误伤栏内组件)。
|
|
80
|
+
*/
|
|
81
|
+
.inbiz-sider-layout {
|
|
82
|
+
/* 只取四栏插槽的第一层装饰 div:`.ant-layout-sider-children` 的第一个孩子是
|
|
83
|
+
插槽包裹层(inline height:100%),第二个才是拖拽手柄(.sider-left-hander)。
|
|
84
|
+
不限定 :first-child 会把 .sider-line 也命中(实测多出 min-height:20px)。 */
|
|
85
|
+
.ant-layout-sider-children > div:first-child > div,
|
|
86
|
+
.site-header > div,
|
|
87
|
+
.site-layout-centent > div {
|
|
88
|
+
position: relative;
|
|
89
|
+
min-height: 20px;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.inbiz-layout {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
min-height: 100vh;
|
|
97
|
+
background: var(--inbiz-color-bg, #f5f7fa);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.inbiz-layout-body {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex: 1;
|
|
103
|
+
min-height: 0;
|
|
104
|
+
align-items: stretch;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.inbiz-layout-left {
|
|
108
|
+
flex: 0 0 auto;
|
|
109
|
+
min-width: 60px;
|
|
110
|
+
background: #fff;
|
|
111
|
+
border-right: 1px solid #f0f0f0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.inbiz-layout-right {
|
|
115
|
+
flex: 0 0 auto;
|
|
116
|
+
background: #fff;
|
|
117
|
+
border-left: 1px solid #f0f0f0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.inbiz-layout-content {
|
|
121
|
+
flex: 1 1 auto;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
overflow: auto;
|
|
124
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"lib": [
|
|
5
|
+
"DOM",
|
|
6
|
+
"DOM.Iterable",
|
|
7
|
+
"ES2020"
|
|
8
|
+
],
|
|
9
|
+
"jsx": "react-jsx",
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"strict": false,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"skipLibCheck": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": false,
|
|
18
|
+
"allowImportingTsExtensions": true,
|
|
19
|
+
"noEmit": true,
|
|
20
|
+
"paths": {
|
|
21
|
+
"@components/*": [
|
|
22
|
+
"./node_modules/@macrowing/inbiz-components/core/components/*"
|
|
23
|
+
],
|
|
24
|
+
"@common/*": [
|
|
25
|
+
"./node_modules/@macrowing/inbiz-components/core/common/*"
|
|
26
|
+
],
|
|
27
|
+
"*": [
|
|
28
|
+
"./node_modules/@types/*",
|
|
29
|
+
"./node_modules/*"
|
|
30
|
+
],
|
|
31
|
+
"@inbiz/entry/locales/index": [
|
|
32
|
+
"./node_modules/@macrowing/inbiz-components/core/entry/locales/index"
|
|
33
|
+
],
|
|
34
|
+
"@/*": [
|
|
35
|
+
"./src/*"
|
|
36
|
+
],
|
|
37
|
+
"@inbiz/containers/*": [
|
|
38
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/*"
|
|
39
|
+
],
|
|
40
|
+
"@inbiz/utils": [
|
|
41
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/utils/index.ts"
|
|
42
|
+
],
|
|
43
|
+
"@inbiz/utils/request": [
|
|
44
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/utils/request/index.ts"
|
|
45
|
+
],
|
|
46
|
+
"@inbiz/hooks": [
|
|
47
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/hooks/index.ts"
|
|
48
|
+
],
|
|
49
|
+
"@inbiz/hooks/useModelList": [
|
|
50
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/hooks/useModelList.ts"
|
|
51
|
+
],
|
|
52
|
+
"@inbiz/cli": [
|
|
53
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/inbiz-cli.ts"
|
|
54
|
+
],
|
|
55
|
+
"InbizConfig": [
|
|
56
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/inbiz-config.ts"
|
|
57
|
+
],
|
|
58
|
+
"@settings": [
|
|
59
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/settings.ts"
|
|
60
|
+
],
|
|
61
|
+
"@inbiz/render": [
|
|
62
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/inbiz-render.tsx"
|
|
63
|
+
],
|
|
64
|
+
"@inbiz/core": [
|
|
65
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/inbiz-core.tsx"
|
|
66
|
+
],
|
|
67
|
+
"@inbiz/react": [
|
|
68
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/inbiz-react.tsx"
|
|
69
|
+
],
|
|
70
|
+
"@inbiz/react-settings-form": [
|
|
71
|
+
"./node_modules/@macrowing/inbiz-runtime/compat/react-settings-form.tsx"
|
|
72
|
+
],
|
|
73
|
+
"@inbiz/basic/document/folderNames": [
|
|
74
|
+
"./node_modules/@macrowing/inbiz-components/basic/document/folderNames"
|
|
75
|
+
],
|
|
76
|
+
"@inbiz/basic/*": [
|
|
77
|
+
"./node_modules/@macrowing/inbiz-components/basic/*",
|
|
78
|
+
"./node_modules/@macrowing/inbiz-components/basic/SyncComponents/*"
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"include": [
|
|
83
|
+
"src/**/*",
|
|
84
|
+
".umirc.ts",
|
|
85
|
+
"typings.d.ts"
|
|
86
|
+
],
|
|
87
|
+
"exclude": [
|
|
88
|
+
"node_modules",
|
|
89
|
+
"dist"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare module '*.less' {
|
|
2
|
+
const content: { [className: string]: string };
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*.css' {
|
|
7
|
+
const content: { [className: string]: string };
|
|
8
|
+
export default content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '*.css?inbiz-app-style' {
|
|
12
|
+
const css: string;
|
|
13
|
+
export default css;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.svg' {
|
|
17
|
+
const content: string;
|
|
18
|
+
export default content;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module '*.png' {
|
|
22
|
+
const content: string;
|
|
23
|
+
export default content;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare module '*.jpg' {
|
|
27
|
+
const content: string;
|
|
28
|
+
export default content;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare module 'react-sizeme' {
|
|
32
|
+
export const withSize: any;
|
|
33
|
+
export const SizeMe: any;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare namespace NodeJS {
|
|
37
|
+
interface ProcessEnv {
|
|
38
|
+
INBIZ_APP_ID?: string;
|
|
39
|
+
INBIZ_SITE_TYPE?: string;
|
|
40
|
+
INBIZ_SITE_OUT_ID?: string;
|
|
41
|
+
INBIZ_DATA_VERSION_ID?: string;
|
|
42
|
+
INBIZ_HOME_ROUTE?: string;
|
|
43
|
+
INBIZ_LOGIN_PATH?: string;
|
|
44
|
+
INBIZ_URL?: string;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@macrowing/inbiz-templates",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "InBiz 出码工程模板:frontend/{web,mgt,wap,components} + backend",
|
|
6
|
+
"files": [
|
|
7
|
+
"frontend",
|
|
8
|
+
"backend",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
}
|
|
14
|
+
}
|