neo-cmp-cli 1.12.10 → 1.12.11
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/dist/module/neoInitByCopy.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/utils/projectUtils/createCmpProjectByTemplate.js +1 -1
- package/docs/NeoEntityGrid /344/275/277/347/224/250/350/257/264/346/230/216.md" +1202 -0
- package/docs//345/217/257/347/224/250/345/261/236/346/200/247/351/205/215/347/275/256/351/241/271.md +801 -0
- package/package.json +2 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/asset-manage-template/package.json +1 -2
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-h5-cmps/package.json +1 -2
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-web-cmps/package.json +9 -9
- package/template/neo-web-cmps/src/components/entityGrid2__c/index.tsx +58 -11
- package/template/neo-web-cmps/src/components/entityGrid2__c/model.ts +2 -17
- package/template/neo-web-cmps/src/components/entityGrid2__c/style.scss +57 -1
- package/template/neo-web-cmps/src/components/entityGrid3__c/index.tsx +79 -0
- package/template/neo-web-cmps/src/components/entityGrid3__c/model.ts +121 -0
- package/template/neo-web-cmps/src/components/entityGrid3__c/style.scss +60 -0
- package/template/neo-web-cmps/src/components/entityGrid4__c/index.tsx +80 -0
- package/template/neo-web-cmps/src/components/entityGrid4__c/model.ts +180 -0
- package/template/neo-web-cmps/src/components/entityGrid4__c/style.scss +13 -0
- package/template/neo-web-cmps/src/components/entityGrid__c/index.tsx +30 -5
- package/template/neo-web-cmps/src/components/entityGrid__c/model.ts +2 -17
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/package.json +1 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo-cmp-cli",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.11",
|
|
4
4
|
"description": "Neo 自定义组件开发工具,支持react 和 vue2.0技术栈。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neo-cli",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"bin/*",
|
|
21
21
|
"dist/*",
|
|
22
|
+
"docs/*",
|
|
22
23
|
"template/*"
|
|
23
24
|
],
|
|
24
25
|
"husky": {
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"antd": "4.9.4",
|
|
43
43
|
"lodash": "^4.17.21",
|
|
44
44
|
"neo-open-api": "^1.2.3",
|
|
45
|
-
"@wibetter/json-editor": "^6.0.5",
|
|
46
45
|
"tslib": "2.3.0",
|
|
47
46
|
"echarts": "^5.5.1",
|
|
48
47
|
"moment": "^2.30.1"
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
"@types/react": "^16.9.11",
|
|
54
53
|
"@types/react-dom": "^16.9.15",
|
|
55
54
|
"@types/axios": "^0.14.0",
|
|
56
|
-
"neo-cmp-cli": "^1.12.
|
|
55
|
+
"neo-cmp-cli": "^1.12.11",
|
|
57
56
|
"husky": "^4.2.5",
|
|
58
57
|
"lint-staged": "^10.2.9",
|
|
59
58
|
"prettier": "^2.0.5",
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
"antd-mobile": "^2.3.3",
|
|
41
41
|
"lodash": "^4.17.23",
|
|
42
42
|
"neo-open-api": "^1.2.3",
|
|
43
|
-
"@wibetter/json-editor": "^6.0.5",
|
|
44
43
|
"tslib": "2.3.0"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"@types/react": "^16.9.11",
|
|
51
50
|
"@types/react-dom": "^16.9.15",
|
|
52
51
|
"@types/axios": "^0.14.0",
|
|
53
|
-
"neo-cmp-cli": "^1.12.
|
|
52
|
+
"neo-cmp-cli": "^1.12.11",
|
|
54
53
|
"husky": "^4.2.5",
|
|
55
54
|
"lint-staged": "^10.2.9",
|
|
56
55
|
"prettier": "^2.0.5"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo-web-cmps",
|
|
3
3
|
"version": "1.1.0",
|
|
4
|
-
"description": "Neo Web
|
|
4
|
+
"description": "Neo Web 列表组件使用示例(react&ts技术栈)",
|
|
5
5
|
"framework": "react-ts",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react&ts技术栈",
|
|
8
|
-
"neoweb
|
|
8
|
+
"neoweb 列表组件"
|
|
9
9
|
],
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
@@ -33,26 +33,26 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"react": "^16.9.0",
|
|
38
|
-
"react-dom": "^16.9.0",
|
|
39
|
-
"axios": "^1.7.0",
|
|
36
|
+
"@ant-design/icons": "^4.8.3",
|
|
40
37
|
"antd": "^4.9.4",
|
|
38
|
+
"axios": "^1.7.0",
|
|
41
39
|
"lodash": "^4.17.23",
|
|
42
40
|
"neo-open-api": "^1.2.3",
|
|
43
|
-
"
|
|
41
|
+
"neo-register": "^1.2.0",
|
|
42
|
+
"react": "^16.9.0",
|
|
43
|
+
"react-dom": "^16.9.0",
|
|
44
44
|
"tslib": "2.3.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/runtime": "^7.26.0",
|
|
48
48
|
"@commitlint/cli": "^18.0.0",
|
|
49
49
|
"@commitlint/config-conventional": "^18.0.0",
|
|
50
|
+
"@types/axios": "^0.14.0",
|
|
50
51
|
"@types/react": "^16.9.11",
|
|
51
52
|
"@types/react-dom": "^16.9.15",
|
|
52
|
-
"@types/axios": "^0.14.0",
|
|
53
|
-
"neo-cmp-cli": "^1.12.10",
|
|
54
53
|
"husky": "^4.2.5",
|
|
55
54
|
"lint-staged": "^10.2.9",
|
|
55
|
+
"neo-cmp-cli": "^1.12.11",
|
|
56
56
|
"prettier": "^2.0.5"
|
|
57
57
|
},
|
|
58
58
|
"overrides": {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Tooltip } from 'antd';
|
|
3
|
+
import { CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
|
2
4
|
import './style.scss'; // 组件内容样式
|
|
3
5
|
// @ts-ignore
|
|
4
|
-
import { NeoEntityGrid } from 'neo-ui-component-web'
|
|
6
|
+
import { NeoEntityGrid } from 'neo-ui-component-web';
|
|
5
7
|
|
|
6
8
|
interface NeoEntityGridProps {
|
|
7
9
|
objectApiKey: string;
|
|
@@ -17,15 +19,38 @@ export default class NeoEntityGridCmp extends React.PureComponent<NeoEntityGridP
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
render() {
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
+
const {
|
|
23
|
+
className,
|
|
24
|
+
objectApiKey,
|
|
25
|
+
pattern,
|
|
26
|
+
hiddenHeader,
|
|
27
|
+
showView,
|
|
28
|
+
enableChangeView,
|
|
29
|
+
defaultViewId,
|
|
30
|
+
disableSearch,
|
|
31
|
+
canCreate,
|
|
32
|
+
canImport,
|
|
33
|
+
editable,
|
|
34
|
+
withOrder,
|
|
35
|
+
withCheck,
|
|
36
|
+
enableToolbar,
|
|
37
|
+
disableExport,
|
|
38
|
+
disablePagination,
|
|
39
|
+
paginationPageSize,
|
|
40
|
+
autoHeight,
|
|
41
|
+
height,
|
|
42
|
+
additionalConditions,
|
|
43
|
+
onRecordChange,
|
|
44
|
+
...restProps
|
|
45
|
+
} = this.props;
|
|
46
|
+
console.log('entityGrid2__c: ', this.props, this);
|
|
22
47
|
|
|
23
48
|
return (
|
|
24
|
-
<div className={`
|
|
49
|
+
<div className={`entityGrid2__c ${className}`}>
|
|
25
50
|
<NeoEntityGrid
|
|
26
51
|
render={this.props.render}
|
|
27
52
|
objectApiKey={objectApiKey || 'account'}
|
|
28
|
-
pattern={
|
|
53
|
+
pattern={'entityView'}
|
|
29
54
|
// defaultViewId="default_view" // 默认展示的列表视图
|
|
30
55
|
hiddenHeader={hiddenHeader ?? false}
|
|
31
56
|
showView={showView ?? true}
|
|
@@ -43,7 +68,7 @@ export default class NeoEntityGridCmp extends React.PureComponent<NeoEntityGridP
|
|
|
43
68
|
paginationPageSize={paginationPageSize ?? 20}
|
|
44
69
|
autoHeight={autoHeight ?? false}
|
|
45
70
|
height={height ?? '500px'}
|
|
46
|
-
|
|
71
|
+
customEmptyMsg="暂无数据,请点击「新建」按钮创建"
|
|
47
72
|
customToolbarButtons={{
|
|
48
73
|
header: [
|
|
49
74
|
{
|
|
@@ -53,17 +78,39 @@ export default class NeoEntityGridCmp extends React.PureComponent<NeoEntityGridP
|
|
|
53
78
|
tooltip: '对选中记录批量审批',
|
|
54
79
|
onClick: () => {
|
|
55
80
|
console.log('批量审批');
|
|
56
|
-
}
|
|
57
|
-
}
|
|
81
|
+
},
|
|
82
|
+
},
|
|
58
83
|
],
|
|
59
84
|
footer: [
|
|
60
85
|
{
|
|
61
86
|
id: 'export-pdf-btn',
|
|
62
87
|
label: '导出 PDF',
|
|
63
88
|
icon: 'FilePdf',
|
|
64
|
-
onClick: () => console.log('导出 PDF')
|
|
65
|
-
}
|
|
66
|
-
|
|
89
|
+
onClick: () => console.log('导出 PDF'),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'status-indicator',
|
|
93
|
+
label: '同步状态',
|
|
94
|
+
customRender: (button: any = { syncStatus: 'ok' }) => {
|
|
95
|
+
const ok = button.syncStatus === 'ok';
|
|
96
|
+
const tip = ok ? '已同步' : '同步失败';
|
|
97
|
+
const Icon = ok ? CheckCircleOutlined : CloseCircleOutlined;
|
|
98
|
+
return (
|
|
99
|
+
<li key={button.id} className="entityGrid2__c-status-indicator">
|
|
100
|
+
<Tooltip title={tip} placement="top" mouseEnterDelay={0.1}>
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
className={`entityGrid2__c-status-indicator__btn entityGrid2__c-status-indicator__btn--${ok ? 'ok' : 'error'}`}
|
|
104
|
+
aria-label={`同步状态:${tip}`}
|
|
105
|
+
>
|
|
106
|
+
<Icon className="entityGrid2__c-status-indicator__icon" aria-hidden />
|
|
107
|
+
</button>
|
|
108
|
+
</Tooltip>
|
|
109
|
+
</li>
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
],
|
|
67
114
|
}}
|
|
68
115
|
/>
|
|
69
116
|
</div>
|
|
@@ -9,10 +9,10 @@ export class NeoEntityGridModel {
|
|
|
9
9
|
// cmpType: string = 'entityList__c';
|
|
10
10
|
|
|
11
11
|
// 组件名称,用于设置在编辑器左侧组件面板中展示的名称
|
|
12
|
-
label: string = '
|
|
12
|
+
label: string = '大列表/自定义工具栏';
|
|
13
13
|
|
|
14
14
|
// 组件描述,用于设置在编辑器左侧组件面板中展示的描述
|
|
15
|
-
description: string = '
|
|
15
|
+
description: string = '数据列表示例: 自定义工具栏';
|
|
16
16
|
|
|
17
17
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示
|
|
18
18
|
// tags: string[] = ['自定义组件'];
|
|
@@ -44,7 +44,6 @@ export class NeoEntityGridModel {
|
|
|
44
44
|
defaultComProps = {
|
|
45
45
|
objectApiKey: 'account',
|
|
46
46
|
funPermission: true, // 设计器添加时绕过职能权限检查,确保能正常渲染列表
|
|
47
|
-
pattern: 'entityView',
|
|
48
47
|
hiddenHeader: false,
|
|
49
48
|
showView: true,
|
|
50
49
|
enableChangeView: true,
|
|
@@ -77,20 +76,6 @@ export class NeoEntityGridModel {
|
|
|
77
76
|
xObjectApiKey: 'objectApiKey',
|
|
78
77
|
label: '列表视图',
|
|
79
78
|
},
|
|
80
|
-
/*
|
|
81
|
-
// 选择器模式下,需要额外配置 referData
|
|
82
|
-
{
|
|
83
|
-
type: 'panelSelect',
|
|
84
|
-
name: 'pattern',
|
|
85
|
-
label: '列表模式',
|
|
86
|
-
value: 'entityView',
|
|
87
|
-
options: [
|
|
88
|
-
{ label: '标准实体列表', value: 'entityView' },
|
|
89
|
-
{ label: '简单列表模式', value: 'simpleListView' },
|
|
90
|
-
{ label: '选择器模式', value: 'pickView' },
|
|
91
|
-
],
|
|
92
|
-
},
|
|
93
|
-
*/
|
|
94
79
|
{
|
|
95
80
|
type: 'panelSwitch',
|
|
96
81
|
name: 'hiddenHeader',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
--padding-bottom: 12px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.entityGrid2__c {
|
|
6
6
|
position: relative;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
|
|
@@ -11,3 +11,59 @@
|
|
|
11
11
|
padding: 6px var(--padding-bottom);
|
|
12
12
|
background-color: #fff;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/* 底部工具栏「同步状态」:antd Tooltip + Icon,文案在悬浮时由 Tooltip 展示 */
|
|
16
|
+
.entityGrid2__c .entityGrid2__c-status-indicator {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
list-style: none;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn {
|
|
26
|
+
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
width: 32px;
|
|
31
|
+
height: 32px;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
border: 1px solid #e5e7eb;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
background: #fff;
|
|
37
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
|
|
38
|
+
cursor: default;
|
|
39
|
+
outline: none;
|
|
40
|
+
transition:
|
|
41
|
+
background 0.15s ease,
|
|
42
|
+
border-color 0.15s ease,
|
|
43
|
+
box-shadow 0.15s ease;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn--ok {
|
|
47
|
+
color: #16a34a;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn--error {
|
|
51
|
+
color: #dc2626;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn:hover,
|
|
55
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn:focus-visible {
|
|
56
|
+
background: #f9fafb;
|
|
57
|
+
border-color: #d1d5db;
|
|
58
|
+
box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__btn:focus-visible {
|
|
62
|
+
box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(59, 130, 246, 0.45);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.entityGrid2__c .entityGrid2__c-status-indicator__icon {
|
|
66
|
+
display: block;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
font-size: 18px;
|
|
69
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './style.scss'; // 组件内容样式
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import { NeoEntityGrid } from 'neo-ui-component-web';
|
|
5
|
+
|
|
6
|
+
interface NeoEntityGridProps {
|
|
7
|
+
objectApiKey: string;
|
|
8
|
+
disableSearch?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
render: (name: string, schema: any) => React.ReactNode;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default class NeoEntityGridCmp extends React.PureComponent<NeoEntityGridProps> {
|
|
15
|
+
constructor(props: NeoEntityGridProps) {
|
|
16
|
+
super(props);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
render() {
|
|
20
|
+
const {
|
|
21
|
+
className,
|
|
22
|
+
objectApiKey,
|
|
23
|
+
pattern,
|
|
24
|
+
hiddenHeader,
|
|
25
|
+
showView,
|
|
26
|
+
enableChangeView,
|
|
27
|
+
defaultViewId,
|
|
28
|
+
disableSearch,
|
|
29
|
+
canCreate,
|
|
30
|
+
canImport,
|
|
31
|
+
editable,
|
|
32
|
+
withOrder,
|
|
33
|
+
withCheck,
|
|
34
|
+
enableToolbar,
|
|
35
|
+
disableExport,
|
|
36
|
+
disablePagination,
|
|
37
|
+
paginationPageSize,
|
|
38
|
+
autoHeight,
|
|
39
|
+
height,
|
|
40
|
+
additionalConditions,
|
|
41
|
+
onRecordChange,
|
|
42
|
+
...restProps
|
|
43
|
+
} = this.props;
|
|
44
|
+
console.log('entityGrid3__c: ', this.props, this);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className={`entityGrid3__c ${className}`}>
|
|
48
|
+
<NeoEntityGrid
|
|
49
|
+
render={this.props.render}
|
|
50
|
+
objectApiKey={objectApiKey || 'account'}
|
|
51
|
+
pattern={'pickView'} // Picker 列表(选择器)
|
|
52
|
+
referData={{
|
|
53
|
+
referObjectApiKey: 'opportunity', // 关联表
|
|
54
|
+
referItemApiKey: 'accountId' // 关联表对应的外键字段
|
|
55
|
+
}}
|
|
56
|
+
selectionMode="multiple" // 多选模式
|
|
57
|
+
shouldCloseDialog={true}
|
|
58
|
+
onRowSelected={(data: any, event: any) => {
|
|
59
|
+
const selectedIds = data.map(({ data }: any) => data.id);
|
|
60
|
+
const selectedNames = data.map(({ data }: any) => data.name);
|
|
61
|
+
console.log('已选中条数:', data.length);
|
|
62
|
+
console.log('已选中 ID:', selectedIds);
|
|
63
|
+
console.log('已选中名称:', selectedNames);
|
|
64
|
+
}}
|
|
65
|
+
// defaultViewId="default_view" // 默认展示的列表视图
|
|
66
|
+
hiddenHeader={hiddenHeader ?? false}
|
|
67
|
+
disableSearch={disableSearch ?? false}
|
|
68
|
+
canCreate={canCreate ?? true}
|
|
69
|
+
withOrder={withOrder ?? true}
|
|
70
|
+
withCheck={withCheck ?? true}
|
|
71
|
+
disablePagination={disablePagination ?? false}
|
|
72
|
+
paginationPageSize={paginationPageSize ?? 20}
|
|
73
|
+
autoHeight={autoHeight ?? false}
|
|
74
|
+
height={height ?? '500px'}
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file 自定义组件对接编辑器的描述文件
|
|
3
|
+
*/
|
|
4
|
+
export class NeoEntityGridModel {
|
|
5
|
+
/**
|
|
6
|
+
* cmpType 为自定义组件名称,用于标识组件的唯一性
|
|
7
|
+
* 在构建时根据当前组件目录名称自动生成
|
|
8
|
+
*/
|
|
9
|
+
// cmpType: string = 'entityList__c';
|
|
10
|
+
|
|
11
|
+
// 组件名称,用于设置在编辑器左侧组件面板中展示的名称
|
|
12
|
+
label: string = 'Picker 列表';
|
|
13
|
+
|
|
14
|
+
// 组件描述,用于设置在编辑器左侧组件面板中展示的描述
|
|
15
|
+
description: string = '数据列表示例: Picker 列表';
|
|
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
|
+
* 用于设置组件支持的终端类型
|
|
32
|
+
*
|
|
33
|
+
* 当前 NeoCRM 平台存在的终端类型:
|
|
34
|
+
* web: 网页端
|
|
35
|
+
* mobile: 移动端
|
|
36
|
+
*/
|
|
37
|
+
targetDevice: string = 'web';
|
|
38
|
+
|
|
39
|
+
// 组件图标,用于设置在编辑器左侧组件面板中展示的图标
|
|
40
|
+
iconUrl: string = 'https://custom-widgets.bj.bcebos.com/table.svg';
|
|
41
|
+
// iconUrl = 'https://neo-widgets.bj.bcebos.com/favicon.png';
|
|
42
|
+
|
|
43
|
+
// 初次插入页面的默认属性数据
|
|
44
|
+
defaultComProps = {
|
|
45
|
+
objectApiKey: 'account',
|
|
46
|
+
funPermission: true, // 设计器添加时绕过职能权限检查,确保能正常渲染列表
|
|
47
|
+
hiddenHeader: true,
|
|
48
|
+
canCreate: true,
|
|
49
|
+
withOrder: true,
|
|
50
|
+
withCheck: true,
|
|
51
|
+
disableSearch: false,
|
|
52
|
+
disablePagination: false,
|
|
53
|
+
paginationPageSize: 20,
|
|
54
|
+
autoHeight: false,
|
|
55
|
+
height: '500px',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
60
|
+
*/
|
|
61
|
+
propsSchema = [
|
|
62
|
+
{
|
|
63
|
+
type: 'xObjectEntityList',
|
|
64
|
+
name: 'objectApiKey',
|
|
65
|
+
label: '实体对象',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'panelSwitch',
|
|
69
|
+
name: 'hiddenHeader',
|
|
70
|
+
label: '隐藏头部',
|
|
71
|
+
defaultChecked: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'panelSwitch',
|
|
75
|
+
name: 'disableSearch',
|
|
76
|
+
label: '禁用搜索',
|
|
77
|
+
defaultChecked: false,
|
|
78
|
+
hiddenOn: 'hiddenHeader',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: 'panelSwitch',
|
|
82
|
+
name: 'canCreate',
|
|
83
|
+
label: '支持新建',
|
|
84
|
+
defaultChecked: true,
|
|
85
|
+
hiddenOn: 'hiddenHeader',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'panelSwitch',
|
|
89
|
+
name: 'withOrder',
|
|
90
|
+
label: '显示序号列',
|
|
91
|
+
defaultChecked: true,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: 'panelSwitch',
|
|
95
|
+
name: 'withCheck',
|
|
96
|
+
label: '显示多选列',
|
|
97
|
+
defaultChecked: true,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'panelNumber',
|
|
101
|
+
name: 'paginationPageSize',
|
|
102
|
+
label: '每页展示条数',
|
|
103
|
+
visibleOn: '!disablePagination',
|
|
104
|
+
value: 20,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: 'panelSwitch',
|
|
108
|
+
name: 'autoHeight',
|
|
109
|
+
label: '高度自适应(根据父容器高度自动适配)',
|
|
110
|
+
defaultChecked: false,
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: 'panelInput',
|
|
114
|
+
name: 'height',
|
|
115
|
+
label: '高度',
|
|
116
|
+
visibleOn: '!autoHeight',
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default NeoEntityGridModel;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--padding-bottom: 12px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.entityGrid3__c {
|
|
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
|
+
|
|
15
|
+
/* 底部工具栏「同步状态」指示器(customToolbarButtons.footer customRender) */
|
|
16
|
+
.entityGrid3__c .entityGrid3__c-status-indicator {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 8px;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 6px 12px;
|
|
22
|
+
list-style: none;
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
line-height: 1.25;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
letter-spacing: 0.02em;
|
|
27
|
+
color: #1f2937;
|
|
28
|
+
background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
|
|
29
|
+
border: 1px solid #e5e7eb;
|
|
30
|
+
border-radius: 999px;
|
|
31
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
|
|
32
|
+
user-select: none;
|
|
33
|
+
vertical-align: middle;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.entityGrid3__c .entityGrid3__c-status-indicator__dot {
|
|
37
|
+
flex-shrink: 0;
|
|
38
|
+
width: 8px;
|
|
39
|
+
height: 8px;
|
|
40
|
+
border-radius: 50%;
|
|
41
|
+
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.entityGrid3__c .entityGrid3__c-status-indicator__dot--ok {
|
|
45
|
+
background: #22c55e;
|
|
46
|
+
box-shadow:
|
|
47
|
+
0 0 0 2px rgba(255, 255, 255, 0.9),
|
|
48
|
+
0 0 0 3px rgba(34, 197, 94, 0.25);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.entityGrid3__c .entityGrid3__c-status-indicator__dot--error {
|
|
52
|
+
background: #ef4444;
|
|
53
|
+
box-shadow:
|
|
54
|
+
0 0 0 2px rgba(255, 255, 255, 0.9),
|
|
55
|
+
0 0 0 3px rgba(239, 68, 68, 0.28);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.entityGrid3__c .entityGrid3__c-status-indicator__label {
|
|
59
|
+
color: #374151;
|
|
60
|
+
}
|