neo-cmp-cli 1.13.8 → 1.13.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/dist/neo/neoLogin.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -1
- package/template/antd-custom-cmp-template/package.json +4 -1
- package/template/asset-manage-template/package.json +4 -8
- package/template/echarts-custom-cmp-template/package.json +4 -1
- package/template/empty-custom-cmp-template/package.json +4 -1
- package/template/map-custom-cmp-template/package.json +4 -1
- package/template/neo-bi-cmps/package.json +3 -0
- package/template/neo-custom-cmp-template/package.json +1 -1
- package/template/neo-h5-cmps/package.json +1 -1
- package/template/neo-order-cmps/package.json +4 -1
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +9 -4
- package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +4 -2
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/model.ts +2 -2
- package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +6 -10
- package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +1 -1
- package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +205 -229
- package/template/neo-web-form/.prettierrc.js +12 -0
- package/template/neo-web-form/@types/neo-ui-common.d.ts +36 -0
- package/template/neo-web-form/README.md +99 -0
- package/template/neo-web-form/commitlint.config.js +59 -0
- package/template/neo-web-form/neo.config.js +57 -0
- package/template/neo-web-form/package.json +66 -0
- package/template/neo-web-form/public/css/base.css +283 -0
- package/template/neo-web-form/public/scripts/app/bluebird.js +6679 -0
- package/template/neo-web-form/public/template.html +13 -0
- package/template/neo-web-form/src/assets/css/common.scss +127 -0
- package/template/neo-web-form/src/assets/css/mixin.scss +47 -0
- package/template/neo-web-form/src/assets/img/AIBtn.gif +0 -0
- package/template/neo-web-form/src/assets/img/NeoCRM.jpg +0 -0
- package/template/neo-web-form/src/assets/img/aiLogo.png +0 -0
- package/template/neo-web-form/src/assets/img/card-list.svg +1 -0
- package/template/neo-web-form/src/assets/img/contact-form.svg +1 -0
- package/template/neo-web-form/src/assets/img/custom-form.svg +1 -0
- package/template/neo-web-form/src/assets/img/custom-widget.svg +1 -0
- package/template/neo-web-form/src/assets/img/data-list.svg +1 -0
- package/template/neo-web-form/src/assets/img/detail.svg +1 -0
- package/template/neo-web-form/src/assets/img/favicon.png +0 -0
- package/template/neo-web-form/src/assets/img/map.svg +1 -0
- package/template/neo-web-form/src/assets/img/search.svg +1 -0
- package/template/neo-web-form/src/assets/img/table.svg +1 -0
- package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +1052 -0
- package/template/neo-web-form/src/components/batchAddTable__c/model.ts +90 -0
- package/template/neo-web-form/src/components/batchAddTable__c/style.scss +21 -0
- package/template/neo-web-form/src/components/batchAddTable__c/tableModal.scss +137 -0
- package/template/neo-web-form/src/components/listSummary__c/index.tsx +120 -0
- package/template/neo-web-form/src/components/listSummary__c/model.ts +69 -0
- package/template/neo-web-form/src/components/listSummary__c/style.scss +40 -0
- package/template/neo-web-form/src/utils/axiosFetcher.ts +37 -0
- package/template/neo-web-form/src/utils/queryObjectData.ts +112 -0
- package/template/neo-web-form/src/utils/xobjects.ts +167 -0
- package/template/neo-web-form/tsconfig.json +39 -0
- package/template/react-custom-cmp-template/package.json +1 -1
- package/template/react-ts-custom-cmp-template/package.json +4 -1
- package/template/vue2-custom-cmp-template/package.json +1 -1
package/dist/neo/neoLogin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("node:fs"),n=require("node:path"),s=require("ora"),r=require("node:http"),o=require("node:url"),i=require("open"),a=require("node:net"),c=require("lodash"),l=require("../utils/common.js"),h=require("./neoEnvManager.js");var p,u;exports.__require=function(){if(u)return p;u=1;const d=e,g=t,m=n,y=s,k=r,_=o,f=i,T=a,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("axios"),t=require("node:fs"),n=require("node:path"),s=require("ora"),r=require("node:http"),o=require("node:url"),i=require("open"),a=require("node:net"),c=require("lodash"),l=require("../utils/common.js"),h=require("./neoEnvManager.js");var p,u;exports.__require=function(){if(u)return p;u=1;const d=e,g=t,m=n,y=s,k=r,_=o,f=i,T=a,U=c,{errorLog:w,successLog:R}=l.__require(),$=h.__require();return p=class{constructor(e){if(this.tokenDir=m.join(process.cwd(),".neo-cli"),this.tokenFile=m.join(this.tokenDir,"token.json"),this.pageDir=m.join(__dirname,"../../template/pageHtml"),this.authErrorTemplate=m.join(this.pageDir,"auth-error.html"),this.authSuccessTemplate=m.join(this.pageDir,"auth-success.html"),this.tokenErrorTemplate=m.join(this.pageDir,"token-error.html"),this.authFailedTemplate=m.join(this.pageDir,"auth-failed.html"),!e)return;const{neoBaseURL:t,loginURL:n,tokenURL:s}=e,r=$.getAuthConfig(),{redirectUri:o,authType:i,auth:a}=r;if(!n||!s)throw new Error("neo.config.js 配置不完整,需要包含 loginURL、tokenURL");this.neoBaseURL=t,this.loginURL=n,this.tokenURL=s,this.NeoCrmAPI=r,this.redirectUri=o,this.authType=i||"oauth2",this.response_type=a.response_type||"code",this.client_id=a.client_id,this.client_secret=a.client_secret,this.scope=a.scope||"all",this.oauthType=a.oauthType||"standard",this.access_type=a.access_type||"offline",this.grant_type=a.grant_type||"authorization_code";try{$.setEnvConfig(U.pick(e,["neoBaseURL","loginURL","tokenURL"]))}catch(e){w(`保存环境配置失败: ${e.message||e.msg}`)}}ensureTokenDir(){g.existsSync(this.tokenDir)||g.mkdirSync(this.tokenDir,{recursive:!0})}saveToken(e){this.ensureTokenDir();const t={...e,savedAt:Date.now(),expiresAt:Date.now()+1e3*(e.expires_in||7200)};g.writeFileSync(this.tokenFile,JSON.stringify(t,null,2),"utf-8")}readToken(){if(!g.existsSync(this.tokenFile))return null;try{return JSON.parse(g.readFileSync(this.tokenFile,"utf-8"))}catch(e){return w(`读取 token 文件失败: ${e.message||e.msg}`),null}}isTokenExpired(e){return!e||!e.expiresAt||Date.now()>=e.expiresAt-3e5}clearToken(){g.existsSync(this.tokenFile)&&g.unlinkSync(this.tokenFile)}getRedirectURI(e){return`http://localhost:${e}`}buildAuthUrl(e){const t=new URLSearchParams({response_type:this.response_type,client_id:this.client_id,redirect_uri:e,scope:this.scope,oauthType:this.oauthType,access_type:this.access_type});return`${this.loginURL}?${t.toString()}`}async openBrowser(e){try{await f(e)}catch(t){w(`无法自动打开浏览器: ${t.message||t.msg}`),console.log(`\n请手动访问以下 URL 进行授权:\n${e}\n`)}}getHtmlTemplate(e,t={}){try{let n=g.readFileSync(e,"utf-8");return Object.keys(t).forEach(e=>{const s=`{{${e}}}`;n=n.replace(new RegExp(s,"g"),t[e])}),n}catch(e){return w(`读取 HTML 模板失败: ${e.message||e.msg}`),"<html><body><h1>页面加载失败</h1></body></html>"}}async isPortInUse(e){return new Promise(t=>{const n=T.createServer();n.once("error",e=>{"EADDRINUSE"===e.code?t(!0):t(!1)}),n.once("listening",()=>{n.once("close",()=>{t(!1)}),n.close()}),n.listen(e)})}async startCallbackServer(){let e=this.redirectUri,t=new URL(e),n=parseInt(t.port,10);await this.isPortInUse(n)&&(w(`\n警告: 端口 ${n} 已被占用,请调整 redirectUri 配置项,使其指向一个未被占用的端口。`),process.exit(1));const s=new Promise((s,r)=>{const o=k.createServer(async(n,i)=>{const a=_.parse(n.url,!0);if(a.pathname===t.pathname||"/"===a.pathname){const t=a.query.code,n=a.query.error;if(n){i.writeHead(400,{"Content-Type":"text/html; charset=utf-8"});const e=this.getHtmlTemplate(this.authErrorTemplate,{ERROR:n});return i.end(e),o.close(),void r(new Error(`授权失败: ${n}`))}if(t)try{const n=await this.getTokenByCode(t,e);this.saveToken(n);const r=n.userInfo.tenantName?`${n.userInfo.tenantName}(${n.tenant_id})`:n.tenant_id||"未返回",a=n.instance_uri||"未返回";i.writeHead(200,{"Content-Type":"text/html; charset=utf-8"});const c=this.getHtmlTemplate(this.authSuccessTemplate,{TENANT_ID:r,INSTANCE_URI:a});return i.end(c),o.close(),void s({code:t,tokenData:n})}catch(e){i.writeHead(500,{"Content-Type":"text/html; charset=utf-8"});const t=this.getHtmlTemplate(this.tokenErrorTemplate,{ERROR:e});return i.end(t),o.close(),void r(e)}i.writeHead(400,{"Content-Type":"text/html; charset=utf-8"});const c=this.getHtmlTemplate(this.authFailedTemplate);i.end(c),o.close(),r(new Error("未获取到授权码"))}else i.writeHead(404,{"Content-Type":"text/plain"}),i.end("Not Found")});o.on("error",e=>{"EADDRINUSE"===e.code?r(new Error(`端口 ${n} 已被占用,无法启动回调服务器`)):r(e)}),o.listen(n,()=>{console.log(`\n本地回调服务器已启动,监听端口: ${n}`),console.log(`回调地址: ${e}`)}),setTimeout(()=>{o.close(),r(new Error("授权超时,请重试"))},3e5)});return{redirectUri:e,getCodeAndTokenPromise:s}}async getTokenByCode(e,t){const n=y("正在获取 access token...").start();try{const s=new URLSearchParams;s.append("grant_type",this.grant_type),s.append("client_id",this.client_id),s.append("client_secret",this.client_secret),s.append("code",e),s.append("redirect_uri",t);const r=(await d.post(this.tokenURL,s.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;if(r&&r.access_token){r&&r.instance_uri&&r.instance_uri!==this.neoBaseURL&&(this.neoBaseURL=r.instance_uri,$.setEnvConfig({neoBaseURL:r.instance_uri}));const e=await this.getUserInfo(r.access_token);e&&e.tenantName&&e.name?r.userInfo=e:w("获取用户信息失败:",e)}else w("获取 token 失败:响应中未包含 access_token",n),w(`响应数据: ${JSON.stringify(r)}`),process.exit(1);return R("成功获取 access token",n),r}catch(e){w("获取 token 失败",n),w(`\n获取 token 失败: ${e.message||e.msg}`),e.response&&w(`响应数据: ${JSON.stringify(e.response.data)}`),process.exit(1)}}async refreshToken(e){const t=y("正在刷新授权信息(token)...").start();try{const n=new URLSearchParams;n.append("grant_type","refresh_token"),n.append("client_id",this.client_id),n.append("client_secret",this.client_secret),n.append("refresh_token",e);const s=(await d.post(this.tokenURL,n.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data;if(!s||!s.access_token)return w("刷新授权信息失败:响应中未包含 access_token",t),w(`响应数据: ${JSON.stringify(s)}`),null;{const e=await this.getUserInfo(s.access_token);s.userInfo=e}return R("刷新授权信息成功(token)。",t),s}catch(e){return w("刷新授权信息失败",t),w(`\n刷新授权信息失败: ${e.message||e.msg}`),e.response&&w(`响应数据: ${JSON.stringify(e.response.data)}`),null}}async getUserInfo(e){let t={};try{let n=this.buildFullUrl(this.NeoCrmAPI.getUserInfoAPI);const s=await d.get(n,{headers:{Authorization:`Bearer ${e}`,"xsy-inner-source":"bff","Content-Type":"application/json"}}),{code:r,message:o,msg:i}=s.data||{};console.log("getUserInfo response:",s),r&&"200"!==r&&(w(`获取用户信息失败: ${o||i||"未知错误"}`),process.exit(1)),t=s.data.result||s.data.data||{}}catch(e){const t=e.message||e.msg;w(t?`获取用户信息失败: ${t}`:`响应数据: ${JSON.stringify(e)}`),process.exit(1)}return t}async login(){console.log("\n========== NeoCRM 登录授权 ==========\n");try{const{redirectUri:e,getCodeAndTokenPromise:t}=await this.startCallbackServer(),n=this.buildAuthUrl(e);console.log("授权 URL:",n),console.log("\n正在打开浏览器进行授权..."),await this.openBrowser(n);const{code:s,tokenData:r}=await t;return R("\n✓ 已获取授权码"),console.log("\n========== 登录成功 ==========\n"),console.log(`实例地址: ${r.instance_uri||"未返回"}`),console.log(`当前租户信息: ${r.userInfo.tenantName||"未返回租户名称"}(${r.tenant_id||"未返回租户 ID"})`),console.log(`当前登录用户: ${r.userInfo.name||"未返回用户名"}`),r}catch(e){w(`\n登录失败: ${e.message||e.msg}`),process.exit(1)}}async logout(){if(console.log("\n========== NeoCRM 登出 ==========\n"),g.existsSync(this.tokenFile))try{$.clearEnvConfig(),this.clearToken(),R("已清除授权信息,下次登录需要重新授权。"),console.log("\n登出成功!\n")}catch(e){w(`登出失败: ${e.message||e.msg}`),process.exit(1)}else console.log("当前未登录,无需登出。")}async getValidToken(){const e=this.readToken();if(e||(w("未找到授权信息,请先执行 neo login 进行登录。"),process.exit(1)),this.isTokenExpired(e)){console.log("授权信息已过期,正在尝试刷新..."),e.refresh_token||(w("自动刷新授权信息失败,请重新登录(neo login)。"),process.exit(1));const t=await this.refreshToken(e.refresh_token);return t||(w("刷新授权信息失败,请重新登录 (neo login)"),process.exit(1)),this.saveToken(t),t}return e}async getAccessToken(){return await this.getValidToken()}buildFullUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.neoBaseURL}${e}`}}};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.13.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e="1.13.9";const o={version:e};exports.default=o,exports.version=e;
|
package/package.json
CHANGED
|
@@ -48,11 +48,14 @@
|
|
|
48
48
|
"@commitlint/config-conventional": "^18.0.0",
|
|
49
49
|
"@types/react": "^16.9.11",
|
|
50
50
|
"@types/react-dom": "^16.9.15",
|
|
51
|
-
"neo-cmp-cli": "^1.13.
|
|
51
|
+
"neo-cmp-cli": "^1.13.9",
|
|
52
52
|
"husky": "^4.2.5",
|
|
53
53
|
"lint-staged": "^10.2.9",
|
|
54
54
|
"prettier": "^2.0.5"
|
|
55
55
|
},
|
|
56
|
+
"overrides": {
|
|
57
|
+
"typescript": "<6"
|
|
58
|
+
},
|
|
56
59
|
"engines": {
|
|
57
60
|
"node": ">= 16.0.0",
|
|
58
61
|
"npm": ">= 8.0.0"
|
|
@@ -52,22 +52,18 @@
|
|
|
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.13.
|
|
55
|
+
"neo-cmp-cli": "^1.13.9",
|
|
56
56
|
"husky": "^4.2.5",
|
|
57
57
|
"lint-staged": "^10.2.9",
|
|
58
58
|
"prettier": "^2.0.5",
|
|
59
59
|
"@babel/runtime": "^7.26.0",
|
|
60
60
|
"@types/echarts": "^4.9.0"
|
|
61
61
|
},
|
|
62
|
+
"overrides": {
|
|
63
|
+
"typescript": "<6"
|
|
64
|
+
},
|
|
62
65
|
"engines": {
|
|
63
66
|
"node": ">= 16.0.0",
|
|
64
67
|
"npm": ">= 8.0.0"
|
|
65
68
|
},
|
|
66
|
-
"repository": {
|
|
67
|
-
"type": "git",
|
|
68
|
-
"url": "https://git@github.com:xxx/CD-TEST.git"
|
|
69
|
-
},
|
|
70
|
-
"bugs": {
|
|
71
|
-
"url": "https://github.com/xxx/CD-TEST/issues"
|
|
72
|
-
}
|
|
73
69
|
}
|
|
@@ -48,12 +48,15 @@
|
|
|
48
48
|
"@commitlint/config-conventional": "^18.0.0",
|
|
49
49
|
"@types/react": "^16.9.11",
|
|
50
50
|
"@types/react-dom": "^16.9.15",
|
|
51
|
-
"neo-cmp-cli": "^1.13.
|
|
51
|
+
"neo-cmp-cli": "^1.13.9",
|
|
52
52
|
"husky": "^4.2.5",
|
|
53
53
|
"lint-staged": "^10.2.9",
|
|
54
54
|
"prettier": "^2.0.5",
|
|
55
55
|
"@types/echarts": "^4.9.0"
|
|
56
56
|
},
|
|
57
|
+
"overrides": {
|
|
58
|
+
"typescript": "<6"
|
|
59
|
+
},
|
|
57
60
|
"engines": {
|
|
58
61
|
"node": ">= 16.0.0",
|
|
59
62
|
"npm": ">= 8.0.0"
|
|
@@ -41,11 +41,14 @@
|
|
|
41
41
|
"@commitlint/config-conventional": "^18.0.0",
|
|
42
42
|
"@types/react": "^16.9.11",
|
|
43
43
|
"@types/react-dom": "^16.9.15",
|
|
44
|
-
"neo-cmp-cli": "^1.13.
|
|
44
|
+
"neo-cmp-cli": "^1.13.9",
|
|
45
45
|
"husky": "^4.2.5",
|
|
46
46
|
"lint-staged": "^10.2.9",
|
|
47
47
|
"prettier": "^2.0.5"
|
|
48
48
|
},
|
|
49
|
+
"overrides": {
|
|
50
|
+
"typescript": "<6"
|
|
51
|
+
},
|
|
49
52
|
"engines": {
|
|
50
53
|
"node": ">= 16.0.0",
|
|
51
54
|
"npm": ">= 8.0.0"
|
|
@@ -47,11 +47,14 @@
|
|
|
47
47
|
"@commitlint/config-conventional": "^18.0.0",
|
|
48
48
|
"@types/react": "^16.9.11",
|
|
49
49
|
"@types/react-dom": "^16.9.15",
|
|
50
|
-
"neo-cmp-cli": "^1.13.
|
|
50
|
+
"neo-cmp-cli": "^1.13.9",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
54
54
|
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"typescript": "<6"
|
|
57
|
+
},
|
|
55
58
|
"engines": {
|
|
56
59
|
"node": ">= 16.0.0",
|
|
57
60
|
"npm": ">= 8.0.0"
|
|
@@ -47,11 +47,14 @@
|
|
|
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.13.
|
|
50
|
+
"neo-cmp-cli": "^1.13.9",
|
|
51
51
|
"husky": "^4.2.5",
|
|
52
52
|
"lint-staged": "^10.2.9",
|
|
53
53
|
"prettier": "^2.0.5"
|
|
54
54
|
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"typescript": "<6"
|
|
57
|
+
},
|
|
55
58
|
"engines": {
|
|
56
59
|
"node": ">= 16.0.0",
|
|
57
60
|
"npm": ">= 8.0.0"
|
|
@@ -266,7 +266,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
266
266
|
* 表单提交事件
|
|
267
267
|
*/
|
|
268
268
|
@NeoEvent.dispatch
|
|
269
|
-
onSubmit() {
|
|
269
|
+
onSubmit(eventData?: any) {
|
|
270
270
|
console.log('触发了表单提交事件:', this.props);
|
|
271
271
|
|
|
272
272
|
/*
|
|
@@ -345,7 +345,10 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
// 触发表单提交事件
|
|
348
|
-
this.onSubmit(
|
|
348
|
+
this.onSubmit({
|
|
349
|
+
xObjectApiKey,
|
|
350
|
+
data: values
|
|
351
|
+
});
|
|
349
352
|
});
|
|
350
353
|
}
|
|
351
354
|
|
|
@@ -376,6 +379,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
376
379
|
referModalVisible: false,
|
|
377
380
|
currentReferField: null,
|
|
378
381
|
});
|
|
382
|
+
return false; // 阻止事件冒泡
|
|
379
383
|
}
|
|
380
384
|
|
|
381
385
|
/**
|
|
@@ -674,6 +678,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
674
678
|
referItemApiKey: currentReferField.apiKey,
|
|
675
679
|
}}
|
|
676
680
|
selectedCount={1}
|
|
681
|
+
hiddenHeader={true}
|
|
677
682
|
onCancel={this.closeReferModal}
|
|
678
683
|
onSelectedCall={(selectedData: any) => {
|
|
679
684
|
const { currentReferField: curField, currentReferField } = this.state;
|
|
@@ -699,6 +704,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
699
704
|
currentReferField: null,
|
|
700
705
|
}));
|
|
701
706
|
}
|
|
707
|
+
return false; // 阻止事件冒泡
|
|
702
708
|
}}
|
|
703
709
|
/>
|
|
704
710
|
)}
|
|
@@ -719,7 +725,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
719
725
|
console.log('createForm__c / this.props:', this.props);
|
|
720
726
|
|
|
721
727
|
const curAmisData = data || {};
|
|
722
|
-
const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
728
|
+
// const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
723
729
|
const { xObjectApiKey } = this.props.xObjectDataApi || {};
|
|
724
730
|
|
|
725
731
|
const displayTitle = formTitle || title || '新增数据';
|
|
@@ -730,7 +736,6 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
730
736
|
<div className="form-header">
|
|
731
737
|
<h3 className="form-title">
|
|
732
738
|
{displayTitle}
|
|
733
|
-
{systemInfo.tenantName ? `【${systemInfo.tenantName}】` : ''}
|
|
734
739
|
</h3>
|
|
735
740
|
</div>
|
|
736
741
|
|
|
@@ -49,7 +49,7 @@ export class CreateFormModel {
|
|
|
49
49
|
defaultComProps = {
|
|
50
50
|
formTitle: '新增数据表单',
|
|
51
51
|
showResetButton: true,
|
|
52
|
-
columnCount:
|
|
52
|
+
columnCount: 2,
|
|
53
53
|
xObjectDataApi: {
|
|
54
54
|
xObjectApiKey: 'opportunity',
|
|
55
55
|
fields: ['entityType', 'ownerId', 'opportunityName', 'accountId', 'money', 'closeDate'],
|
|
@@ -65,6 +65,8 @@ export class CreateFormModel {
|
|
|
65
65
|
apiKey: 'onSubmit', // 事件名称
|
|
66
66
|
label: '提交表单后', // 事件
|
|
67
67
|
helpText: '表单提交后触发该事件', // 信息icon hover 时的提示文本
|
|
68
|
+
eventParams: // 定义事件触发时接收到的事件数据格式
|
|
69
|
+
'[{"apiKey":"eventParam","children":[{"apiKey":"data","label":"当前表单数据","type":"Object"}],"label":"事件入参","type":"Object"}]',
|
|
68
70
|
},
|
|
69
71
|
];
|
|
70
72
|
|
|
@@ -101,7 +103,7 @@ export class CreateFormModel {
|
|
|
101
103
|
type: 'panelSelect',
|
|
102
104
|
name: 'columnCount',
|
|
103
105
|
label: '表单列数',
|
|
104
|
-
value:
|
|
106
|
+
value: 2,
|
|
105
107
|
placeholder: '请选择表单列数',
|
|
106
108
|
options: [
|
|
107
109
|
{
|
|
@@ -9,11 +9,11 @@ export class NeoEntityGridModel {
|
|
|
9
9
|
// cmpType: string = 'entityList__c';
|
|
10
10
|
|
|
11
11
|
// 组件名称,用于设置在编辑器左侧组件面板中展示的名称
|
|
12
|
-
label: string = 'Picker
|
|
12
|
+
label: string = 'Picker列表';
|
|
13
13
|
|
|
14
14
|
// 组件描述,用于设置在编辑器左侧组件面板中展示的描述
|
|
15
15
|
description: string =
|
|
16
|
-
'自定义Picker
|
|
16
|
+
'自定义Picker列表: Picker 模式的数据选择列表,支持在其他自定义组件中使用。支持单选和多选。';
|
|
17
17
|
|
|
18
18
|
// 分类标签,用于设置在编辑器左侧组件面板哪个分类中展示
|
|
19
19
|
// tags: string[] = ['自定义组件'];
|
|
@@ -596,23 +596,19 @@ export default class SearchForm extends React.PureComponent<
|
|
|
596
596
|
const { title, loading, submitting, error } = this.state;
|
|
597
597
|
const { formTitle, className, showResetButton = true, data } = this.props;
|
|
598
598
|
|
|
599
|
-
// 测试输出
|
|
600
|
-
console.log('this.props:', this.props);
|
|
601
|
-
|
|
602
599
|
const curAmisData = data || {};
|
|
603
|
-
const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
600
|
+
// const systemInfo = curAmisData.__NeoSystemInfo || {};
|
|
604
601
|
const { xObjectApiKey } = this.props.xObjectDataApi || {};
|
|
605
602
|
|
|
606
603
|
const displayTitle = formTitle || title || '自定义筛选条件';
|
|
607
604
|
|
|
608
605
|
return (
|
|
609
|
-
<div className={`searchForm__c ${className}
|
|
610
|
-
<Card>
|
|
606
|
+
<div className={`searchForm__c ${className || ''}`.trim()}>
|
|
607
|
+
<Card bordered={false} className="searchForm__c-card">
|
|
611
608
|
<div className="form-header">
|
|
612
|
-
<
|
|
613
|
-
{displayTitle}
|
|
614
|
-
|
|
615
|
-
</h3>
|
|
609
|
+
<div className="form-header-text">
|
|
610
|
+
<h3 className="form-title">{displayTitle}</h3>
|
|
611
|
+
</div>
|
|
616
612
|
</div>
|
|
617
613
|
|
|
618
614
|
<div className="form-content">
|