提交 fceb3c4d 编写于 作者: ibizdev's avatar ibizdev

SYSTEM 发布系统代码

上级 997a4eed
......@@ -637,12 +637,12 @@
<PSDATAENTITIES>
<PSDATAENTITY ID="b870529f2e6e059597d7a0582e215e34" NAME="ENTITY2" CODENAME="Entity2" LOGICNAME="实体2" PSMODULEID="9711cea1c1536487d13078d6df5718b3">
<PSDATAENTITY ID="766ab2e45e3c8b065622cac357002e89" NAME="ENTITY" CODENAME="Entity" LOGICNAME="实体" PSMODULEID="1cf5e1f5569acda3c4a88a91c5130a69">
<IBIZFILES>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module2/service" PUB="Entity2ServiceBase.java" USR="Entity2Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module2/dao" PUB="Entity2DAOBase.java" USR="Entity2DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module2/entity" PUB="Entity2Base.java" USR="Entity2.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module2/demodel" PUB="Entity2DEModelBase.java" USR="Entity2DEModel.java"/>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module/service" PUB="EntityServiceBase.java" USR="EntityService.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module/dao" PUB="EntityDAOBase.java" USR="EntityDAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module/entity" PUB="EntityBase.java" USR="Entity.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module/demodel" PUB="EntityDEModelBase.java" USR="EntityDEModel.java"/>
</IBIZFILES>
<PSDEACTIONS>
</PSDEACTIONS>
......@@ -651,21 +651,21 @@
<PSDEACMODES>
<PSDEACMODE NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module2/demodel/entity2/ac" PUB="Entity2DefaultACModelBase.java" USR="Entity2DefaultACModel.java"/>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module/demodel/entity/ac" PUB="EntityDefaultACModelBase.java" USR="EntityDefaultACModel.java"/>
</IBIZFILES>
</PSDEACMODE>
</PSDEACMODES>
<PSDEDATAQUERYIES>
<PSDEDATAQUERY NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module2/demodel/entity2/dataquery" PUB="Entity2DefaultDQModelBase.java" USR="Entity2DefaultDQModel.java"/>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module/demodel/entity/dataquery" PUB="EntityDefaultDQModelBase.java" USR="EntityDefaultDQModel.java"/>
</IBIZFILES>
</PSDEDATAQUERY>
</PSDEDATAQUERYIES>
<PSDEDATASETS>
<PSDEDATASET NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module2/demodel/entity2/dataset" PUB="Entity2DefaultDSModelBase.java" USR="Entity2DefaultDSModel.java"/>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module/demodel/entity/dataset" PUB="EntityDefaultDSModelBase.java" USR="EntityDefaultDSModel.java"/>
</IBIZFILES>
</PSDEDATASET>
</PSDEDATASETS>
......@@ -679,12 +679,12 @@
</PSDEWFS>
</PSDATAENTITY>
<PSDATAENTITY ID="766ab2e45e3c8b065622cac357002e89" NAME="ENTITY" CODENAME="Entity" LOGICNAME="实体" PSMODULEID="1cf5e1f5569acda3c4a88a91c5130a69">
<PSDATAENTITY ID="b870529f2e6e059597d7a0582e215e34" NAME="ENTITY2" CODENAME="Entity2" LOGICNAME="实体2" PSMODULEID="9711cea1c1536487d13078d6df5718b3">
<IBIZFILES>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module/service" PUB="EntityServiceBase.java" USR="EntityService.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module/dao" PUB="EntityDAOBase.java" USR="EntityDAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module/entity" PUB="EntityBase.java" USR="Entity.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module/demodel" PUB="EntityDEModelBase.java" USR="EntityDEModel.java"/>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module2/service" PUB="Entity2ServiceBase.java" USR="Entity2Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module2/dao" PUB="Entity2DAOBase.java" USR="Entity2DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module2/entity" PUB="Entity2Base.java" USR="Entity2.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module2/demodel" PUB="Entity2DEModelBase.java" USR="Entity2DEModel.java"/>
</IBIZFILES>
<PSDEACTIONS>
</PSDEACTIONS>
......@@ -693,21 +693,21 @@
<PSDEACMODES>
<PSDEACMODE NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module/demodel/entity/ac" PUB="EntityDefaultACModelBase.java" USR="EntityDefaultACModel.java"/>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module2/demodel/entity2/ac" PUB="Entity2DefaultACModelBase.java" USR="Entity2DefaultACModel.java"/>
</IBIZFILES>
</PSDEACMODE>
</PSDEACMODES>
<PSDEDATAQUERYIES>
<PSDEDATAQUERY NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module/demodel/entity/dataquery" PUB="EntityDefaultDQModelBase.java" USR="EntityDefaultDQModel.java"/>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module2/demodel/entity2/dataquery" PUB="Entity2DefaultDQModelBase.java" USR="Entity2DefaultDQModel.java"/>
</IBIZFILES>
</PSDEDATAQUERY>
</PSDEDATAQUERYIES>
<PSDEDATASETS>
<PSDEDATASET NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module/demodel/entity/dataset" PUB="EntityDefaultDSModelBase.java" USR="EntityDefaultDSModel.java"/>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module2/demodel/entity2/dataset" PUB="Entity2DefaultDSModelBase.java" USR="Entity2DefaultDSModel.java"/>
</IBIZFILES>
</PSDEDATASET>
</PSDEDATASETS>
......@@ -763,12 +763,12 @@
</PSDEWFS>
</PSDATAENTITY>
<PSDATAENTITY ID="ea74cfe18bed6cc112ba9c5ae0576771" NAME="ENTITY5" CODENAME="Entity5" LOGICNAME="实体5" PSMODULEID="23047071812f845fc762b5e17d9d687c">
<PSDATAENTITY ID="29fc5746919ab6aadfecc85cfd291a3a" NAME="ENTITY4" CODENAME="Entity4" LOGICNAME="实体4" PSMODULEID="45e0212eee51c3f900347c70b2367522">
<IBIZFILES>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module5/service" PUB="Entity5ServiceBase.java" USR="Entity5Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module5/dao" PUB="Entity5DAOBase.java" USR="Entity5DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module5/entity" PUB="Entity5Base.java" USR="Entity5.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module5/demodel" PUB="Entity5DEModelBase.java" USR="Entity5DEModel.java"/>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module4/service" PUB="Entity4ServiceBase.java" USR="Entity4Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module4/dao" PUB="Entity4DAOBase.java" USR="Entity4DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module4/entity" PUB="Entity4Base.java" USR="Entity4.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module4/demodel" PUB="Entity4DEModelBase.java" USR="Entity4DEModel.java"/>
</IBIZFILES>
<PSDEACTIONS>
</PSDEACTIONS>
......@@ -777,21 +777,21 @@
<PSDEACMODES>
<PSDEACMODE NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module5/demodel/entity5/ac" PUB="Entity5DefaultACModelBase.java" USR="Entity5DefaultACModel.java"/>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module4/demodel/entity4/ac" PUB="Entity4DefaultACModelBase.java" USR="Entity4DefaultACModel.java"/>
</IBIZFILES>
</PSDEACMODE>
</PSDEACMODES>
<PSDEDATAQUERYIES>
<PSDEDATAQUERY NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module5/demodel/entity5/dataquery" PUB="Entity5DefaultDQModelBase.java" USR="Entity5DefaultDQModel.java"/>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module4/demodel/entity4/dataquery" PUB="Entity4DefaultDQModelBase.java" USR="Entity4DefaultDQModel.java"/>
</IBIZFILES>
</PSDEDATAQUERY>
</PSDEDATAQUERYIES>
<PSDEDATASETS>
<PSDEDATASET NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module5/demodel/entity5/dataset" PUB="Entity5DefaultDSModelBase.java" USR="Entity5DefaultDSModel.java"/>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module4/demodel/entity4/dataset" PUB="Entity4DefaultDSModelBase.java" USR="Entity4DefaultDSModel.java"/>
</IBIZFILES>
</PSDEDATASET>
</PSDEDATASETS>
......@@ -805,12 +805,12 @@
</PSDEWFS>
</PSDATAENTITY>
<PSDATAENTITY ID="29fc5746919ab6aadfecc85cfd291a3a" NAME="ENTITY4" CODENAME="Entity4" LOGICNAME="实体4" PSMODULEID="45e0212eee51c3f900347c70b2367522">
<PSDATAENTITY ID="ea74cfe18bed6cc112ba9c5ae0576771" NAME="ENTITY5" CODENAME="Entity5" LOGICNAME="实体5" PSMODULEID="23047071812f845fc762b5e17d9d687c">
<IBIZFILES>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module4/service" PUB="Entity4ServiceBase.java" USR="Entity4Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module4/dao" PUB="Entity4DAOBase.java" USR="Entity4DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module4/entity" PUB="Entity4Base.java" USR="Entity4.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module4/demodel" PUB="Entity4DEModelBase.java" USR="Entity4DEModel.java"/>
<IBIZFILE TYPE="SF_SERVICE" FOLDER="srv/module5/service" PUB="Entity5ServiceBase.java" USR="Entity5Service.java"/>
<IBIZFILE TYPE="SF_DAO" FOLDER="srv/module5/dao" PUB="Entity5DAOBase.java" USR="Entity5DAO.java"/>
<IBIZFILE TYPE="SF_ENTITY" FOLDER="srv/module5/entity" PUB="Entity5Base.java" USR="Entity5.java"/>
<IBIZFILE TYPE="SF_DEMODEL" FOLDER="srv/module5/demodel" PUB="Entity5DEModelBase.java" USR="Entity5DEModel.java"/>
</IBIZFILES>
<PSDEACTIONS>
</PSDEACTIONS>
......@@ -819,21 +819,21 @@
<PSDEACMODES>
<PSDEACMODE NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module4/demodel/entity4/ac" PUB="Entity4DefaultACModelBase.java" USR="Entity4DefaultACModel.java"/>
<IBIZFILE TYPE="SF_DEACMODEL" FOLDER="srv/module5/demodel/entity5/ac" PUB="Entity5DefaultACModelBase.java" USR="Entity5DefaultACModel.java"/>
</IBIZFILES>
</PSDEACMODE>
</PSDEACMODES>
<PSDEDATAQUERYIES>
<PSDEDATAQUERY NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module4/demodel/entity4/dataquery" PUB="Entity4DefaultDQModelBase.java" USR="Entity4DefaultDQModel.java"/>
<IBIZFILE TYPE="SF_DEDQMODEL" FOLDER="srv/module5/demodel/entity5/dataquery" PUB="Entity5DefaultDQModelBase.java" USR="Entity5DefaultDQModel.java"/>
</IBIZFILES>
</PSDEDATAQUERY>
</PSDEDATAQUERYIES>
<PSDEDATASETS>
<PSDEDATASET NAME="DEFAULT" CODENAME="Default" >
<IBIZFILES>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module4/demodel/entity4/dataset" PUB="Entity4DefaultDSModelBase.java" USR="Entity4DefaultDSModel.java"/>
<IBIZFILE TYPE="SF_DEDSMODEL" FOLDER="srv/module5/demodel/entity5/dataset" PUB="Entity5DefaultDSModelBase.java" USR="Entity5DefaultDSModel.java"/>
</IBIZFILES>
</PSDEDATASET>
</PSDEDATASETS>
......
......@@ -4,8 +4,10 @@ import ExampleEditorType from './pages/exapmple/example-editor-type/example-edit
import ExampleEditView from './pages/exapmple/example-edit-view/example-edit-view';
import Entity3EditView from './pages/module3/entity3-edit-view/entity3-edit-view';
import ExampleMain3EditView from './pages/exapmple/example-main3-edit-view/example-main3-edit-view';
import ExampleMain5EditView from './pages/exapmple/example-main5-edit-view/example-main5-edit-view';
import Entity4EditView from './pages/module4/entity4-edit-view/entity4-edit-view';
import Entity5EditView from './pages/module5/entity5-edit-view/entity5-edit-view';
import ExampleMain4EditView from './pages/exapmple/example-main4-edit-view/example-main4-edit-view';
import ExampleDLFEditView from './pages/exapmple/example-dlfedit-view/example-dlfedit-view';
import Entity2EditView from './pages/module2/entity2-edit-view/entity2-edit-view';
import ExampleMain2EditView from './pages/exapmple/example-main2-edit-view/example-main2-edit-view';
......@@ -60,12 +62,18 @@ export default class App extends PureComponent {
if (Object.is(this.currentPage, "ExampleMain3EditView")) {
return <ExampleMain3EditView/>;
}
if (Object.is(this.currentPage, "ExampleMain5EditView")) {
return <ExampleMain5EditView/>;
}
if (Object.is(this.currentPage, "Entity4EditView")) {
return <Entity4EditView/>;
}
if (Object.is(this.currentPage, "Entity5EditView")) {
return <Entity5EditView/>;
}
if (Object.is(this.currentPage, "ExampleMain4EditView")) {
return <ExampleMain4EditView/>;
}
if (Object.is(this.currentPage, "ExampleDLFEditView")) {
return <ExampleDLFEditView/>;
}
......@@ -99,7 +107,7 @@ export default class App extends PureComponent {
<Layout id="components-layout-demo-custom-trigger">
<Sider trigger={null} collapsible style={{ minHeight: '100vh' }}>
<div className="logo"><img src="assets/images/logo.png" /></div>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['"EntityEditView""ExampleEditorType""ExampleEditView""Entity3EditView""ExampleMain3EditView""Entity4EditView""Entity5EditView""ExampleDLFEditView""Entity2EditView""ExampleMain2EditView"']} onClick={({ item, key, keyPath, domEvent }) => { this.handleMenuClick(item, key, keyPath, domEvent) }}>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['"EntityEditView""ExampleEditorType""ExampleEditView""Entity3EditView""ExampleMain3EditView""ExampleMain5EditView""Entity4EditView""Entity5EditView""ExampleMain4EditView""ExampleDLFEditView""Entity2EditView""ExampleMain2EditView"']} onClick={({ item, key, keyPath, domEvent }) => { this.handleMenuClick(item, key, keyPath, domEvent) }}>
<Menu.Item key="EntityEditView">
<Icon type="user" />
<span>实体编辑视图</span>
......@@ -120,24 +128,32 @@ export default class App extends PureComponent {
<Icon type="video-camera" />
<span>表单3</span>
</Menu.Item>
<Menu.Item key="Entity4EditView">
<Menu.Item key="ExampleMain5EditView">
<Icon type="upload" />
<span>表单5</span>
</Menu.Item>
<Menu.Item key="Entity4EditView">
<Icon type="user" />
<span>实体4编辑视图</span>
</Menu.Item>
<Menu.Item key="Entity5EditView">
<Icon type="user" />
<Icon type="video-camera" />
<span>实体5编辑视图</span>
</Menu.Item>
<Menu.Item key="ExampleMain4EditView">
<Icon type="upload" />
<span>表单4</span>
</Menu.Item>
<Menu.Item key="ExampleDLFEditView">
<Icon type="video-camera" />
<Icon type="user" />
<span>表单项动态逻辑示例</span>
</Menu.Item>
<Menu.Item key="Entity2EditView">
<Icon type="upload" />
<Icon type="video-camera" />
<span>实体2编辑视图</span>
</Menu.Item>
<Menu.Item key="ExampleMain2EditView">
<Icon type="user" />
<Icon type="upload" />
<span>表单2</span>
</Menu.Item>
</Menu>
......
......@@ -35,33 +35,40 @@ export class MainFormData {
*/
entity3name?: any;
/**
* 建立人
*
*
* @type {*}
* @memberof MainFormData
*/
formitem?: any;
/**
*
*
* @type {*}
* @memberof MainFormData
*/
createman?: any;
formitem2?: any;
/**
* 建立时间
*
*
* @type {*}
* @memberof MainFormData
*/
createdate?: any;
formitem1?: any;
/**
* 更新人
*
*
* @type {*}
* @memberof MainFormData
*/
updateman?: any;
formitem3?: any;
/**
* 更新时间
*
*
* @type {*}
* @memberof MainFormData
*/
updatedate?: any;
formitem4?: any;
/**
* 实体3标识
*
......@@ -201,25 +208,30 @@ export default class Main extends PureComponent<MainProps> {
{ required: false, type: 'string', message: '实体3名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '实体3名称 值不能为空', trigger: 'blur' },
],
createman: [
{ type: 'string', message: '建立人 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '建立人 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '建立人 值不能为空', trigger: 'blur' },
formitem: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
createdate: [
{ type: 'string', message: '建立时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'blur' },
formitem2: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
formitem1: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
updateman: [
{ type: 'string', message: '更新人 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新人 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新人 值不能为空', trigger: 'blur' },
formitem3: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
updatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
formitem4: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
entity3id: [
{ type: 'string', message: '实体3标识 值必须为字符串类型', trigger: 'change' },
......@@ -237,11 +249,15 @@ export default class Main extends PureComponent<MainProps> {
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '实体3基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
grouppanel2: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel2', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel4: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel4', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
group2: new FormGroupPanelModel({ caption: '操作信息', detailType: 'GROUPPANEL', name: 'group2', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
grouppanel1: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
formpage2: new FormPageModel({ caption: '其它', detailType: 'FORMPAGE', name: 'formpage2', visible: true, isShowCaption: true, form: this })
tabpanel1: new FormTabPanelModel({ caption: '', detailType: 'TABPANEL', name: 'tabpanel1', visible: true, isShowCaption: false, form: this, tabPages: [] })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
......@@ -261,17 +277,18 @@ export default class Main extends PureComponent<MainProps> {
,
entity3name: new FormItemModel({ caption: '实体3名称', detailType: 'FORMITEM', name: 'entity3name', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
formitem: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
formitem2: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem2', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
createdate: new FormItemModel({ caption: '建立时间', detailType: 'FORMITEM', name: 'createdate', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
formitem1: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem1', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
updateman: new FormItemModel({ caption: '更新人', detailType: 'FORMITEM', name: 'updateman', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
formitem3: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem3', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
updatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'updatedate', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
formitem4: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem4', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
entity3id: new FormItemModel({ caption: '实体3标识', detailType: 'FORMITEM', name: 'entity3id', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [{ name: 'formpage1', index: 0, visible: true }, { name: 'formpage2', index: 1, visible: true }] }),
}
/**
......@@ -308,6 +325,9 @@ export default class Main extends PureComponent<MainProps> {
}
......@@ -413,14 +433,6 @@ export default class Main extends PureComponent<MainProps> {
return <>
<div className="ibiz-form main">
<Form layout="inline">
<Tabs defaultActiveKey="1" onChange={(key: string) => this.tabChange(key)}>
<TabPane
tab={
<span className='caption'>
基本信息
</span>
}
key="0">
{this.detailsModel.group1.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<Collapse defaultActiveKey={['group1']} className=''>
<Panel header="实体3基本信息" key="group1">
......@@ -443,86 +455,115 @@ export default class Main extends PureComponent<MainProps> {
</Row>
</Panel>
</Collapse>
</Collapse>
</Col>:""}
{this.detailsModel.formitem.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<div className={`app-form-item app-form-item-left`}>
{this.detailsModel.formitem.isShowCaption && !this.detailsModel.formitem.isEmptyCaption ?
<div className="app-form-item-label" style={{ width: '130px' }}>
{this.detailsModel.formitem.required ? <span className="isrequired">*</span> : ""}
</div> : ""}
<div className="app-form-item-container" style={{ width: "calc(100% - 130px)" }}>
<Form.Item key={'formitem'} validateStatus={this.detailsModel.formitem.validateStatus} help={this.detailsModel.formitem.error}>
<Input id={'formitem'} disabled={this.detailsModel.formitem.disabled} value={this.data.formitem} onChange={($event) =>{this.formItemChange('formitem',$event.target.value)}}/>
</Form.Item>
</div>
</div>
</TabPane>
<TabPane
tab={
<span className='caption'>
其它
</span>
}
key="1">
{this.detailsModel.group2.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<Collapse defaultActiveKey={['group2']} className=''>
<Panel header="操作信息" key="group2">
</Col>:""}
{this.detailsModel.grouppanel1.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<Collapse defaultActiveKey={['grouppanel1']} className=''>
<Panel header="分组面板" key="grouppanel1">
<Row>
{this.detailsModel.createman.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
{this.detailsModel.grouppanel2.visible?<Col style={{}} sm={{ span: 8, offset: 0 }} md={{span: 8, offset: 0}} lg={{ span: 8, offset: 0}} xl={{ span: 8, offset: 0}}>
<Collapse defaultActiveKey={['grouppanel2']} className=''>
<Panel header="分组面板" key="grouppanel2">
<Row>
</Row>
</Panel>
</Collapse>
</Col>:""}
{this.detailsModel.grouppanel4.visible?<Col style={{}} sm={{ span: 8, offset: 0 }} md={{span: 8, offset: 0}} lg={{ span: 8, offset: 0}} xl={{ span: 8, offset: 0}}>
<Collapse defaultActiveKey={['grouppanel4']} className=''>
<Panel header="分组面板" key="grouppanel4">
<Row>
</Row>
</Panel>
</Collapse>
</Col>:""}
</Row>
</Panel>
</Collapse>
</Col>:""}
{this.detailsModel.tabpanel1.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<Tabs className="">
</Tabs>
</Col>:""}
{this.detailsModel.formitem2.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<div className={`app-form-item app-form-item-left`}>
{this.detailsModel.createman.isShowCaption && !this.detailsModel.createman.isEmptyCaption ?
{this.detailsModel.formitem2.isShowCaption && !this.detailsModel.formitem2.isEmptyCaption ?
<div className="app-form-item-label" style={{ width: '130px' }}>
{this.detailsModel.createman.required ? <span className="isrequired">*</span> : ""}建立人
{this.detailsModel.formitem2.required ? <span className="isrequired">*</span> : ""}
</div> : ""}
<div className="app-form-item-container" style={{ width: "calc(100% - 130px)" }}>
<Form.Item key={'createman'} validateStatus={this.detailsModel.createman.validateStatus} help={this.detailsModel.createman.error}>
<span>{this.data.createman}</span>
<Form.Item key={'formitem2'} validateStatus={this.detailsModel.formitem2.validateStatus} help={this.detailsModel.formitem2.error}>
<AppDropDownList value={this.data.formitem2} disabled={this.detailsModel.formitem2.disabled} codelist={this.codelistModel} placeholder={'请选择...'} onChange={($event) =>{this.formItemChange('formitem2', $event)}}></AppDropDownList>
</Form.Item>
</div>
</div>
</div>
</Col>:""}
{this.detailsModel.createdate.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
{this.detailsModel.formitem1.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<div className={`app-form-item app-form-item-left`}>
{this.detailsModel.createdate.isShowCaption && !this.detailsModel.createdate.isEmptyCaption ?
{this.detailsModel.formitem1.isShowCaption && !this.detailsModel.formitem1.isEmptyCaption ?
<div className="app-form-item-label" style={{ width: '130px' }}>
{this.detailsModel.createdate.required ? <span className="isrequired">*</span> : ""}建立时间
{this.detailsModel.formitem1.required ? <span className="isrequired">*</span> : ""}
</div> : ""}
<div className="app-form-item-container" style={{ width: "calc(100% - 130px)" }}>
<Form.Item key={'createdate'} validateStatus={this.detailsModel.createdate.validateStatus} help={this.detailsModel.createdate.error}>
<span>{this.data.createdate}</span>
<Form.Item key={'formitem1'} validateStatus={this.detailsModel.formitem1.validateStatus} help={this.detailsModel.formitem1.error}>
<AppCheckBox value={this.data.formitem1} disabled={this.detailsModel.formitem1.disabled} onChange={($event) =>{this.formItemChange('formitem1', $event)}}></AppCheckBox>
</Form.Item>
</div>
</div>
</div>
</Col>:""}
{this.detailsModel.updateman.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
{this.detailsModel.formitem3.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<div className={`app-form-item app-form-item-left`}>
{this.detailsModel.updateman.isShowCaption && !this.detailsModel.updateman.isEmptyCaption ?
{this.detailsModel.formitem3.isShowCaption && !this.detailsModel.formitem3.isEmptyCaption ?
<div className="app-form-item-label" style={{ width: '130px' }}>
{this.detailsModel.updateman.required ? <span className="isrequired">*</span> : ""}更新人
{this.detailsModel.formitem3.required ? <span className="isrequired">*</span> : ""}
</div> : ""}
<div className="app-form-item-container" style={{ width: "calc(100% - 130px)" }}>
<Form.Item key={'updateman'} validateStatus={this.detailsModel.updateman.validateStatus} help={this.detailsModel.updateman.error}>
<span>{this.data.updateman}</span>
<Form.Item key={'formitem3'} validateStatus={this.detailsModel.formitem3.validateStatus} help={this.detailsModel.formitem3.error}>
<AppDatePicker value={this.data.formitem3} disabled={this.detailsModel.formitem3.disabled} showTime={true} format={'YYYY-MM-DD HH:mm:ss'} placeholder={"请选择时间..."} onChange={($event) =>{this.formItemChange('formitem3',$event)}}/>
</Form.Item>
</div>
</div>
</div>
</Col>:""}
{this.detailsModel.updatedate.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
{this.detailsModel.formitem4.visible?<Col style={{}} lg={{ span: 24, offset: 0}}>
<div className={`app-form-item app-form-item-left`}>
{this.detailsModel.updatedate.isShowCaption && !this.detailsModel.updatedate.isEmptyCaption ?
{this.detailsModel.formitem4.isShowCaption && !this.detailsModel.formitem4.isEmptyCaption ?
<div className="app-form-item-label" style={{ width: '130px' }}>
{this.detailsModel.updatedate.required ? <span className="isrequired">*</span> : ""}更新时间
{this.detailsModel.formitem4.required ? <span className="isrequired">*</span> : ""}
</div> : ""}
<div className="app-form-item-container" style={{ width: "calc(100% - 130px)" }}>
<Form.Item key={'updatedate'} validateStatus={this.detailsModel.updatedate.validateStatus} help={this.detailsModel.updatedate.error}>
<span>{this.data.updatedate}</span>
<Form.Item key={'formitem4'} validateStatus={this.detailsModel.formitem4.validateStatus} help={this.detailsModel.formitem4.error}>
<AppFileUpload value={this.data.formitem4} disabled={this.detailsModel.formitem4.disabled} uploadparams={''} exportparams={''} customparams={{}} onChange={($event) => { this.formItemChange('formitem4', $event) }}></AppFileUpload>
</Form.Item>
</div>
</div>
</div>
</Col>:""}
</Row>
</Panel>
</Collapse>
</Col>:""}
</TabPane>
</Tabs>
</Form>
</div>
</>;
......
// this is less
.app-form-item {
display: flex;
justify-content: space-between;
padding-right: 16px;
margin-bottom: 6px;
.app-form-item-label {
text-align: right;
height: 32px;
line-height: 32px;
padding-right: 16px;
.isrequired {
display: inline-block;
margin-right: 4px;
font-family: SimSun;
line-height: 1;
font-size: 14px;
color: #f5222d;
}
}
.app-form-item-container {
.ant-form-item {
width: 100%;
.ant-form-item-control-wrapper {
width: 100%;
height: auto;
min-height: 59px;
}
}
}
}
.app-form-item-left {
flex-direction: row;
}
.app-form-item-right {
flex-direction: row-reverse;
}
.app-form-item-top {
flex-direction: column;
}
.app-form-item-bottom {
flex-direction: column-reverse;
}
.ant-form-inline .ant-form-item-with-help {
margin-bottom: 0px !important;
}
import React, { PureComponent } from 'react';
import { Form, Input, Row, Col, Tabs, Icon, Collapse, Button, Select, message } from 'antd';
import Schema from "async-validator";
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '../../../ibizsys/form-detail';
import { Util } from '../../../ibizsys/utils/util';
import AppDropDownList from '../../../ibizsys/components/app-dropdown-list/app-dropdown-list';
import AppRadioGroup from '../../../ibizsys/components/app-radio-group/app-radio-group';
import AppCheckBox from '../../../ibizsys/components/app-checkbox/app-checkbox';
import AppCheckBoxGroup from '../../../ibizsys/components/app-checkbox-group/app-checkbox-group';
import AppDatePicker from '../../../ibizsys/components/app-date-picker/app-date-picker';
import AppTimePicker from '../../../ibizsys/components/app-time-picker/app-time-picker';
import AppImageUpload from '../../../ibizsys/components/app-image-upload/app-image-upload';
import AppFileUpload from '../../../ibizsys/components/app-file-upload/app-file-upload';
import AppRichTextEditor from '../../../ibizsys/components/app-rich-text-editor/app-rich-text-editor';
import './main4.less';
const { TabPane } = Tabs;
const { Panel } = Collapse;
const { Option } = Select;
const { TextArea } = Input;
/**
* 表单属性
*
* @export
* @interface Main4FormData
*/
export class Main4FormData {
/**
* 示例标识
*
* @type {*}
* @memberof Main4FormData
*/
exampleid?: any;
}
/**
* 输入属性
*
* @export
* @interface Main4Props
*/
export interface Main4Props {
/**
* 表单数据对象
*
* @type {Main4FormData}
* @memberof Main4Props
*/
data?: Main4FormData;
/**
* 表单分页切换
*
* @memberof Main4Props
*/
tabChange?: (key: string) => void;
/**
* 表单项之变化
*
* @memberof MainProps
*/
formItemChange?:(key:any) => void;
}
/**
* Main4
*
* @export
* @class Main4
* @extends {PureComponent}
*/
export default class Main4 extends PureComponent<Main4Props> {
/**
* 表单数据
*
* @type {*}
* @memberof Main4
*/
public data: Main4FormData = new Main4FormData();
/**
* 初始化实例
*
* @type {*}
* @memberof Main4
*/
constructor(props) {
super(props);
if (this.data && this.props.data && !Object.is(JSON.stringify(this.data), JSON.stringify(this.props.data))) {
Object.assign(this.data, this.props.data);
}
this.initForm();
}
/**
* 在组件接收到一个新的 prop (或更新后)时被调用
*
* @memberof IBizViewController
*/
public componentWillReceiveProps(nextProps: Readonly<Main4Props>, nextContext: any) {
if (this.data && nextProps.data && !Object.is(JSON.stringify(this.data), JSON.stringify(nextProps.data))) {
Object.assign(this.data, nextProps.data);
}
}
/**
* 在组件从 DOM 中移除的时候立刻被调用
*
* @memberof IBizViewController
*/
public componentWillUnmount() {
}
/**
* 属性值规则
*
* @type {*}
* @memberof Main4
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '示例名称 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
exampleid: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Main4
*/
public detailsModel: any = {
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '示例名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
exampleid: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'exampleid', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
}
/**
* 代码表模型
*
* @type {*}
* @memberof Main4
*/
public codelistModel:any = {
}
/**
* 表单逻辑
*
* @private
* @param { name, newVal, oldVal }
* @memberof Main4
*/
private formLogic(name: string, newVal: any, oldVal?: any): void {
}
/**
* 表单分页切换
*
* @param {string} key 分页标识
* @memberof Main4
*/
public tabChange(key: string): void {
if (this.props.tabChange) {
this.props.tabChange(key);
}
}
/**
* 表单值变化事件
*
* @memberof Main4
*/
public formItemChange(item: string, value: any, isFirst?: boolean) {
this.data[item] = value;
this.formLogic(item, value);
if (!isFirst) {
this.validateItem(item, value);
if (this.props.formItemChange) {
this.props.formItemChange({name:item,value:value});
}
}
this.tick();
}
/**
* 按钮点击事件
*
* @memberof Main4
*/
public buttonClick($event:any,value:String){
message.info('点击了'+value);
}
/**
* 初始化表单
*
* @memberof Main4
*/
public initForm() {
if (Object.keys(this.data).length > 0) {
Object.keys(this.data).forEach((item) => {
this.formItemChange(item, this.data[item], true);
})
}
}
/**
* 校验单个表单项
* @param item
* @param value
*/
public validateItem(item: string, value: any) {
// 做校验
// 1.获取数值和规则
const rule = this.rules[item];
// 2.创建校验规则
const schema = new Schema({ [item]: rule })
// 校验返回Promise
return schema.validate({ [item]: value },undefined,errors => {
if (errors) {
// 有错
this.detailsModel[item].setError(errors[0].message);
} else {
this.detailsModel[item].setError('');
}
})
}
/**
* 校验表单
*
* @memberof Main4
*/
public validateForm(callback:Function) {
let tasks: any;
if (Object.keys(this.data).length > 0) {
tasks = Object.keys(this.data).map((item) => {
this.validateItem(item, this.data[item]);
})
}
Promise.all(tasks)
.then(() => callback(true))
.catch(() => callback(false))
}
/**
* 绘制内容
*
* @returns
* @memberof Main4
*/
public render(): any {
return <>
<div className="ibiz-form main4">
<Form layout="inline">
<Tabs defaultActiveKey="1" onChange={(key: string) => this.tabChange(key)}>
</Tabs>
</Form>
</div>
</>;
}
/**
* 变更监测
*
* @protected
* @memberof Main
*/
protected tick(): void {
this.setState({
date: new Date()
});
}
}
\ No newline at end of file
// this is less
.app-form-item {
display: flex;
justify-content: space-between;
padding-right: 16px;
margin-bottom: 6px;
.app-form-item-label {
text-align: right;
height: 32px;
line-height: 32px;
padding-right: 16px;
.isrequired {
display: inline-block;
margin-right: 4px;
font-family: SimSun;
line-height: 1;
font-size: 14px;
color: #f5222d;
}
}
.app-form-item-container {
.ant-form-item {
width: 100%;
.ant-form-item-control-wrapper {
width: 100%;
height: auto;
min-height: 59px;
}
}
}
}
.app-form-item-left {
flex-direction: row;
}
.app-form-item-right {
flex-direction: row-reverse;
}
.app-form-item-top {
flex-direction: column;
}
.app-form-item-bottom {
flex-direction: column-reverse;
}
.ant-form-inline .ant-form-item-with-help {
margin-bottom: 0px !important;
}
import React, { PureComponent } from 'react';
import { Form, Input, Row, Col, Tabs, Icon, Collapse, Button, Select, message } from 'antd';
import Schema from "async-validator";
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '../../../ibizsys/form-detail';
import { Util } from '../../../ibizsys/utils/util';
import AppDropDownList from '../../../ibizsys/components/app-dropdown-list/app-dropdown-list';
import AppRadioGroup from '../../../ibizsys/components/app-radio-group/app-radio-group';
import AppCheckBox from '../../../ibizsys/components/app-checkbox/app-checkbox';
import AppCheckBoxGroup from '../../../ibizsys/components/app-checkbox-group/app-checkbox-group';
import AppDatePicker from '../../../ibizsys/components/app-date-picker/app-date-picker';
import AppTimePicker from '../../../ibizsys/components/app-time-picker/app-time-picker';
import AppImageUpload from '../../../ibizsys/components/app-image-upload/app-image-upload';
import AppFileUpload from '../../../ibizsys/components/app-file-upload/app-file-upload';
import AppRichTextEditor from '../../../ibizsys/components/app-rich-text-editor/app-rich-text-editor';
import './main5.less';
const { TabPane } = Tabs;
const { Panel } = Collapse;
const { Option } = Select;
const { TextArea } = Input;
/**
* 表单属性
*
* @export
* @interface Main5FormData
*/
export class Main5FormData {
/**
* 示例标识
*
* @type {*}
* @memberof Main5FormData
*/
exampleid?: any;
}
/**
* 输入属性
*
* @export
* @interface Main5Props
*/
export interface Main5Props {
/**
* 表单数据对象
*
* @type {Main5FormData}
* @memberof Main5Props
*/
data?: Main5FormData;
/**
* 表单分页切换
*
* @memberof Main5Props
*/
tabChange?: (key: string) => void;
/**
* 表单项之变化
*
* @memberof MainProps
*/
formItemChange?:(key:any) => void;
}
/**
* Main5
*
* @export
* @class Main5
* @extends {PureComponent}
*/
export default class Main5 extends PureComponent<Main5Props> {
/**
* 表单数据
*
* @type {*}
* @memberof Main5
*/
public data: Main5FormData = new Main5FormData();
/**
* 初始化实例
*
* @type {*}
* @memberof Main5
*/
constructor(props) {
super(props);
if (this.data && this.props.data && !Object.is(JSON.stringify(this.data), JSON.stringify(this.props.data))) {
Object.assign(this.data, this.props.data);
}
this.initForm();
}
/**
* 在组件接收到一个新的 prop (或更新后)时被调用
*
* @memberof IBizViewController
*/
public componentWillReceiveProps(nextProps: Readonly<Main5Props>, nextContext: any) {
if (this.data && nextProps.data && !Object.is(JSON.stringify(this.data), JSON.stringify(nextProps.data))) {
Object.assign(this.data, nextProps.data);
}
}
/**
* 在组件从 DOM 中移除的时候立刻被调用
*
* @memberof IBizViewController
*/
public componentWillUnmount() {
}
/**
* 属性值规则
*
* @type {*}
* @memberof Main5
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '示例名称 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
exampleid: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Main5
*/
public detailsModel: any = {
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '示例名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
exampleid: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'exampleid', visible: true, isShowCaption: true, form: this, disabled: false,error:"",isEmptyCaption:"false",validateStatus:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
}
/**
* 代码表模型
*
* @type {*}
* @memberof Main5
*/
public codelistModel:any = {
}
/**
* 表单逻辑
*
* @private
* @param { name, newVal, oldVal }
* @memberof Main5
*/
private formLogic(name: string, newVal: any, oldVal?: any): void {
}
/**
* 表单分页切换
*
* @param {string} key 分页标识
* @memberof Main5
*/
public tabChange(key: string): void {
if (this.props.tabChange) {
this.props.tabChange(key);
}
}
/**
* 表单值变化事件
*
* @memberof Main5
*/
public formItemChange(item: string, value: any, isFirst?: boolean) {
this.data[item] = value;
this.formLogic(item, value);
if (!isFirst) {
this.validateItem(item, value);
if (this.props.formItemChange) {
this.props.formItemChange({name:item,value:value});
}
}
this.tick();
}
/**
* 按钮点击事件
*
* @memberof Main5
*/
public buttonClick($event:any,value:String){
message.info('点击了'+value);
}
/**
* 初始化表单
*
* @memberof Main5
*/
public initForm() {
if (Object.keys(this.data).length > 0) {
Object.keys(this.data).forEach((item) => {
this.formItemChange(item, this.data[item], true);
})
}
}
/**
* 校验单个表单项
* @param item
* @param value
*/
public validateItem(item: string, value: any) {
// 做校验
// 1.获取数值和规则
const rule = this.rules[item];
// 2.创建校验规则
const schema = new Schema({ [item]: rule })
// 校验返回Promise
return schema.validate({ [item]: value },undefined,errors => {
if (errors) {
// 有错
this.detailsModel[item].setError(errors[0].message);
} else {
this.detailsModel[item].setError('');
}
})
}
/**
* 校验表单
*
* @memberof Main5
*/
public validateForm(callback:Function) {
let tasks: any;
if (Object.keys(this.data).length > 0) {
tasks = Object.keys(this.data).map((item) => {
this.validateItem(item, this.data[item]);
})
}
Promise.all(tasks)
.then(() => callback(true))
.catch(() => callback(false))
}
/**
* 绘制内容
*
* @returns
* @memberof Main5
*/
public render(): any {
return <>
<div className="ibiz-form main5">
<Form layout="inline">
<Tabs defaultActiveKey="1" onChange={(key: string) => this.tabChange(key)}>
</Tabs>
</Form>
</div>
</>;
}
/**
* 变更监测
*
* @protected
* @memberof Main
*/
protected tick(): void {
this.setState({
date: new Date()
});
}
}
\ No newline at end of file
import React, { PureComponent } from 'react';
import './example-main4-edit-view.less';
import Main4form from '../../../forms/example/main4/main4';
/**
* ExampleMain4EditView
*
* @export
* @class ExampleMain4EditView
* @extends {PureComponent}
*/
export default class ExampleMain4EditView extends PureComponent {
public formData = {
"bookname":"test1",
"input":"文本test",
"label":"标签test",
"group1":"书籍基本信息test",
"formpage1":"基本信息test",
"createman":"建立人test",
"createdate":"建立时间test",
"updateman":"更新人test",
"updatedate":"更新时间test",
"group2":"操作信息test",
"formpage2":"其它test"
}
/**
* 绘制内容
*
* @returns
* @memberof ExampleMain4EditView
*/
public render() {
return <>
<div>
<Main4form data={{}} formItemChange={(value:any) =>{this.formItemChange(value)}}></Main4form>
</div>
</>;
}
/**
* 表单项变化
* @param value
*/
public formItemChange(value:any){
console.log(value);
}
}
\ No newline at end of file
import React, { PureComponent } from 'react';
import './example-main5-edit-view.less';
import Main5form from '../../../forms/example/main5/main5';
/**
* ExampleMain5EditView
*
* @export
* @class ExampleMain5EditView
* @extends {PureComponent}
*/
export default class ExampleMain5EditView extends PureComponent {
public formData = {
"bookname":"test1",
"input":"文本test",
"label":"标签test",
"group1":"书籍基本信息test",
"formpage1":"基本信息test",
"createman":"建立人test",
"createdate":"建立时间test",
"updateman":"更新人test",
"updatedate":"更新时间test",
"group2":"操作信息test",
"formpage2":"其它test"
}
/**
* 绘制内容
*
* @returns
* @memberof ExampleMain5EditView
*/
public render() {
return <>
<div>
<Main5form data={{}} formItemChange={(value:any) =>{this.formItemChange(value)}}></Main5form>
</div>
</>;
}
/**
* 表单项变化
* @param value
*/
public formItemChange(value:any){
console.log(value);
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册