neo-cmp-cli 1.12.6 → 1.12.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/dist/neo/neoEnvManager.js +1 -1
- package/dist/neo/pullCmp.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/develop//345/261/236/346/200/247/351/205/215/347/275/256/351/241/271/347/261/273/345/236/213/346/261/207/346/200/273.md +558 -0
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +1 -1
- package/template/neo-bi-cmps/package.json +1 -1
- package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +3 -3
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-h5-cmps/neo.config.js +34 -76
- package/template/neo-h5-cmps/package.json +7 -3
- package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +0 -4
- package/template/neo-h5-cmps/src/components/entityList__c/model.ts +10 -5
- package/template/neo-h5-cmps/src/components/entityTabs__c/index.tsx +29 -17
- package/template/neo-h5-cmps/src/components/entityTabs__c/model.ts +25 -5
- package/template/neo-h5-cmps/src/components/entityTabs__c/style.scss +11 -22
- package/template/neo-h5-cmps/src/components/openChatPageBtn__c/index.tsx +3 -1
- package/template/neo-h5-cmps/src/utils/xobjects.ts +8 -3
- package/template/neo-h5-cmps/tsconfig.json +1 -1
- package/template/neo-order-cmps/package.json +1 -1
- 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/template/neo-h5-cmps/src/components/simpleTable__c/README.md +0 -90
- package/template/neo-h5-cmps/src/components/simpleTable__c/index.tsx +0 -277
- package/template/neo-h5-cmps/src/components/simpleTable__c/model.ts +0 -91
- package/template/neo-h5-cmps/src/components/simpleTable__c/style.scss +0 -116
|
@@ -10,91 +10,49 @@ function resolve(dir) {
|
|
|
10
10
|
// 包括生产和开发的环境配置信息
|
|
11
11
|
module.exports = {
|
|
12
12
|
settings: {
|
|
13
|
-
enableESLint: false,
|
|
14
|
-
enableESLintFix: false,
|
|
15
|
-
enableStyleLint: false,
|
|
16
|
-
enableStyleLintFix: false
|
|
13
|
+
enableESLint: false,
|
|
14
|
+
enableESLintFix: false,
|
|
15
|
+
enableStyleLint: false,
|
|
16
|
+
enableStyleLintFix: false
|
|
17
17
|
},
|
|
18
18
|
webpack: {
|
|
19
|
-
target: [
|
|
19
|
+
target: [
|
|
20
|
+
"web",
|
|
21
|
+
"es5"
|
|
22
|
+
],
|
|
20
23
|
resolve: {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
extensions: [
|
|
25
|
+
".js",
|
|
26
|
+
".jsx",
|
|
27
|
+
".ts",
|
|
28
|
+
".tsx",
|
|
29
|
+
".umd.js",
|
|
30
|
+
".min.js",
|
|
31
|
+
".json"
|
|
32
|
+
],
|
|
23
33
|
alias: {
|
|
24
|
-
|
|
25
|
-
$assets: resolve(
|
|
26
|
-
$public: resolve(
|
|
27
|
-
$utils: resolve(
|
|
28
|
-
}
|
|
34
|
+
"@": resolve("./src"),
|
|
35
|
+
$assets: resolve("./src/assets"),
|
|
36
|
+
$public: resolve("./public"),
|
|
37
|
+
$utils: resolve("./src/utils")
|
|
38
|
+
}
|
|
29
39
|
},
|
|
30
|
-
// sassResources中的sass文件会自动注入每一个sass文件中
|
|
31
40
|
sassResources: [
|
|
32
|
-
resolve(
|
|
33
|
-
resolve(
|
|
41
|
+
resolve("./src/assets/css/common.scss"),
|
|
42
|
+
resolve("./src/assets/css/mixin.scss")
|
|
34
43
|
],
|
|
35
|
-
|
|
36
|
-
ignoreNodeModules: false, // 打包时是否忽略 node_modules
|
|
37
|
-
// allowList: [], // ignoreNodeModules为true时生效
|
|
38
|
-
// projectDir: ['src'],
|
|
39
|
-
// template: resolve('./public/template.html'), // 自定义html模板
|
|
40
|
-
// plugins: [],
|
|
41
|
-
// babelPlugins: [],
|
|
42
|
-
},
|
|
43
|
-
// 用于添加 Neo 共享依赖模块的配置信息
|
|
44
|
-
/*
|
|
45
|
-
neoCommonModule: {
|
|
46
|
-
// exports: ['xxModule'], // 数组写法,用于导出当前自定义组件中的第三方依赖模块
|
|
47
|
-
exports: { // 对象写法,可用于导出自定义组件中的某个内容模块(需要使用绝对路径导出)
|
|
48
|
-
'xxModule': path.resolve('./src/components/xxModule'), // 导出 xx组件 或 xx模块
|
|
49
|
-
},
|
|
50
|
-
// remoteDeps: ['xxCmpType'], // 远程依赖组件,表示当前自定义组件会用到的依赖组件,需要和 externals 配合使用
|
|
51
|
-
// externals: ['xxModule'], // 自定义组件中需要剔除的模块,仅支持数组写法
|
|
44
|
+
ignoreNodeModules: false
|
|
52
45
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
59
|
-
// 外链调试(在线上页面设计器端预览自定义组件)
|
|
60
|
-
index: [
|
|
61
|
-
'./src/components/xxCmp/register.ts',
|
|
62
|
-
'./src/components/xxCmp/model.ts',
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
NODE_ENV: 'development',
|
|
66
|
-
port: 80, // 设置基础端口,如果被占用则自动寻找可用端口
|
|
67
|
-
closeHotReload: true, // 是否关闭热更新
|
|
68
|
-
assetsPublicPath: '/', // 设置静态资源的引用路径(根域名+路径)
|
|
69
|
-
assetsSubDirectory: '',
|
|
70
|
-
hostname: 'localhost',
|
|
71
|
-
proxyTable: {
|
|
72
|
-
'/apiTest': {
|
|
73
|
-
target: 'http://api-test.com.cn', // 不支持跨域的接口根地址
|
|
74
|
-
ws: true,
|
|
75
|
-
changeOrigin: true,
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
*/
|
|
46
|
+
linkDebug: {},
|
|
47
|
+
neoConfig1: {
|
|
48
|
+
neoBaseURL: "https://crm-test.xiaoshouyi.com",
|
|
49
|
+
loginURL: "https://login-test.xiaoshouyi.com/auc/oauth2/auth",
|
|
50
|
+
tokenURL: "https://login-test.xiaoshouyi.com/auc/oauth2/token"
|
|
79
51
|
},
|
|
80
|
-
// 选择「自定义环境」时需要添加 NeoCRM 平台配置,可自定义对接的任何环境
|
|
81
52
|
neoConfig: {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
tokenURL: 'https://login-test.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址(默认:https://login.xiaoshouyi.com/auc/oauth2/token)
|
|
86
|
-
},
|
|
87
|
-
pushCmp: {
|
|
88
|
-
// 用于构建并发布至 NeoCRM 的相关配置
|
|
89
|
-
/*
|
|
90
|
-
【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
|
|
91
|
-
NODE_ENV: 'production',
|
|
92
|
-
entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
|
|
93
|
-
InfoCardModel: './src/components/xxCmp/model.ts',
|
|
94
|
-
infoCard: './src/components/xxCmp/register.ts'
|
|
95
|
-
},
|
|
96
|
-
cssExtract: false, // 不额外提取css文件
|
|
97
|
-
assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
|
|
98
|
-
*/
|
|
53
|
+
neoBaseURL: "https://crm-tencentuat.xiaoshouyi.com",
|
|
54
|
+
loginURL: "https://login-tencentuat.xiaoshouyi.com/auc/oauth2/auth",
|
|
55
|
+
tokenURL: "https://login-tencentuat.xiaoshouyi.com/auc/oauth2/token"
|
|
99
56
|
},
|
|
57
|
+
pushCmp: {}
|
|
100
58
|
};
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"pushCmp": "neo push cmp",
|
|
16
16
|
"pullCmp": "neo pull cmp",
|
|
17
17
|
"deleteCmp": "neo delete cmp",
|
|
18
|
+
"build2lib": "neo build2lib",
|
|
18
19
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
@@ -36,17 +37,20 @@
|
|
|
36
37
|
"react": "^16.9.0",
|
|
37
38
|
"react-dom": "^16.9.0",
|
|
38
39
|
"axios": "^1.7.0",
|
|
39
|
-
"antd": "^
|
|
40
|
+
"antd-mobile": "^2.3.3",
|
|
40
41
|
"lodash": "^4.17.23",
|
|
41
|
-
"neo-open-api": "^1.2.1"
|
|
42
|
+
"neo-open-api": "^1.2.1",
|
|
43
|
+
"@wibetter/json-editor": "^6.0.5",
|
|
44
|
+
"tslib": "2.3.0"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
47
|
+
"@babel/runtime": "^7.26.0",
|
|
44
48
|
"@commitlint/cli": "^18.0.0",
|
|
45
49
|
"@commitlint/config-conventional": "^18.0.0",
|
|
46
50
|
"@types/react": "^16.9.11",
|
|
47
51
|
"@types/react-dom": "^16.9.15",
|
|
48
52
|
"@types/axios": "^0.14.0",
|
|
49
|
-
"neo-cmp-cli": "^1.12.
|
|
53
|
+
"neo-cmp-cli": "^1.12.8",
|
|
50
54
|
"husky": "^4.2.5",
|
|
51
55
|
"lint-staged": "^10.2.9",
|
|
52
56
|
"prettier": "^2.0.5"
|
|
@@ -26,10 +26,6 @@ export default class EntityListCmp extends React.PureComponent<EntityListProps>
|
|
|
26
26
|
<div className={`entityList__c ${className}`}>
|
|
27
27
|
<NeoEntityList
|
|
28
28
|
name="entityList"
|
|
29
|
-
style={{
|
|
30
|
-
minHeight: '200px',
|
|
31
|
-
maxHeight: '100%',
|
|
32
|
-
}}
|
|
33
29
|
onItemClickIntercept={(data: any, entity: any) => {
|
|
34
30
|
// 自定义点击处理
|
|
35
31
|
console.log('点击了列表项', data, entity);
|
|
@@ -49,9 +49,8 @@ export class EntityListModel {
|
|
|
49
49
|
disabledSort: false,
|
|
50
50
|
disabledFilter: false,
|
|
51
51
|
disabledOperationBtn: false,
|
|
52
|
-
|
|
52
|
+
pageSize: 5,
|
|
53
53
|
tableType: 'list', // list 列表,lookup 下拉框,dashboardList BI 列表
|
|
54
|
-
isNoRefresh: true, // 禁用下拉刷新和上拉加载
|
|
55
54
|
skipExt: true, // 禁用 Nex 扩展
|
|
56
55
|
};
|
|
57
56
|
|
|
@@ -128,9 +127,15 @@ export class EntityListModel {
|
|
|
128
127
|
},
|
|
129
128
|
{
|
|
130
129
|
type: 'panelNumber',
|
|
131
|
-
name: '
|
|
132
|
-
label: '
|
|
133
|
-
value:
|
|
130
|
+
name: 'pageSize',
|
|
131
|
+
label: '每页展示条数',
|
|
132
|
+
value: 5,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: 'panelSwitch',
|
|
136
|
+
name: 'autoHeight',
|
|
137
|
+
label: '高度自适应(根据父容器高度自动适配)',
|
|
138
|
+
defaultChecked: true,
|
|
134
139
|
},
|
|
135
140
|
];
|
|
136
141
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Tabs } from 'antd';
|
|
2
|
+
import { Tabs } from 'antd-mobile';
|
|
3
3
|
import './style.scss'; // 组件内容样式
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
import { NeoEntityList } from 'neo-ui-component-h5'; // neo h5 组件库
|
|
@@ -15,6 +15,8 @@ interface EntityListTabsProps {
|
|
|
15
15
|
aiQuery?: string;
|
|
16
16
|
agentApiKey?: string;
|
|
17
17
|
aiChatBtnPlaceholder?: string;
|
|
18
|
+
fixedTabsHeight?: boolean;
|
|
19
|
+
tabsHeight?: string;
|
|
18
20
|
data?: any;
|
|
19
21
|
env?: any;
|
|
20
22
|
className?: string;
|
|
@@ -22,10 +24,10 @@ interface EntityListTabsProps {
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const TABS = [
|
|
25
|
-
{ key: 'account',
|
|
26
|
-
{ key: 'contact',
|
|
27
|
-
{ key: 'product',
|
|
28
|
-
{ key: 'order',
|
|
27
|
+
{ key: 'account', title: '客户', entityApiKey: 'account' },
|
|
28
|
+
{ key: 'contact', title: '联系人', entityApiKey: 'contact' },
|
|
29
|
+
{ key: 'product', title: '产品', entityApiKey: 'product' },
|
|
30
|
+
{ key: 'order', title: '订单', entityApiKey: 'order' },
|
|
29
31
|
];
|
|
30
32
|
|
|
31
33
|
export default class EntityListTabsCmp extends React.PureComponent<EntityListTabsProps> {
|
|
@@ -46,14 +48,11 @@ export default class EntityListTabsCmp extends React.PureComponent<EntityListTab
|
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
renderEntityList = (entityApiKey: string) => {
|
|
49
|
-
const { className, ...restProps } = this.props;
|
|
51
|
+
const { className, fixedTabsHeight, tabsHeight, ...restProps } = this.props;
|
|
50
52
|
return (
|
|
51
53
|
<NeoEntityList
|
|
52
54
|
key={entityApiKey}
|
|
53
55
|
name={`entityList-${entityApiKey}`}
|
|
54
|
-
style={{
|
|
55
|
-
height: '300px'
|
|
56
|
-
}}
|
|
57
56
|
onItemClickIntercept={(data: any, entity: any) => {
|
|
58
57
|
console.log('点击了列表项', data, entity);
|
|
59
58
|
return false;
|
|
@@ -75,13 +74,21 @@ export default class EntityListTabsCmp extends React.PureComponent<EntityListTab
|
|
|
75
74
|
showHeader = true,
|
|
76
75
|
showAiChatBtn = true,
|
|
77
76
|
aiChatBtnPlaceholder = '打开AI对话页',
|
|
77
|
+
fixedTabsHeight = false,
|
|
78
|
+
tabsHeight = '500px',
|
|
78
79
|
} = this.props;
|
|
79
80
|
|
|
81
|
+
const tabsContentStyle = fixedTabsHeight
|
|
82
|
+
? { height: tabsHeight }
|
|
83
|
+
: undefined;
|
|
84
|
+
|
|
80
85
|
return (
|
|
81
86
|
<div className={`entityTabs__c ${className || ''}`}>
|
|
82
87
|
{showHeader && (
|
|
83
88
|
<div className="title-header">
|
|
84
|
-
<span className="title-header-text">
|
|
89
|
+
<span className="title-header-text">
|
|
90
|
+
{headerTitle || '数据列表'}
|
|
91
|
+
</span>
|
|
85
92
|
{showAiChatBtn && (
|
|
86
93
|
<button
|
|
87
94
|
className="entityTabs-aiChatBtn"
|
|
@@ -95,13 +102,18 @@ export default class EntityListTabsCmp extends React.PureComponent<EntityListTab
|
|
|
95
102
|
)}
|
|
96
103
|
</div>
|
|
97
104
|
)}
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
<div className="custom-tabs">
|
|
106
|
+
<Tabs
|
|
107
|
+
tabs={TABS.map(({ key, title }) => ({ key, title }))}
|
|
108
|
+
initialPage="account"
|
|
109
|
+
>
|
|
110
|
+
{TABS.map(({ entityApiKey }) => (
|
|
111
|
+
<div key={entityApiKey} style={tabsContentStyle}>
|
|
112
|
+
{this.renderEntityList(entityApiKey)}
|
|
113
|
+
</div>
|
|
114
|
+
))}
|
|
115
|
+
</Tabs>
|
|
116
|
+
</div>
|
|
105
117
|
</div>
|
|
106
118
|
);
|
|
107
119
|
}
|
|
@@ -54,9 +54,10 @@ export class EntityListTabsModel {
|
|
|
54
54
|
disabledSort: true,
|
|
55
55
|
disabledFilter: true,
|
|
56
56
|
disabledOperationBtn: true,
|
|
57
|
-
|
|
57
|
+
autoHeight: true,
|
|
58
|
+
pageSize: 5,
|
|
58
59
|
tableType: 'list', // list 列表,lookup 下拉框,dashboardList BI 列表
|
|
59
|
-
isNoRefresh: true, // 禁用下拉刷新和上拉加载
|
|
60
|
+
// isNoRefresh: true, // 禁用下拉刷新和上拉加载
|
|
60
61
|
skipExt: true, // 禁用 Nex 扩展
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -78,6 +79,19 @@ export class EntityListTabsModel {
|
|
|
78
79
|
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
79
80
|
*/
|
|
80
81
|
propsSchema = [
|
|
82
|
+
{
|
|
83
|
+
type: 'panelSwitch',
|
|
84
|
+
name: 'fixedTabsHeight',
|
|
85
|
+
label: '固定 Tabs 高度',
|
|
86
|
+
defaultChecked: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: 'panelInput',
|
|
90
|
+
name: 'tabsHeight',
|
|
91
|
+
label: 'Tabs 高度',
|
|
92
|
+
visibleOn: 'fixedTabsHeight',
|
|
93
|
+
value: '500px',
|
|
94
|
+
},
|
|
81
95
|
{
|
|
82
96
|
type: 'panelSwitch',
|
|
83
97
|
name: 'showHeader',
|
|
@@ -162,9 +176,15 @@ export class EntityListTabsModel {
|
|
|
162
176
|
},
|
|
163
177
|
{
|
|
164
178
|
type: 'panelNumber',
|
|
165
|
-
name: '
|
|
166
|
-
label: '
|
|
167
|
-
value:
|
|
179
|
+
name: 'pageSize',
|
|
180
|
+
label: '每页展示条数',
|
|
181
|
+
value: 5,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'panelSwitch',
|
|
185
|
+
name: 'autoHeight',
|
|
186
|
+
label: '高度自适应(根据父容器高度自动适配)',
|
|
187
|
+
defaultChecked: true,
|
|
168
188
|
},
|
|
169
189
|
];
|
|
170
190
|
}
|
|
@@ -24,10 +24,6 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.neo-list-container {
|
|
28
|
-
height: 500px !important;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
27
|
// AI 对话框按钮 - 样式参照 openChatPageBtn
|
|
32
28
|
.entityTabs-aiChatBtn {
|
|
33
29
|
position: relative;
|
|
@@ -52,7 +48,12 @@
|
|
|
52
48
|
inset: -2px;
|
|
53
49
|
border-radius: 8px;
|
|
54
50
|
padding: 2px;
|
|
55
|
-
background: linear-gradient(
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
135deg,
|
|
53
|
+
#667eea 0%,
|
|
54
|
+
#764ba2 50%,
|
|
55
|
+
#f093fb 100%
|
|
56
|
+
);
|
|
56
57
|
-webkit-mask: linear-gradient(#fff 0 0) content-box,
|
|
57
58
|
linear-gradient(#fff 0 0);
|
|
58
59
|
-webkit-mask-composite: xor;
|
|
@@ -89,30 +90,22 @@
|
|
|
89
90
|
white-space: nowrap;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
// Tabs 头部居中并均匀展示
|
|
93
|
+
// Tabs 头部居中并均匀展示 (antd-mobile)
|
|
93
94
|
.custom-tabs {
|
|
94
|
-
.
|
|
95
|
+
.am-tabs-default-bar {
|
|
95
96
|
margin-bottom: 0;
|
|
96
97
|
|
|
97
|
-
&::
|
|
98
|
+
&::after {
|
|
98
99
|
border-bottom: 1px solid #f0f0f0;
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
.
|
|
103
|
+
.am-tabs-default-bar-content {
|
|
103
104
|
display: flex;
|
|
104
105
|
justify-content: center;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
.
|
|
108
|
-
display: flex;
|
|
109
|
-
flex: 1;
|
|
110
|
-
margin: 0;
|
|
111
|
-
width: 100%;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// 每个 tab 居中均匀展示,最小宽度 30px
|
|
115
|
-
.ant-tabs-tab {
|
|
108
|
+
.am-tabs-default-bar-tab {
|
|
116
109
|
display: flex;
|
|
117
110
|
flex: 1;
|
|
118
111
|
min-width: 30px;
|
|
@@ -120,10 +113,6 @@
|
|
|
120
113
|
padding: 12px 8px;
|
|
121
114
|
margin: 0 !important;
|
|
122
115
|
font-size: 14px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.ant-tabs-tab-btn {
|
|
126
|
-
min-width: 30px;
|
|
127
116
|
text-align: center;
|
|
128
117
|
}
|
|
129
118
|
}
|
|
@@ -51,7 +51,9 @@ export default class openChatPageBtn extends BaseCmp<
|
|
|
51
51
|
onClick={() => this.openChatPage()}
|
|
52
52
|
>
|
|
53
53
|
<span className="openChatPageBtn-icon"></span>
|
|
54
|
-
<span className="openChatPageBtn-text">
|
|
54
|
+
<span className="openChatPageBtn-text">
|
|
55
|
+
{placeholder || '打开AI对话页'}
|
|
56
|
+
</span>
|
|
55
57
|
</button>
|
|
56
58
|
</div>
|
|
57
59
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Toast } from 'antd-mobile';
|
|
2
2
|
import axiosFetcher from './axiosFetcher';
|
|
3
3
|
|
|
4
4
|
// 获取业务类型列表
|
|
@@ -19,7 +19,7 @@ export const getEntityTypeList = async (
|
|
|
19
19
|
return result;
|
|
20
20
|
} catch (error) {
|
|
21
21
|
console.error('获取业务类型失败:', error);
|
|
22
|
-
|
|
22
|
+
Toast.fail('获取业务类型失败。');
|
|
23
23
|
return {};
|
|
24
24
|
}
|
|
25
25
|
};
|
|
@@ -41,7 +41,7 @@ export const getEntityList = async (options?: any) => {
|
|
|
41
41
|
return result;
|
|
42
42
|
} catch (error) {
|
|
43
43
|
console.error('获取对象列表失败:', error);
|
|
44
|
-
|
|
44
|
+
Toast.fail('获取对象列表失败。');
|
|
45
45
|
return {};
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -65,6 +65,7 @@ export const createXObject = async (xObjectApiKey: string, options: any) => {
|
|
|
65
65
|
return result;
|
|
66
66
|
} catch (error) {
|
|
67
67
|
console.error('创建业务数据失败:', error);
|
|
68
|
+
Toast.fail('创建业务数据失败');
|
|
68
69
|
throw error;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
@@ -84,6 +85,7 @@ export const getXObjectDesc = async (xObjectApiKey: string, options?: any) => {
|
|
|
84
85
|
return result;
|
|
85
86
|
} catch (error) {
|
|
86
87
|
console.error('获取业务对象描述:', error);
|
|
88
|
+
Toast.fail('获取业务对象描述失败');
|
|
87
89
|
throw error;
|
|
88
90
|
}
|
|
89
91
|
};
|
|
@@ -111,6 +113,7 @@ export const updateXObject = async (
|
|
|
111
113
|
return result;
|
|
112
114
|
} catch (error) {
|
|
113
115
|
console.error('更新业务数据失败:', error);
|
|
116
|
+
Toast.fail('更新业务数据失败');
|
|
114
117
|
throw error;
|
|
115
118
|
}
|
|
116
119
|
};
|
|
@@ -134,6 +137,7 @@ export const getXObject = async (
|
|
|
134
137
|
return result;
|
|
135
138
|
} catch (error) {
|
|
136
139
|
console.error('获取业务数据信息失败:', error);
|
|
140
|
+
Toast.fail('获取业务数据信息失败');
|
|
137
141
|
throw error;
|
|
138
142
|
}
|
|
139
143
|
};
|
|
@@ -157,6 +161,7 @@ export const deleteXObject = async (
|
|
|
157
161
|
return result;
|
|
158
162
|
} catch (error) {
|
|
159
163
|
console.error('删除业务数据:', error);
|
|
164
|
+
Toast.fail('删除业务数据失败');
|
|
160
165
|
throw error;
|
|
161
166
|
}
|
|
162
167
|
};
|
|
@@ -1,90 +0,0 @@
|
|
|
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
|
-
|