neo-cmp-cli 1.13.21 → 1.13.23
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 +3 -0
- package/dist/_virtual/array-set2.js +1 -0
- package/dist/_virtual/base64-vlq2.js +1 -0
- package/dist/_virtual/base642.js +1 -0
- package/dist/_virtual/binary-search2.js +1 -0
- package/dist/_virtual/mapping-list2.js +1 -0
- package/dist/_virtual/picocolors.js +1 -0
- package/dist/_virtual/quick-sort2.js +1 -0
- package/dist/_virtual/source-map-consumer2.js +1 -0
- package/dist/_virtual/source-map-generator2.js +1 -0
- package/dist/_virtual/source-map2.js +1 -0
- package/dist/_virtual/source-node2.js +1 -0
- package/dist/_virtual/symbols.js +1 -0
- package/dist/_virtual/util2.js +1 -0
- package/dist/loaders/component-scope-style-loader2.js +1 -1
- package/dist/node_modules/nanoid/non-secure/index.js +1 -0
- package/dist/node_modules/picocolors/picocolors.js +1 -0
- package/dist/node_modules/postcss/lib/at-rule.js +1 -0
- package/dist/node_modules/postcss/lib/comment.js +1 -0
- package/dist/node_modules/postcss/lib/container.js +1 -0
- package/dist/node_modules/postcss/lib/css-syntax-error.js +1 -0
- package/dist/node_modules/postcss/lib/declaration.js +1 -0
- package/dist/node_modules/postcss/lib/document.js +1 -0
- package/dist/node_modules/postcss/lib/fromJSON.js +1 -0
- package/dist/node_modules/postcss/lib/input.js +1 -0
- package/dist/node_modules/postcss/lib/lazy-result.js +1 -0
- package/dist/node_modules/postcss/lib/list.js +1 -0
- package/dist/node_modules/postcss/lib/map-generator.js +1 -0
- package/dist/node_modules/postcss/lib/no-work-result.js +1 -0
- package/dist/node_modules/postcss/lib/node.js +1 -0
- package/dist/node_modules/postcss/lib/parse.js +1 -0
- package/dist/node_modules/postcss/lib/parser.js +1 -0
- package/dist/node_modules/postcss/lib/postcss.js +1 -0
- package/dist/node_modules/postcss/lib/previous-map.js +1 -0
- package/dist/node_modules/postcss/lib/processor.js +1 -0
- package/dist/node_modules/postcss/lib/result.js +1 -0
- package/dist/node_modules/postcss/lib/root.js +1 -0
- package/dist/node_modules/postcss/lib/rule.js +1 -0
- package/dist/node_modules/postcss/lib/stringifier.js +1 -0
- package/dist/node_modules/postcss/lib/stringify.js +1 -0
- package/dist/node_modules/postcss/lib/symbols.js +1 -0
- package/dist/node_modules/postcss/lib/terminal-highlight.js +1 -0
- package/dist/node_modules/postcss/lib/tokenize.js +1 -0
- package/dist/node_modules/postcss/lib/warn-once.js +1 -0
- package/dist/node_modules/postcss/lib/warning.js +1 -0
- package/dist/node_modules/source-map/lib/array-set.js +1 -1
- package/dist/node_modules/source-map/lib/base64-vlq.js +1 -1
- package/dist/node_modules/source-map/lib/base64.js +1 -1
- package/dist/node_modules/source-map/lib/binary-search.js +1 -1
- package/dist/node_modules/source-map/lib/mapping-list.js +1 -1
- package/dist/node_modules/source-map/lib/quick-sort.js +1 -1
- package/dist/node_modules/source-map/lib/source-map-consumer.js +1 -1
- package/dist/node_modules/source-map/lib/source-map-generator.js +1 -1
- package/dist/node_modules/source-map/lib/source-node.js +1 -1
- package/dist/node_modules/source-map/lib/util.js +1 -1
- package/dist/node_modules/source-map/source-map.js +1 -1
- package/dist/node_modules/source-map-js/lib/array-set.js +1 -0
- package/dist/node_modules/source-map-js/lib/base64-vlq.js +1 -0
- package/dist/node_modules/source-map-js/lib/base64.js +1 -0
- package/dist/node_modules/source-map-js/lib/binary-search.js +1 -0
- package/dist/node_modules/source-map-js/lib/mapping-list.js +1 -0
- package/dist/node_modules/source-map-js/lib/quick-sort.js +1 -0
- package/dist/node_modules/source-map-js/lib/source-map-consumer.js +1 -0
- package/dist/node_modules/source-map-js/lib/source-map-generator.js +1 -0
- package/dist/node_modules/source-map-js/lib/source-node.js +1 -0
- package/dist/node_modules/source-map-js/lib/util.js +1 -0
- package/dist/node_modules/source-map-js/source-map.js +1 -0
- package/dist/package.json.js +1 -1
- package/package.json +7 -5
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/antd-custom-cmp-template/src/components/dataDashboard__c/model.ts +1 -1
- package/template/antd-custom-cmp-template/src/components/dataDashboard__c/style.scss +11 -11
- package/template/antd-custom-cmp-template/src/components/searchWidget__c/model.ts +1 -1
- package/template/asset-manage-template/package.json +1 -1
- package/template/asset-manage-template/src/components/assetManage__c/style.scss +4 -4
- package/template/asset-manage-template/src/components/bidList__c/style.scss +2 -2
- package/template/asset-manage-template/src/components/bidPackage__c/style.scss +2 -2
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/echarts-custom-cmp-template/src/components/chartWidget__c/model.ts +1 -1
- package/template/echarts-custom-cmp-template/src/components/chartWidget__c/style.scss +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/map-custom-cmp-template/package.json +1 -1
- package/template/map-custom-cmp-template/src/components/mapWidget__c/model.ts +1 -1
- package/template/map-custom-cmp-template/src/components/mapWidget__c/style.scss +2 -2
- package/template/neo-bi-cmps/package.json +1 -1
- package/template/neo-bi-cmps/public/demo.html +10 -10
- package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +2 -1
- package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +13 -8
- package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +10 -4
- package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +13 -5
- package/template/neo-custom-cmp-template/CODEBUDDY.md +92 -0
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-custom-cmp-template/src/components/customApi__c/index.tsx +8 -4
- package/template/neo-custom-cmp-template/src/components/customApi__c/model.ts +1 -1
- package/template/neo-custom-cmp-template/src/components/customApi__c/style.scss +25 -20
- package/template/neo-custom-cmp-template/src/components/entityDetail__c/index.tsx +26 -55
- package/template/neo-custom-cmp-template/src/components/entityDetail__c/model.ts +1 -1
- package/template/neo-custom-cmp-template/src/components/entityDetail__c/style.scss +155 -100
- package/template/neo-custom-cmp-template/src/components/entityForm__c/index.tsx +0 -1
- package/template/neo-custom-cmp-template/src/components/entityForm__c/model.ts +11 -3
- package/template/neo-custom-cmp-template/src/components/entityForm__c/style.scss +1 -1
- package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +10 -9
- package/template/neo-custom-cmp-template/src/components/entityTable__c/model.ts +12 -3
- package/template/neo-custom-cmp-template/src/components/entityTable__c/style.scss +171 -116
- package/template/neo-custom-cmp-template/src/components/simpleCmp__c/index.tsx +3 -3
- package/template/neo-custom-cmp-template/src/components/simpleCmp__c/model.ts +1 -1
- package/template/neo-custom-cmp-template/src/components/simpleCmp__c/style.scss +94 -13
- package/template/neo-h5-cmps/package.json +1 -1
- package/template/neo-h5-cmps/src/components/chatPage__c/model.ts +1 -1
- package/template/neo-h5-cmps/src/components/entityList__c/model.ts +1 -1
- package/template/neo-h5-cmps/src/components/entityTabs__c/model.ts +2 -2
- package/template/neo-h5-cmps/src/components/entityTabs__c/style.scss +15 -6
- package/template/neo-h5-cmps/src/components/globalSearchInput__c/model.ts +1 -1
- package/template/neo-h5-cmps/src/components/openChatPageBtn__c/model.ts +1 -1
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-order-cmps/src/components/entityInfoCard__c/index.tsx +4 -12
- package/template/neo-order-cmps/src/components/entityInfoCard__c/model.ts +3 -3
- package/template/neo-order-cmps/src/components/entityInfoCard__c/style.scss +6 -5
- package/template/neo-order-cmps/src/components/simpleTable__c/index.tsx +71 -20
- package/template/neo-order-cmps/src/components/simpleTable__c/model.ts +15 -11
- package/template/neo-order-cmps/src/components/simpleTable__c/style.scss +39 -29
- package/template/neo-pipeline-cmps/package.json +1 -1
- package/template/neo-pipeline-cmps/public/demo.html +10 -10
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/style.scss +1 -1
- package/template/neo-pipeline-cmps/src/components/showHealthResult__c/style.scss +1 -1
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +3 -3
- package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +2 -2
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/style.scss +1 -1
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/style.scss +2 -2
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +2 -2
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/style.scss +1 -5
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/model.ts +3 -1
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/style.scss +1 -6
- package/template/neo-web-entity-grid/src/components/entityGrid4__c/model.ts +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid__c/model.ts +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid__c/style.scss +1 -6
- package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +11 -3
- package/template/neo-web-form/package.json +1 -1
- package/template/neo-web-form/src/components/batchAddTable__c/model.ts +1 -1
- package/template/neo-web-form/src/components/batchAddTable__c/tableModal.scss +1 -1
- package/template/neo-web-form/src/components/listSummary__c/model.ts +1 -1
- package/template/neo-web-form/src/components/listSummary__c/style.scss +2 -2
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-custom-cmp-template/src/components/infoCard__c/model.js +1 -1
- package/template/react-ts-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/src/components/listWidget__c/model.ts +1 -1
- package/template/react-ts-custom-cmp-template/src/components/listWidget__c/style.scss +1 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
- package/template/vue2-custom-cmp-template/src/components/vueInfoCard__c/model.js +1 -1
- package/template/antd-custom-cmp-template/src/components/infoCard__c/index.tsx +0 -89
- package/template/antd-custom-cmp-template/src/components/infoCard__c/model.ts +0 -76
- package/template/antd-custom-cmp-template/src/components/infoCard__c/style.scss +0 -105
- package/template/neo-custom-cmp-template/src/components/entityCardList__c/README.md +0 -61
- package/template/neo-custom-cmp-template/src/components/entityCardList__c/index.tsx +0 -225
- package/template/neo-custom-cmp-template/src/components/entityCardList__c/model.ts +0 -81
- package/template/neo-custom-cmp-template/src/components/entityCardList__c/style.scss +0 -260
|
@@ -7,11 +7,19 @@
|
|
|
7
7
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
8
8
|
margin-bottom: 12px;
|
|
9
9
|
|
|
10
|
-
// 组件标题(根据 titleStyle.show
|
|
10
|
+
// 组件标题(根据 titleStyle.show 展示,具体字号等可由 inline titleStyle 覆盖)
|
|
11
11
|
.target-number-title {
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
padding: 8px 16px 8px 14px;
|
|
14
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
15
|
+
'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: 500;
|
|
12
18
|
line-height: 1.4;
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
letter-spacing: 0.08em;
|
|
20
|
+
color: #1f1f1f;
|
|
21
|
+
background: linear-gradient(180deg, #fafbfd 0%, #f4f7fb 100%);
|
|
22
|
+
border-left: 4px solid #1677ff;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
.target-number-block {
|
|
@@ -102,13 +110,13 @@
|
|
|
102
110
|
|
|
103
111
|
@media (max-width: 576px) {
|
|
104
112
|
padding: 8px;
|
|
105
|
-
min-width: calc(50% -
|
|
113
|
+
min-width: calc(50% - 30px);
|
|
106
114
|
}
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
.target-number-value {
|
|
110
118
|
font-size: 32px;
|
|
111
|
-
font-weight:
|
|
119
|
+
font-weight: 500;
|
|
112
120
|
color: #262626;
|
|
113
121
|
line-height: 1.2;
|
|
114
122
|
word-break: break-all;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# CODEBUDDY.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to CodeBuddy Code when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
NeoCRM 自定义业务组件模板项目。基于 React 16 + TypeScript + Ant Design 4 + SCSS,通过 `neo-cmp-cli` 工具链进行预览、调试和发布。
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm i # 安装依赖
|
|
13
|
+
npm run preview # 预览组件 (neo preview)
|
|
14
|
+
npm run linkDebug # 外链调试 - 在线上页面设计器端预览自定义组件
|
|
15
|
+
npm run neoLogin # OAuth2 登录 NeoCRM 平台
|
|
16
|
+
npm run pushCmp # 构建并发布组件到 NeoCRM 平台
|
|
17
|
+
npm run pullCmp # 从平台拉取组件
|
|
18
|
+
npm run deleteCmp # 删除平台上的组件
|
|
19
|
+
npm run format # Prettier 格式化
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
没有标准的 build/dev/test 命令。构建在 `neo push cmp` 时隐式执行,无测试框架配置。
|
|
23
|
+
|
|
24
|
+
## Architecture
|
|
25
|
+
|
|
26
|
+
### Component Structure
|
|
27
|
+
|
|
28
|
+
每个自定义组件位于 `src/components/` 下,以 `cmpType__c` 命名(`__c` 后缀表示自定义):
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
src/components/xxCmp__c/
|
|
32
|
+
├── index.tsx # 组件实现(默认入口)
|
|
33
|
+
├── model.ts # 模型文件 - 对接页面设计器的属性/事件/函数声明
|
|
34
|
+
├── style.scss # 组件样式
|
|
35
|
+
└── README.md # 组件文档(可选)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
当 `neo.config.js` 的 `entry` 为空时,CLI 根据 `src/components/` 目录结构自动生成 entry 和注册文件,开发者无需关注 `neo-register`。
|
|
39
|
+
|
|
40
|
+
### Component Base Class
|
|
41
|
+
|
|
42
|
+
- `BaseCmp`(来自 `neo-ui-common`):主要基类,继承自 `React.PureComponent`
|
|
43
|
+
- 部分组件也可直接继承 `React.PureComponent`
|
|
44
|
+
- 类型定义在 `@types/neo-ui-common.d.ts`
|
|
45
|
+
|
|
46
|
+
### Model File
|
|
47
|
+
|
|
48
|
+
`model.ts` 定义组件在设计器中的配置,关键字段:
|
|
49
|
+
|
|
50
|
+
- `label` / `description`:组件名称和描述
|
|
51
|
+
- `targetPage`:支持页面类型(`all` / `entityFormPage` / `customPage`)
|
|
52
|
+
- `targetDevice`:支持终端(`web` / `mobile`)
|
|
53
|
+
- `iconUrl`:组件图标
|
|
54
|
+
- `defaultComProps`:默认属性
|
|
55
|
+
- `propsSchema`:编辑器属性面板配置
|
|
56
|
+
- `events`:组件事件声明
|
|
57
|
+
- `functions`:组件对外暴露的函数
|
|
58
|
+
|
|
59
|
+
### Platform APIs
|
|
60
|
+
|
|
61
|
+
- **neo-open-api / xObject**:实体数据 CRUD(`query`, `get`, `create`, `update`, `delete`, `getDesc`, `getEntityTypeList`)
|
|
62
|
+
- **neo-open-api / customApi**:自定义 API 代理调用(`customApi.run`)
|
|
63
|
+
- **neo-ui-common / NeoEvent**:事件系统
|
|
64
|
+
- `@NeoEvent.function` 装饰器:声明可被其他组件调用的函数
|
|
65
|
+
- `@NeoEvent.dispatch`:声明事件派发
|
|
66
|
+
- `NeoEvent.broadcast` / `NeoEvent.listen`:广播/监听事件
|
|
67
|
+
- **props.data.__NeoSystemInfo**:平台系统信息
|
|
68
|
+
|
|
69
|
+
### Data Fetching Modes
|
|
70
|
+
|
|
71
|
+
1. **自动获取**(`autoFetchData: true`):平台自动注入 `props.entityData` 和 `props.xObjectDataApi.fieldDescList`
|
|
72
|
+
2. **手动获取**:组件自行通过 `neo-open-api` SDK 调用接口
|
|
73
|
+
|
|
74
|
+
### Path Aliases (webpack)
|
|
75
|
+
|
|
76
|
+
- `@` → `./src`
|
|
77
|
+
- `$assets` → `./src/assets`
|
|
78
|
+
- `$public` → `./public`
|
|
79
|
+
- `$utils` → `./src/utils`
|
|
80
|
+
|
|
81
|
+
### SCSS Auto-injection
|
|
82
|
+
|
|
83
|
+
`src/assets/css/common.scss`(变量、函数)和 `src/assets/css/mixin.scss`(通用 mixin)通过 `sassResources` 自动注入所有 SCSS 文件,无需手动 import。
|
|
84
|
+
|
|
85
|
+
## Key Rules
|
|
86
|
+
|
|
87
|
+
- **React 16**:必须使用 React 16 版本
|
|
88
|
+
- **样式隔离**:组件最外层设置唯一 className(如 `entityForm__c`),所有样式放在该选择器内
|
|
89
|
+
- **组件命名**:目录名使用 `cmpType__c` 格式
|
|
90
|
+
- **发布要求**:`package.json` 的 `name` 值必须唯一,`version` 值不能重复
|
|
91
|
+
- **代码风格**:Prettier 配置为单引号、分号、2 空格缩进、尾逗号 all
|
|
92
|
+
- **Commit 规范**:type 必须是 feat/fix/bug/docs/style/refactor/test/chore/perf/build/ci 之一
|
|
@@ -145,13 +145,13 @@ export default class CustomApiCmp extends BaseCmp<
|
|
|
145
145
|
const { className, title: propsTitle } = this.props;
|
|
146
146
|
const displayTitle = propsTitle || '自定义 API 示例';
|
|
147
147
|
|
|
148
|
-
console.log('this.props:', this.props);
|
|
149
|
-
|
|
150
148
|
return (
|
|
151
149
|
<div className={`customApi__c ${className || ''}`}>
|
|
152
150
|
<div className="table-wrapper">
|
|
153
151
|
<div className="panel-header">
|
|
154
|
-
<
|
|
152
|
+
<div className="panel-header-text">
|
|
153
|
+
<h3>{displayTitle}</h3>
|
|
154
|
+
</div>
|
|
155
155
|
</div>
|
|
156
156
|
<div className="table-container">
|
|
157
157
|
<Spin spinning={loading} tip="加载数据中...">
|
|
@@ -171,7 +171,11 @@ export default class CustomApiCmp extends BaseCmp<
|
|
|
171
171
|
columns={POST_COLUMNS}
|
|
172
172
|
dataSource={dataSource}
|
|
173
173
|
rowKey="id"
|
|
174
|
-
pagination={{
|
|
174
|
+
pagination={{
|
|
175
|
+
pageSize: 10,
|
|
176
|
+
showSizeChanger: true,
|
|
177
|
+
showTotal: (total) => `共 ${total} 条`,
|
|
178
|
+
}}
|
|
175
179
|
scroll={{ y: 'max-content' }}
|
|
176
180
|
/>
|
|
177
181
|
)}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
.customApi__c {
|
|
2
|
+
background: #fff;
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
|
|
2
5
|
.table-wrapper {
|
|
3
|
-
|
|
4
|
-
border-radius: 4px;
|
|
6
|
+
padding: 16px 20px;
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
overflow: hidden;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
.panel-header {
|
|
11
|
-
padding:
|
|
12
|
-
background: #
|
|
13
|
-
border-bottom: 1px solid #ddd;
|
|
13
|
+
padding: 8px 0;
|
|
14
|
+
background: #fff;
|
|
14
15
|
display: flex;
|
|
15
16
|
justify-content: space-between;
|
|
16
|
-
align-items:
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
margin-bottom: 12px;
|
|
19
|
+
border-bottom: 1px solid #f0f0f0;
|
|
20
|
+
|
|
21
|
+
.panel-header-text {
|
|
22
|
+
flex: 1;
|
|
23
|
+
min-width: 0;
|
|
24
|
+
}
|
|
17
25
|
|
|
18
26
|
h3 {
|
|
19
27
|
margin: 0;
|
|
20
28
|
font-size: 16px;
|
|
21
|
-
font-weight:
|
|
22
|
-
color: #
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
color: #434343;
|
|
23
31
|
}
|
|
24
32
|
}
|
|
25
33
|
|
|
@@ -30,7 +38,7 @@
|
|
|
30
38
|
.ant-table {
|
|
31
39
|
.ant-table-thead > tr > th {
|
|
32
40
|
background-color: #f9f9f9;
|
|
33
|
-
font-weight:
|
|
41
|
+
font-weight: 500;
|
|
34
42
|
color: #262626;
|
|
35
43
|
border-bottom: 1px solid #eee;
|
|
36
44
|
padding: 10px;
|
|
@@ -38,6 +46,7 @@
|
|
|
38
46
|
font-size: 13px;
|
|
39
47
|
position: sticky;
|
|
40
48
|
top: 0;
|
|
49
|
+
z-index: 1;
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
.ant-table-tbody > tr > td {
|
|
@@ -52,6 +61,11 @@
|
|
|
52
61
|
}
|
|
53
62
|
}
|
|
54
63
|
|
|
64
|
+
.ant-pagination {
|
|
65
|
+
padding: 12px 0 0;
|
|
66
|
+
margin: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
55
69
|
.ant-empty {
|
|
56
70
|
padding: 40px 0;
|
|
57
71
|
|
|
@@ -73,14 +87,9 @@
|
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
89
|
|
|
76
|
-
// 响应式设计
|
|
77
90
|
@media (max-width: 768px) {
|
|
78
91
|
.panel-header {
|
|
79
|
-
padding: 12px;
|
|
80
|
-
|
|
81
|
-
h3 {
|
|
82
|
-
font-size: 14px;
|
|
83
|
-
}
|
|
92
|
+
padding: 12px 0 6px 0;
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
.table-container {
|
|
@@ -96,11 +105,7 @@
|
|
|
96
105
|
|
|
97
106
|
@media (max-width: 576px) {
|
|
98
107
|
.panel-header {
|
|
99
|
-
padding: 10px;
|
|
100
|
-
|
|
101
|
-
h3 {
|
|
102
|
-
font-size: 13px;
|
|
103
|
-
}
|
|
108
|
+
padding: 10px 0 6px 0;
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
.table-container {
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Card,
|
|
4
|
-
Row,
|
|
5
|
-
Col,
|
|
6
|
-
Spin,
|
|
7
|
-
Empty,
|
|
8
|
-
Descriptions,
|
|
9
|
-
Button,
|
|
10
|
-
Tag,
|
|
11
|
-
Divider,
|
|
12
|
-
Typography,
|
|
13
|
-
} from 'antd';
|
|
2
|
+
import { Spin, Empty, Button, Tag, Divider, Typography } from 'antd';
|
|
14
3
|
import {
|
|
15
4
|
ReloadOutlined,
|
|
16
|
-
InfoCircleOutlined,
|
|
17
5
|
CheckCircleOutlined,
|
|
18
6
|
CloseCircleOutlined,
|
|
19
7
|
} from '@ant-design/icons';
|
|
@@ -21,7 +9,7 @@ import {
|
|
|
21
9
|
import { xObject } from 'neo-open-api'; // Neo OpenAPI SDK
|
|
22
10
|
import './style.scss';
|
|
23
11
|
|
|
24
|
-
const { Title
|
|
12
|
+
const { Title } = Typography;
|
|
25
13
|
|
|
26
14
|
interface EntityDetailProps {
|
|
27
15
|
title?: string;
|
|
@@ -165,7 +153,7 @@ export default class EntityDetail extends React.PureComponent<
|
|
|
165
153
|
|
|
166
154
|
renderFieldValue(value: any, fieldType: string) {
|
|
167
155
|
if (value === null || value === undefined || value === '') {
|
|
168
|
-
return <
|
|
156
|
+
return <span className="info-value-empty">-</span>;
|
|
169
157
|
}
|
|
170
158
|
|
|
171
159
|
// 根据字段类型渲染不同的值
|
|
@@ -245,39 +233,28 @@ export default class EntityDetail extends React.PureComponent<
|
|
|
245
233
|
}
|
|
246
234
|
|
|
247
235
|
return (
|
|
248
|
-
<
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
contentStyle={{
|
|
262
|
-
backgroundColor: '#ffffff',
|
|
263
|
-
}}
|
|
264
|
-
>
|
|
265
|
-
{fields.map((fieldKey) => {
|
|
266
|
-
const fieldType = this.getFieldType(fieldKey);
|
|
267
|
-
const fieldLabel = this.getFieldLabel(fieldKey);
|
|
268
|
-
const fieldValue = detailData[fieldKey];
|
|
269
|
-
|
|
270
|
-
return (
|
|
271
|
-
<Descriptions.Item label={fieldLabel} key={fieldKey}>
|
|
236
|
+
<div className="detail-info-body">
|
|
237
|
+
<div className="info-grid">
|
|
238
|
+
{columnGroups.map((fields, colIndex) => (
|
|
239
|
+
<div key={colIndex} className="info-column">
|
|
240
|
+
{fields.map((fieldKey) => {
|
|
241
|
+
const fieldType = this.getFieldType(fieldKey);
|
|
242
|
+
const fieldLabel = this.getFieldLabel(fieldKey);
|
|
243
|
+
const fieldValue = detailData[fieldKey];
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
<div key={fieldKey} className="info-item">
|
|
247
|
+
<div className="info-label">{fieldLabel}</div>
|
|
248
|
+
<div className="info-value">
|
|
272
249
|
{this.renderFieldValue(fieldValue, fieldType)}
|
|
273
|
-
</
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
</
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
</
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
})}
|
|
254
|
+
</div>
|
|
255
|
+
))}
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
281
258
|
);
|
|
282
259
|
}
|
|
283
260
|
|
|
@@ -289,18 +266,12 @@ export default class EntityDetail extends React.PureComponent<
|
|
|
289
266
|
console.log('this.props:', this.props);
|
|
290
267
|
|
|
291
268
|
return (
|
|
292
|
-
<div className={
|
|
269
|
+
<div className={['entityDetail__c', className].filter(Boolean).join(' ')}>
|
|
293
270
|
{showTitle && (
|
|
294
271
|
<div className="detail-header">
|
|
295
272
|
<div className="header-content">
|
|
296
273
|
<Title level={4} className="header-title">
|
|
297
|
-
|
|
298
|
-
{title || '实体数据详情'}
|
|
299
|
-
{systemInfo.tenantName ? (
|
|
300
|
-
<Tag color="blue" style={{ marginLeft: 8 }}>
|
|
301
|
-
{systemInfo.tenantName}
|
|
302
|
-
</Tag>
|
|
303
|
-
) : null}
|
|
274
|
+
{title || '实体详情数据'}
|
|
304
275
|
</Title>
|
|
305
276
|
<Button
|
|
306
277
|
type="primary"
|
|
@@ -14,7 +14,7 @@ export class EntityDetailModel {
|
|
|
14
14
|
label: string = '实体数据详情';
|
|
15
15
|
|
|
16
16
|
/** 组件描述,用于设置在编辑器左侧组件面板中展示的描述 */
|
|
17
|
-
description: string = '
|
|
17
|
+
description: string = '实体详情信息展示,支持多列布局';
|
|
18
18
|
|
|
19
19
|
/** 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示 */
|
|
20
20
|
// tags: string[] = ['自定义组件'];
|