neo-cmp-cli 1.12.8 → 1.12.10

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.
Files changed (161) hide show
  1. package/README.md +204 -6
  2. package/dist/index2.js +1 -1
  3. package/dist/module/neoInitByCopy.js +1 -1
  4. package/dist/neo/env.js +1 -1
  5. package/dist/package.json.js +1 -1
  6. package/package.json +4 -1
  7. package/template/antd-custom-cmp-template/package.json +1 -1
  8. package/template/asset-manage-template/README.md +154 -0
  9. package/template/asset-manage-template/docs/README.md +244 -0
  10. package/template/asset-manage-template/neo.config.js +60 -0
  11. package/template/asset-manage-template/package.json +74 -0
  12. package/template/asset-manage-template/src/assets/img/chart.svg +1 -0
  13. package/template/asset-manage-template/src/components/README.md +3 -0
  14. package/template/asset-manage-template/src/components/assetManage__c/assetApi.ts +70 -0
  15. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetCreateModal.tsx +260 -0
  16. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetGrid.tsx +48 -0
  17. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetSidebar.tsx +74 -0
  18. package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetToolbar.tsx +79 -0
  19. package/template/asset-manage-template/src/components/assetManage__c/cmps/assetDisplay.tsx +72 -0
  20. package/template/asset-manage-template/src/components/assetManage__c/constants.ts +28 -0
  21. package/template/asset-manage-template/src/components/assetManage__c/index.tsx +258 -0
  22. package/template/asset-manage-template/src/components/assetManage__c/model.ts +75 -0
  23. package/template/asset-manage-template/src/components/assetManage__c/style.scss +425 -0
  24. package/template/asset-manage-template/src/components/assetManage__c/types.ts +60 -0
  25. package/template/asset-manage-template/src/components/bidList__c/cmps/BidCard.tsx +47 -0
  26. package/template/asset-manage-template/src/components/bidList__c/constants.ts +6 -0
  27. package/template/asset-manage-template/src/components/bidList__c/formatUtils.ts +14 -0
  28. package/template/asset-manage-template/src/components/bidList__c/index.tsx +194 -0
  29. package/template/asset-manage-template/src/components/bidList__c/model.ts +57 -0
  30. package/template/asset-manage-template/src/components/bidList__c/style.scss +179 -0
  31. package/template/asset-manage-template/src/components/bidList__c/types.ts +10 -0
  32. package/template/asset-manage-template/src/components/bidPackage__c/cmps/BidPackageHeader.tsx +140 -0
  33. package/template/asset-manage-template/src/components/bidPackage__c/cmps/PackageItemTable.tsx +148 -0
  34. package/template/asset-manage-template/src/components/bidPackage__c/index.tsx +394 -0
  35. package/template/asset-manage-template/src/components/bidPackage__c/mainTableColumns.tsx +57 -0
  36. package/template/asset-manage-template/src/components/bidPackage__c/model.ts +86 -0
  37. package/template/asset-manage-template/src/components/bidPackage__c/style.scss +256 -0
  38. package/template/asset-manage-template/src/components/bidPackage__c/types.ts +35 -0
  39. package/template/asset-manage-template/src/components/bidPackage__c/utils.ts +19 -0
  40. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/axiosFetcher.ts +0 -0
  41. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/queryObjectData.ts +36 -0
  42. package/template/asset-manage-template/src/utils/url.ts +82 -0
  43. package/template/{neo-bi-cmps → asset-manage-template}/src/utils/xobjects.ts +0 -0
  44. package/template/asset-manage-template/tsconfig.json +40 -0
  45. package/template/echarts-custom-cmp-template/package.json +1 -1
  46. package/template/empty-custom-cmp-template/package.json +2 -2
  47. package/template/neo-custom-cmp-template/package.json +5 -2
  48. package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +62 -6
  49. package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +36 -0
  50. package/template/neo-custom-cmp-template/tsconfig.json +1 -2
  51. package/template/neo-h5-cmps/neo.config.js +1 -6
  52. package/template/neo-h5-cmps/package.json +7 -4
  53. package/template/neo-h5-cmps/src/utils/queryObjectData.ts +36 -0
  54. package/template/neo-h5-cmps/tsconfig.json +3 -4
  55. package/template/neo-order-cmps/package.json +2 -2
  56. package/template/neo-order-cmps/src/utils/queryObjectData.ts +36 -0
  57. package/template/neo-web-cmps/@types/neo-ui-common.d.ts +36 -0
  58. package/template/neo-web-cmps/neo.config.js +53 -0
  59. package/template/{neo-bi-cmps → neo-web-cmps}/package.json +10 -7
  60. package/template/neo-web-cmps/src/assets/img/AIBtn.gif +0 -0
  61. package/template/neo-web-cmps/src/assets/img/aiLogo.png +0 -0
  62. package/template/neo-web-cmps/src/assets/img/card-list.svg +1 -0
  63. package/template/neo-web-cmps/src/assets/img/contact-form.svg +1 -0
  64. package/template/neo-web-cmps/src/assets/img/custom-form.svg +1 -0
  65. package/template/neo-web-cmps/src/assets/img/data-list.svg +1 -0
  66. package/template/neo-web-cmps/src/assets/img/detail.svg +1 -0
  67. package/template/neo-web-cmps/src/assets/img/map.svg +1 -0
  68. package/template/neo-web-cmps/src/assets/img/search.svg +1 -0
  69. package/template/neo-web-cmps/src/components/entityGrid2__c/index.tsx +72 -0
  70. package/template/neo-web-cmps/src/components/entityGrid2__c/model.ts +195 -0
  71. package/template/neo-web-cmps/src/components/entityGrid2__c/style.scss +13 -0
  72. package/template/neo-web-cmps/src/components/entityGrid__c/index.tsx +52 -0
  73. package/template/neo-web-cmps/src/components/entityGrid__c/model.ts +195 -0
  74. package/template/neo-web-cmps/src/components/entityGrid__c/style.scss +13 -0
  75. package/template/neo-web-cmps/src/utils/axiosFetcher.ts +37 -0
  76. package/template/neo-web-cmps/src/utils/queryObjectData.ts +112 -0
  77. package/template/{develop/neo-custom-cmp-template → neo-web-cmps}/src/utils/xobjects.ts +28 -64
  78. package/template/{neo-bi-cmps → neo-web-cmps}/tsconfig.json +2 -3
  79. package/template/react-custom-cmp-template/package.json +1 -1
  80. package/template/react-ts-custom-cmp-template/package.json +1 -1
  81. package/template/vue2-custom-cmp-template/package.json +1 -1
  82. package/template/develop/BI /351/241/271/347/233/256/345/210/206/346/236/220/346/212/245/345/221/212.md" +0 -562
  83. package/template/develop/ChatPage /347/273/204/344/273/266/344/275/277/347/224/250/350/257/264/346/230/216/346/226/207/346/241/243.md" +0 -507
  84. package/template/develop/EntityGrid Web /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -868
  85. package/template/develop/EntityList H5 /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -1386
  86. package/template/develop/GlobalSearch/347/273/204/344/273/266/345/257/271/346/257/224/345/210/206/346/236/220.md +0 -866
  87. package/template/develop/Neo /344/270/255/345/217/257/347/224/250 amis /347/273/204/344/273/266.md" +0 -1490
  88. package/template/develop/cmpEventFunctions.ts +0 -257
  89. package/template/develop/cmpEvents.ts +0 -864
  90. package/template/develop/comTree/347/224/237/346/210/220/350/277/207/347/250/213/345/210/206/346/236/220.md +0 -469
  91. package/template/develop/commonModules.js +0 -55
  92. package/template/develop/components-table.md +0 -50
  93. package/template/develop/neo-custom-cmp-template/README.md +0 -48
  94. package/template/develop/neo-custom-cmp-template/docs/README.md +0 -13
  95. package/template/develop/neo-custom-cmp-template/neo.config.js +0 -121
  96. package/template/develop/neo-custom-cmp-template/package.json +0 -63
  97. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +0 -65
  98. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +0 -180
  99. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +0 -50
  100. package/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +0 -260
  101. package/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +0 -94
  102. package/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +0 -252
  103. package/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +0 -56
  104. package/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +0 -120
  105. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +0 -115
  106. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +0 -304
  107. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +0 -87
  108. package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +0 -127
  109. package/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -29
  110. package/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -39
  111. package/template/develop/neo-custom-cmp-template/tsconfig.json +0 -68
  112. package/template/develop/neo-ui-component-h5.md +0 -105
  113. package/template/develop/neo-ui-component-web-xregister.md +0 -31
  114. package/template/develop/neo-ui-component-web.md +0 -292
  115. package/template/develop/neoCmps.ts +0 -7508
  116. package/template/develop/neoGlobalSearchInput /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -497
  117. package/template/develop/pageSchema1.json +0 -744
  118. package/template/develop//344/272/213/344/273/266/345/212/250/344/275/234/344/277/235/345/255/230/346/265/201/347/250/213/345/210/206/346/236/220.md +0 -390
  119. package/template/develop//345/215/225/345/205/203/346/265/213/350/257/225/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -1139
  120. package/template/develop//345/261/236/346/200/247/351/205/215/347/275/256/351/241/271/347/261/273/345/236/213/346/261/207/346/200/273.md +0 -558
  121. package/template/neo-bi-cmps/neo.config.js +0 -124
  122. package/template/neo-bi-cmps/src/components/targetNumber__c/README.md +0 -100
  123. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/configSchema.ts +0 -253
  124. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.scss +0 -76
  125. package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +0 -148
  126. package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +0 -440
  127. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +0 -128
  128. package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +0 -173
  129. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/.prettierrc.js +0 -0
  130. /package/template/{neo-bi-cmps → asset-manage-template}/@types/neo-ui-common.d.ts +0 -0
  131. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/commitlint.config.js +0 -0
  132. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/css/base.css +0 -0
  133. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/scripts/app/bluebird.js +0 -0
  134. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/template.html +0 -0
  135. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/common.scss +0 -0
  136. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/mixin.scss +0 -0
  137. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/AIBtn.gif +0 -0
  138. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/NeoCRM.jpg +0 -0
  139. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/aiLogo.png +0 -0
  140. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/card-list.svg +0 -0
  141. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/contact-form.svg +0 -0
  142. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/custom-form.svg +0 -0
  143. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/custom-widget.svg +0 -0
  144. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/data-list.svg +0 -0
  145. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/detail.svg +0 -0
  146. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/favicon.png +0 -0
  147. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/map.svg +0 -0
  148. /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/search.svg +0 -0
  149. /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/table.svg +0 -0
  150. /package/template/{neo-bi-cmps → neo-web-cmps}/.prettierrc.js +0 -0
  151. /package/template/{neo-bi-cmps → neo-web-cmps}/README.md +0 -0
  152. /package/template/{neo-bi-cmps → neo-web-cmps}/commitlint.config.js +0 -0
  153. /package/template/{neo-bi-cmps → neo-web-cmps}/public/css/base.css +0 -0
  154. /package/template/{neo-bi-cmps → neo-web-cmps}/public/scripts/app/bluebird.js +0 -0
  155. /package/template/{neo-bi-cmps → neo-web-cmps}/public/template.html +0 -0
  156. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/css/common.scss +0 -0
  157. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/css/mixin.scss +0 -0
  158. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/NeoCRM.jpg +0 -0
  159. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/custom-widget.svg +0 -0
  160. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/favicon.png +0 -0
  161. /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/table.svg +0 -0
