neo-cmp-cli 1.12.8 → 1.12.10
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 +204 -6
- package/dist/index2.js +1 -1
- package/dist/module/neoInitByCopy.js +1 -1
- package/dist/neo/env.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +4 -1
- package/template/antd-custom-cmp-template/package.json +1 -1
- package/template/asset-manage-template/README.md +154 -0
- package/template/asset-manage-template/docs/README.md +244 -0
- package/template/asset-manage-template/neo.config.js +60 -0
- package/template/asset-manage-template/package.json +74 -0
- package/template/asset-manage-template/src/assets/img/chart.svg +1 -0
- package/template/asset-manage-template/src/components/README.md +3 -0
- package/template/asset-manage-template/src/components/assetManage__c/assetApi.ts +70 -0
- package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetCreateModal.tsx +260 -0
- package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetGrid.tsx +48 -0
- package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetSidebar.tsx +74 -0
- package/template/asset-manage-template/src/components/assetManage__c/cmps/AssetToolbar.tsx +79 -0
- package/template/asset-manage-template/src/components/assetManage__c/cmps/assetDisplay.tsx +72 -0
- package/template/asset-manage-template/src/components/assetManage__c/constants.ts +28 -0
- package/template/asset-manage-template/src/components/assetManage__c/index.tsx +258 -0
- package/template/asset-manage-template/src/components/assetManage__c/model.ts +75 -0
- package/template/asset-manage-template/src/components/assetManage__c/style.scss +425 -0
- package/template/asset-manage-template/src/components/assetManage__c/types.ts +60 -0
- package/template/asset-manage-template/src/components/bidList__c/cmps/BidCard.tsx +47 -0
- package/template/asset-manage-template/src/components/bidList__c/constants.ts +6 -0
- package/template/asset-manage-template/src/components/bidList__c/formatUtils.ts +14 -0
- package/template/asset-manage-template/src/components/bidList__c/index.tsx +194 -0
- package/template/asset-manage-template/src/components/bidList__c/model.ts +57 -0
- package/template/asset-manage-template/src/components/bidList__c/style.scss +179 -0
- package/template/asset-manage-template/src/components/bidList__c/types.ts +10 -0
- package/template/asset-manage-template/src/components/bidPackage__c/cmps/BidPackageHeader.tsx +140 -0
- package/template/asset-manage-template/src/components/bidPackage__c/cmps/PackageItemTable.tsx +148 -0
- package/template/asset-manage-template/src/components/bidPackage__c/index.tsx +394 -0
- package/template/asset-manage-template/src/components/bidPackage__c/mainTableColumns.tsx +57 -0
- package/template/asset-manage-template/src/components/bidPackage__c/model.ts +86 -0
- package/template/asset-manage-template/src/components/bidPackage__c/style.scss +256 -0
- package/template/asset-manage-template/src/components/bidPackage__c/types.ts +35 -0
- package/template/asset-manage-template/src/components/bidPackage__c/utils.ts +19 -0
- package/template/{neo-bi-cmps → asset-manage-template}/src/utils/axiosFetcher.ts +0 -0
- package/template/{neo-bi-cmps → asset-manage-template}/src/utils/queryObjectData.ts +36 -0
- package/template/asset-manage-template/src/utils/url.ts +82 -0
- package/template/{neo-bi-cmps → asset-manage-template}/src/utils/xobjects.ts +0 -0
- package/template/asset-manage-template/tsconfig.json +40 -0
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +2 -2
- package/template/neo-custom-cmp-template/package.json +5 -2
- package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +62 -6
- package/template/neo-custom-cmp-template/src/utils/queryObjectData.ts +36 -0
- package/template/neo-custom-cmp-template/tsconfig.json +1 -2
- package/template/neo-h5-cmps/neo.config.js +1 -6
- package/template/neo-h5-cmps/package.json +7 -4
- package/template/neo-h5-cmps/src/utils/queryObjectData.ts +36 -0
- package/template/neo-h5-cmps/tsconfig.json +3 -4
- package/template/neo-order-cmps/package.json +2 -2
- package/template/neo-order-cmps/src/utils/queryObjectData.ts +36 -0
- package/template/neo-web-cmps/@types/neo-ui-common.d.ts +36 -0
- package/template/neo-web-cmps/neo.config.js +53 -0
- package/template/{neo-bi-cmps → neo-web-cmps}/package.json +10 -7
- package/template/neo-web-cmps/src/assets/img/AIBtn.gif +0 -0
- package/template/neo-web-cmps/src/assets/img/aiLogo.png +0 -0
- package/template/neo-web-cmps/src/assets/img/card-list.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/contact-form.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/custom-form.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/data-list.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/detail.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/map.svg +1 -0
- package/template/neo-web-cmps/src/assets/img/search.svg +1 -0
- package/template/neo-web-cmps/src/components/entityGrid2__c/index.tsx +72 -0
- package/template/neo-web-cmps/src/components/entityGrid2__c/model.ts +195 -0
- package/template/neo-web-cmps/src/components/entityGrid2__c/style.scss +13 -0
- package/template/neo-web-cmps/src/components/entityGrid__c/index.tsx +52 -0
- package/template/neo-web-cmps/src/components/entityGrid__c/model.ts +195 -0
- package/template/neo-web-cmps/src/components/entityGrid__c/style.scss +13 -0
- package/template/neo-web-cmps/src/utils/axiosFetcher.ts +37 -0
- package/template/neo-web-cmps/src/utils/queryObjectData.ts +112 -0
- package/template/{develop/neo-custom-cmp-template → neo-web-cmps}/src/utils/xobjects.ts +28 -64
- package/template/{neo-bi-cmps → neo-web-cmps}/tsconfig.json +2 -3
- 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/develop/BI /351/241/271/347/233/256/345/210/206/346/236/220/346/212/245/345/221/212.md" +0 -562
- package/template/develop/ChatPage /347/273/204/344/273/266/344/275/277/347/224/250/350/257/264/346/230/216/346/226/207/346/241/243.md" +0 -507
- package/template/develop/EntityGrid Web /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -868
- package/template/develop/EntityList H5 /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -1386
- package/template/develop/GlobalSearch/347/273/204/344/273/266/345/257/271/346/257/224/345/210/206/346/236/220.md +0 -866
- package/template/develop/Neo /344/270/255/345/217/257/347/224/250 amis /347/273/204/344/273/266.md" +0 -1490
- package/template/develop/cmpEventFunctions.ts +0 -257
- package/template/develop/cmpEvents.ts +0 -864
- package/template/develop/comTree/347/224/237/346/210/220/350/277/207/347/250/213/345/210/206/346/236/220.md +0 -469
- package/template/develop/commonModules.js +0 -55
- package/template/develop/components-table.md +0 -50
- package/template/develop/neo-custom-cmp-template/README.md +0 -48
- package/template/develop/neo-custom-cmp-template/docs/README.md +0 -13
- package/template/develop/neo-custom-cmp-template/neo.config.js +0 -121
- package/template/develop/neo-custom-cmp-template/package.json +0 -63
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/README.md +0 -65
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/index.tsx +0 -180
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/model.ts +0 -50
- package/template/develop/neo-custom-cmp-template/src/components/contactCardList/style.scss +0 -260
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/README.md +0 -94
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/index.tsx +0 -252
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/model.ts +0 -56
- package/template/develop/neo-custom-cmp-template/src/components/contactForm/style.scss +0 -120
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/README.md +0 -115
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/index.tsx +0 -304
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/model.ts +0 -87
- package/template/develop/neo-custom-cmp-template/src/components/neoEntityGrid/style.scss +0 -127
- package/template/develop/neo-custom-cmp-template/src/utils/axiosFetcher.ts +0 -29
- package/template/develop/neo-custom-cmp-template/src/utils/queryObjectData.ts +0 -39
- package/template/develop/neo-custom-cmp-template/tsconfig.json +0 -68
- package/template/develop/neo-ui-component-h5.md +0 -105
- package/template/develop/neo-ui-component-web-xregister.md +0 -31
- package/template/develop/neo-ui-component-web.md +0 -292
- package/template/develop/neoCmps.ts +0 -7508
- package/template/develop/neoGlobalSearchInput /347/273/204/344/273/266/347/232/204/350/257/246/347/273/206/345/210/206/346/236/220/346/226/207/346/241/243.md" +0 -497
- package/template/develop/pageSchema1.json +0 -744
- package/template/develop//344/272/213/344/273/266/345/212/250/344/275/234/344/277/235/345/255/230/346/265/201/347/250/213/345/210/206/346/236/220.md +0 -390
- package/template/develop//345/215/225/345/205/203/346/265/213/350/257/225/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -1139
- 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 +0 -558
- package/template/neo-bi-cmps/neo.config.js +0 -124
- package/template/neo-bi-cmps/src/components/targetNumber__c/README.md +0 -100
- package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/configSchema.ts +0 -253
- package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.scss +0 -76
- package/template/neo-bi-cmps/src/components/targetNumber__c/customStyleConfig/index.tsx +0 -148
- package/template/neo-bi-cmps/src/components/targetNumber__c/index.tsx +0 -440
- package/template/neo-bi-cmps/src/components/targetNumber__c/model.ts +0 -128
- package/template/neo-bi-cmps/src/components/targetNumber__c/style.scss +0 -173
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/.prettierrc.js +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/@types/neo-ui-common.d.ts +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/commitlint.config.js +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/css/base.css +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/scripts/app/bluebird.js +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/public/template.html +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/common.scss +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/css/mixin.scss +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/AIBtn.gif +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/NeoCRM.jpg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/aiLogo.png +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/card-list.svg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/contact-form.svg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/custom-form.svg +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/custom-widget.svg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/data-list.svg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/detail.svg +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/favicon.png +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/map.svg +0 -0
- /package/template/{neo-bi-cmps → asset-manage-template}/src/assets/img/search.svg +0 -0
- /package/template/{develop/neo-custom-cmp-template → asset-manage-template}/src/assets/img/table.svg +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/.prettierrc.js +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/README.md +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/commitlint.config.js +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/public/css/base.css +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/public/scripts/app/bluebird.js +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/public/template.html +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/css/common.scss +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/css/mixin.scss +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/NeoCRM.jpg +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/custom-widget.svg +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/favicon.png +0 -0
- /package/template/{neo-bi-cmps → neo-web-cmps}/src/assets/img/table.svg +0 -0
|
@@ -44,15 +44,10 @@ module.exports = {
|
|
|
44
44
|
ignoreNodeModules: false
|
|
45
45
|
},
|
|
46
46
|
linkDebug: {},
|
|
47
|
-
|
|
47
|
+
neoConfig: {
|
|
48
48
|
neoBaseURL: "https://crm-test.xiaoshouyi.com",
|
|
49
49
|
loginURL: "https://login-test.xiaoshouyi.com/auc/oauth2/auth",
|
|
50
50
|
tokenURL: "https://login-test.xiaoshouyi.com/auc/oauth2/token"
|
|
51
51
|
},
|
|
52
|
-
neoConfig: {
|
|
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"
|
|
56
|
-
},
|
|
57
52
|
pushCmp: {}
|
|
58
53
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neo-h5-cmps",
|
|
3
3
|
"version": "1.1.0",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Neo Web 核心业务组件使用示例(react&ts技术栈)",
|
|
5
5
|
"framework": "react-ts",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react&ts技术栈",
|
|
8
|
-
"
|
|
8
|
+
"neoh5 核心业务组件"
|
|
9
9
|
],
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"axios": "^1.7.0",
|
|
40
40
|
"antd-mobile": "^2.3.3",
|
|
41
41
|
"lodash": "^4.17.23",
|
|
42
|
-
"neo-open-api": "^1.2.
|
|
42
|
+
"neo-open-api": "^1.2.3",
|
|
43
43
|
"@wibetter/json-editor": "^6.0.5",
|
|
44
44
|
"tslib": "2.3.0"
|
|
45
45
|
},
|
|
@@ -50,11 +50,14 @@
|
|
|
50
50
|
"@types/react": "^16.9.11",
|
|
51
51
|
"@types/react-dom": "^16.9.15",
|
|
52
52
|
"@types/axios": "^0.14.0",
|
|
53
|
-
"neo-cmp-cli": "^1.12.
|
|
53
|
+
"neo-cmp-cli": "^1.12.10",
|
|
54
54
|
"husky": "^4.2.5",
|
|
55
55
|
"lint-staged": "^10.2.9",
|
|
56
56
|
"prettier": "^2.0.5"
|
|
57
57
|
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"typescript": "<6"
|
|
60
|
+
},
|
|
58
61
|
"engines": {
|
|
59
62
|
"node": ">= 16.0.0",
|
|
60
63
|
"npm": ">= 8.0.0"
|
|
@@ -4,6 +4,23 @@ import axiosFetcher from '$utils/axiosFetcher';
|
|
|
4
4
|
* 这里存放通用查询类 Open API
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/** 将 where 规范为 SQL 片段:字符串直接使用;数组用 and 拼接各条件 */
|
|
8
|
+
function normalizeWhere(where: unknown): string {
|
|
9
|
+
if (where == null || where === '') {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
if (typeof where === 'string') {
|
|
13
|
+
return where.trim();
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(where)) {
|
|
16
|
+
return where
|
|
17
|
+
.map((part) => (part == null ? '' : String(part).trim()))
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
.join(' and ');
|
|
20
|
+
}
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
|
|
7
24
|
// 获取业务对象数据列表
|
|
8
25
|
export const queryXObjectData = async (options?: any) => {
|
|
9
26
|
const apiUrl = '/rest/data/v2/query';
|
|
@@ -29,6 +46,25 @@ export const queryXObjectData = async (options?: any) => {
|
|
|
29
46
|
querySql += ` order by ${curOptions.orderBy}`;
|
|
30
47
|
}
|
|
31
48
|
|
|
49
|
+
/**
|
|
50
|
+
* 添加过滤条件(如果有的话)
|
|
51
|
+
* 支持的操作符包括:=、!=、like、not like、not in、is not null、is null、>、<、<>、>=、<=、in、between ... and ...。
|
|
52
|
+
* 对于 =、like 和 in 有以下说明:
|
|
53
|
+
* “=” 作为字符串的条件时,表示精确匹配。例如,查询条件 city = '北京',将返回 city 字段值严格等于 "北京" 的所有记录。
|
|
54
|
+
* "like" 作为字符串的条件时,需要使用"%" 通配符进行模糊匹配。例如,city like‘北京%',将返回 city 字段值以 "北京" 开头的所有记录。
|
|
55
|
+
* 目前仅支持将通配符“%” 放到已知内容之后的查询方式,例如,不支持 city like ‘% 北京'的查询方式。
|
|
56
|
+
* 当 SQL 查询中包含“%”等特殊字符时,需要对 SQL 进行 URL 编码处理。
|
|
57
|
+
* 支持"in",但不包括子查询。
|
|
58
|
+
* 支持的逻辑运算符包括:and、or。
|
|
59
|
+
*
|
|
60
|
+
* `where` 可为字符串,或字符串数组(多项默认以 and 连接,等价于手写 `a and b`)。
|
|
61
|
+
*/
|
|
62
|
+
const whereClause = normalizeWhere(curOptions.where);
|
|
63
|
+
console.log('whereClause:', whereClause);
|
|
64
|
+
if (whereClause) {
|
|
65
|
+
querySql += ` where ${whereClause}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
if (curOptions.page || curOptions.pageSize) {
|
|
33
69
|
// 添加分页限制
|
|
34
70
|
querySql += ` limit ${pageSize} offset ${offset}`;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"target": "esnext",
|
|
5
5
|
"module": "esnext",
|
|
6
6
|
"allowJs": false,
|
|
7
|
-
"jsx": "react",
|
|
7
|
+
"jsx": "react", // preserve
|
|
8
8
|
"declaration": false,
|
|
9
9
|
"noEmit": false,
|
|
10
10
|
"importHelpers": true,
|
|
@@ -31,10 +31,9 @@
|
|
|
31
31
|
"forceConsistentCasingInFileNames": true
|
|
32
32
|
},
|
|
33
33
|
"include": [
|
|
34
|
-
"src"
|
|
35
|
-
"test"
|
|
34
|
+
"src"
|
|
36
35
|
],
|
|
37
36
|
"exclude": [
|
|
38
37
|
"node_modules"
|
|
39
38
|
]
|
|
40
|
-
}
|
|
39
|
+
}
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"axios": "^1.7.0",
|
|
40
40
|
"antd": "^4.9.4",
|
|
41
41
|
"lodash": "^4.17.23",
|
|
42
|
-
"neo-open-api": "^1.2.
|
|
42
|
+
"neo-open-api": "^1.2.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@commitlint/cli": "^18.0.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/react": "^16.9.11",
|
|
48
48
|
"@types/react-dom": "^16.9.15",
|
|
49
49
|
"@types/axios": "^0.14.0",
|
|
50
|
-
"neo-cmp-cli": "^1.12.
|
|
50
|
+
"neo-cmp-cli": "^1.12.10",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
@@ -4,6 +4,23 @@ import axiosFetcher from '$utils/axiosFetcher';
|
|
|
4
4
|
* 这里存放通用查询类 Open API
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/** 将 where 规范为 SQL 片段:字符串直接使用;数组用 and 拼接各条件 */
|
|
8
|
+
function normalizeWhere(where: unknown): string {
|
|
9
|
+
if (where == null || where === '') {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
if (typeof where === 'string') {
|
|
13
|
+
return where.trim();
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(where)) {
|
|
16
|
+
return where
|
|
17
|
+
.map((part) => (part == null ? '' : String(part).trim()))
|
|
18
|
+
.filter(Boolean)
|
|
19
|
+
.join(' and ');
|
|
20
|
+
}
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
|
|
7
24
|
// 获取业务对象数据列表
|
|
8
25
|
export const queryXObjectData = async (options?: any) => {
|
|
9
26
|
const apiUrl = '/rest/data/v2/query';
|
|
@@ -29,6 +46,25 @@ export const queryXObjectData = async (options?: any) => {
|
|
|
29
46
|
querySql += ` order by ${curOptions.orderBy}`;
|
|
30
47
|
}
|
|
31
48
|
|
|
49
|
+
/**
|
|
50
|
+
* 添加过滤条件(如果有的话)
|
|
51
|
+
* 支持的操作符包括:=、!=、like、not like、not in、is not null、is null、>、<、<>、>=、<=、in、between ... and ...。
|
|
52
|
+
* 对于 =、like 和 in 有以下说明:
|
|
53
|
+
* “=” 作为字符串的条件时,表示精确匹配。例如,查询条件 city = '北京',将返回 city 字段值严格等于 "北京" 的所有记录。
|
|
54
|
+
* "like" 作为字符串的条件时,需要使用"%" 通配符进行模糊匹配。例如,city like‘北京%',将返回 city 字段值以 "北京" 开头的所有记录。
|
|
55
|
+
* 目前仅支持将通配符“%” 放到已知内容之后的查询方式,例如,不支持 city like ‘% 北京'的查询方式。
|
|
56
|
+
* 当 SQL 查询中包含“%”等特殊字符时,需要对 SQL 进行 URL 编码处理。
|
|
57
|
+
* 支持"in",但不包括子查询。
|
|
58
|
+
* 支持的逻辑运算符包括:and、or。
|
|
59
|
+
*
|
|
60
|
+
* `where` 可为字符串,或字符串数组(多项默认以 and 连接,等价于手写 `a and b`)。
|
|
61
|
+
*/
|
|
62
|
+
const whereClause = normalizeWhere(curOptions.where);
|
|
63
|
+
console.log('whereClause:', whereClause);
|
|
64
|
+
if (whereClause) {
|
|
65
|
+
querySql += ` where ${whereClause}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
if (curOptions.page || curOptions.pageSize) {
|
|
33
69
|
// 添加分页限制
|
|
34
70
|
querySql += ` limit ${pageSize} offset ${offset}`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* BaseCmpProps 基础组件属性接口
|
|
5
|
+
*/
|
|
6
|
+
export interface BaseCmpProps {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* ScopedComponentType 作用域组件类型接口
|
|
12
|
+
*/
|
|
13
|
+
export interface ScopedComponentType {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* BaseCmp 基础组件类
|
|
19
|
+
* 继承自 React.PureComponent,提供基础组件功能
|
|
20
|
+
*/
|
|
21
|
+
export declare class BaseCmp<
|
|
22
|
+
T extends BaseCmpProps = BaseCmpProps,
|
|
23
|
+
S = any
|
|
24
|
+
> extends React.PureComponent<T, S> implements ScopedComponentType {
|
|
25
|
+
props: Readonly<T> & Readonly<{ children?: React.ReactNode }>;
|
|
26
|
+
state: Readonly<S>;
|
|
27
|
+
setState<K extends keyof S>(
|
|
28
|
+
state:
|
|
29
|
+
| ((prevState: Readonly<S>, props: Readonly<T>) => Pick<S, K> | S | null)
|
|
30
|
+
| (Pick<S, K> | S | null),
|
|
31
|
+
callback?: () => void
|
|
32
|
+
): void;
|
|
33
|
+
forceUpdate(callback?: () => void): void;
|
|
34
|
+
render(): React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
|
|
5
|
+
// 统一路径解析
|
|
6
|
+
function resolve(dir) {
|
|
7
|
+
return path.resolve(__dirname, dir);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// 包括生产和开发的环境配置信息
|
|
11
|
+
module.exports = {
|
|
12
|
+
settings: {
|
|
13
|
+
enableESLint: false,
|
|
14
|
+
enableESLintFix: false,
|
|
15
|
+
enableStyleLint: false,
|
|
16
|
+
enableStyleLintFix: false
|
|
17
|
+
},
|
|
18
|
+
webpack: {
|
|
19
|
+
target: [
|
|
20
|
+
"web",
|
|
21
|
+
"es5"
|
|
22
|
+
],
|
|
23
|
+
resolve: {
|
|
24
|
+
extensions: [
|
|
25
|
+
".js",
|
|
26
|
+
".jsx",
|
|
27
|
+
".ts",
|
|
28
|
+
".tsx",
|
|
29
|
+
".umd.js",
|
|
30
|
+
".min.js",
|
|
31
|
+
".json"
|
|
32
|
+
],
|
|
33
|
+
alias: {
|
|
34
|
+
"@": resolve("./src"),
|
|
35
|
+
$assets: resolve("./src/assets"),
|
|
36
|
+
$public: resolve("./public"),
|
|
37
|
+
$utils: resolve("./src/utils")
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
sassResources: [
|
|
41
|
+
resolve("./src/assets/css/common.scss"),
|
|
42
|
+
resolve("./src/assets/css/mixin.scss")
|
|
43
|
+
],
|
|
44
|
+
ignoreNodeModules: false
|
|
45
|
+
},
|
|
46
|
+
linkDebug: {},
|
|
47
|
+
neoConfig: {
|
|
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"
|
|
51
|
+
},
|
|
52
|
+
pushCmp: {}
|
|
53
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "neo-
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "
|
|
2
|
+
"name": "neo-web-cmps",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Neo Web 核心业务组件使用示例(react&ts技术栈)",
|
|
5
5
|
"framework": "react-ts",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react&ts技术栈",
|
|
8
|
-
"
|
|
8
|
+
"neoweb 核心业务组件"
|
|
9
9
|
],
|
|
10
10
|
"author": "wibetter",
|
|
11
11
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"format": "prettier --write \"src/**/**/*.{js,jsx,ts,tsx,vue,scss,json}\""
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"
|
|
22
|
+
"dist/*"
|
|
23
23
|
],
|
|
24
24
|
"husky": {
|
|
25
25
|
"hooks": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"axios": "^1.7.0",
|
|
40
40
|
"antd": "^4.9.4",
|
|
41
41
|
"lodash": "^4.17.23",
|
|
42
|
-
"neo-open-api": "^1.2.
|
|
42
|
+
"neo-open-api": "^1.2.3",
|
|
43
43
|
"@wibetter/json-editor": "^6.0.5",
|
|
44
44
|
"tslib": "2.3.0"
|
|
45
45
|
},
|
|
@@ -50,11 +50,14 @@
|
|
|
50
50
|
"@types/react": "^16.9.11",
|
|
51
51
|
"@types/react-dom": "^16.9.15",
|
|
52
52
|
"@types/axios": "^0.14.0",
|
|
53
|
-
"neo-cmp-cli": "^1.12.
|
|
53
|
+
"neo-cmp-cli": "^1.12.10",
|
|
54
54
|
"husky": "^4.2.5",
|
|
55
55
|
"lint-staged": "^10.2.9",
|
|
56
56
|
"prettier": "^2.0.5"
|
|
57
57
|
},
|
|
58
|
+
"overrides": {
|
|
59
|
+
"typescript": "<6"
|
|
60
|
+
},
|
|
58
61
|
"engines": {
|
|
59
62
|
"node": ">= 16.0.0",
|
|
60
63
|
"npm": ">= 8.0.0"
|
|
Binary file
|
|
Binary file
|
|
@@ -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="1758858496804" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4824" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M362.666667 448h-213.333334c-46.933333 0-85.333333-38.4-85.333333-85.333333v-213.333334c0-46.933333 38.4-85.333333 85.333333-85.333333h213.333334c46.933333 0 85.333333 38.4 85.333333 85.333333v213.333334c0 46.933333-38.4 85.333333-85.333333 85.333333z m-213.333334-298.666667v213.333334h213.333334v-213.333334h-213.333334zM917.333333 405.333333h-298.666666c-25.6 0-42.666667-17.066667-42.666667-42.666666s17.066667-42.666667 42.666667-42.666667h298.666666c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666666zM917.333333 192h-298.666666c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666666h298.666666c25.6 0 42.666667 17.066667 42.666667 42.666666s-17.066667 42.666667-42.666667 42.666667zM362.666667 960h-213.333334c-46.933333 0-85.333333-38.4-85.333333-85.333333v-213.333334c0-46.933333 38.4-85.333333 85.333333-85.333333h213.333334c46.933333 0 85.333333 38.4 85.333333 85.333333v213.333334c0 46.933333-38.4 85.333333-85.333333 85.333333z m-213.333334-298.666667v213.333334h213.333334v-213.333334h-213.333334zM917.333333 917.333333h-298.666666c-25.6 0-42.666667-17.066667-42.666667-42.666666s17.066667-42.666667 42.666667-42.666667h298.666666c25.6 0 42.666667 17.066667 42.666667 42.666667s-17.066667 42.666667-42.666667 42.666666zM917.333333 704h-298.666666c-25.6 0-42.666667-17.066667-42.666667-42.666667s17.066667-42.666667 42.666667-42.666666h298.666666c25.6 0 42.666667 17.066667 42.666667 42.666666s-17.066667 42.666667-42.666667 42.666667z" p-id="4825" 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="1758858859788" class="icon" viewBox="0 0 1600 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6860" xmlns:xlink="http://www.w3.org/1999/xlink" width="312.5" height="200"><path d="M983.3038 139.924829l-69.963665 0C913.340135 63.602422 849.737713 0 773.415306 0s-139.924829 63.602422-139.924829 139.924829l-63.602422 0 0 69.963665 413.415745 0L983.3038 139.924829 983.3038 139.924829 983.3038 139.924829zM703.452891 139.924829c0-38.161203 31.801211-69.962415 69.962415-69.962415 38.161203 0 69.962415 31.801211 69.962415 69.962415L703.452891 139.924829 703.452891 139.924829z" p-id="6861" fill="#0764f5"></path><path d="M1111.109894 253.80844l0 449.446951C1149.998596 706.249138 1167.498575 714.999127 1181.072308 735.056603l0-513.049374c0-44.522446-31.801211-82.683649-82.683649-82.683649l-57.24118 0 0 69.962415 31.801211 0C1092.028667 209.285995 1111.109894 228.367221 1111.109894 253.80844L1111.109894 253.80844z" p-id="6862" fill="#0764f5"></path><path d="M922.572624 896.793905l-454.449445 0c-25.439969 0-38.161203-19.081227-38.161203-38.161203L429.961975 248.049697c0-25.441219 19.081227-38.161203 38.161203-38.161203l31.801211 0L499.92439 139.924829l-57.24118 0c-44.522446 0-82.683649 38.162453-82.683649 82.683649l0 674.185427c0 44.521196 31.801211 82.683649 82.683649 82.683649l518.050618 0C931.248863 956.248833 922.572624 928.595116 922.572624 896.793905L922.572624 896.793905z" p-id="6863" fill="#0764f5"></path><path d="M1087.753672 724.081616c-80.334902 0-149.959817 64.267422-149.959817 149.958567 0 80.336152 64.268672 149.959817 149.959817 149.959817s149.958567-64.268672 149.958567-149.959817C1237.713489 788.349038 1173.444818 724.081616 1087.753672 724.081616L1087.753672 724.081616zM1109.176146 895.462657l0 85.691145-42.846198 0 0-85.691145-85.691145 0 0-42.844948 85.691145 0 0-85.691145 42.846198 0 0 85.691145 85.691145 0 0 42.844948L1109.176146 895.462657 1109.176146 895.462657z" p-id="6864" fill="#0764f5"></path><path d="M804.611518 653.237953c-10.739987-4.229995-19.073727-9.053739-25.027469-14.407482-5.979993-5.391243-10.394987-11.056237-13.276234-16.976229-2.882496-5.986243-4.511244-11.932485-4.887494-17.886228-0.4075-5.953743 0-11.811236 1.156249-17.573729 1.534998-9.617488 4.603744-16.41373 9.211239-20.451225 4.601244-4.041245 10.584987-8.927489 17.851228-14.689982 3.069996-2.694997 5.858743-6.453742 8.36624-11.213736 2.502497-4.824994 4.694994-9.709988 6.604992-14.722482 1.943748-5.763743 3.886245-11.902485 5.796243-18.417478 3.821245-1.157499 7.452491-3.256246 10.932487-6.358742 3.069996-2.661247 5.854993-6.421242 8.36499-11.243736 2.501247-4.762494 4.102495-11.214986 4.883744-19.296226 0.784999-6.139993 0.689999-11.307486-0.28-15.536231-0.974999-4.227495-2.224997-7.704991-3.761245-10.398737-1.533748-3.068746-3.633746-5.546243-6.326242-7.457491 0-15.754981-0.941249-31.323712-2.882496-46.669943-1.942498-13.467484-5.171244-27.563716-9.774988-42.348698-4.633744-14.784982-11.932485-28.346215-21.924973-40.62495-4.194995-5.387493-10.056238-10.743737-17.572479-16.13248-7.484991-5.387493-16.03748-10.212488-25.618719-14.408732-9.617488-4.258745-19.894976-7.578741-30.852462-10.084988-10.931237-2.504997-21.957473-3.761245-33.10871-3.761245-8.836239 0-17.982478 0.689999-27.377467 2.006248-9.394989 1.378748-18.823727 3.946245-28.218716 7.79874-9.431238 3.853745-18.639977 9.113739-27.662466 15.851231-9.018739 6.702492-17.193729 15.439981-24.49122 26.216218-8.08124 11.148736-14.096233 23.803721-18.168728 38.024954-4.008745 14.222483-6.797492 27.438717-8.33249 39.749951-1.938748 14.594982-2.692497 29.192464-2.317497 43.788697-3.443746 3.852495-5.951243 7.86124-7.484991 12.121235-1.534998 3.822495-2.601247 8.42499-3.162496 13.814983-0.564999 5.357493 0.2825 11.307486 2.598747 17.852478 1.909998 6.547492 4.226245 11.527486 6.923742 15.004982 2.693747 3.444996 5.163744 6.137493 7.451241 8.04874 2.696247 1.911248 5.387493 3.257496 8.08249 4.041245 1.942498 6.514992 3.851245 12.654985 5.762493 18.418728 1.946248 5.011244 4.042495 9.897488 6.327492 14.721232 2.317497 4.759994 5.012494 8.51999 8.08124 11.214986 6.516242 5.387493 12.464985 10.648737 17.852478 15.848731 5.387493 5.167494 8.45874 12.183735 9.208739 21.017474 0.40875 6.169992 0.597499 11.714986 0.597499 16.69498 0 5.013744-0.972499 9.806238-2.882496 14.437482-1.908748 4.604994-4.978744 9.208739-9.242489 13.812483-4.194995 4.603744-10.334987 9.428738-18.417478 14.412482-10.366237 6.513742-22.294973 11.527486-35.707456 14.971232-13.464984 3.473746-26.436218 7.426241-38.902453 11.806236-12.497485 4.418745-23.428721 10.402487-32.82246 17.856228-9.429988 7.514991-15.098732 18.354978-17.043729 32.57746-3.822495 24.95997-4.697494 45.322445-2.567497 61.076175 2.099997 15.723731 5.073744 25.149969 8.927489 28.222466 2.287497 1.942498 7.86124 3.852495 16.69498 5.763743 8.832489 1.938748 19.608726 3.852495 32.261211 5.762493 12.714984 1.908748 26.814967 3.728745 42.349948 5.484993 15.567481 1.718748 31.228712 3.253746 46.982443 4.602494 15.723731 1.317498 31.012462 2.412497 45.796194 3.163746 14.784982 0.782499 27.751216 1.157499 38.903703 1.157499 11.152486 0 24.30122-0.37625 39.462452-1.157499 15.159981-0.752499 31.012462-1.847498 47.552442-3.163746 16.50623-1.347498 32.92121-2.977496 49.23494-4.919994 9.192489-1.074999 17.882478-2.244997 26.101218-3.503746 0 0-5.852493-162.766051-8.812489-163.56605C824.688993 660.534194 814.227756 657.057948 804.611518 653.237953L804.611518 653.237953z" p-id="6865" fill="#0764f5"></path><path d="M891.166412 413.571995l121.812351 0c13.216234 0 23.927471-10.712487 23.927471-23.926221 0-13.213734-10.711237-23.926221-23.927471-23.926221l-121.812351 0c-13.213734 0-23.926221 10.712487-23.926221 23.926221C867.238941 402.858258 877.952678 413.571995 891.166412 413.571995L891.166412 413.571995z" p-id="6866" fill="#0764f5"></path><path d="M1012.980013 490.449401l-121.812351 0c-13.213734 0-23.926221 10.711237-23.926221 23.924971 0 13.214984 10.712487 23.927471 23.926221 23.927471l121.812351 0c13.214984 0 23.926221-10.712487 23.926221-23.927471C1036.906234 501.160638 1026.194997 490.449401 1012.980013 490.449401L1012.980013 490.449401z" p-id="6867" fill="#0764f5"></path><path d="M1012.980013 608.928007l-121.812351 0c-13.213734 0-23.926221 10.711237-23.926221 23.924971 0 13.214984 10.712487 23.926221 23.926221 23.926221l121.812351 0c13.214984 0 23.926221-10.711237 23.926221-23.926221C1036.906234 619.639244 1026.194997 608.928007 1012.980013 608.928007L1012.980013 608.928007z" p-id="6868" fill="#0764f5"></path><path d="M836.027729 663.60794c0 0 31.213712 2.016248 53.971184 27.641216 0 0 13.437484 11.874986 16.981229 43.749947l0 56.249931c0 0-4.706244 29.087464-62.139924 35.924956L833.748982 702.499142 836.027729 663.60794z" p-id="6869" 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="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>
|
|
@@ -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="1759211982910" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2424" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1024 1024H0V0h768v20.608l19.84-19.904 235.52 235.392-19.84 19.904H1024v768zM768 147.2V256h108.8zM896 384h-256V128H128v768h768V384z m-128 192H256V448h512v128z m0 192H256v-128h512v128z" fill="#0764f5" p-id="2425"></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="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>
|
|
@@ -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="1768806232857" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2470" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M469.333333 768c-166.4 0-298.666667-132.266667-298.666666-298.666667s132.266667-298.666667 298.666666-298.666666 298.666667 132.266667 298.666667 298.666666-132.266667 298.666667-298.666667 298.666667z m0-85.333333c119.466667 0 213.333333-93.866667 213.333334-213.333334s-93.866667-213.333333-213.333334-213.333333-213.333333 93.866667-213.333333 213.333333 93.866667 213.333333 213.333333 213.333334z m251.733334 0l119.466666 119.466666-59.733333 59.733334-119.466667-119.466667 59.733334-59.733333z" fill="#0764f5" p-id="2471"></path></svg>
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { className, objectApiKey, pattern, hiddenHeader, showView, enableChangeView, defaultViewId, disableSearch, canCreate, canImport, editable, withOrder, withCheck, enableToolbar, disableExport, disablePagination, paginationPageSize, autoHeight, height, additionalConditions, onRecordChange, ...restProps } = this.props;
|
|
21
|
+
console.log('entityGrid__c: ', this.props, this);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={`entityGrid__c ${className}`}>
|
|
25
|
+
<NeoEntityGrid
|
|
26
|
+
render={this.props.render}
|
|
27
|
+
objectApiKey={objectApiKey || 'account'}
|
|
28
|
+
pattern={pattern || 'entityView'}
|
|
29
|
+
// defaultViewId="default_view" // 默认展示的列表视图
|
|
30
|
+
hiddenHeader={hiddenHeader ?? false}
|
|
31
|
+
showView={showView ?? true}
|
|
32
|
+
enableChangeView={enableChangeView ?? true}
|
|
33
|
+
defaultViewId={defaultViewId ?? 'default_view'}
|
|
34
|
+
disableSearch={disableSearch ?? false}
|
|
35
|
+
canCreate={canCreate ?? true}
|
|
36
|
+
canImport={canImport ?? true}
|
|
37
|
+
editable={editable ?? true}
|
|
38
|
+
withOrder={withOrder ?? true}
|
|
39
|
+
withCheck={withCheck ?? true}
|
|
40
|
+
enableToolbar={enableToolbar ?? true}
|
|
41
|
+
disableExport={disableExport ?? false}
|
|
42
|
+
disablePagination={disablePagination ?? false}
|
|
43
|
+
paginationPageSize={paginationPageSize ?? 20}
|
|
44
|
+
autoHeight={autoHeight ?? false}
|
|
45
|
+
height={height ?? '500px'}
|
|
46
|
+
additionalConditions={[]}
|
|
47
|
+
customToolbarButtons={{
|
|
48
|
+
header: [
|
|
49
|
+
{
|
|
50
|
+
id: 'approve-btn',
|
|
51
|
+
label: '批量审批',
|
|
52
|
+
icon: 'CheckOne',
|
|
53
|
+
tooltip: '对选中记录批量审批',
|
|
54
|
+
onClick: () => {
|
|
55
|
+
console.log('批量审批');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
footer: [
|
|
60
|
+
{
|
|
61
|
+
id: 'export-pdf-btn',
|
|
62
|
+
label: '导出 PDF',
|
|
63
|
+
icon: 'FilePdf',
|
|
64
|
+
onClick: () => console.log('导出 PDF')
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file 自定义组件对接编辑器的描述文件
|
|
3
|
+
*/
|
|
4
|
+
export class NeoEntityGridModel {
|
|
5
|
+
/**
|
|
6
|
+
* cmpType 为自定义组件名称,用于标识组件的唯一性
|
|
7
|
+
* 在构建时根据当前组件目录名称自动生成
|
|
8
|
+
*/
|
|
9
|
+
// cmpType: string = 'entityList__c';
|
|
10
|
+
|
|
11
|
+
// 组件名称,用于设置在编辑器左侧组件面板中展示的名称
|
|
12
|
+
label: string = '数据列表示例2';
|
|
13
|
+
|
|
14
|
+
// 组件描述,用于设置在编辑器左侧组件面板中展示的描述
|
|
15
|
+
description: string = '数据列表示例2';
|
|
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
|
+
pattern: 'entityView',
|
|
48
|
+
hiddenHeader: false,
|
|
49
|
+
showView: true,
|
|
50
|
+
enableChangeView: true,
|
|
51
|
+
enableToolbar: true,
|
|
52
|
+
canCreate: true,
|
|
53
|
+
canImport: true,
|
|
54
|
+
withOrder: true,
|
|
55
|
+
withCheck: true,
|
|
56
|
+
editable: true,
|
|
57
|
+
disableSearch: false,
|
|
58
|
+
disableExport: false,
|
|
59
|
+
disablePagination: false,
|
|
60
|
+
paginationPageSize: 20,
|
|
61
|
+
autoHeight: false,
|
|
62
|
+
height: '500px',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 组件面板配置,用于生成编辑器右侧属性配置面板内容
|
|
67
|
+
*/
|
|
68
|
+
propsSchema = [
|
|
69
|
+
{
|
|
70
|
+
type: 'xObjectEntityList',
|
|
71
|
+
name: 'objectApiKey',
|
|
72
|
+
label: '实体对象',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: 'dataViewIdSelect',
|
|
76
|
+
name: 'defaultViewId',
|
|
77
|
+
xObjectApiKey: 'objectApiKey',
|
|
78
|
+
label: '列表视图',
|
|
79
|
+
},
|
|
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
|
+
{
|
|
95
|
+
type: 'panelSwitch',
|
|
96
|
+
name: 'hiddenHeader',
|
|
97
|
+
label: '隐藏头部',
|
|
98
|
+
defaultChecked: false,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'panelSwitch',
|
|
102
|
+
name: 'disableSearch',
|
|
103
|
+
label: '禁用搜索',
|
|
104
|
+
defaultChecked: false,
|
|
105
|
+
hiddenOn: 'hiddenHeader',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'panelSwitch',
|
|
109
|
+
name: 'showView',
|
|
110
|
+
label: '显示列表视图控制栏',
|
|
111
|
+
defaultChecked: true,
|
|
112
|
+
hiddenOn: 'hiddenHeader',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: 'panelSwitch',
|
|
116
|
+
name: 'enableChangeView',
|
|
117
|
+
label: '支持列表视图切换',
|
|
118
|
+
defaultChecked: true,
|
|
119
|
+
hiddenOn: 'hiddenHeader',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'panelSwitch',
|
|
123
|
+
name: 'enableToolbar',
|
|
124
|
+
label: '显示工具栏(含刷新、导出等)',
|
|
125
|
+
defaultChecked: true,
|
|
126
|
+
hiddenOn: 'hiddenHeader',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'panelSwitch',
|
|
130
|
+
name: 'canCreate',
|
|
131
|
+
label: '支持新建',
|
|
132
|
+
defaultChecked: true,
|
|
133
|
+
hiddenOn: 'hiddenHeader',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'panelSwitch',
|
|
137
|
+
name: 'canImport',
|
|
138
|
+
label: '支持导入',
|
|
139
|
+
defaultChecked: false,
|
|
140
|
+
hiddenOn: 'hiddenHeader',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: 'panelSwitch',
|
|
144
|
+
name: 'disableExport',
|
|
145
|
+
label: '禁用导出',
|
|
146
|
+
defaultChecked: false,
|
|
147
|
+
hiddenOn: 'hiddenHeader',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'panelSwitch',
|
|
151
|
+
name: 'withOrder',
|
|
152
|
+
label: '显示序号列',
|
|
153
|
+
defaultChecked: true,
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'panelSwitch',
|
|
157
|
+
name: 'withCheck',
|
|
158
|
+
label: '显示多选列',
|
|
159
|
+
defaultChecked: true,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
type: 'panelSwitch',
|
|
163
|
+
name: 'editable',
|
|
164
|
+
label: '支持单元格编辑',
|
|
165
|
+
defaultChecked: true,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
type: 'panelSwitch',
|
|
169
|
+
name: 'disablePagination',
|
|
170
|
+
label: '是否禁用分页',
|
|
171
|
+
defaultChecked: false,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'panelNumber',
|
|
175
|
+
name: 'paginationPageSize',
|
|
176
|
+
label: '每页展示条数',
|
|
177
|
+
visibleOn: '!disablePagination',
|
|
178
|
+
value: 20,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'panelSwitch',
|
|
182
|
+
name: 'autoHeight',
|
|
183
|
+
label: '高度自适应(根据父容器高度自动适配)',
|
|
184
|
+
defaultChecked: false,
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: 'panelInput',
|
|
188
|
+
name: 'height',
|
|
189
|
+
label: '高度',
|
|
190
|
+
visibleOn: '!autoHeight',
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export default NeoEntityGridModel;
|