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

SYSTEM 发布系统代码

上级 3fc7ed66
......@@ -18,6 +18,10 @@ const routes: Routes = [
path: 'exapmple_examplemain3editview',
loadChildren: '@pages/exapmple/example-main3-edit-view/example-main3-edit-view.module#ExampleMain3EditViewModule'
},
{
path: 'module3_entity3main9editview',
loadChildren: '@pages/module3/entity3-main9-edit-view/entity3-main9-edit-view.module#Entity3Main9EditViewModule'
},
{
path: 'module_entityeditview',
loadChildren: '@pages/module/entity-edit-view/entity-edit-view.module#EntityEditViewModule'
......@@ -66,6 +70,10 @@ const routes: Routes = [
path: 'module2_entity2editview',
loadChildren: '@pages/module2/entity2-edit-view/entity2-edit-view.module#Entity2EditViewModule'
},
{
path: 'exapmple_examplemain8editview',
loadChildren: '@pages/exapmple/example-main8-edit-view/example-main8-edit-view.module#ExampleMain8EditViewModule'
},
{
path: 'exapmple_examplemain4editview',
loadChildren: '@pages/exapmple/example-main4-edit-view/example-main4-edit-view.module#ExampleMain4EditViewModule'
......
......@@ -4,6 +4,7 @@
<li nz-menu-item (click)="onClick('module5_entity5main5editview')">表单5</li>
<li nz-menu-item (click)="onClick('module4_entity4main7editview')">111111</li>
<li nz-menu-item (click)="onClick('exapmple_examplemain3editview')">模拟</li>
<li nz-menu-item (click)="onClick('module3_entity3main9editview')">表单9</li>
<li nz-menu-item (click)="onClick('module_entityeditview')">实体编辑视图</li>
<li nz-menu-item (click)="onClick('exapmple_exampleeditortype')">基础编辑器</li>
<li nz-menu-item (click)="onClick('exapmple_exampleeditview')">基础表单项</li>
......@@ -16,6 +17,7 @@
<li nz-menu-item (click)="onClick('exapmple_exampledlfeditview')">表单项动态逻辑示例</li>
<li nz-menu-item (click)="onClick('exapmple_examplemain5editview')">表单5</li>
<li nz-menu-item (click)="onClick('module2_entity2editview')">实体2编辑视图</li>
<li nz-menu-item (click)="onClick('exapmple_examplemain8editview')">表单8</li>
<li nz-menu-item (click)="onClick('exapmple_examplemain4editview')">表单4</li>
</ul>
</nz-sider>
......
<div style="background: #fff;height: 100%;padding: 16px;overflow: auto;">
<main8-form (dataChangeEvent)="onFormDataChange($event)"></main8-form></div>
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { RouterModule } from '@angular/router';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { EditFormModule } from '@widgets/example/main8/main8.module';
import { ExampleMain8EditViewPage } from './example-main8-edit-view';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: ExampleMain8EditViewPage,
data: { name: 'exapmple_examplemain8editview' }
}
])
],
exports: [ RouterModule ]
})
export class ExampleMain8EditViewRouteModule {}
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
ExampleMain8EditViewRouteModule,
EditFormModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [ExampleMain8EditViewPage],
entryComponents: [ExampleMain8EditViewPage],
exports: [ExampleMain8EditViewPage]
})
export class ExampleMain8EditViewModule {}
import { Component } from '@angular/core';
import { Subject, Unsubscribable } from 'rxjs';
@Component({
selector: 'view-example-main8-edit-view',
templateUrl: './example-main8-edit-view.html',
styleUrls: ['./example-main8-edit-view.less']
})
export class ExampleMain8EditViewPage {
/**
* 表单数据变化
*
* @param {*} $event
* @memberof BookTestEditViewPage
*/
public onFormDataChange($event: any) {
console.log($event);
}
}
<div style="background: #fff;height: 100%;padding: 16px;overflow: auto;">
<main9-form (dataChangeEvent)="onFormDataChange($event)"></main9-form></div>
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { RouterModule } from '@angular/router';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { EditFormModule } from '@widgets/entity3/main9/main9.module';
import { Entity3Main9EditViewPage } from './entity3-main9-edit-view';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: Entity3Main9EditViewPage,
data: { name: 'module3_entity3main9editview' }
}
])
],
exports: [ RouterModule ]
})
export class Entity3Main9EditViewRouteModule {}
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
Entity3Main9EditViewRouteModule,
EditFormModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [Entity3Main9EditViewPage],
entryComponents: [Entity3Main9EditViewPage],
exports: [Entity3Main9EditViewPage]
})
export class Entity3Main9EditViewModule {}
import { Component } from '@angular/core';
import { Subject, Unsubscribable } from 'rxjs';
@Component({
selector: 'view-entity3-main9-edit-view',
templateUrl: './entity3-main9-edit-view.html',
styleUrls: ['./entity3-main9-edit-view.less']
})
export class Entity3Main9EditViewPage {
/**
* 表单数据变化
*
* @param {*} $event
* @memberof BookTestEditViewPage
*/
public onFormDataChange($event: any) {
console.log($event);
}
}
<form nz-form nz-row class="app-form">
<div nz-row>
<nz-tabset>
<nz-tab [nzTitle]="formpage1Template">
<ng-template #formpage1Template>
基本信息
</ng-template>
<div nz-col [ngClass]="{ hidden: !detailsModel.group1.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-card [nzBordered]="false" nzTitle="实体3基本信息" class="app-form-group">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem[1].required" style="width: 130px;">标签</nz-form-label>
<nz-form-label [nzRequired]="rules.formitem[1].required" style="width: 130px;"></nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem.validateStatus" [nzErrorTip]="detailsModel.formitem.error">
<input nz-input name="formitem" type="password" [ngModel]="data.formitem" [disabled]="detailsModel.formitem.disabled" placeholder="请输入..." (ngModelChange)="onFormDataChange('formitem', $event)" style=""/> </nz-form-control>
</nz-form-item >
</div>
</div>
</nz-card>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem2.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem2.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem2[1].required" style="width: 130px;">新标签</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem2.validateStatus" [nzErrorTip]="detailsModel.formitem2.error">
<span name="formitem2" style="">{{ data.formitem2 }}</span> </nz-form-control>
</nz-form-item >
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.entity3name.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.entity3name.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.entity3name[1].required" style="width: 130px;">实体3名称</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.entity3name.validateStatus" [nzErrorTip]="detailsModel.entity3name.error">
<input nz-input name="entity3name" [ngModel]="data.entity3name" [disabled]="detailsModel.entity3name.disabled" placeholder="请输入..." (ngModelChange)="onFormDataChange('entity3name', $event)" style=""/> </nz-form-control>
</nz-form-item >
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.button1.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<button class="" nz-button nzType="primary" (click)="button1_click($event)" style="">
<span ></span>
</button>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.entity3id.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.entity3id.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.entity3id[1].required" style="width: 130px;">实体3标识</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.entity3id.validateStatus" [nzErrorTip]="detailsModel.entity3id.error">
<span name="entity3id" style="">{{ data.entity3id }}</span> </nz-form-control>
</nz-form-item >
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.rawitem1.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<div class="" style="">
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel1.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel2.visible }" style='' [nzSm]="{ span: 6, offset: 0 }" [nzMd]="{ span: 6, offset: 0 }" [nzLg]="{ span: 6, offset: 0 }" [nzXl]="{ span: 6, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem3.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem3.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem3[1].required" style="width: 130px;"></nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem3.validateStatus" [nzErrorTip]="detailsModel.formitem3.error">
<app-checkbox-list [value]="data.formitem3" [disabled]="detailsModel.formitem3.disabled" (onFormItemValueChange)="onFormDataChange('formitem3', $event)"></app-checkbox-list> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel3.visible }" style='' [nzSm]="{ span: 6, offset: 0 }" [nzMd]="{ span: 6, offset: 0 }" [nzLg]="{ span: 6, offset: 0 }" [nzXl]="{ span: 6, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem5.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem5.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem5[1].required" style="width: 130px;">密码</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem5.validateStatus" [nzErrorTip]="detailsModel.formitem5.error">
<input nz-input name="formitem5" type="password" [ngModel]="data.formitem5" [disabled]="detailsModel.formitem5.disabled" placeholder="请输入..." (ngModelChange)="onFormDataChange('formitem5', $event)" style=""/> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel4.visible }" style='' [nzSm]="{ span: 6, offset: 0 }" [nzMd]="{ span: 6, offset: 0 }" [nzLg]="{ span: 6, offset: 0 }" [nzXl]="{ span: 6, offset: 0 }">
<div nz-row>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel5.visible }" style='' [nzSm]="{ span: 6, offset: 0 }" [nzMd]="{ span: 6, offset: 0 }" [nzLg]="{ span: 6, offset: 0 }" [nzXl]="{ span: 6, offset: 0 }">
<div nz-row>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem6.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem6.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem6[1].required" style="width: 130px;">密码</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem6.validateStatus" [nzErrorTip]="detailsModel.formitem6.error">
</nz-form-control>
<input nz-input name="formitem" [ngModel]="data.formitem" [disabled]="detailsModel.formitem.disabled" placeholder="请输入..." (ngModelChange)="onFormDataChange('formitem', $event)" style=""/> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
</nz-tab>
<nz-tab [nzTitle]="formpage2Template">
<ng-template #formpage2Template>
其它
</ng-template>
<div nz-col [ngClass]="{ hidden: !detailsModel.group2.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-card [nzBordered]="false" nzTitle="操作信息" class="app-form-group">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel6.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel7.visible }" style='' [nzSm]="{ span: 8, offset: 0 }" [nzMd]="{ span: 8, offset: 0 }" [nzLg]="{ span: 8, offset: 0 }" [nzXl]="{ span: 8, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.updatedate.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.updatedate.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.updatedate[1].required" style="width: 130px;">更新时间</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.updatedate.validateStatus" [nzErrorTip]="detailsModel.updatedate.error">
<span name="updatedate" style="">{{ data.updatedate }}</span> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel8.visible }" style='' [nzSm]="{ span: 8, offset: 0 }" [nzMd]="{ span: 8, offset: 0 }" [nzLg]="{ span: 8, offset: 0 }" [nzXl]="{ span: 8, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.createdate.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.createdate.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.createdate[1].required" style="width: 130px;">建立时间</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.createdate.validateStatus" [nzErrorTip]="detailsModel.createdate.error">
<span name="createdate" style="">{{ data.createdate }}</span> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.grouppanel9.visible }" style='' [nzSm]="{ span: 8, offset: 0 }" [nzMd]="{ span: 8, offset: 0 }" [nzLg]="{ span: 8, offset: 0 }" [nzXl]="{ span: 8, offset: 0 }">
<div nz-row>
<div nz-col [ngClass]="{ hidden: !detailsModel.updateman.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.updateman.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.updateman[1].required" style="width: 130px;">更新人</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.updateman.validateStatus" [nzErrorTip]="detailsModel.updateman.error">
<span name="updateman" style="">{{ data.updateman }}</span> </nz-form-control>
</nz-form-item >
</div>
</div>
</div>
</div>
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.createman.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.createman.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.createman[1].required" style="width: 130px;">建立人</nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.createman.validateStatus" [nzErrorTip]="detailsModel.createman.error">
<span name="createman" style="">{{ data.createman }}</span> </nz-form-control>
</nz-form-item >
</div>
<div nz-col [ngClass]="{ hidden: !detailsModel.formitem4.visible }" style='' [nzLg]="{ span: 24, offset: 0 }">
<nz-form-item [nzFlex]="true" [ngClass]="[(detailsModel.formitem4.validateStatus == 'error') ? '' : 'no-error']">
<nz-form-label [nzRequired]="rules.formitem4[1].required" style="width: 130px;"></nz-form-label>
<nz-form-control style="flex-grow: 1;" [nzValidateStatus]="detailsModel.formitem4.validateStatus" [nzErrorTip]="detailsModel.formitem4.error">
<span name="formitem4" style="">{{ data.formitem4 }}</span> </nz-form-control>
</nz-form-item >
</div>
</div>
</nz-card>
</div>
</nz-tab>
</nz-tabset>
</div>
</form>
\ No newline at end of file
......@@ -62,8 +62,6 @@ export class EditForm implements OnInit {
* @memberof Main
*/
public codelistModel: any = {
'SysOperator': [
]
};
/**
......@@ -106,57 +104,13 @@ export class EditForm implements OnInit {
{ required: false, type: 'string', message: ' 值不能为空' },
],
formitem: [
{ type: 'string', message: '标签 值必须为字符串类型' },
{ required: false, type: 'string', message: '标签 值不能为空' },
],
formitem2: [
{ type: 'string', message: '新标签 值必须为字符串类型' },
{ required: false, type: 'string', message: '新标签 值不能为空' },
],
entity3name: [
{ type: 'string', message: '实体3名称 值必须为字符串类型' },
{ required: false, type: 'string', message: '实体3名称 值不能为空' },
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
entity3id: [
{ type: 'string', message: '实体3标识 值必须为字符串类型' },
{ required: false, type: 'string', message: '实体3标识 值不能为空' },
],
formitem1: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
formitem3: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
formitem5: [
{ type: 'string', message: '密码 值必须为字符串类型' },
{ required: false, type: 'string', message: '密码 值不能为空' },
],
formitem6: [
{ type: 'string', message: '密码 值必须为字符串类型' },
{ required: false, type: 'string', message: '密码 值不能为空' },
],
updatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型' },
{ required: false, type: 'string', message: '更新时间 值不能为空' },
],
createdate: [
{ type: 'string', message: '建立时间 值必须为字符串类型' },
{ required: false, type: 'string', message: '建立时间 值不能为空' },
],
updateman: [
{ type: 'string', message: '更新人 值必须为字符串类型' },
{ required: false, type: 'string', message: '更新人 值不能为空' },
],
createman: [
{ type: 'string', message: '建立人 值必须为字符串类型' },
{ required: false, type: 'string', message: '建立人 值不能为空' },
],
formitem4: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
}
/**
......@@ -166,35 +120,7 @@ export class EditForm implements OnInit {
* @memberof Main
*/
public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '实体3基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
button1: new FormButtonModel({ caption: '', detailType: 'BUTTON', name: 'button1', visible: true, isShowCaption: true, form: this })
,
rawitem1: new FormRowItemModel({ caption: '', detailType: 'RAWITEM', name: 'rawitem1', visible: true, isShowCaption: true, form: this })
,
grouppanel2: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel2', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel3: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel3', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel4: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel4', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel5: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel5', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel1: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
grouppanel7: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel7', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel8: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel8', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel9: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel9', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
grouppanel6: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel6', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
group2: new FormGroupPanelModel({ caption: '操作信息', detailType: 'GROUPPANEL', name: 'group2', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', extractMode: 'ITEM', details: [] } })
,
formpage2: new FormPageModel({ caption: '其它', detailType: 'FORMPAGE', name: 'formpage2', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
......@@ -212,33 +138,10 @@ export class EditForm implements OnInit {
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem: new FormItemModel({ caption: '标签', detailType: 'FORMITEM', name: 'formitem', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem2: new FormItemModel({ caption: '新标签', detailType: 'FORMITEM', name: 'formitem2', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
entity3name: new FormItemModel({ caption: '实体3名称', detailType: 'FORMITEM', name: 'entity3name', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
formitem: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
entity3id: new FormItemModel({ caption: '实体3标识', detailType: 'FORMITEM', name: 'entity3id', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem1: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem1', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem3: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem3', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem5: new FormItemModel({ caption: '密码', detailType: 'FORMITEM', name: 'formitem5', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem6: new FormItemModel({ caption: '密码', detailType: 'FORMITEM', name: 'formitem6', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
updatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'updatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
createdate: new FormItemModel({ caption: '建立时间', detailType: 'FORMITEM', name: 'createdate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
updateman: new FormItemModel({ caption: '更新人', detailType: 'FORMITEM', name: 'updateman', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
formitem4: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem4', visible: true, isShowCaption: true, form: this, disabled: 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 }] }),
};
/**
......@@ -259,16 +162,6 @@ export class EditForm implements OnInit {
this.validateFormItem(field.name);
}
});
}
/**
* 事件触发
*
* @param {*} $event
* @memberof EditForm
*/
public button1_click($event: any) {
}
/**
......@@ -350,30 +243,5 @@ export class EditForm implements OnInit {
}
}
\ No newline at end of file
<form nz-form nz-row class="app-form">
<div nz-row>
<nz-tabset>
</nz-tabset>
</div>
</form>
\ No newline at end of file
// this is less
.hidden {
display: none;
}
.app-form {
.app-form-group {
height: 100%;
/deep/ .ant-card-body {
height: calc(100% - 58px);
}
}
.no-error {
margin-bottom: 24px;
}
/deep/ .ant-tabs-tabpane {
padding: 0 16px;
}
}
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { RouterModule } from '@angular/router';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { EditForm } from './main9';
import { AppTimePickerModule } from '@components/app-time-picker/app-time-picker.module';
import { AppDatePickerModule } from '@components/app-date-picker/app-date-picker.module';
import { AppSelectModule } from '@components/app-select/app-select.module';
import { AppRadioModule } from '@components/app-radio/app-radio.module';
import { AppCheckboxListModule } from '@components/app-checkbox-list/app-checkbox-list.module';
import { AppCheckboxModule } from '@components/app-checkbox/app-checkbox.module';
import { AppImageUploadModule } from '@components/app-image-upload/app-image-upload.module';
import { AppFileUploadModule } from '@components/app-file-upload/app-file-upload.module';
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
AppDatePickerModule,
AppTimePickerModule,
AppSelectModule,
AppRadioModule,
AppCheckboxListModule,
AppCheckboxModule,
AppImageUploadModule,
AppFileUploadModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [EditForm],
exports: [EditForm]
})
export class EditFormModule { }
import { Component, OnInit, Input, Output, EventEmitter, ViewContainerRef, ViewChild, OnDestroy, AfterViewInit } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { Util } from '@global/util/util';
import { NzModalService } from 'ng-zorro-antd/modal';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@global/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
@Component({
selector: 'main9-form',
templateUrl: './main9.html',
styleUrls: ['./main9.less'],
})
export class EditForm implements OnInit {
constructor(private $util: Util) {
}
/**
* 数据对象
*
* @type {*}
* @memberof EditForm
*/
@Input()
set formData(val: any) {
if (val) {
this.data = JSON.parse(JSON.stringify(val));
this.formLogic('', null, null);
}
}
/**
* 表单数据对象
*
* @type {*}
* @memberof EditForm
*/
public data: any = {};
/**
* 表单数据变化
*
* @type {Subject<any>}
* @memberof EditForm
*/
public formDataChange: Subject<any> = new Subject<any>();
/**
* 表单数据变化抛出事件
*
* @type {EventEmitter<any>}
* @memberof EditForm
*/
@Output() dataChangeEvent: EventEmitter<any> = new EventEmitter<any>();
/**
* 代码表模型
*
* @type {*}
* @memberof Main9
*/
public codelistModel: any = {
};
/**
* 属性值规则
*
* @type {*}
* @memberof Main9
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型' },
{ required: false, type: 'string', message: '更新时间 值不能为空' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfkey: [
{ type: 'string', message: '实体3标识 值必须为字符串类型' },
{ required: false, type: 'string', message: '实体3标识 值不能为空' },
],
srfmajortext: [
{ type: 'string', message: '实体3名称 值必须为字符串类型' },
{ required: false, type: 'string', message: '实体3名称 值不能为空' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
entity3id: [
{ type: 'string', message: '实体3标识 值必须为字符串类型' },
{ required: false, type: 'string', message: '实体3标识 值不能为空' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Main9
*/
public detailsModel: any = {
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '实体3标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '实体3名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
entity3id: new FormItemModel({ caption: '实体3标识', detailType: 'FORMITEM', name: 'entity3id', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
};
/**
* 生命周期
*
* @memberof EditForm
*/
ngOnInit(): void {
this.formLogic('', null, null);
this.formDataChange.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe(data => {
this.dataChangeEvent.emit(JSON.parse(data.data));
const field = data.field;
if (field) {
this.formLogic(field.name, field.value, field.oldVal);
this.validateFormItem(field.name);
}
});
}
/**
* 表单项值变化事件
*
* @param {{name: string, value: any}} {name, value}
* @memberof EditForm
*/
public onFormDataChange(name: string, value: any): void {
if (Object.is(this.data[name], value)) {
return;
}
let oldVal: any = this.data[name];
this.data[name] = value;
this.formDataChange.next({ data: JSON.stringify(this.data), field: { name: name, value: value, oldVal: oldVal } });
}
/**
* 校验表单项
*
* @param {string} name
* @memberof EditForm
*/
public validateFormItem(name: string) {
if (!name) {
return;
}
const rule: any[] = this.rules[name];
let message = '';
let status = '';
const val: any = this.data[name];
rule.every((rule: any) => {
if (rule.required && (!val || Object.is(val, '')) ) {
message = rule.message;
status = 'error';
return false;
} else if (val && rule.pattern && !rule.pattern.test(val)) {
message = rule.message;
status = 'error';
return false;
}
return true;
});
this.detailsModel[name].error = message;
this.detailsModel[name].validateStatus = status;
}
/**
* 获取代码表集合
*
* @param {string} name
* @memberof EditForm
*/
public getCodeList(name: string) {
if (!name || !this.codelistModel[name]) {
return [];
}
return this.codelistModel[name];
}
/**
* 表单逻辑
*
* @param {string} name
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
public formLogic(name: string, newVal: any, oldVal: any) {
}
}
\ No newline at end of file
<form nz-form nz-row class="app-form">
<div nz-row>
<nz-tabset>
</nz-tabset>
</div>
</form>
\ No newline at end of file
// this is less
.hidden {
display: none;
}
.app-form {
.app-form-group {
height: 100%;
/deep/ .ant-card-body {
height: calc(100% - 58px);
}
}
.no-error {
margin-bottom: 24px;
}
/deep/ .ant-tabs-tabpane {
padding: 0 16px;
}
}
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { RouterModule } from '@angular/router';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { EditForm } from './main8';
import { AppTimePickerModule } from '@components/app-time-picker/app-time-picker.module';
import { AppDatePickerModule } from '@components/app-date-picker/app-date-picker.module';
import { AppSelectModule } from '@components/app-select/app-select.module';
import { AppRadioModule } from '@components/app-radio/app-radio.module';
import { AppCheckboxListModule } from '@components/app-checkbox-list/app-checkbox-list.module';
import { AppCheckboxModule } from '@components/app-checkbox/app-checkbox.module';
import { AppImageUploadModule } from '@components/app-image-upload/app-image-upload.module';
import { AppFileUploadModule } from '@components/app-file-upload/app-file-upload.module';
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
AppDatePickerModule,
AppTimePickerModule,
AppSelectModule,
AppRadioModule,
AppCheckboxListModule,
AppCheckboxModule,
AppImageUploadModule,
AppFileUploadModule
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [EditForm],
exports: [EditForm]
})
export class EditFormModule { }
import { Component, OnInit, Input, Output, EventEmitter, ViewContainerRef, ViewChild, OnDestroy, AfterViewInit } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { NzNotificationService } from 'ng-zorro-antd/notification';
import { Util } from '@global/util/util';
import { NzModalService } from 'ng-zorro-antd/modal';
import { FormButtonModel, FormPageModel, FormItemModel, FormDRUIPartModel, FormPartModel, FormGroupPanelModel, FormIFrameModel, FormRowItemModel, FormTabPageModel, FormTabPanelModel, FormUserControlModel } from '@global/model/form-detail';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
@Component({
selector: 'main8-form',
templateUrl: './main8.html',
styleUrls: ['./main8.less'],
})
export class EditForm implements OnInit {
constructor(private $util: Util) {
}
/**
* 数据对象
*
* @type {*}
* @memberof EditForm
*/
@Input()
set formData(val: any) {
if (val) {
this.data = JSON.parse(JSON.stringify(val));
this.formLogic('', null, null);
}
}
/**
* 表单数据对象
*
* @type {*}
* @memberof EditForm
*/
public data: any = {};
/**
* 表单数据变化
*
* @type {Subject<any>}
* @memberof EditForm
*/
public formDataChange: Subject<any> = new Subject<any>();
/**
* 表单数据变化抛出事件
*
* @type {EventEmitter<any>}
* @memberof EditForm
*/
@Output() dataChangeEvent: EventEmitter<any> = new EventEmitter<any>();
/**
* 代码表模型
*
* @type {*}
* @memberof Main8
*/
public codelistModel: any = {
};
/**
* 属性值规则
*
* @type {*}
* @memberof Main8
*/
public rules: any = {
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型' },
{ required: false, type: 'string', message: '更新时间 值不能为空' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfkey: [
{ type: 'string', message: '示例标识 值必须为字符串类型' },
{ required: false, type: 'string', message: '示例标识 值不能为空' },
],
srfmajortext: [
{ type: 'string', message: '示例名称 值必须为字符串类型' },
{ required: false, type: 'string', message: '示例名称 值不能为空' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型' },
{ required: false, type: 'string', message: ' 值不能为空' },
],
exampleid: [
{ type: 'string', message: '示例标识 值必须为字符串类型' },
{ required: false, type: 'string', message: '示例标识 值不能为空' },
],
}
/**
* 详情模型集合
*
* @type {*}
* @memberof Main8
*/
public detailsModel: any = {
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '示例名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
exampleid: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'exampleid', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
};
/**
* 生命周期
*
* @memberof EditForm
*/
ngOnInit(): void {
this.formLogic('', null, null);
this.formDataChange.pipe(
debounceTime(300),
distinctUntilChanged()
).subscribe(data => {
this.dataChangeEvent.emit(JSON.parse(data.data));
const field = data.field;
if (field) {
this.formLogic(field.name, field.value, field.oldVal);
this.validateFormItem(field.name);
}
});
}
/**
* 表单项值变化事件
*
* @param {{name: string, value: any}} {name, value}
* @memberof EditForm
*/
public onFormDataChange(name: string, value: any): void {
if (Object.is(this.data[name], value)) {
return;
}
let oldVal: any = this.data[name];
this.data[name] = value;
this.formDataChange.next({ data: JSON.stringify(this.data), field: { name: name, value: value, oldVal: oldVal } });
}
/**
* 校验表单项
*
* @param {string} name
* @memberof EditForm
*/
public validateFormItem(name: string) {
if (!name) {
return;
}
const rule: any[] = this.rules[name];
let message = '';
let status = '';
const val: any = this.data[name];
rule.every((rule: any) => {
if (rule.required && (!val || Object.is(val, '')) ) {
message = rule.message;
status = 'error';
return false;
} else if (val && rule.pattern && !rule.pattern.test(val)) {
message = rule.message;
status = 'error';
return false;
}
return true;
});
this.detailsModel[name].error = message;
this.detailsModel[name].validateStatus = status;
}
/**
* 获取代码表集合
*
* @param {string} name
* @memberof EditForm
*/
public getCodeList(name: string) {
if (!name || !this.codelistModel[name]) {
return [];
}
return this.codelistModel[name];
}
/**
* 表单逻辑
*
* @param {string} name
* @param {*} newVal
* @param {*} oldVal
* @memberof EditForm
*/
public formLogic(name: string, newVal: any, oldVal: any) {
}
}
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册