neo-cmp-cli 1.3.6 → 1.3.8
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 +5 -5
- package/package.json +1 -1
- package/src/template/antd-custom-cmp-template/package.json +2 -2
- package/src/template/echarts-custom-cmp-template/package.json +2 -2
- package/src/template/echarts-custom-cmp-template/src/components/map-widget/README.md +125 -0
- package/src/template/echarts-custom-cmp-template/src/components/map-widget/USAGE.md +190 -0
- package/src/template/echarts-custom-cmp-template/src/components/map-widget/index.tsx +385 -0
- package/src/template/echarts-custom-cmp-template/src/components/map-widget/model.ts +105 -0
- package/src/template/echarts-custom-cmp-template/src/components/map-widget/style.scss +192 -0
- package/src/template/echarts-custom-cmp-template/src/utils/url.ts +82 -0
- package/src/template/neo-custom-cmp-template/neo.config.js +4 -4
- package/src/template/neo-custom-cmp-template/package.json +2 -2
- package/src/template/neo-custom-cmp-template/src/assets/img/custom-form.svg +1 -0
- package/src/template/neo-custom-cmp-template/src/assets/img/data-list.svg +1 -0
- package/src/template/react-custom-cmp-template/package.json +2 -2
- package/src/template/react-ts-custom-cmp-template/neo.config.js +4 -4
- package/src/template/react-ts-custom-cmp-template/package.json +3 -3
- package/src/template/react-ts-custom-cmp-template/src/assets/img/map.svg +1 -0
- package/src/template/vue2-custom-cmp-template/package.json +2 -2
- package/src/template/echarts-custom-cmp-template/src/components/info-card/index.tsx +0 -69
- package/src/template/echarts-custom-cmp-template/src/components/info-card/model.ts +0 -78
- package/src/template/echarts-custom-cmp-template/src/components/info-card/style.scss +0 -105
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/README.md +0 -61
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/index.tsx +0 -191
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/model.ts +0 -56
- package/src/template/neo-custom-cmp-template/src/components/contact-card-list/style.scss +0 -260
- package/src/template/neo-custom-cmp-template/src/components/contact-form/README.md +0 -94
- package/src/template/neo-custom-cmp-template/src/components/contact-form/index.tsx +0 -249
- package/src/template/neo-custom-cmp-template/src/components/contact-form/model.ts +0 -63
- package/src/template/neo-custom-cmp-template/src/components/contact-form/style.scss +0 -120
- package/src/template/react-ts-custom-cmp-template/src/components/info-card/index.tsx +0 -69
- package/src/template/react-ts-custom-cmp-template/src/components/info-card/model.ts +0 -78
- package/src/template/react-ts-custom-cmp-template/src/components/info-card/style.scss +0 -105
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取URL参数
|
|
3
|
+
* @returns
|
|
4
|
+
*/
|
|
5
|
+
export function getUrlParams() {
|
|
6
|
+
const urlParams: { [key: string]: string } = {};
|
|
7
|
+
let url = window.location.href;
|
|
8
|
+
if (url.indexOf('?') !== -1) {
|
|
9
|
+
url = url.substring(url.indexOf('?') + 1, url.length);
|
|
10
|
+
const urlArr = url.split('&');
|
|
11
|
+
for (let i = 0, size = urlArr.length; i < size; i++) {
|
|
12
|
+
const urlArrItem = urlArr[i].split('=');
|
|
13
|
+
// 对参数值进行 URL 解码,避免中文字符串乱码
|
|
14
|
+
urlParams[urlArrItem[0]] = urlArrItem[1]
|
|
15
|
+
? decodeURIComponent(urlArrItem[1])
|
|
16
|
+
: '';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return urlParams;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 从URL参数中提取指定的字段数值
|
|
24
|
+
* @param paramName 参数名称
|
|
25
|
+
* @param defaultValue 默认值
|
|
26
|
+
* @returns 参数值或默认值
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // 从当前页面URL提取debug参数
|
|
30
|
+
* const debug = getUrlParam('debug', false)
|
|
31
|
+
*
|
|
32
|
+
* // 提取数字参数
|
|
33
|
+
* const page = getUrlParam('page', 1)
|
|
34
|
+
*
|
|
35
|
+
* // 提取字符串参数
|
|
36
|
+
* const mode = getUrlParam('mode', 'production')
|
|
37
|
+
*/
|
|
38
|
+
export function getUrlParam(paramName: string, defaultValue: any = null): any {
|
|
39
|
+
const urlParams = getUrlParams();
|
|
40
|
+
const paramValue = urlParams[paramName];
|
|
41
|
+
|
|
42
|
+
// 尝试转换数据类型
|
|
43
|
+
if (paramValue === 'true') return true;
|
|
44
|
+
if (paramValue === 'false') return false;
|
|
45
|
+
if (paramValue === 'null') return null;
|
|
46
|
+
if (paramValue === 'undefined') return undefined;
|
|
47
|
+
|
|
48
|
+
// 尝试转换为数字
|
|
49
|
+
const numValue = Number(paramValue);
|
|
50
|
+
if (!isNaN(numValue) && isFinite(numValue)) {
|
|
51
|
+
return numValue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return paramValue ?? defaultValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 从URL参数中提取多个字段数值
|
|
59
|
+
* @param params 参数配置对象,键为参数名,值为默认值
|
|
60
|
+
* @param url 可选的URL字符串,默认使用当前页面URL
|
|
61
|
+
* @returns 包含所有参数值的对象
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const params = getUrlParams({
|
|
65
|
+
* debug: false,
|
|
66
|
+
* mode: 'production',
|
|
67
|
+
* page: 1,
|
|
68
|
+
* theme: 'light'
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
export function getUrlParamsByKeys(
|
|
72
|
+
params: Record<string, any>,
|
|
73
|
+
url?: string,
|
|
74
|
+
): Record<string, any> {
|
|
75
|
+
const result: Record<string, any> = {};
|
|
76
|
+
|
|
77
|
+
for (const [paramName, defaultValue] of Object.entries(params)) {
|
|
78
|
+
result[paramName] = getUrlParam(paramName, defaultValue);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
@@ -80,8 +80,8 @@ module.exports = {
|
|
|
80
80
|
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
81
81
|
// 外链调试(在线上页面设计器端预览自定义组件)
|
|
82
82
|
index: [
|
|
83
|
-
'./src/components/
|
|
84
|
-
'./src/components/
|
|
83
|
+
'./src/components/entity-form/register.ts',
|
|
84
|
+
'./src/components/entity-form/model.ts',
|
|
85
85
|
],
|
|
86
86
|
},
|
|
87
87
|
NODE_ENV: 'development',
|
|
@@ -105,8 +105,8 @@ module.exports = {
|
|
|
105
105
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
106
106
|
NODE_ENV: 'production',
|
|
107
107
|
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
108
|
-
InfoCardModel: './src/components/
|
|
109
|
-
infoCard: './src/components/
|
|
108
|
+
InfoCardModel: './src/components/entity-form/model.ts',
|
|
109
|
+
infoCard: './src/components/entity-form/register.ts'
|
|
110
110
|
},
|
|
111
111
|
cssExtract: false, // 不额外提取css文件
|
|
112
112
|
ossType: 'ali', // oss类型:ali、baidu
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/wibetter/neo-custom-cmp-template/issues"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"neo-register": "^1.0.
|
|
41
|
+
"neo-register": "^1.0.5",
|
|
42
42
|
"react": "^16.9.0",
|
|
43
43
|
"react-dom": "^16.9.0",
|
|
44
44
|
"axios": "^0.27.2",
|
|
@@ -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.3.
|
|
55
|
+
"neo-cmp-cli": "^1.3.8",
|
|
56
56
|
"husky": "^4.2.5",
|
|
57
57
|
"lint-staged": "^10.2.9",
|
|
58
58
|
"prettier": "^2.0.5"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1760606213824" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2396" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M258.133333 128A106.666667 106.666667 0 0 0 362.666667 213.333333h298.666666a106.666667 106.666667 0 0 0 104.533334-85.333333h87.424A128 128 0 0 1 981.333333 255.744v597.845333A127.872 127.872 0 0 1 853.290667 981.333333H170.666667A128 128 0 0 1 42.666667 853.589333V255.744A127.872 127.872 0 0 1 170.709333 128H258.133333zM298.666667 384a42.666667 42.666667 0 1 0 0 85.333333h256a42.666667 42.666667 0 0 0 0-85.333333H298.666667z m0 170.666667a42.666667 42.666667 0 0 0 0 85.333333h426.666666a42.666667 42.666667 0 0 0 0-85.333333H298.666667z m0 170.666666a42.666667 42.666667 0 0 0 0 85.333334h256a42.666667 42.666667 0 0 0 0-85.333334H298.666667zM362.666667 42.666667h298.666666a64 64 0 0 1 0 128h-298.666666a64 64 0 0 1 0-128z" p-id="2397" fill="#0764f5"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1759212323849" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3505" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M202.8 408.1c-55 0-99.7 44.7-99.7 99.7s44.7 99.7 99.7 99.7c40.7 0 75.8-24.6 91.3-59.7h639v-80h-639c-15.5-35.1-50.6-59.7-91.3-59.7z m0 157c-31.6 0-57.3-25.7-57.3-57.3 0-31.6 25.7-57.3 57.3-57.3 31.6 0 57.3 25.7 57.3 57.3 0 31.6-25.7 57.3-57.3 57.3zM202.8 739.3c-55 0-99.7 44.7-99.7 99.7s44.7 99.7 99.7 99.7c40.7 0 75.8-24.6 91.3-59.7h639v-80h-639c-15.5-35.1-50.6-59.7-91.3-59.7z m0 157c-31.6 0-57.3-25.7-57.3-57.3 0-31.6 25.7-57.3 57.3-57.3 31.6 0 57.3 25.7 57.3 57.3 0 31.6-25.7 57.3-57.3 57.3zM295.1 149.5c-14.9-36.4-50.6-62.1-92.3-62.1-55 0-99.7 44.7-99.7 99.7s44.7 99.7 99.7 99.7c39.8 0 74.2-23.5 90.2-57.3h640v-80H295.1z m-92.3 95c-31.6 0-57.3-25.7-57.3-57.3 0-31.6 25.7-57.3 57.3-57.3 31.6 0 57.3 25.7 57.3 57.3 0 31.5-25.7 57.3-57.3 57.3zM519.6 641.8H933v80H519.6zM519.6 308.6H933v80H519.6z" fill="#0764f5" p-id="3506"></path></svg>
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"url": "https://github.com/wibetter/react-custom-cmp-template/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"neo-register": "^1.0.
|
|
40
|
+
"neo-register": "^1.0.5",
|
|
41
41
|
"react": "^16.9.0",
|
|
42
42
|
"react-dom": "^16.9.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@commitlint/cli": "^8.3.5",
|
|
46
46
|
"@commitlint/config-conventional": "^9.1.1",
|
|
47
|
-
"neo-cmp-cli": "^1.3.
|
|
47
|
+
"neo-cmp-cli": "^1.3.8",
|
|
48
48
|
"husky": "^4.2.5",
|
|
49
49
|
"lint-staged": "^10.2.9",
|
|
50
50
|
"prettier": "^2.0.5"
|
|
@@ -79,8 +79,8 @@ module.exports = {
|
|
|
79
79
|
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
80
80
|
// 外链调试(在线上页面设计器端预览自定义组件)
|
|
81
81
|
index: [
|
|
82
|
-
'./src/components/
|
|
83
|
-
'./src/components/
|
|
82
|
+
'./src/components/list-widget/register.ts',
|
|
83
|
+
'./src/components/list-widget/model.ts',
|
|
84
84
|
],
|
|
85
85
|
},
|
|
86
86
|
NODE_ENV: 'development',
|
|
@@ -104,8 +104,8 @@ module.exports = {
|
|
|
104
104
|
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
105
105
|
NODE_ENV: 'production',
|
|
106
106
|
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
listWidgetModel: './src/components/list-widget/model.ts',
|
|
108
|
+
listWidget: './src/components/list-widget/register.ts'
|
|
109
109
|
},
|
|
110
110
|
cssExtract: false, // 不额外提取css文件
|
|
111
111
|
ossType: 'ali', // oss类型:ali、baidu
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-ts-custom-cmp-template",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "neo自定义组件模板(react&ts技术栈)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"自定义组件模板",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"url": "https://github.com/wibetter/react-ts-custom-cmp-template/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"neo-register": "^1.0.
|
|
40
|
+
"neo-register": "^1.0.5",
|
|
41
41
|
"react": "^16.9.0",
|
|
42
42
|
"react-dom": "^16.9.0"
|
|
43
43
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@commitlint/config-conventional": "^9.1.1",
|
|
47
47
|
"@types/react": "^16.9.11",
|
|
48
48
|
"@types/react-dom": "^16.9.15",
|
|
49
|
-
"neo-cmp-cli": "^1.3.
|
|
49
|
+
"neo-cmp-cli": "^1.3.8",
|
|
50
50
|
"husky": "^4.2.5",
|
|
51
51
|
"lint-staged": "^10.2.9",
|
|
52
52
|
"prettier": "^2.0.5"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1760670196857" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4651" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M485.888 626.496 512 663.488l26.112-36.992c1.088-1.472 107.392-151.68 140.864-189.184C715.776 396.224 736 343.168 736 288 736 164.544 635.52 64 512 64s-224 100.48-224 224c0 55.232 20.224 108.288 57.088 149.376C378.624 474.816 484.8 625.024 485.888 626.496zM512 128c88.256 0 160 71.808 160 160 0 39.424-14.464 77.312-40.768 106.688C606.016 422.912 546.624 504.64 512 552.896 477.44 504.64 418.048 422.912 392.768 394.688 366.528 365.376 352 327.488 352 288 352 199.808 423.744 128 512 128zM512 384c52.928 0 96-43.072 96-96S564.928 192 512 192 416 235.072 416 288 459.072 384 512 384zM512 256c17.6 0 32 14.336 32 32S529.6 320 512 320 480 305.664 480 288 494.4 256 512 256zM960 129.024l0 703.168L680 960 384 832l-320 127.36L64 258.176l168.256-67.904C227.264 211.456 224 233.28 224 256c0 2.176 0.512 4.224 0.576 6.4L128 301.376l0 563.648 192-76.416L320 476.032c18.048 23.36 41.472 55.104 64 86.144l0 200.96 1.024-0.384 24.384 10.56L640 872.96 640 562.304c22.976-31.616 46.208-63.168 64-86.144l0 402.56 192-87.68L896 228.608l-97.536 44.544C798.784 267.392 800 261.76 800 256c0-17.664-2.176-34.752-5.184-51.584L960 129.024z" p-id="4652" fill="#0764f5"></path></svg>
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"url": "https://github.com/wibetter/vue2-custom-cmp-template/issues"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"neo-register": "^1.0.
|
|
40
|
+
"neo-register": "^1.0.5",
|
|
41
41
|
"vue": "^2.6.14",
|
|
42
42
|
"element-ui": "^2.15.12"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@commitlint/cli": "^8.3.5",
|
|
46
46
|
"@commitlint/config-conventional": "^9.1.1",
|
|
47
|
-
"neo-cmp-cli": "^1.3.
|
|
47
|
+
"neo-cmp-cli": "^1.3.8",
|
|
48
48
|
"husky": "^4.2.5",
|
|
49
49
|
"lint-staged": "^10.2.9",
|
|
50
50
|
"prettier": "^2.0.5",
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import './style.scss'; // 组件内容样式
|
|
3
|
-
|
|
4
|
-
interface InfoCardProps {
|
|
5
|
-
title: string;
|
|
6
|
-
backgroundImage: string;
|
|
7
|
-
imgCount: number;
|
|
8
|
-
commentCount: number;
|
|
9
|
-
data?: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default class InfoCard extends React.PureComponent<InfoCardProps> {
|
|
13
|
-
constructor(props: InfoCardProps) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.agreeDataFormat = this.agreeDataFormat.bind(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
agreeDataFormat(agreeData: number) {
|
|
19
|
-
if (agreeData && agreeData <= 9999) {
|
|
20
|
-
return agreeData;
|
|
21
|
-
}
|
|
22
|
-
if (agreeData && agreeData > 9999) {
|
|
23
|
-
return `${Math.floor(agreeData / 1000) / 10}w`;
|
|
24
|
-
}
|
|
25
|
-
return '';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
render() {
|
|
29
|
-
const { title, backgroundImage, imgCount, commentCount } = this.props;
|
|
30
|
-
console.log('当前自定义组件:', this.props, this);
|
|
31
|
-
const curAmisData = this.props.data || {};
|
|
32
|
-
|
|
33
|
-
const userInfo = curAmisData.__NeoCurrentUser;
|
|
34
|
-
const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
35
|
-
|
|
36
|
-
const curBackgroundImage =
|
|
37
|
-
backgroundImage || 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg';
|
|
38
|
-
return (
|
|
39
|
-
<div className="info-card-container">
|
|
40
|
-
<div className="news-title">
|
|
41
|
-
{title ||
|
|
42
|
-
'营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。'}
|
|
43
|
-
{systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
|
|
44
|
-
</div>
|
|
45
|
-
<div className="item-imgbox">
|
|
46
|
-
{userInfo && userInfo.icon && (
|
|
47
|
-
<div className="user-info-box">
|
|
48
|
-
<img src={userInfo.icon} className="user-icon" />
|
|
49
|
-
<span className="user-name">{userInfo.name}</span>
|
|
50
|
-
</div>
|
|
51
|
-
)}
|
|
52
|
-
<div
|
|
53
|
-
className="news-img"
|
|
54
|
-
style={{ backgroundImage: `url(${curBackgroundImage})` }}
|
|
55
|
-
></div>
|
|
56
|
-
{imgCount > 0 && <div className="img-count">{imgCount}</div>}
|
|
57
|
-
</div>
|
|
58
|
-
<div className="news-info">
|
|
59
|
-
<div className="left media-mark">NeoCRM · 低代码平台</div>
|
|
60
|
-
{commentCount && commentCount > 0 && (
|
|
61
|
-
<div className="cmt-num right">
|
|
62
|
-
{this.agreeDataFormat(commentCount)}评
|
|
63
|
-
</div>
|
|
64
|
-
)}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file 自定义组件对接编辑器的描述文件
|
|
3
|
-
*/
|
|
4
|
-
export class InfoCardModel {
|
|
5
|
-
/**
|
|
6
|
-
* cmpType 为自定义组件名称,用于标识组件的唯一性
|
|
7
|
-
* 在构建时根据当前组件目录名称自动生成
|
|
8
|
-
*/
|
|
9
|
-
// cmpType: string = 'info-card';
|
|
10
|
-
|
|
11
|
-
// 组件名称,用于设置在编辑器左侧组件面板中展示的名称
|
|
12
|
-
label: string = '信息卡片';
|
|
13
|
-
|
|
14
|
-
// 组件描述,用于设置在编辑器左侧组件面板中展示的描述
|
|
15
|
-
description: string = '信息展示卡片';
|
|
16
|
-
|
|
17
|
-
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示(可设置多个分类标签)
|
|
18
|
-
tags: string[] = ['自定义组件'];
|
|
19
|
-
|
|
20
|
-
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
21
|
-
iconSrc: string = 'https://neo-widgets.bj.bcebos.com/custom-widget.svg';
|
|
22
|
-
// iconSrc = 'https://neo-widgets.bj.bcebos.com/favicon.png';
|
|
23
|
-
|
|
24
|
-
// 初次插入页面的默认属性数据
|
|
25
|
-
defaultComProps = {
|
|
26
|
-
title:
|
|
27
|
-
'营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
|
|
28
|
-
label: '信息卡片',
|
|
29
|
-
backgroundImage: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
|
|
30
|
-
imgCount: 3,
|
|
31
|
-
commentCount: 2025,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// 设计器端预览时展示的默认数据
|
|
35
|
-
previewComProps = {
|
|
36
|
-
label: '信息卡片',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
41
|
-
*/
|
|
42
|
-
propsSchema = [
|
|
43
|
-
{
|
|
44
|
-
type: 'textarea',
|
|
45
|
-
name: 'title',
|
|
46
|
-
label: '卡片title',
|
|
47
|
-
value:
|
|
48
|
-
'营销服全场景智能CRM,帮助企业搭建数字化客户经营平台,实现业绩高质量增长。',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: 'text',
|
|
52
|
-
name: 'backgroundImage',
|
|
53
|
-
label: '展示图片',
|
|
54
|
-
value: 'https://neo-widgets.bj.bcebos.com/NeoCRM.jpg',
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: 'number',
|
|
58
|
-
name: 'imgCount',
|
|
59
|
-
label: '图片数量',
|
|
60
|
-
value: 3,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: 'number',
|
|
64
|
-
name: 'commentCount',
|
|
65
|
-
label: '评论数',
|
|
66
|
-
value: 2025,
|
|
67
|
-
},
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
// 支持 函数式写法:propsSchemaCreator,com 为组件实例。优先级比 propsSchema 高
|
|
71
|
-
/*
|
|
72
|
-
propsSchemaCreator = (com: any) => {
|
|
73
|
-
return [];
|
|
74
|
-
};
|
|
75
|
-
*/
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default InfoCardModel;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--padding-bottom: 12px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.info-card-container {
|
|
6
|
-
position: relative;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
|
|
9
|
-
/* border-bottom: 1px solid #ececec; */
|
|
10
|
-
margin: 6px 12px;
|
|
11
|
-
padding: 6px var(--padding-bottom);
|
|
12
|
-
background-color: #fff;
|
|
13
|
-
|
|
14
|
-
.news-title {
|
|
15
|
-
padding: 6px 0;
|
|
16
|
-
font-family: PingFangSC-Regular;
|
|
17
|
-
font-size: 16px;
|
|
18
|
-
line-height: 22px;
|
|
19
|
-
color: #5f5e5e;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.item-imgbox {
|
|
23
|
-
position: relative;
|
|
24
|
-
height: 395px;
|
|
25
|
-
background: #f0f0f0;
|
|
26
|
-
cursor: pointer;
|
|
27
|
-
box-sizing: border-box;
|
|
28
|
-
text-align: center;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
|
|
31
|
-
.news-img {
|
|
32
|
-
width: 100%;
|
|
33
|
-
height: 100%;
|
|
34
|
-
box-sizing: border-box;
|
|
35
|
-
background-size: contain;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.img-count {
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 0;
|
|
41
|
-
right: 0;
|
|
42
|
-
padding: 6px 8px;
|
|
43
|
-
color: #fff;
|
|
44
|
-
min-width: 60px;
|
|
45
|
-
text-align: center;
|
|
46
|
-
line-height: 1.2;
|
|
47
|
-
background: rgb(0 0 0 / 40%);
|
|
48
|
-
font-size: 25px;
|
|
49
|
-
box-sizing: border-box;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.user-info-box {
|
|
54
|
-
position: absolute;
|
|
55
|
-
top: 10px;
|
|
56
|
-
left: 10px;
|
|
57
|
-
width: 100px;
|
|
58
|
-
min-height: 100px;
|
|
59
|
-
padding: 6px 8px;
|
|
60
|
-
color: #fff;
|
|
61
|
-
min-width: 60px;
|
|
62
|
-
text-align: center;
|
|
63
|
-
line-height: 1.2;
|
|
64
|
-
background: rgb(0 0 0 / 40%);
|
|
65
|
-
font-size: 25px;
|
|
66
|
-
box-sizing: border-box;
|
|
67
|
-
overflow: hidden;
|
|
68
|
-
display: flex;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
align-items: center;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
|
|
73
|
-
.user-icon {
|
|
74
|
-
width: 64px;
|
|
75
|
-
height: 64px;
|
|
76
|
-
border-radius: 50%;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.user-name {
|
|
80
|
-
font-size: 16px;
|
|
81
|
-
font-weight: 600;
|
|
82
|
-
margin-top: 10px;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.news-info {
|
|
88
|
-
font-family: PingFangSC-Light;
|
|
89
|
-
height: 28px;
|
|
90
|
-
box-sizing: border-box;
|
|
91
|
-
display: flex;
|
|
92
|
-
justify-content: space-between;
|
|
93
|
-
align-items: center;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.media-mark,
|
|
97
|
-
.cmt-num {
|
|
98
|
-
display: inline-block;
|
|
99
|
-
height: 28px;
|
|
100
|
-
line-height: 28px;
|
|
101
|
-
font-family: PingFangSC-Light;
|
|
102
|
-
font-size: 18px;
|
|
103
|
-
color: #828282;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# ContactCardList 联系人卡片列表组件
|
|
2
|
-
联系人卡片列表组件用于展示联系人信息,以卡片形式展示每个联系人的姓名和手机号。组件使用 Ant Design 的 Card 组件,具有良好的视觉效果和交互体验。
|
|
3
|
-
|
|
4
|
-
## 功能特性
|
|
5
|
-
|
|
6
|
-
- 📱 响应式设计,支持多种屏幕尺寸
|
|
7
|
-
- 🎨 美观的卡片布局,支持悬停效果
|
|
8
|
-
- 🔄 自动加载数据,支持错误重试
|
|
9
|
-
- 📊 使用 neo-open-api 获取 customContact__c 数据
|
|
10
|
-
- 🎯 展示联系人姓名和手机号信息
|
|
11
|
-
- 💫 加载状态和空状态处理
|
|
12
|
-
|
|
13
|
-
## 组件属性
|
|
14
|
-
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 描述 |
|
|
16
|
-
|--------|------|--------|------|
|
|
17
|
-
| title | string | '联系人卡片列表' | 组件标题 |
|
|
18
|
-
| data | any | - | 组件数据,包含用户信息和系统信息 |
|
|
19
|
-
|
|
20
|
-
## 数据源
|
|
21
|
-
|
|
22
|
-
组件通过 `neo-open-api` 工具函数获取数据:
|
|
23
|
-
|
|
24
|
-
- **数据表**: `customContact__c`
|
|
25
|
-
- **字段**: `id`, `name`, `phone__c`
|
|
26
|
-
|
|
27
|
-
## 样式特性
|
|
28
|
-
|
|
29
|
-
- 使用 Flexbox 布局,支持响应式设计
|
|
30
|
-
- 卡片悬停效果,提升用户体验
|
|
31
|
-
- 渐变色头像,美观大方
|
|
32
|
-
- 支持移动端适配
|
|
33
|
-
|
|
34
|
-
## 使用示例
|
|
35
|
-
|
|
36
|
-
```tsx
|
|
37
|
-
import ContactCardList from './components/contact-card-list';
|
|
38
|
-
|
|
39
|
-
// 在页面中使用
|
|
40
|
-
<ContactCardList
|
|
41
|
-
title="我的联系人"
|
|
42
|
-
data={amisData}
|
|
43
|
-
/>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## 技术栈
|
|
47
|
-
|
|
48
|
-
- React 16.9+
|
|
49
|
-
- TypeScript
|
|
50
|
-
- Ant Design 4.9+
|
|
51
|
-
- SCSS
|
|
52
|
-
|
|
53
|
-
## 文件结构
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
contact-card-list/
|
|
57
|
-
├── index.tsx # 主组件文件
|
|
58
|
-
├── model.ts # 组件配置和编辑器属性定义
|
|
59
|
-
├── style.scss # 组件样式文件
|
|
60
|
-
└── README.md # 组件说明文档
|
|
61
|
-
```
|