neo-cmp-cli 1.13.18 → 1.13.20
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 +217 -600
- package/dist/neo/neoRequire.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -2
- package/template/asset-manage-template/package.json +2 -2
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +2 -2
- package/template/neo-bi-cmps/package.json +2 -2
- package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +1 -1
- package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +18 -10
- package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +8 -2
- package/template/neo-bi-cmps/src/utils/common.ts +18 -20
- package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +4 -6
- package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +4 -2
- package/template/neo-bi-cmps/src/utils/simpleTable.tsx +21 -16
- package/template/neo-custom-cmp-template/package.json +2 -2
- package/template/neo-custom-cmp-template/src/components/customApi__c/README.md +90 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/index.tsx +184 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/model.ts +53 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/style.scss +116 -0
- package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +5 -1
- package/template/neo-custom-cmp-template/src/components/simpleCmp__c/index.tsx +4 -1
- package/template/neo-h5-cmps/neo.config.js +1 -1
- package/template/neo-h5-cmps/package.json +2 -2
- package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +0 -1
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-pipeline-cmps/package.json +1 -1
- package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +10 -2
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +1 -0
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +14 -2
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/reset.scss +4 -0
- package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +2 -1
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +14 -2
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +14 -2
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +271 -259
- package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +17 -3
- package/template/neo-web-entity-grid/src/components/createForm__c/resetAntd.scss +0 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/style.scss +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/index.tsx +5 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +4 -3
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/index.tsx +1 -1
- package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +4 -3
- package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +9 -4
- package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +2 -1
- package/template/neo-web-form/package.json +2 -2
- package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +19 -19
- package/template/neo-web-form/src/components/batchAddTable__c/model.ts +11 -15
- package/template/neo-web-form/src/components/listSummary__c/index.tsx +6 -5
- package/template/react-custom-cmp-template/package.json +1 -1
- package/docs/H5/347/253/257 NeoEntityList /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -293
- package/docs/Web/347/253/257 NeoEntityGrid /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -1206
- package/docs//345/217/257/347/224/250/345/261/236/346/200/247/351/205/215/347/275/256/351/241/271.md +0 -801
- package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/forward.zip +0 -0
- package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243//350/207/252/345/256/232/344/271/211API:/351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -13
package/dist/neo/neoRequire.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash");var e,n;exports.__require=function(){if(n)return e;n=1;const s=o,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash");var e,n;exports.__require=function(){if(n)return e;n=1;const s=o,d={react:"^16.13.1","react-dom":"^16.13.1",mobx:"^6.3.0","mobx-react":"^7.0.0","mobx-state-tree":"^5.4.0",axios:"^1.7.0",classnames:"^2.3.2",qs:"^6.11.0",lodash:"^4.17.23",amis:"^1.1.5",antd:"4.9.4","antd-mobile":"2.3.4","@ant-design/icons":"^4.8.0","neo-ui-component-web":"^1.0.0","neo-ui-component-h5":"^1.0.0","neo-ui-common":"^1.0.0"};return e={initNeoRequire:()=>{window.neoRequire||(window.neoRequire=o=>window.__NeoCommonModules[o]||window[o])},addNeoCommonModules:o=>{if(window.__NeoCommonModules||(window.__NeoCommonModules={}),isPlainObject(o)){Object.keys(o).forEach(e=>{const n=o[e],s=window.__NeoCommonModules[e];if(!Object.isFrozen(s)&&s&&Object.keys(s).length<3)try{window.__NeoCommonModules[e]=Object.assign(s,n),void 0!==n.__esModule&&(window.__NeoCommonModules[e].__esModule=n.__esModule),void 0!==n.default&&(window.__NeoCommonModules[e].default=n.default)}catch(o){console.warn(`window.__NeoCommonModules[${e}] Object.assign error:`,o),window.__NeoCommonModules[e]=n}else window.__NeoCommonModules[e]=n})}},addNeoRemoteDeps:o=>{window.__NeoCommonModules||(window.__NeoCommonModules={}),window.__NeoCommonModules.__neoRemoteDeps||(window.__NeoCommonModules.__neoRemoteDeps={}),s.isPlainObject(o)&&(window.__NeoCommonModules.__neoRemoteDeps=Object.assign(window.__NeoCommonModules.__neoRemoteDeps,o))},getExternalsByNeoCommonModules:o=>{const e={};return Object.keys(d).forEach(o=>{e[o]=`commonjs ${o}`}),o&&o.length>0&&o.forEach(o=>{e[o]=`commonjs ${o}`}),e}}};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.13.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.13.20";const o={version:e};exports.default=o,exports.version=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo-cmp-cli",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.20",
|
|
4
4
|
"description": "Neo 自定义组件开发工具,支持react 和 vue2.0技术栈。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neo-cli",
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"bin/*",
|
|
21
21
|
"dist/*",
|
|
22
|
-
"docs/*",
|
|
23
22
|
"template/*"
|
|
24
23
|
],
|
|
25
24
|
"husky": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"axios": "^1.7.0",
|
|
42
42
|
"antd": "4.9.4",
|
|
43
43
|
"lodash": "^4.17.21",
|
|
44
|
-
"neo-open-api": "^1.2.
|
|
44
|
+
"neo-open-api": "^1.2.9",
|
|
45
45
|
"tslib": "2.3.0",
|
|
46
46
|
"echarts": "^5.5.1",
|
|
47
47
|
"moment": "^2.30.1"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/react": "^16.9.11",
|
|
53
53
|
"@types/react-dom": "^16.9.15",
|
|
54
54
|
"@types/axios": "^0.14.0",
|
|
55
|
-
"neo-cmp-cli": "^1.13.
|
|
55
|
+
"neo-cmp-cli": "^1.13.20",
|
|
56
56
|
"husky": "^4.2.5",
|
|
57
57
|
"lint-staged": "^10.2.9",
|
|
58
58
|
"prettier": "^2.0.5",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"react": "^16.9.0",
|
|
35
35
|
"react-dom": "^16.9.0",
|
|
36
36
|
"antd": "4.9.4",
|
|
37
|
-
"neo-open-api": "^1.2.
|
|
37
|
+
"neo-open-api": "^1.2.9"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@commitlint/cli": "^18.0.0",
|
|
41
41
|
"@commitlint/config-conventional": "^18.0.0",
|
|
42
42
|
"@types/react": "^16.9.11",
|
|
43
43
|
"@types/react-dom": "^16.9.15",
|
|
44
|
-
"neo-cmp-cli": "^1.13.
|
|
44
|
+
"neo-cmp-cli": "^1.13.20",
|
|
45
45
|
"husky": "^4.2.5",
|
|
46
46
|
"lint-staged": "^10.2.9",
|
|
47
47
|
"prettier": "^2.0.5"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"echarts": "^5.6.0",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
40
|
"moment": "^2.30.1",
|
|
41
|
-
"neo-open-api": "^1.2.
|
|
41
|
+
"neo-open-api": "^1.2.8",
|
|
42
42
|
"neo-register": "^1.1.3",
|
|
43
43
|
"react": "^16.9.0",
|
|
44
44
|
"react-dom": "^16.9.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@types/react-dom": "^16.9.15",
|
|
54
54
|
"husky": "^4.2.5",
|
|
55
55
|
"lint-staged": "^10.2.9",
|
|
56
|
-
"neo-cmp-cli": "^1.13.
|
|
56
|
+
"neo-cmp-cli": "^1.13.20",
|
|
57
57
|
"prettier": "^2.0.5"
|
|
58
58
|
},
|
|
59
59
|
"overrides": {
|
|
@@ -156,8 +156,7 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
156
156
|
this.handleCloseDateRangeChange.bind(this);
|
|
157
157
|
this.handleChangesSinceTimeChange =
|
|
158
158
|
this.handleChangesSinceTimeChange.bind(this);
|
|
159
|
-
this.closeDateRangePickerValue =
|
|
160
|
-
this.closeDateRangePickerValue.bind(this);
|
|
159
|
+
this.closeDateRangePickerValue = this.closeDateRangePickerValue.bind(this);
|
|
161
160
|
this.changesSinceDatePickerValue =
|
|
162
161
|
this.changesSinceDatePickerValue.bind(this);
|
|
163
162
|
this.getFilters = this.getFilters.bind(this);
|
|
@@ -245,9 +244,10 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
245
244
|
closeDateCustomRange: isCustom
|
|
246
245
|
? prev.closeDateCustomRange
|
|
247
246
|
: relativeRange,
|
|
248
|
-
changesSinceCustomTime:
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
changesSinceCustomTime:
|
|
248
|
+
prev.values.changesSince === 'Custom'
|
|
249
|
+
? prev.changesSinceCustomTime
|
|
250
|
+
: relativeRange?.start ?? null,
|
|
251
251
|
};
|
|
252
252
|
});
|
|
253
253
|
}
|
|
@@ -285,8 +285,8 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
285
285
|
changesSinceCustomTime: changesCustom
|
|
286
286
|
? changesSinceCustomTime ?? undefined
|
|
287
287
|
: rangeResolved?.start != null
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
? rangeResolved.start
|
|
289
|
+
: undefined,
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -299,7 +299,7 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
299
299
|
onValuesChange(payload);
|
|
300
300
|
}
|
|
301
301
|
this.onFiltersChange({
|
|
302
|
-
data: payload
|
|
302
|
+
data: payload,
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
/*
|
|
@@ -317,7 +317,11 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
317
317
|
this.setState({ ownerLoading: true });
|
|
318
318
|
const currentUser = Object.assign({}, this.props.data?.__NeoCurrentUser);
|
|
319
319
|
// 给当前用户增加标记
|
|
320
|
-
if (
|
|
320
|
+
if (
|
|
321
|
+
currentUser &&
|
|
322
|
+
currentUser.name &&
|
|
323
|
+
currentUser.name.indexOf('(CurrentUser)') === -1
|
|
324
|
+
) {
|
|
321
325
|
currentUser.name = currentUser.name + '(CurrentUser)';
|
|
322
326
|
}
|
|
323
327
|
const currentUserRecords =
|
|
@@ -709,7 +713,11 @@ class FilterBar extends BaseCmp<FilterBarProps, FilterBarState> {
|
|
|
709
713
|
console.log('[FilterBar__c] render', this.props);
|
|
710
714
|
|
|
711
715
|
return (
|
|
712
|
-
<div
|
|
716
|
+
<div
|
|
717
|
+
className={`filterBar__c ${className || ''}`}
|
|
718
|
+
style={style}
|
|
719
|
+
data-time="2026.4.15 01"
|
|
720
|
+
>
|
|
713
721
|
{this.renderCloseDateBlock()}
|
|
714
722
|
{this.renderOwnerBlock()}
|
|
715
723
|
{this.renderBusinessTypeBlock()}
|
|
@@ -25,8 +25,14 @@ export class FilterBarModel {
|
|
|
25
25
|
label: '筛选条件变化后',
|
|
26
26
|
helpText:
|
|
27
27
|
'任一筛选项或自定义时间区间变更时触发;事件参数含 closeDate、closeDateCustomRange(非 custom 时为当前相对周期起止 Unix 毫秒时间戳;custom 时为 RangePicker 起止)、opportunityOwner(负责人多选 id 数组)、businessType、businessTypeLabel(业务类型展示名)、changesSince、changesSinceCustomTime(Changes Since 为 Custom 时为所选日期当日 0 点;否则在 Close Date 非 custom 时为周期起点当日 0 点)',
|
|
28
|
-
eventParams:
|
|
29
|
-
|
|
28
|
+
eventParams: [
|
|
29
|
+
{
|
|
30
|
+
apiKey: 'eventParam',
|
|
31
|
+
children: [{ apiKey: 'data', label: '当前筛选数据', type: 'Object' }],
|
|
32
|
+
label: '事件入参',
|
|
33
|
+
type: 'Object',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
30
36
|
},
|
|
31
37
|
];
|
|
32
38
|
|
|
@@ -131,16 +131,18 @@ export function getDefaultOpportunityOwnerIds(
|
|
|
131
131
|
): (number | string)[] {
|
|
132
132
|
// return [1246045]; // 默认用户改成 (Alice)
|
|
133
133
|
const curUser = props.data?.__NeoCurrentUser;
|
|
134
|
-
if (
|
|
134
|
+
if (
|
|
135
|
+
curUser?.id == null ||
|
|
136
|
+
curUser.name == null ||
|
|
137
|
+
String(curUser.name).trim() === ''
|
|
138
|
+
) {
|
|
135
139
|
return [];
|
|
136
140
|
}
|
|
137
141
|
return [curUser.id];
|
|
138
142
|
}
|
|
139
143
|
|
|
140
144
|
/** 负责人多选默认值:当前登录用户 id(与 __NeoCurrentUser 一致) */
|
|
141
|
-
export function getDefaultFilterWhereByProps(
|
|
142
|
-
props: any = {},
|
|
143
|
-
): any {
|
|
145
|
+
export function getDefaultFilterWhereByProps(props: any = {}): any {
|
|
144
146
|
let userId = 1246045; // 默认用户(Alice)
|
|
145
147
|
const curUser = props.data?.__NeoCurrentUser;
|
|
146
148
|
if (curUser?.id) {
|
|
@@ -204,28 +206,24 @@ export function getDefaultFilterWhereByProps(
|
|
|
204
206
|
return defaultFilter;
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
export function getDefaultFilterByProps(
|
|
208
|
-
props: any = {},
|
|
209
|
-
): any {
|
|
209
|
+
export function getDefaultFilterByProps(props: any = {}): any {
|
|
210
210
|
let userId = 1246045; // 默认用户(Alice)
|
|
211
211
|
const curUser = props.data?.__NeoCurrentUser;
|
|
212
212
|
if (curUser?.id) {
|
|
213
213
|
userId = curUser.id;
|
|
214
214
|
}
|
|
215
215
|
const defaultFilter = {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
closeDate: 401,
|
|
217
|
+
closeDateCustomRange: {
|
|
218
|
+
start: 1775059200000,
|
|
219
|
+
end: 1782835199999,
|
|
220
220
|
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"changesSince": "Start of the Period",
|
|
228
|
-
"changesSinceCustomTime": 1775059200000
|
|
221
|
+
opportunityOwner: [userId],
|
|
222
|
+
businessType: 8150459,
|
|
223
|
+
businessTypeLabel: 'New Business',
|
|
224
|
+
businessTypeApiKey: 'defaultBusiType_1',
|
|
225
|
+
changesSince: 'Start of the Period',
|
|
226
|
+
changesSinceCustomTime: 1775059200000,
|
|
229
227
|
};
|
|
230
228
|
return defaultFilter;
|
|
231
|
-
}
|
|
229
|
+
}
|
|
@@ -248,11 +248,9 @@ function entityTypeChunk(
|
|
|
248
248
|
*/
|
|
249
249
|
export const filter2chartFilter = (filter: any): ChartFilterPayload => {
|
|
250
250
|
const f = filter && typeof filter === 'object' ? filter : {};
|
|
251
|
-
const parts = [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
entityTypeChunk(f),
|
|
255
|
-
].filter(Boolean) as Omit<ChartFilterItem, 'seq'>[];
|
|
251
|
+
const parts = [closeDateChunk(f), ownerChunk(f), entityTypeChunk(f)].filter(
|
|
252
|
+
Boolean,
|
|
253
|
+
) as Omit<ChartFilterItem, 'seq'>[];
|
|
256
254
|
|
|
257
255
|
const filterOut: ChartFilterItem[] = parts.map((p, i) => ({
|
|
258
256
|
...p,
|
|
@@ -265,4 +263,4 @@ export const filter2chartFilter = (filter: any): ChartFilterPayload => {
|
|
|
265
263
|
: filterOut.map((x) => String(x.seq)).join(' and ');
|
|
266
264
|
|
|
267
265
|
return { relation, filter: filterOut };
|
|
268
|
-
};
|
|
266
|
+
};
|
|
@@ -132,13 +132,15 @@ export function classicFunnelLayerHeightPercents(
|
|
|
132
132
|
if (n === 0) return [];
|
|
133
133
|
const h = Math.max(viewHeightPx, 1);
|
|
134
134
|
const factor = (h - gapPx * Math.max(n - 1, 0)) / h;
|
|
135
|
-
const positives = amountNums.map((v) =>
|
|
135
|
+
const positives = amountNums.map((v) =>
|
|
136
|
+
Number.isFinite(v) && v > 0 ? v : 0,
|
|
137
|
+
);
|
|
136
138
|
const sum = positives.reduce((a, v) => a + v, 0);
|
|
137
139
|
if (sum <= 0) {
|
|
138
140
|
const even = (100 / n) * factor;
|
|
139
141
|
return Array(n).fill(`${even}%`);
|
|
140
142
|
}
|
|
141
|
-
return positives.map((v) => `${
|
|
143
|
+
return positives.map((v) => `${100 * (v / sum) * factor}%`);
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
export interface BuildFunnelChartOptionParams {
|
|
@@ -91,9 +91,7 @@ export function historyRowToSnap(row: unknown): HistoryOppSnap | null {
|
|
|
91
91
|
opportunityName: String(
|
|
92
92
|
o.opportunity_1_opportunityName ?? o.opportunityName ?? '',
|
|
93
93
|
),
|
|
94
|
-
saleStageId: String(
|
|
95
|
-
o.opportunity_1_saleStageId ?? o.saleStageId ?? '',
|
|
96
|
-
),
|
|
94
|
+
saleStageId: String(o.opportunity_1_saleStageId ?? o.saleStageId ?? ''),
|
|
97
95
|
money: o.opportunity_1_money ?? o.money,
|
|
98
96
|
};
|
|
99
97
|
}
|
|
@@ -151,7 +149,9 @@ export function formatMoneyCell(value: unknown): string {
|
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
/** oppHealthAssessmentLevel:数值 → 健康度标签(带颜色背景) */
|
|
154
|
-
export function renderOppHealthAssessmentLevel(
|
|
152
|
+
export function renderOppHealthAssessmentLevel(
|
|
153
|
+
value: unknown,
|
|
154
|
+
): React.ReactNode {
|
|
155
155
|
if (value == null || value === '') return '—';
|
|
156
156
|
const n = toFiniteNumber(value);
|
|
157
157
|
if (n === 5) {
|
|
@@ -160,7 +160,9 @@ export function renderOppHealthAssessmentLevel(value: unknown): React.ReactNode
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
if (n === 6) {
|
|
163
|
-
return
|
|
163
|
+
return (
|
|
164
|
+
<span className="opp-health-tag opp-health-tag--yellow">Health</span>
|
|
165
|
+
);
|
|
164
166
|
}
|
|
165
167
|
if (n === 7) {
|
|
166
168
|
return <span className="opp-health-tag opp-health-tag--red">Risk</span>;
|
|
@@ -205,7 +207,9 @@ export function moneyChangeTooltipTitle(
|
|
|
205
207
|
<div className="simpleTable-change-tip__detail">
|
|
206
208
|
{formatMoneyCell(h.money)}
|
|
207
209
|
{' → '}
|
|
208
|
-
<span className="simpleTable-change-tip__to">
|
|
210
|
+
<span className="simpleTable-change-tip__to">
|
|
211
|
+
{formatMoneyCell(current)}
|
|
212
|
+
</span>
|
|
209
213
|
</div>
|
|
210
214
|
<div className="simpleTable-change-tip__meta">
|
|
211
215
|
Changed on {formatChangeRecordedAt(preset)}
|
|
@@ -227,7 +231,9 @@ export function closeDateChangeTooltipTitle(
|
|
|
227
231
|
<div className="simpleTable-change-tip__detail">
|
|
228
232
|
{formatCloseDate(h.closeDate)}
|
|
229
233
|
{' → '}
|
|
230
|
-
<span className="simpleTable-change-tip__to">
|
|
234
|
+
<span className="simpleTable-change-tip__to">
|
|
235
|
+
{formatCloseDate(current)}
|
|
236
|
+
</span>
|
|
231
237
|
</div>
|
|
232
238
|
<div className="simpleTable-change-tip__meta">
|
|
233
239
|
Changed on {formatChangeRecordedAt(preset)}
|
|
@@ -275,15 +281,10 @@ export function renderWinRateHoverCard(record: any): React.ReactNode {
|
|
|
275
281
|
const negatives = record?.customItem242__c;
|
|
276
282
|
const winRate = record?.customItem239__c;
|
|
277
283
|
|
|
278
|
-
const fmtLine = (v: unknown) =>
|
|
279
|
-
v == null || v === '' ? '—' : String(v);
|
|
284
|
+
const fmtLine = (v: unknown) => (v == null || v === '' ? '—' : String(v));
|
|
280
285
|
|
|
281
286
|
return (
|
|
282
|
-
<Card
|
|
283
|
-
size="small"
|
|
284
|
-
bordered={false}
|
|
285
|
-
className="simpleTable-winrate-card"
|
|
286
|
-
>
|
|
287
|
+
<Card size="small" bordered={false} className="simpleTable-winrate-card">
|
|
287
288
|
<div className="simpleTable-winrate-card__baseline">
|
|
288
289
|
Baseline Probability{' '}
|
|
289
290
|
<span className="simpleTable-winrate-card__baseline-val">
|
|
@@ -291,12 +292,16 @@ export function renderWinRateHoverCard(record: any): React.ReactNode {
|
|
|
291
292
|
</span>
|
|
292
293
|
</div>
|
|
293
294
|
<hr className="simpleTable-winrate-card__hr" />
|
|
294
|
-
<div className="simpleTable-winrate-card__section-title">
|
|
295
|
+
<div className="simpleTable-winrate-card__section-title">
|
|
296
|
+
Positive Factors
|
|
297
|
+
</div>
|
|
295
298
|
<div className="simpleTable-winrate-card__positives">
|
|
296
299
|
{fmtLine(positives)}
|
|
297
300
|
</div>
|
|
298
301
|
<hr className="simpleTable-winrate-card__hr" />
|
|
299
|
-
<div className="simpleTable-winrate-card__section-title">
|
|
302
|
+
<div className="simpleTable-winrate-card__section-title">
|
|
303
|
+
Negative Factors
|
|
304
|
+
</div>
|
|
300
305
|
<div className="simpleTable-winrate-card__negatives">
|
|
301
306
|
{fmtLine(negatives)}
|
|
302
307
|
</div>
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"axios": "^1.7.0",
|
|
48
48
|
"antd": "^4.9.4",
|
|
49
49
|
"lodash": "^4.17.23",
|
|
50
|
-
"neo-open-api": "^1.2.
|
|
50
|
+
"neo-open-api": "^1.2.9"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@commitlint/cli": "^18.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/react": "^16.9.11",
|
|
56
56
|
"@types/react-dom": "^16.9.15",
|
|
57
57
|
"@types/axios": "^0.14.0",
|
|
58
|
-
"neo-cmp-cli": "^1.13.
|
|
58
|
+
"neo-cmp-cli": "^1.13.20",
|
|
59
59
|
"husky": "^4.2.5",
|
|
60
60
|
"lint-staged": "^10.2.9",
|
|
61
61
|
"prettier": "^2.0.5"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# XObject 数据表格组件(简化版)
|
|
2
|
+
|
|
3
|
+
基于 XObject 的数据表格组件,仅支持数据展示,表格列根据 `xObject.getDesc` 返回的 fields 动态生成。
|
|
4
|
+
备注:使用 Neo Open API SDK(neo-open-api) 提供的方法实现数据对象的查询操作。
|
|
5
|
+
|
|
6
|
+
## 功能特性
|
|
7
|
+
|
|
8
|
+
- 📊 **动态表格列**:根据 XObject 字段描述自动生成表格列
|
|
9
|
+
- 🔍 **数据展示**:支持展示 XObject 实体数据
|
|
10
|
+
- 🎨 **响应式设计**:适配不同屏幕尺寸
|
|
11
|
+
- ⚙️ **属性配置**:支持通过编辑器配置组件属性
|
|
12
|
+
|
|
13
|
+
## 组件属性
|
|
14
|
+
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 说明 |
|
|
16
|
+
|--------|------|--------|------|
|
|
17
|
+
| title | string | '数据表格' | 表格标题 |
|
|
18
|
+
| xObjectDataApi | object | - | 实体数据源配置 |
|
|
19
|
+
| xObjectDataApi.xObjectApiKey | string | '' | 数据对象的 API Key |
|
|
20
|
+
| xObjectDataApi.fields | string[] | [] | 要显示的字段列表 |
|
|
21
|
+
|
|
22
|
+
## 使用方法
|
|
23
|
+
|
|
24
|
+
### 1. 在编辑器中使用
|
|
25
|
+
|
|
26
|
+
1. 从组件面板拖拽 "实体数据表格(简化版)" 组件到页面
|
|
27
|
+
2. 在右侧属性面板中选择要操作的数据对象
|
|
28
|
+
3. 配置要显示的字段(可选)
|
|
29
|
+
4. 保存并预览
|
|
30
|
+
|
|
31
|
+
### 2. 代码中使用
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import SimpleTable from './components/simpleTable__c';
|
|
35
|
+
|
|
36
|
+
// 使用组件
|
|
37
|
+
<SimpleTable
|
|
38
|
+
xObjectDataApi={{
|
|
39
|
+
xObjectApiKey: 'customContact__c',
|
|
40
|
+
fields: ['name', 'phone__c'],
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 技术实现
|
|
46
|
+
|
|
47
|
+
### 核心依赖
|
|
48
|
+
|
|
49
|
+
- **Ant Design**:UI 组件库
|
|
50
|
+
- **React**:前端框架
|
|
51
|
+
- **TypeScript**:类型支持
|
|
52
|
+
|
|
53
|
+
### 数据流程
|
|
54
|
+
|
|
55
|
+
1. **初始化**:组件挂载时获取字段描述
|
|
56
|
+
2. **列生成**:根据字段描述动态生成表格列
|
|
57
|
+
3. **数据加载**:使用 `xObject.query` 获取数据列表
|
|
58
|
+
|
|
59
|
+
## 样式定制
|
|
60
|
+
|
|
61
|
+
组件提供了完整的 SCSS 样式文件,支持以下定制:
|
|
62
|
+
|
|
63
|
+
- 表格样式(边框、悬停效果等)
|
|
64
|
+
- 响应式设计(移动端适配)
|
|
65
|
+
|
|
66
|
+
## 注意事项
|
|
67
|
+
|
|
68
|
+
1. **权限要求**:确保用户有对应 XObject 的读取权限
|
|
69
|
+
2. **字段类型**:支持所有基础字段类型的展示
|
|
70
|
+
3. **错误处理**:组件内置了完善的错误处理和用户提示
|
|
71
|
+
|
|
72
|
+
## 与完整版组件的区别
|
|
73
|
+
|
|
74
|
+
本简化版组件相比完整版 `entityTable__c` 组件:
|
|
75
|
+
|
|
76
|
+
- ❌ **不支持新增**:移除了新增记录功能
|
|
77
|
+
- ❌ **不支持编辑**:移除了编辑记录功能
|
|
78
|
+
- ❌ **不支持删除**:移除了删除记录功能
|
|
79
|
+
- ❌ **不支持刷新**:移除了手动刷新按钮
|
|
80
|
+
- ❌ **不支持分页**:移除了分页功能,显示所有数据
|
|
81
|
+
- ✅ **仅支持展示**:专注于数据展示功能
|
|
82
|
+
|
|
83
|
+
## 扩展开发
|
|
84
|
+
|
|
85
|
+
如需扩展功能,可以:
|
|
86
|
+
|
|
87
|
+
1. **添加字段类型支持**:在 `generateColumns()` 方法中添加字段格式化逻辑
|
|
88
|
+
2. **自定义样式**:修改 `style.scss` 文件定制组件外观
|
|
89
|
+
3. **添加排序功能**:扩展表格功能支持列排序
|
|
90
|
+
|