neo-cmp-cli 1.13.22 → 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.
Files changed (83) hide show
  1. package/README.md +3 -0
  2. package/package.json +1 -1
  3. package/template/antd-custom-cmp-template/package.json +1 -1
  4. package/template/antd-custom-cmp-template/src/components/dataDashboard__c/model.ts +1 -1
  5. package/template/antd-custom-cmp-template/src/components/dataDashboard__c/style.scss +11 -11
  6. package/template/antd-custom-cmp-template/src/components/searchWidget__c/model.ts +1 -1
  7. package/template/asset-manage-template/package.json +1 -1
  8. package/template/asset-manage-template/src/components/assetManage__c/style.scss +4 -4
  9. package/template/asset-manage-template/src/components/bidList__c/style.scss +2 -2
  10. package/template/asset-manage-template/src/components/bidPackage__c/style.scss +2 -2
  11. package/template/echarts-custom-cmp-template/package.json +1 -1
  12. package/template/echarts-custom-cmp-template/src/components/chartWidget__c/model.ts +1 -1
  13. package/template/echarts-custom-cmp-template/src/components/chartWidget__c/style.scss +1 -1
  14. package/template/empty-custom-cmp-template/package.json +1 -1
  15. package/template/map-custom-cmp-template/package.json +1 -1
  16. package/template/map-custom-cmp-template/src/components/mapWidget__c/model.ts +1 -1
  17. package/template/map-custom-cmp-template/src/components/mapWidget__c/style.scss +2 -2
  18. package/template/neo-bi-cmps/package.json +1 -1
  19. package/template/neo-bi-cmps/public/demo.html +10 -10
  20. package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +2 -1
  21. package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +13 -8
  22. package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +10 -4
  23. package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +13 -5
  24. package/template/neo-custom-cmp-template/package.json +1 -1
  25. package/template/neo-custom-cmp-template/src/components/customApi__c/model.ts +1 -1
  26. package/template/neo-custom-cmp-template/src/components/customApi__c/style.scss +5 -3
  27. package/template/neo-custom-cmp-template/src/components/entityDetail__c/index.tsx +25 -54
  28. package/template/neo-custom-cmp-template/src/components/entityDetail__c/model.ts +1 -1
  29. package/template/neo-custom-cmp-template/src/components/entityDetail__c/style.scss +111 -68
  30. package/template/neo-custom-cmp-template/src/components/entityForm__c/index.tsx +0 -1
  31. package/template/neo-custom-cmp-template/src/components/entityForm__c/model.ts +1 -1
  32. package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +0 -1
  33. package/template/neo-custom-cmp-template/src/components/entityTable__c/model.ts +11 -11
  34. package/template/neo-custom-cmp-template/src/components/entityTable__c/style.scss +4 -4
  35. package/template/neo-custom-cmp-template/src/components/simpleCmp__c/index.tsx +2 -2
  36. package/template/neo-custom-cmp-template/src/components/simpleCmp__c/model.ts +1 -1
  37. package/template/neo-h5-cmps/package.json +1 -1
  38. package/template/neo-h5-cmps/src/components/chatPage__c/model.ts +1 -1
  39. package/template/neo-h5-cmps/src/components/entityList__c/model.ts +1 -1
  40. package/template/neo-h5-cmps/src/components/entityTabs__c/model.ts +2 -2
  41. package/template/neo-h5-cmps/src/components/entityTabs__c/style.scss +15 -6
  42. package/template/neo-h5-cmps/src/components/globalSearchInput__c/model.ts +1 -1
  43. package/template/neo-h5-cmps/src/components/openChatPageBtn__c/model.ts +1 -1
  44. package/template/neo-order-cmps/src/components/entityInfoCard__c/index.tsx +4 -12
  45. package/template/neo-order-cmps/src/components/entityInfoCard__c/model.ts +3 -3
  46. package/template/neo-order-cmps/src/components/entityInfoCard__c/style.scss +6 -5
  47. package/template/neo-order-cmps/src/components/simpleTable__c/index.tsx +71 -20
  48. package/template/neo-order-cmps/src/components/simpleTable__c/model.ts +15 -11
  49. package/template/neo-order-cmps/src/components/simpleTable__c/style.scss +39 -29
  50. package/template/neo-pipeline-cmps/package.json +1 -1
  51. package/template/neo-pipeline-cmps/public/demo.html +10 -10
  52. package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/style.scss +1 -1
  53. package/template/neo-pipeline-cmps/src/components/showHealthResult__c/style.scss +1 -1
  54. package/template/neo-pipeline-cmps/src/components/simpleTable__c/common.scss +3 -3
  55. package/template/neo-pipeline-cmps/src/components/simpleTable__c/style.scss +2 -2
  56. package/template/neo-pipeline-cmps/src/components/stageSwitch__c/style.scss +1 -1
  57. package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/style.scss +2 -2
  58. package/template/neo-web-entity-grid/package.json +1 -1
  59. package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +1 -1
  60. package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +1 -1
  61. package/template/neo-web-entity-grid/src/components/entityGrid3__c/model.ts +1 -1
  62. package/template/neo-web-entity-grid/src/components/entityGrid4__c/model.ts +1 -1
  63. package/template/neo-web-entity-grid/src/components/entityGrid__c/model.ts +1 -1
  64. package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +1 -1
  65. package/template/neo-web-form/package.json +1 -1
  66. package/template/neo-web-form/src/components/batchAddTable__c/model.ts +1 -1
  67. package/template/neo-web-form/src/components/batchAddTable__c/tableModal.scss +1 -1
  68. package/template/neo-web-form/src/components/listSummary__c/model.ts +1 -1
  69. package/template/neo-web-form/src/components/listSummary__c/style.scss +2 -2
  70. package/template/react-custom-cmp-template/package.json +1 -1
  71. package/template/react-custom-cmp-template/src/components/infoCard__c/model.js +1 -1
  72. package/template/react-ts-custom-cmp-template/package.json +1 -1
  73. package/template/react-ts-custom-cmp-template/src/components/listWidget__c/model.ts +1 -1
  74. package/template/react-ts-custom-cmp-template/src/components/listWidget__c/style.scss +1 -1
  75. package/template/vue2-custom-cmp-template/package.json +1 -1
  76. package/template/vue2-custom-cmp-template/src/components/vueInfoCard__c/model.js +1 -1
  77. package/template/antd-custom-cmp-template/src/components/infoCard__c/index.tsx +0 -89
  78. package/template/antd-custom-cmp-template/src/components/infoCard__c/model.ts +0 -76
  79. package/template/antd-custom-cmp-template/src/components/infoCard__c/style.scss +0 -105
  80. package/template/neo-custom-cmp-template/src/components/entityCardList__c/README.md +0 -61
  81. package/template/neo-custom-cmp-template/src/components/entityCardList__c/index.tsx +0 -226
  82. package/template/neo-custom-cmp-template/src/components/entityCardList__c/model.ts +0 -89
  83. package/template/neo-custom-cmp-template/src/components/entityCardList__c/style.scss +0 -260
