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
|
@@ -1,225 +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.accountName ||
|
|
139
|
-
object.productName ||
|
|
140
|
-
'未知姓名'}
|
|
141
|
-
</span>
|
|
142
|
-
</div>
|
|
143
|
-
<div className="object-phone">
|
|
144
|
-
<PhoneOutlined className="info-icon" />
|
|
145
|
-
<span className="phone-text">
|
|
146
|
-
{object.phone__c ||
|
|
147
|
-
object.phone ||
|
|
148
|
-
object.phoneNumber ||
|
|
149
|
-
'未填写手机号'}
|
|
150
|
-
</span>
|
|
151
|
-
</div>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
</Card>
|
|
155
|
-
</Col>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
render() {
|
|
160
|
-
const { title, className } = this.props;
|
|
161
|
-
const { objectDataList, loading, error } = this.state;
|
|
162
|
-
const curAmisData = this.props.data || {};
|
|
163
|
-
const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
164
|
-
console.log('this.props:', this.props);
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<div className={`entityCardList__c ${className}`}>
|
|
168
|
-
<div className="card-list-header">
|
|
169
|
-
<div className="header-content">
|
|
170
|
-
<h3 className="header-title">
|
|
171
|
-
{title || '数据卡片列表'}
|
|
172
|
-
{systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
|
|
173
|
-
</h3>
|
|
174
|
-
<Button
|
|
175
|
-
type="primary"
|
|
176
|
-
icon={<ReloadOutlined />}
|
|
177
|
-
onClick={this.loadObjectData}
|
|
178
|
-
loading={loading}
|
|
179
|
-
className="refresh-button"
|
|
180
|
-
size="small"
|
|
181
|
-
>
|
|
182
|
-
刷新
|
|
183
|
-
</Button>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
|
|
187
|
-
<div className="card-list-content">
|
|
188
|
-
<Spin spinning={loading} tip="加载数据数据中...">
|
|
189
|
-
{error ? (
|
|
190
|
-
<div className="error-container">
|
|
191
|
-
<Empty
|
|
192
|
-
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
|
193
|
-
description={
|
|
194
|
-
<div>
|
|
195
|
-
<div style={{ color: '#ff4d4f', marginBottom: 8 }}>
|
|
196
|
-
{error}
|
|
197
|
-
</div>
|
|
198
|
-
<button
|
|
199
|
-
className="retry-button"
|
|
200
|
-
onClick={this.loadObjectData}
|
|
201
|
-
>
|
|
202
|
-
重新加载
|
|
203
|
-
</button>
|
|
204
|
-
</div>
|
|
205
|
-
}
|
|
206
|
-
/>
|
|
207
|
-
</div>
|
|
208
|
-
) : objectDataList.length === 0 ? (
|
|
209
|
-
<Empty
|
|
210
|
-
image={Empty.PRESENTED_IMAGE_SIMPLE}
|
|
211
|
-
description="暂无数据数据"
|
|
212
|
-
/>
|
|
213
|
-
) : (
|
|
214
|
-
<Row gutter={[16, 16]}>
|
|
215
|
-
{objectDataList.map((object: ContactData, index: number) =>
|
|
216
|
-
this.renderEntityCard(object, index),
|
|
217
|
-
)}
|
|
218
|
-
</Row>
|
|
219
|
-
)}
|
|
220
|
-
</Spin>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
@@ -1,81 +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: 'customContact__c',
|
|
42
|
-
fields: ['name', 'phone__c'],
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
// 当前组件支持的函数列表(其他组件可触发当前组件的函数)
|
|
47
|
-
functions = [
|
|
48
|
-
{
|
|
49
|
-
apiKey: 'loadObjectData',
|
|
50
|
-
label: '重新获取数据列表',
|
|
51
|
-
helpTextKey: '获取实体业务数据列表',
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
57
|
-
*/
|
|
58
|
-
propsSchema = [
|
|
59
|
-
{
|
|
60
|
-
type: 'textarea',
|
|
61
|
-
name: 'title',
|
|
62
|
-
label: '组件标题',
|
|
63
|
-
value: '数据卡片列表',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'xObjectDataApi', // 用于获取实体业务数据列表的配置项
|
|
67
|
-
name: 'xObjectDataApi',
|
|
68
|
-
label: '实体数据源',
|
|
69
|
-
placeholder: '请选择实体数据源',
|
|
70
|
-
/*
|
|
71
|
-
// 返回的数值格式:
|
|
72
|
-
value: {
|
|
73
|
-
xObjectApiKey: 'customContact__c',
|
|
74
|
-
fields: ['name', 'phone__c'],
|
|
75
|
-
},
|
|
76
|
-
*/
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
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: #262626;
|
|
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
|
-
}
|