@@ -1,100 +0,0 @@
1
- # 数值指标组件 (targetNumber__c)
2
-
3
- ## 组件描述
4
-
5
- 数值指标组件用于展示关键数值指标,支持从 XObject 实体对象获取动态数据。组件支持绑定多个字段,每个字段都会显示为一个独立的数值块,支持自定义样式和布局方式。
6
-
7
- ## 功能特性
8
-
9
- - ✅ 支持从 XObject 实体对象获取动态数据
10
- - ✅ 支持数据源配置(使用 `xObjectEntityList`)
11
- - ✅ 支持多个字段绑定(使用 `selectFieldDescApi`,必填)
12
- - ✅ 支持自定义字体大小、颜色等样式配置
13
- - ✅ 支持两种布局方式:上图下文、左图右文
14
- - ✅ 支持数值格式化(数字类型自动添加千分位)
15
- - ✅ 支持加载状态和错误提示
16
- - ✅ 响应式设计,适配移动端和桌面端
17
- - ✅ 每个字段自动显示自己的标签和数值
18
-
19
- ## 使用方法
20
-
21
- ### 基础用法
22
-
23
- ```tsx
24
- <TargetNumber
25
- entityApiKey="customContact__c"
26
- selectFieldDesc={[
27
- {
28
- apiKey: "amount__c",
29
- label: "合同金额",
30
- type: "currency"
31
- },
32
- {
33
- apiKey: "count__c",
34
- label: "合同数量",
35
- type: "number"
36
- }
37
- ]}
38
- />
39
- ```
40
-
41
- ### 配置项说明
42
-
43
- | 属性名 | 类型 | 默认值 | 说明 |
44
- |--------|------|--------|------|
45
- | `entityApiKey` | `string` | - | 实体对象的 API Key |
46
- | `selectFieldDesc` | `object[]` | - | 绑定的字段描述信息数组(包含 apiKey、label、type),至少需要配置一个字段 |
47
- | `fontSize` | `number \| string` | `32` | 数值字体大小(单位:px) |
48
- | `fontColor` | `string` | `#262626` | 数值字体颜色 |
49
- | `fontWeight` | `number \| string` | `600` | 数值字体粗细 |
50
- | `titleFontSize` | `number \| string` | `14` | 字段标签字体大小(单位:px) |
51
- | `titleColor` | `string` | `#8c8c8c` | 字段标签字体颜色 |
52
- | `alignClass` | `'flex-col' \| 'flex-row'` | `'flex-col'` | 布局方式:flex-col(上图下文)或 flex-row(左图右文) |
53
- | `formatter` | `function` | - | 自定义数值格式化函数,接收 (value, fieldDesc) 参数 |
54
- | `className` | `string` | - | 组件类名 |
55
-
56
- ### 编辑器配置
57
-
58
- 组件在 Neo 平台编辑器中支持以下配置项:
59
-
60
- 1. **实体对象** (`xObjectEntityList`): 选择要获取数据的实体对象
61
- 2. **绑定字段** (`selectFieldDescApi`): 选择要显示的字段,支持多选,至少需要选择一个字段
62
- 3. **数值字体大小**: 设置数值的字体大小
63
- 4. **数值字体颜色**: 设置数值的字体颜色
64
- 5. **数值字体粗细**: 设置数值的字体粗细
65
- 6. **标签字体大小**: 设置字段标签的字体大小
66
- 7. **标签字体颜色**: 设置字段标签的字体颜色
67
- 8. **布局方式**: 选择上图下文或左图右文
68
-
69
- ### 支持的函数
70
-
71
- 组件支持以下函数,可在其他组件中触发:
72
-
73
- - `loadData`: 刷新数据,重新加载数值指标数据
74
-
75
- ## 数据获取方式
76
-
77
- 组件通过以下方式获取数据:
78
-
79
- 1. 使用 `xObject.query()` API 查询实体数据
80
- 2. 根据配置的 `entityApiKey` 和 `selectFieldDesc` 数组获取字段值
81
- 3. 直接使用查询结果的第一条记录的字段值,不进行前端聚合计算
82
- 4. 从第一条记录中提取所有选中字段的值,每个字段显示为一个独立的数值块
83
-
84
- ## 样式定制
85
-
86
- 组件使用 SCSS 编写样式,支持通过以下方式定制:
87
-
88
- 1. 修改 `style.scss` 文件
89
- 2. 通过 `className` 属性添加自定义类名
90
- 3. 通过内联样式属性(`fontSize`、`fontColor` 等)动态调整样式
91
-
92
- ## 注意事项
93
-
94
- 1. 使用组件前需要先配置 `entityApiKey` 和 `selectFieldDesc`(至少一个字段)
95
- 2. `selectFieldDesc` 必须是一个数组,至少包含一个有效的字段描述
96
- 3. 字段类型为 `number` 或 `currency` 时,会自动添加千分位格式化
97
- 4. 如果数据加载失败,会显示错误提示信息
98
- 5. 组件支持响应式设计,在不同屏幕尺寸下自动调整样式
99
- 6. 组件直接使用查询结果的第一条记录,不进行前端聚合计算
100
- 7. 每个字段都会显示自己的标签和数值,标签使用字段的 `label` 属性
@@ -1,253 +0,0 @@
1
- /**
2
- * 用于定制组件的样式配置
3
- * 备注:使用 JSONEditor 渲染配置内容。
4
- * 说明:以下 configSchema 可使用 JSONSchemaEditor 生成。使用方式见 https://github.com/wibetter/json-editor。
5
- * JSONEditor 在线地址:https://wibetter.github.io/json-editor/online-demo/6.0.0/index.html。
6
- */
7
- export const configSchema = {
8
- type: 'object',
9
- name: 'targetNumber',
10
- title: '自定义样式配置',
11
- properties: {
12
- baseStyle: {
13
- type: 'object',
14
- title: '基础样式',
15
- isFixed: false,
16
- properties: {
17
- backgroundColor: {
18
- type: 'color',
19
- title: '背景色',
20
- default: '#ffffff',
21
- description: '',
22
- },
23
- paddingMargin: {
24
- type: 'padding-margin',
25
- title: '内外边距',
26
- isContainer: false,
27
- properties: {
28
- margin: {
29
- title: '外边距',
30
- type: 'input',
31
- default: '0',
32
- description: '',
33
- },
34
- padding: {
35
- title: '内边距',
36
- type: 'input',
37
- default: '0',
38
- description: '',
39
- },
40
- quantity: {
41
- type: 'select',
42
- default: 'px',
43
- options: [
44
- {
45
- label: 'px',
46
- value: 'px',
47
- },
48
- {
49
- label: 'rem',
50
- value: 'rem',
51
- },
52
- {
53
- label: 'em',
54
- value: 'em',
55
- },
56
- {
57
- label: '%',
58
- value: '%',
59
- },
60
- ],
61
- title: '单位类型',
62
- },
63
- },
64
- propertyOrder: ['margin', 'padding', 'quantity'],
65
- description: '',
66
- },
67
- },
68
- propertyOrder: ['backgroundColor', 'paddingMargin'],
69
- },
70
- layoutStyle: {
71
- type: 'object',
72
- title: '布局配置',
73
- isFixed: false,
74
- properties: {
75
- legendOrient: {
76
- type: 'radio',
77
- title: '图例排列方向',
78
- options: [
79
- {
80
- label: '水平方向',
81
- value: 'horizontal',
82
- },
83
- {
84
- label: '垂直方向',
85
- value: 'vertical',
86
- },
87
- ],
88
- description: '',
89
- },
90
- alignClass: {
91
- type: 'radio',
92
- title: '排列方式',
93
- options: [
94
- {
95
- label: '上图下文',
96
- value: 'horizontal',
97
- },
98
- {
99
- label: '上文下图',
100
- value: 'flex-col-reverse',
101
- },
102
- {
103
- label: '左图右文',
104
- value: 'flex-row',
105
- },
106
- {
107
- label: '左文右图',
108
- value: 'flex-row-reverse',
109
- },
110
- ],
111
- description: '用于设置数值和标题的排列方式',
112
- default: 'horizontal',
113
- },
114
- },
115
- propertyOrder: ['legendOrient', 'alignClass'],
116
- },
117
- titleStyle: {
118
- type: 'object',
119
- title: '标题样式',
120
- isFixed: true,
121
- properties: {
122
- show: {
123
- type: 'boolean',
124
- title: '显示标题',
125
- default: false,
126
- description: '',
127
- },
128
- text: {
129
- title: '标题文字',
130
- type: 'input',
131
- default: '',
132
- description: '',
133
- placeholder: '',
134
- onShow: 'show',
135
- },
136
- fontSize: {
137
- type: 'number',
138
- title: '标题字号',
139
- default: 24,
140
- minimum: 0,
141
- maximum: 1000,
142
- description: '',
143
- onShow: 'show',
144
- },
145
- fontWeight: {
146
- type: 'number',
147
- title: '标题字重',
148
- default: 400,
149
- minimum: 0,
150
- maximum: 1000,
151
- description: '',
152
- onShow: 'show',
153
- },
154
- color: {
155
- type: 'color',
156
- title: '字体颜色',
157
- default: '#000000',
158
- description: '',
159
- onShow: 'show',
160
- },
161
- },
162
- propertyOrder: ['show', 'text', 'fontSize', 'fontWeight', 'color'],
163
- },
164
- numberStyle: {
165
- type: 'object',
166
- title: '数值样式',
167
- isFixed: false,
168
- properties: {
169
- fontSize: {
170
- type: 'number',
171
- title: '标题字号',
172
- default: 18,
173
- minimum: 0,
174
- maximum: 1000,
175
- description: '',
176
- onShow: '',
177
- },
178
- fontWeight: {
179
- type: 'number',
180
- title: '标题字重',
181
- default: 800,
182
- minimum: 0,
183
- maximum: 1000,
184
- description: '',
185
- onShow: '',
186
- },
187
- color: {
188
- type: 'color',
189
- title: '字体颜色',
190
- default: '#ffffff',
191
- description: '',
192
- onShow: '',
193
- },
194
- linkHref: {
195
- type: 'url',
196
- title: '数值链接',
197
- default: '',
198
- description: '配置点击数值跳转的地址',
199
- placeholder: '',
200
- },
201
- },
202
- propertyOrder: ['fontSize', 'fontWeight', 'color', 'linkHref'],
203
- },
204
- numberTitleStyle: {
205
- type: 'object',
206
- title: '数值标题样式',
207
- isFixed: false,
208
- properties: {
209
- fontSize: {
210
- type: 'number',
211
- title: '标题字号',
212
- default: 16,
213
- minimum: 0,
214
- maximum: 1000,
215
- description: '',
216
- onShow: '',
217
- },
218
- fontWeight: {
219
- type: 'number',
220
- title: '标题字重',
221
- default: 400,
222
- minimum: 0,
223
- maximum: 1000,
224
- description: '',
225
- onShow: '',
226
- },
227
- color: {
228
- type: 'color',
229
- title: '字体颜色',
230
- default: '#ffffff',
231
- description: '',
232
- onShow: '',
233
- },
234
- linkHref: {
235
- type: 'url',
236
- title: '数值标题链接',
237
- default: '',
238
- description: '配置点击数值标题跳转的地址',
239
- placeholder: '',
240
- },
241
- },
242
- propertyOrder: ['fontSize', 'fontWeight', 'color', 'linkHref'],
243
- },
244
- },
245
- propertyOrder: [
246
- 'baseStyle',
247
- 'layoutStyle',
248
- 'titleStyle',
249
- 'numberStyle',
250
- 'numberTitleStyle',
251
- ],
252
- lastUpdateTime: 1769497373733,
253
- };
@@ -1,76 +0,0 @@
1
- .properties-panel-custom-style-config {
2
- .custom-style-config-input-container {
3
- display: flex;
4
- flex-direction: row !important;
5
- align-items: center;
6
- gap: 0;
7
-
8
- .custom-style-config-input {
9
- flex: 1;
10
- height: 35px;
11
- padding: 4px 11px;
12
- border: 1px solid #d9d9d9;
13
- // border-right: none;
14
- border-radius: 2px 0 0 2px;
15
- background: var(--background-light);
16
- color: #262626;
17
- transition: all 0.2s ease;
18
- cursor: not-allowed;
19
-
20
- &::placeholder {
21
- color: #aaaaaa;
22
- }
23
-
24
- &:focus {
25
- box-shadow: none;
26
- border-color: #d9d9d9;
27
- }
28
-
29
- &.ant-input-disabled {
30
- color: var(--font-secondary);
31
- cursor: not-allowed;
32
- background: #f5f5f5;
33
- }
34
-
35
- &[readonly] {
36
- cursor: not-allowed;
37
- background: #fafafa;
38
- }
39
- }
40
-
41
- .custom-style-config-setting-btn {
42
- flex-shrink: 0;
43
- width: 35px;
44
- height: 35px;
45
- padding: 0;
46
- display: flex;
47
- align-items: center;
48
- justify-content: center;
49
- border: 1px solid #d9d9d9;
50
- // border-left: none;
51
- border-radius: 0 2px 2px 0;
52
- background: var(--background-light);
53
- cursor: pointer;
54
- transition: all 0.2s ease;
55
- margin-left: 0;
56
-
57
- &:hover:not(:disabled) {
58
- border-color: #40a9ff;
59
- color: #40a9ff;
60
- }
61
-
62
- &:disabled {
63
- color: var(--font-secondary);
64
- border-color: #d9d9d9;
65
- background: #f5f5f5;
66
- cursor: not-allowed;
67
- }
68
- }
69
- }
70
- }
71
-
72
- .custom-style-config-modal-content {
73
- min-height: 400px;
74
- max-height: 600px;
75
- overflow-y: auto;
76
- }
@@ -1,148 +0,0 @@
1
- // @ts-ignore
2
- import { FormItem, RendererProps } from 'amis';
3
- import React from 'react';
4
- import { Input, Button, Modal, message } from 'antd';
5
- import { SettingOutlined } from '@ant-design/icons';
6
- // @ts-ignore
7
- import JSONEditor from '@wibetter/json-editor';
8
- import '@wibetter/json-editor/lib/index.css';
9
-
10
- import { configSchema } from './configSchema';
11
- import './index.scss';
12
-
13
- interface ICustomStyleConfigProps {
14
- onChange?: Function;
15
- value?: any;
16
- name: string;
17
- }
18
-
19
- interface ICustomStyleConfigState {
20
- isModalVisible: boolean;
21
- editorValue: any;
22
- }
23
-
24
- @FormItem({
25
- type: 'customStyleConfig',
26
- detectProps: ['data'],
27
- })
28
- export default class CustomStyleConfigRenderer extends React.Component<
29
- RendererProps & ICustomStyleConfigProps,
30
- ICustomStyleConfigState
31
- > {
32
- constructor(props: RendererProps & ICustomStyleConfigProps) {
33
- super(props);
34
-
35
- this.state = {
36
- isModalVisible: false,
37
- editorValue: props.value || {},
38
- };
39
-
40
- this.showModal = this.showModal.bind(this);
41
- this.handleModalOk = this.handleModalOk.bind(this);
42
- this.handleModalCancel = this.handleModalCancel.bind(this);
43
- this.handleEditorChange = this.handleEditorChange.bind(this);
44
- }
45
-
46
- handleEditorChange = (value: any) => {
47
- this.setState({ editorValue: value });
48
- };
49
-
50
- handleModalOk = () => {
51
- const { editorValue } = this.state;
52
- const { onChange } = this.props;
53
-
54
- try {
55
- onChange && onChange(editorValue);
56
- this.setState({ isModalVisible: false });
57
- } catch (error) {
58
- message.error('保存配置失败');
59
- }
60
- };
61
-
62
- handleModalCancel = () => {
63
- // 取消时恢复原始值
64
- const value = this.props.value || {};
65
- this.setState({
66
- isModalVisible: false,
67
- editorValue: value,
68
- });
69
- };
70
-
71
- showModal = () => {
72
- const value = this.props.value || {};
73
- this.setState({
74
- isModalVisible: true,
75
- editorValue: value,
76
- });
77
- };
78
-
79
- getDisplayValue = () => {
80
- const { value } = this.props;
81
-
82
- if (!value || Object.keys(value).length === 0) {
83
- return '';
84
- }
85
-
86
- return '已配置自定义样式';
87
- };
88
-
89
- render() {
90
- const { disabled, viewStyle, wideScreen, value } = this.props;
91
- const { isModalVisible } = this.state;
92
- console.log('customStyleConfig:', this.props);
93
- console.log('test1:', this.props.data['__NeoPageInfo']);
94
-
95
- return (
96
- <div className="properties-panel-custom-style-config">
97
- <div className="custom-style-config-input-container">
98
- <Input
99
- value={this.getDisplayValue()}
100
- placeholder="请配置自定义样式"
101
- disabled={disabled}
102
- readOnly
103
- className="custom-style-config-input"
104
- />
105
- <Button
106
- type="text"
107
- icon={<SettingOutlined />}
108
- onClick={this.showModal}
109
- disabled={disabled}
110
- className="custom-style-config-setting-btn"
111
- />
112
- </div>
113
- <Modal
114
- title="自定义样式配置"
115
- visible={isModalVisible}
116
- onOk={this.handleModalOk}
117
- onCancel={this.handleModalCancel}
118
- width={800}
119
- centered={true}
120
- okText="确定"
121
- cancelText="取消"
122
- destroyOnClose={false}
123
- >
124
- <div className="custom-style-config-modal-content">
125
- {isModalVisible && (
126
- <JSONEditor
127
- schemaData={configSchema}
128
- jsonData={value}
129
- onChange={this.handleEditorChange}
130
- viewStyle={viewStyle || 'tabs'}
131
- tabPosition="left"
132
- wideScreen={wideScreen ?? false}
133
- />
134
- )}
135
- </div>
136
- </Modal>
137
- </div>
138
- );
139
- }
140
- }
141
-
142
- /*
143
- // 通过 普通方式进行
144
- FormItem({
145
- type: 'customStyleConfig',
146
- detectProps: ['data'],
147
- })(CustomStyleConfigRenderer);
148
- */