@@ -1,226 +0,0 @@
1
- import * as React from 'react';
2
- import { Card, Row, Col, Spin, Empty, Avatar, Button } from 'antd';
3
- import { UserOutlined, PhoneOutlined, ReloadOutlined } from '@ant-design/icons';
4
- // 引入 neo-ui-common / BaseCmp
5
- // @ts-ignore
6
- import { BaseCmp } from 'neo-ui-common';
7
-
8
- // 引入 Neo Open API
9
- // @ts-ignore
10
- import { xObject } from 'neo-open-api';
11
-
12
- // 引入 neo-ui-common / NeoEvent
13
- // @ts-ignore
14
- import { NeoEvent } from 'neo-ui-common';
15
-
16
- import './style.scss';
17
-
18
- interface EntityCardListProps {
19
- title: string;
20
- xObjectDataApi?: any;
21
- entityData?: any;
22
- data?: any;
23
- className?: string;
24
- }
25
-
26
- interface ContactData {
27
- id: string;
28
- name: string;
29
- phone__c: string;
30
- [key: string]: any;
31
- }
32
-
33
- interface EntityCardListState {
34
- objectDataList: ContactData[];
35
- totalSize: number;
36
- loading: boolean;
37
- error: string | null;
38
- }
39
-
40
- export default class EntityCardList extends BaseCmp<
41
- EntityCardListProps,
42
- EntityCardListState
43
- > {
44
- constructor(props: EntityCardListProps) {
45
- super(props);
46
-
47
- this.state = {
48
- objectDataList: [],
49
- totalSize: 0,
50
- loading: false,
51
- error: null,
52
- };
53
-
54
- this.loadObjectData = this.loadObjectData.bind(this);
55
- }
56
-
57
- componentDidMount() {
58
- this.loadObjectData();
59
-
60
- /*
61
- // 监听一个广播事件
62
- NeoEvent.listen('reloadData', (eventData: any) => {
63
- console.log('EntityCardList 监听到了一个广播事件 reloadData: ', eventData);
64
- this.loadObjectData();
65
- });
66
- */
67
- }
68
-
69
- componentDidUpdate(prevProps: Readonly<EntityCardListProps>) {
70
- const { xObjectDataApi } = this.props;
71
- if (
72
- xObjectDataApi?.xObjectApiKey !==
73
- prevProps.xObjectDataApi?.xObjectApiKey ||
74
- xObjectDataApi?.fields !== prevProps.xObjectDataApi?.fields
75
- ) {
76
- this.loadObjectData();
77
- }
78
- }
79
-
80
- @NeoEvent.function
81
- async loadObjectData(parma1?: any) {
82
- const { xObjectDataApi } = this.props;
83
- const { autoFetchData } = xObjectDataApi || {};
84
-
85
- // 测试输出,输出当前参数
86
- console.log('parma1:', parma1);
87
-
88
- if (autoFetchData) {
89
- // 方式一:直接从 props 中取实体数据源相关数据
90
- const { entityData: entityDataList } = this.props;
91
- if (entityDataList) {
92
- this.setState({ objectDataList: entityDataList });
93
- }
94
- } else {
95
- this.setState({ loading: true, error: null });
96
- // 方式二:使用 Neo Open API SDK 获取数据
97
- const result = await xObject.query(xObjectDataApi);
98
-
99
- if (result?.status) {
100
- const records = result.data || [];
101
- const totalSize = result.totalSize || 0;
102
- this.setState({
103
- objectDataList: records,
104
- totalSize,
105
- loading: false,
106
- });
107
- } else {
108
- this.setState({
109
- error: result?.msg || '获取数据数据失败',
110
- loading: false,
111
- });
112
- }
113
- }
114
- }
115
-
116
- renderEntityCard(object: ContactData, index: number) {
117
- return (
118
- <Col xs={24} sm={12} md={8} lg={6} xl={6} key={object.id || index}>
119
- <Card
120
- className="object-card"
121
- hoverable
122
- size="small"
123
- style={{ marginBottom: 16 }}
124
- >
125
- <div className="object-card-content">
126
- <div className="object-avatar">
127
- <Avatar
128
- size={48}
129
- icon={<UserOutlined />}
130
- className="avatar-icon"
131
- />
132
- </div>
133
- <div className="object-info">
134
- <div className="object-name">
135
- <UserOutlined className="info-icon" />
136
- <span className="name-text">
137
- {object.name ||
138
- object.contactName ||
139
- object.accountName ||
140
- object.productName ||
141
- '未知姓名'}
142
- </span>
143
- </div>
144
- <div className="object-phone">
145
- <PhoneOutlined className="info-icon" />
146
- <span className="phone-text">
147
- {object.phone__c ||
148
- object.phone ||
149
- object.mobile ||
150
- object.phoneNumber ||
151
- '未填写手机号'}
152
- </span>
153
- </div>
154
- </div>
155
- </div>
156
- </Card>
157
- </Col>
158
- );
159
- }
160
-
161
- render() {
162
- const { title, className } = this.props;
163
- const { objectDataList, loading, error } = this.state;
164
- // const curAmisData = this.props.data || {}; // 组件上下文信息
165
- // const systemInfo = curAmisData.__NeoSystemInfo || {}; // 系统信息
166
- console.log('this.props:', this.props);
167
-
168
- return (
169
- <div className={`entityCardList__c ${className}`}>
170
- <div className="card-list-header">
171
- <div className="header-content">
172
- <h3 className="header-title">
173
- {title || '数据卡片列表'}
174
- </h3>
175
- <Button
176
- type="primary"
177
- icon={<ReloadOutlined />}
178
- onClick={this.loadObjectData}
179
- loading={loading}
180
- className="refresh-button"
181
- size="small"
182
- >
183
- 刷新
184
- </Button>
185
- </div>
186
- </div>
187
-
188
- <div className="card-list-content">
189
- <Spin spinning={loading} tip="加载数据数据中...">
190
- {error ? (
191
- <div className="error-container">
192
- <Empty
193
- image={Empty.PRESENTED_IMAGE_SIMPLE}
194
- description={
195
- <div>
196
- <div style={{ color: '#ff4d4f', marginBottom: 8 }}>
197
- {error}
198
- </div>
199
- <button
200
- className="retry-button"
201
- onClick={this.loadObjectData}
202
- >
203
- 重新加载
204
- </button>
205
- </div>
206
- }
207
- />
208
- </div>
209
- ) : objectDataList.length === 0 ? (
210
- <Empty
211
- image={Empty.PRESENTED_IMAGE_SIMPLE}
212
- description="暂无数据数据"
213
- />
214
- ) : (
215
- <Row gutter={[16, 16]}>
216
- {objectDataList.map((object: ContactData, index: number) =>
217
- this.renderEntityCard(object, index),
218
- )}
219
- </Row>
220
- )}
221
- </Spin>
222
- </div>
223
- </div>
224
- );
225
- }
226
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * @file 数据卡片列表组件对接编辑器的描述文件
3
- */
4
- export class EntityCardListModel {
5
- /**
6
- * cmpType 为自定义组件名称,用于标识组件的唯一性
7
- * 在构建时根据当前组件目录名称自动生成
8
- */
9
- // cmpType: string = 'entityCardList';
10
-
11
- // 组件名称,用于设置在编辑器左侧组件面板中展示的名称
12
- label: string = '实体数据卡片列表';
13
-
14
- // 组件描述,用于设置在编辑器左侧组件面板中展示的描述
15
- description: string = '展示实体数据信息的卡片列表组件,支持姓名和手机号展示';
16
-
17
- // 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示
18
- // tags: string[] = ['自定义组件'];
19
-
20
- /**
21
- * 用于设置组件支持的页面类型
22
- *
23
- * 当前 NeoCRM 平台存在的页面类型:
24
- * all: 1 全页面
25
- * entityFormPage: 4 实体表单页
26
- * customPage: 6 自定义页面
27
- */
28
- targetPage: string[] = ['all'];
29
-
30
- // 适配终端类型
31
- targetDevice: string = 'web';
32
-
33
- // 组件图标,用于设置在编辑器左侧组件面板中展示的图标
34
- iconUrl: string = 'https://custom-widgets.bj.bcebos.com/data-list.svg';
35
-
36
- // 初次插入页面的默认属性数据
37
- defaultComProps = {
38
- title: '数据卡片列表',
39
- label: '数据卡片列表',
40
- xObjectDataApi: {
41
- xObjectApiKey: 'contact',
42
- fields: [
43
- 'entityType',
44
- 'contactName',
45
- 'accountId',
46
- 'depart',
47
- 'mobile',
48
- 'email',
49
- 'comment',
50
- ],
51
- },
52
- };
53
-
54
- // 当前组件支持的函数列表(其他组件可触发当前组件的函数)
55
- functions = [
56
- {
57
- apiKey: 'loadObjectData',
58
- label: '重新获取数据列表',
59
- helpTextKey: '获取实体业务数据列表',
60
- },
61
- ];
62
-
63
- /**
64
- * 组件面板配置,用于生成编辑器右侧属性配置面板内容
65
- */
66
- propsSchema = [
67
- {
68
- type: 'textarea',
69
- name: 'title',
70
- label: '组件标题',
71
- value: '数据卡片列表',
72
- },
73
- {
74
- type: 'xObjectDataApi', // 用于获取实体业务数据列表的配置项
75
- name: 'xObjectDataApi',
76
- label: '实体数据源',
77
- placeholder: '请选择实体数据源',
78
- /*
79
- // 返回的数值格式:
80
- value: {
81
- xObjectApiKey: 'customContact__c',
82
- fields: ['name', 'phone__c'],
83
- },
84
- */
85
- },
86
- ];
87
- }
88
-
89
- export default EntityCardListModel;
@@ -1,260 +0,0 @@
1
- .entityCardList__c {
2
- position: relative;
3
- box-sizing: border-box;
4
- height: 100%;
5
- display: flex;
6
- flex-direction: column;
7
- margin: 6px 12px;
8
- padding: 12px;
9
- background-color: #fff;
10
- border-radius: 8px;
11
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
12
-
13
- .card-list-header {
14
- flex-shrink: 0;
15
- margin-bottom: 16px;
16
- border-bottom: 1px solid #f0f0f0;
17
- padding-bottom: 12px;
18
-
19
- .header-content {
20
- display: flex;
21
- justify-content: space-between;
22
- align-items: center;
23
- gap: 16px;
24
- }
25
-
26
- .header-title {
27
- margin: 0;
28
- font-family: PingFangSC-Medium, -apple-system, BlinkMacSystemFont,
29
- 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
30
- font-size: 18px;
31
- font-weight: 500;
32
- line-height: 1.4;
33
- color: #434343;
34
- flex: 1;
35
- }
36
-
37
- .refresh-button {
38
- flex-shrink: 0;
39
- border-radius: 6px;
40
- font-size: 13px;
41
- height: 32px;
42
- padding: 4px 12px;
43
- box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
44
- transition: all 0.3s ease;
45
-
46
- &:hover {
47
- box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
48
- transform: translateY(-1px);
49
- }
50
-
51
- &:active {
52
- transform: translateY(0);
53
- }
54
-
55
- .anticon {
56
- font-size: 12px;
57
- }
58
- }
59
- }
60
-
61
- .card-list-content {
62
- flex: 1;
63
- overflow-y: auto;
64
-
65
- .error-container {
66
- display: flex;
67
- justify-content: center;
68
- align-items: center;
69
- min-height: 300px;
70
- padding: 20px;
71
-
72
- .retry-button {
73
- padding: 8px 16px;
74
- background-color: #1890ff;
75
- color: white;
76
- border: none;
77
- border-radius: 4px;
78
- cursor: pointer;
79
- font-size: 14px;
80
- transition: background-color 0.3s;
81
-
82
- &:hover {
83
- background-color: #40a9ff;
84
- }
85
-
86
- &:active {
87
- background-color: #096dd9;
88
- }
89
- }
90
- }
91
- }
92
-
93
- .object-card {
94
- height: 100%;
95
- border-radius: 12px;
96
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
97
- transition: all 0.3s ease;
98
- border: 1px solid #f0f0f0;
99
-
100
- &:hover {
101
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
102
- transform: translateY(-2px);
103
- border-color: #d9d9d9;
104
- }
105
-
106
- .ant-card-body {
107
- padding: 16px;
108
- height: 100%;
109
- display: flex;
110
- align-items: center;
111
- }
112
-
113
- .object-card-content {
114
- display: flex;
115
- align-items: center;
116
- width: 100%;
117
- gap: 12px;
118
-
119
- .object-avatar {
120
- flex-shrink: 0;
121
-
122
- .avatar-icon {
123
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
124
- border: 2px solid #fff;
125
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
126
- }
127
- }
128
-
129
- .object-info {
130
- flex: 1;
131
- min-width: 0;
132
-
133
- .object-name,
134
- .object-phone {
135
- display: flex;
136
- align-items: center;
137
- margin-bottom: 4px;
138
- gap: 6px;
139
-
140
- &:last-child {
141
- margin-bottom: 0;
142
- }
143
-
144
- .info-icon {
145
- font-size: 12px;
146
- color: #8c8c8c;
147
- flex-shrink: 0;
148
- }
149
-
150
- .name-text,
151
- .phone-text {
152
- font-size: 14px;
153
- line-height: 1.4;
154
- overflow: hidden;
155
- text-overflow: ellipsis;
156
- white-space: nowrap;
157
- }
158
-
159
- .name-text {
160
- color: #262626;
161
- font-weight: 500;
162
- }
163
-
164
- .phone-text {
165
- color: #595959;
166
- font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo,
167
- Courier, monospace;
168
- }
169
- }
170
-
171
- .object-name {
172
- margin-bottom: 8px;
173
- }
174
- }
175
- }
176
- }
177
-
178
- // 响应式设计
179
- @media (max-width: 768px) {
180
- margin: 4px 8px;
181
- padding: 8px;
182
-
183
- .card-list-header {
184
- margin-bottom: 12px;
185
- padding-bottom: 8px;
186
-
187
- .header-content {
188
- gap: 12px;
189
- }
190
-
191
- .header-title {
192
- font-size: 16px;
193
- }
194
-
195
- .refresh-button {
196
- height: 28px;
197
- padding: 2px 8px;
198
- font-size: 12px;
199
-
200
- .anticon {
201
- font-size: 11px;
202
- }
203
- }
204
- }
205
-
206
- .object-card {
207
- .ant-card-body {
208
- padding: 12px;
209
- }
210
-
211
- .object-card-content {
212
- gap: 8px;
213
-
214
- .object-avatar {
215
- .avatar-icon {
216
- width: 40px !important;
217
- height: 40px !important;
218
- line-height: 40px !important;
219
- }
220
- }
221
-
222
- .object-info {
223
- .object-name,
224
- .object-phone {
225
- .name-text,
226
- .phone-text {
227
- font-size: 13px;
228
- }
229
- }
230
- }
231
- }
232
- }
233
- }
234
-
235
- @media (max-width: 480px) {
236
- .object-card {
237
- .object-card-content {
238
- flex-direction: column;
239
- text-align: center;
240
- gap: 8px;
241
-
242
- .object-info {
243
- .object-name,
244
- .object-phone {
245
- justify-content: center;
246
- }
247
- }
248
- }
249
- }
250
- }
251
- }
252
-
253
- // 全局样式覆盖
254
- .ant-spin-container {
255
- min-height: 200px;
256
- }
257
-
258
- .ant-empty {
259
- padding: 40px 20px;
260
- }