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

ibizdev提交

上级 d7080fe4
流水线 #1829 已失败 ,包含阶段
此差异已折叠。
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>srv_Default_pub</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
\ No newline at end of file
此差异已折叠。
<?xml version="1.0" encoding="UTF-8"?>
<diagram>
<page_setting>
<direction_horizontal>true</direction_horizontal>
<scale>100</scale>
<paper_size>A4 210 x 297 mm</paper_size>
<top_margin>30</top_margin>
<left_margin>30</left_margin>
<bottom_margin>30</bottom_margin>
<right_margin>30</right_margin>
</page_setting>
<category_index>0</category_index>
<zoom>1.0</zoom>
<x>0</x>
<y>0</y>
<default_color>
<r>128</r>
<g>128</g>
<b>192</b>
</default_color>
<color>
<r>255</r>
<g>255</g>
<b>255</b>
</color>
<font_name>Microsoft YaHei UI</font_name>
<font_size>9</font_size>
<settings>
<database>StandardSQL</database>
<capital>false</capital>
<table_style></table_style>
<notation></notation>
<notation_level>0</notation_level>
<notation_expand_group>false</notation_expand_group>
<view_mode>2</view_mode>
<outline_view_mode>2</outline_view_mode>
<view_order_by>1</view_order_by>
<auto_ime_change>false</auto_ime_change>
<validate_physical_name>true</validate_physical_name>
<use_bezier_curve>false</use_bezier_curve>
<suspend_validator>false</suspend_validator>
<export_setting>
<export_ddl_setting>
<output_path></output_path>
<encoding></encoding>
<line_feed></line_feed>
<is_open_after_saved>true</is_open_after_saved>
<environment_id>null</environment_id>
<category_id>null</category_id>
<ddl_target>
<create_comment>true</create_comment>
<create_foreignKey>true</create_foreignKey>
<create_index>true</create_index>
<create_sequence>true</create_sequence>
<create_table>true</create_table>
<create_tablespace>true</create_tablespace>
<create_trigger>true</create_trigger>
<create_view>true</create_view>
<drop_index>true</drop_index>
<drop_sequence>true</drop_sequence>
<drop_table>true</drop_table>
<drop_tablespace>true</drop_tablespace>
<drop_trigger>true</drop_trigger>
<drop_view>true</drop_view>
<inline_column_comment>true</inline_column_comment>
<inline_table_comment>true</inline_table_comment>
<comment_value_description>true</comment_value_description>
<comment_value_logical_name>false</comment_value_logical_name>
<comment_value_logical_name_description>false</comment_value_logical_name_description>
<comment_replace_line_feed>false</comment_replace_line_feed>
<comment_replace_string></comment_replace_string>
</ddl_target>
</export_ddl_setting>
<export_excel_setting>
<category_id>null</category_id>
<output_path></output_path>
<template></template>
<template_path></template_path>
<used_default_template_lang></used_default_template_lang>
<image_output></image_output>
<is_open_after_saved>true</is_open_after_saved>
<is_put_diagram>true</is_put_diagram>
<is_use_logical_name>true</is_use_logical_name>
</export_excel_setting>
<export_html_setting>
<output_dir></output_dir>
<with_category_image>true</with_category_image>
<with_image>true</with_image>
<is_open_after_saved>true</is_open_after_saved>
</export_html_setting>
<export_image_setting>
<output_file_path></output_file_path>
<category_dir_path></category_dir_path>
<with_category_image>true</with_category_image>
<is_open_after_saved>true</is_open_after_saved>
</export_image_setting>
<export_java_setting>
<java_output></java_output>
<package_name></package_name>
<class_name_suffix></class_name_suffix>
<src_file_encoding></src_file_encoding>
<with_hibernate>false</with_hibernate>
</export_java_setting>
<export_testdata_setting>
<file_encoding></file_encoding>
<file_path></file_path>
<format>0</format>
</export_testdata_setting>
</export_setting>
<category_settings>
<free_layout>false</free_layout>
<show_referred_tables>false</show_referred_tables>
<categories>
</categories>
</category_settings>
<translation_settings>
<use>false</use>
<translations>
</translations>
</translation_settings>
<model_properties>
<id></id>
<height>-1</height>
<width>-1</width>
<font_name>Microsoft YaHei UI</font_name>
<font_size>9</font_size>
<x>50</x>
<y>50</y>
<color>
<r>255</r>
<g>255</g>
<b>255</b>
</color>
<connections>
</connections>
<display>false</display>
<creation_date>2016-09-01 09:10:11</creation_date>
<updated_date>2016-09-01 19:00:53</updated_date>
<model_property>
<name>Project Name</name>
<value></value>
</model_property>
<model_property>
<name>Model Name</name>
<value></value>
</model_property>
<model_property>
<name>Version</name>
<value></value>
</model_property>
<model_property>
<name>Company</name>
<value></value>
</model_property>
<model_property>
<name>Author</name>
<value></value>
</model_property>
</model_properties>
<table_properties>
<schema></schema>
</table_properties>
<environment_setting>
<environment>
<id>0</id>
<name>Default</name>
</environment>
</environment_setting>
</settings>
<dictionary>
</dictionary>
<tablespace_set>
</tablespace_set>
<contents>
</contents>
<column_groups>
</column_groups>
<test_data_list>
</test_data_list>
<sequence_set>
</sequence_set>
<trigger_set>
</trigger_set>
<change_tracking_list>
</change_tracking_list>
</diagram>
\ No newline at end of file
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"test": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "less"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/test",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "./node_modules/@ant-design/icons-angular/src/inline-svg/",
"output": "/assets/"
}
],
"styles": [
"src/styles.less"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "test:build",
"host": "0.0.0.0",
"port": 8100,
"proxyConfig": "./proxy.config.json"
},
"configurations": {
"production": {
"browserTarget": "test:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "test:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.less"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "test:serve"
},
"configurations": {
"production": {
"devServerTarget": "test:serve:production"
}
}
}
}
}
},
"defaultProject": "test"
}
\ No newline at end of file
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
\ No newline at end of file
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
\ No newline at end of file
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to test!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get(browser.baseUrl) as Promise<any>;
}
getTitleText() {
return element(by.css('app-root h1')).getText() as Promise<string>;
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/test'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
{
"name": "test",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.2.0",
"@angular/common": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
"@angular/forms": "~8.2.0",
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"font-awesome": "^4.7.0",
"ng-zorro-antd": "^8.1.2",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.802.1",
"@angular/cli": "~8.2.1",
"@angular/compiler-cli": "~8.2.0",
"@angular/language-service": "~8.2.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}
}
{
"/": {
"target": "http://127.0.0.1:8080/AngularR6"
}
}
\ No newline at end of file
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { AppComponent } from './app.component';
const routes: Routes = [
{
path: '',
children: [
{
path: 'exapmple_exampleeditortype',
loadChildren: '@pages/exapmple/example-editor-type/example-editor-type.module#ExampleEditorTypeModule'
},
{
path: 'exapmple_exampleeditview',
loadChildren: '@pages/exapmple/example-edit-view/example-edit-view.module#ExampleEditViewModule'
},
{
path: 'exapmple_exampledlfeditview',
loadChildren: '@pages/exapmple/example-dlfedit-view/example-dlfedit-view.module#ExampleDLFEditViewModule'
},
]
},
{
path: '**',
redirectTo: '',
pathMatch: 'full'
}
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules, useHash: true })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
<nz-layout class="app-layout">
<nz-sider>
<ul nz-menu nzMode="inline" nzTheme="dark">
<li nz-menu-item (click)="onClick('exapmple_exampleeditortype')">基础编辑器</li>
<li nz-menu-item (click)="onClick('exapmple_exampleeditview')">基础表单项</li>
<li nz-menu-item (click)="onClick('exapmple_exampledlfeditview')">表单项动态逻辑示例</li>
</ul>
</nz-sider>
<nz-content>
<router-outlet></router-outlet>
</nz-content>
</nz-layout>
\ No newline at end of file
.app-layout {
height: 100%;
> .ant-layout-content {
height: 100%;
padding: 16px;
}
}
\ No newline at end of file
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'test'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('test');
});
it('should render title in a h1 tag', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to test!');
});
});
import { Component } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent {
/**
* 构造方法
* @param {Router} $router
* @memberof AppComponent
*/
constructor(private $router: Router) { }
/**
*点击菜单
*
* @param {*} name
* @memberof AppComponent
*/
public onClick(name) {
this.$router.navigate([name]);
}
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NgZorroAntdModule, NZ_I18N, zh_CN } from 'ng-zorro-antd';
import { FormsModule } from '@angular/forms';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
registerLocaleData(zh);
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
NgZorroAntdModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule
],
providers: [{ provide: NZ_I18N, useValue: zh_CN }],
bootstrap: [AppComponent]
})
export class AppModule { }
<nz-checkbox-group [ngModel]="items" [nzDisabled]="disabled" (ngModelChange)="onValueChange()" [ngStyle]="{width: width + 'px'}"></nz-checkbox-group>
\ No newline at end of file
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppCheckboxList } from './app-checkbox-list';
@NgModule({
imports: [
NzCheckboxModule,
CommonModule,
FormsModule,
],
declarations: [AppCheckboxList],
exports: [AppCheckboxList]
})
export class AppCheckboxListModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-checkbox-list',
templateUrl: './app-checkbox-list.html',
styleUrls: ['./app-checkbox-list.less']
})
export class AppCheckboxList implements OnInit {
/**
* 值项
*
* @memberof AppCheckboxList
*/
@Input()
set value(val) {
if (val && this.items.length > 0) {
if (Object.is(this.mode, 'num')) {
let num: number = parseInt(val, 10);
this.items.forEach((item: any) => {
if ((num & item.value) == item.value) {
item.checked = true;
}
});
} else if (!this.mode || Object.is(this.mode, 'str')) {
let datas: any[] = val.split(this.separator ? this.separator : ';');
datas.forEach(data => {
let item = this.items.find((obj) => (obj.value == data));
if (item) {
item.checked = true;
}
});
}
}
}
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppCheckboxList
*/
@Input() public disabled: boolean = false;
/**
* 代码表
*
* @type {any[]}
* @memberof AppCheckboxList
*/
@Input() codeList: any[];
/**
* 值项
*
* @type {*}
* @memberof AppCheckboxList
*/
public itemValue: any = null;
/**
* 代码表项集合
*
* @type {any[]}
* @memberof AppCheckboxList
*/
public items: any[] = [];
/**
* 宽度
*
* @type {*}
* @memberof AppCheckboxList
*/
@Input() public width: any;
/**
* 模式(数字或者字符串)
*
* @type {*}
* @memberof AppCheckboxList
*/
@Input() mode: any;
/**
* 分隔符
*
* @type {*}
* @memberof AppCheckBox
*/
@Input() separator: any;
/**
* 表单项之变化事件
*
* @memberof AppCheckboxList
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppCheckboxList
*/
public ngOnInit(): void {
if (this.codeList) {
let datas = JSON.parse(JSON.stringify(this.codeList));
this.items = datas.map(data => {
return { ...data, checked: false, label: data.text };
});
}
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppCheckboxList
*/
public onValueChange() {
let data = null;
if (Object.is(this.mode, 'num')) {
this.items.forEach(item => {
if (!item.checked) {
return;
}
data = 0 | parseInt(item.value, 10);
});
} else if (!this.mode || Object.is(this.mode, 'str')) {
let datas: any[] = [];
this.items.forEach(item => {
if (!item.checked) {
return;
}
datas.push(item.value);
});
data = datas.join(this.separator ? this.separator : ';');
}
console.log(data);
this.onFormItemValueChange.emit(data);
}
}
<label nz-checkbox [ngModel]="itemValue" [disabled]="disabled" (ngModelChange)="onValueChange($event)"></label>
\ No newline at end of file
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppCheckbox } from './app-checkbox';
@NgModule({
imports: [
NzCheckboxModule,
CommonModule,
FormsModule,
],
declarations: [AppCheckbox],
exports: [AppCheckbox]
})
export class AppCheckboxModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-checkbox',
templateUrl: './app-checkbox.html',
styleUrls: ['./app-checkbox.less']
})
export class AppCheckbox implements OnInit {
/**
* 名称
*
* @type {string}
* @memberof AppCheckbox
*/
@Input() name: string;
/**
* 禁用
*
* @type {boolean}
* @memberof AppCheckbox
*/
@Input() disabled: boolean;
/**
* 值项
*
* @memberof AppCheckbox
*/
@Input()
set value(val) {
this.itemValue = (val === 1 ? true : false);
}
/**
* 编辑器值项
*
* @type {number}
* @memberof AppCheckbox
*/
public itemValue: boolean = false;
/**
* 表单项之变化事件
*
* @memberof AppCheckbox
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppCheckbox
*/
ngOnInit(): void {
}
/**
* 值变化
*
* @param {boolean} $event
* @memberof AppCheckbox
*/
public onValueChange($event: boolean) {
let val: number = $event ? 1 : 0;
this.onFormItemValueChange.emit(val);
}
}
<nz-date-picker [ngModel]="value" [nzShowTime]="isShowTime" [nzDisabled]="disabled" [nzPlaceHolder]="placeholder" (ngModelChange)="onValueChange($event)" [nzFormat]="valFormat" [ngStyle]="{width: width + 'px'}"></nz-date-picker>
\ No newline at end of file
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppDatePicker } from './app-date-picker';
@NgModule({
imports: [
NzDatePickerModule,
CommonModule,
FormsModule,
],
declarations: [AppDatePicker],
exports: [AppDatePicker]
})
export class AppDatePickerModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-date-picker',
templateUrl: './app-date-picker.html',
styleUrls: ['./app-date-picker.less']
})
export class AppDatePicker implements OnInit {
/**
* 值项
*
* @memberof AppDatePicker
*/
@Input() public value: any;
/**
* 提示语
*
* @type {string}
* @memberof AppDatePicker
*/
@Input() public placeholder: string = '请选择';
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppDatePicker
*/
@Input() public disabled: boolean;
/**
* 宽度
*
* @type {*}
* @memberof AppDatePicker
*/
@Input() public width: any;
/**
* 值格式
*
* @type {string}
* @memberof AppDatePicker
*/
@Input()
set format(val: string) {
this.valFormat = val;
if (this.valFormat.indexOf('HH') > 0) {
this.isShowTime = true;
}
}
/**
* 显示值格式
*
* @type {string}
* @memberof AppDatePicker
*/
public valFormat: string = 'yyyy-MM-dd';
/**
* 是否可选择时间
*
* @type {boolean}
* @memberof AppDatePicker
*/
public isShowTime: boolean = false;
/**
* 表单项之变化事件
*
* @memberof AppDatePicker
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppDatePicker
*/
public ngOnInit(): void {
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppDatePicker
*/
public onValueChange($event: any) {
let val = this.formatValue($event);
this.onFormItemValueChange.emit(val);
}
/**
* 处理值
*
* @param {Date} date
* @memberof AppDatePicker
*/
public formatValue(date: Date) {
if (!date) {
return null;
}
let data: string = this.valFormat;
let obj: any = {
yyyy: date.getFullYear(),
MM: this.AppendVal(date.getMonth() + 1),
dd: this.AppendVal(date.getDate()),
HH: this.AppendVal(date.getHours()),
mm: this.AppendVal(date.getMinutes()),
ss: this.AppendVal(date.getSeconds())
};
let keys = Object.keys(obj);
keys.forEach(key => {
let val = obj[key];
data = data.replace(key, val);
});
return data;
}
/**
* 值追加
*
* @param {number} val
* @returns
* @memberof AppDatePicker
*/
public AppendVal(val: number) {
return (val < 10 ? '0' + val : val);
}
}
<nz-upload
[nzMultiple]="isMultiple"
[nzAction]="url"
[nzDisabled]="disabled"
[nzFileList]="fileList"
(nzChange)="onChange($event)"
>
<button nz-button><i nz-icon nzType="upload"></i><span>上传文件</span></button>
</nz-upload>
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppFileUpload } from './app-file-upload';
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
],
declarations: [AppFileUpload],
exports: [AppFileUpload]
})
export class AppFileUploadModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-file-upload',
templateUrl: './app-file-upload.html',
styleUrls: ['./app-file-upload.less']
})
export class AppFileUpload implements OnInit {
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppFileUpload
*/
@Input() disabled: boolean;
/**
* 值项
*
* @memberof AppFileUpload
*/
@Input()
set value(val: any) {
if (val) {
this.fileList = JSON.parse(val);
} else {
this.fileList = [];
}
}
/**
* 表单项之变化事件
*
* @memberof AppFileUpload
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 上传地址
*
* @type {string}
* @memberof AppFileUpload
*/
public url: string = 'https://jsonplaceholder.typicode.com/posts/';
/**
* 已上传文件
*
* @type {any[]}
* @memberof AppFileUpload
*/
public fileList: any[] = [];
/**
* 是否支持多选
*
* @type {boolean}
* @memberof AppFileUpload
*/
public isMultiple: boolean = false;
/**
* 生命周期
*
* @memberof AppFileUpload
*/
ngOnInit(): void {
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppFileUpload
*/
public onChange($event) {
if (Object.is($event.type, 'success')) {
let files: any[] = JSON.parse(JSON.stringify(this.fileList));
files.push($event.file);
this.onFormItemValueChange.emit(JSON.stringify(files));
} else if (Object.is($event.type, 'removed')) {
let files: any[] = JSON.parse(JSON.stringify(this.fileList));
let file = $event.file;
let index = files.findIndex((item) => Object.is(item.uid, file.uid));
files.splice(index, 1);
this.onFormItemValueChange.emit(JSON.stringify(files));
}
}
}
<div class="app-image-upload">
<nz-upload
nzShowButton
[nzMultiple]="isMultiple"
[nzAction]="url"
[nzDisabled]="disabled"
nzListType="picture-card"
[nzFileList]="fileList"
[nzShowUploadList]="showUploadList"
[nzPreview]="handlePreview"
(nzChange)="onChange($event)"
>
<i nz-icon nzType="plus"></i>
</nz-upload>
<nz-modal
[nzVisible]="previewVisible"
[nzContent]="modalContent"
[nzFooter]="null"
(nzOnCancel)="previewVisible = false"
>
<ng-template #modalContent>
<img [src]="previewImage" [ngStyle]="{ width: '100%' }" />
</ng-template>
</nz-modal>
</div>
\ No newline at end of file
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppImageUpload } from './app-image-upload';
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
],
declarations: [AppImageUpload],
exports: [AppImageUpload]
})
export class AppImageUploadModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-image-upload',
templateUrl: './app-image-upload.html',
styleUrls: ['./app-image-upload.less']
})
export class AppImageUpload implements OnInit {
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppImageUpload
*/
@Input() disabled: boolean;
/**
* 值项
*
* @memberof AppImageUpload
*/
@Input()
set value(val: any) {
if (val) {
this.fileList = JSON.parse(val);
} else {
this.fileList = [];
}
}
/**
* 表单项之变化事件
*
* @memberof AppImageUpload
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 上传地址
*
* @type {string}
* @memberof AppImageUpload
*/
public url: string = 'https://jsonplaceholder.typicode.com/posts/';
/**
* 已上传文件
*
* @type {any[]}
* @memberof AppImageUpload
*/
public fileList: any[] = [];
/**
* 上传列表配置
*
* @type {*}
* @memberof AppImageUpload
*/
public showUploadList: any = {
showPreviewIcon: true,
showRemoveIcon: true,
hidePreviewIconInNonImage: true
};
/**
* 预览显示
*
* @type {boolean}
* @memberof AppImageUpload
*/
public previewVisible: boolean = false;
/**
* 预览图片地址
*
* @type {string}
* @memberof AppImageUpload
*/
public previewImage: string | undefined = '';
/**
* 是否支持多选
*
* @type {boolean}
* @memberof AppImageUpload
*/
public isMultiple: boolean = false;
/**
* 生命周期
*
* @memberof AppImageUpload
*/
ngOnInit(): void {
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppImageUpload
*/
public onChange($event) {
if (Object.is($event.type, 'success')) {
let files: any[] = JSON.parse(JSON.stringify(this.fileList));
files.push($event.file);
this.onFormItemValueChange.emit(JSON.stringify(files));
} else if (Object.is($event.type, 'removed')) {
let files: any[] = JSON.parse(JSON.stringify(this.fileList));
let file = $event.file;
let index = files.findIndex((item) => Object.is(item.uid, file.uid));
files.splice(index, 1);
this.onFormItemValueChange.emit(JSON.stringify(files));
}
}
/**
* 预览
*
* @param {*} file
* @memberof AppImageUpload
*/
public handlePreview(file: any) {
this.previewImage = file.url || file.thumbUrl;
this.previewVisible = true;
}
}
<nz-radio-group [(ngModel)]="itemValue" (ngModelChange)="onValueChange($event)" [ngStyle]="{width: width + 'px'}">
<label nz-radio *ngFor="let item of items" [nzDisabled]="disabled" [nzValue]="item.value">{{ item.text }}</label>
</nz-radio-group>
\ No newline at end of file
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppRadio } from './app-radio';
@NgModule({
imports: [
NzRadioModule,
CommonModule,
FormsModule,
],
declarations: [AppRadio],
exports: [AppRadio]
})
export class AppRadioModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-radio',
templateUrl: './app-radio.html',
styleUrls: ['./app-radio.less']
})
export class AppRadio implements OnInit {
/**
* 值项
*
* @memberof AppRadio
*/
@Input()
set value(val) {
this.itemValue = val;
}
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppRadio
*/
@Input() public disabled: boolean = false;
/**
* 代码表
*
* @type {any[]}
* @memberof AppCheckboxList
*/
@Input() codeList: any[];
/**
* 值项
*
* @type {*}
* @memberof AppRadio
*/
public itemValue: any = null;
/**
* 代码表项集合
*
* @type {any[]}
* @memberof AppRadio
*/
public items: any[] = [];
/**
* 宽度
*
* @type {*}
* @memberof AppRadio
*/
@Input() public width: any;
/**
* 表单项之变化事件
*
* @memberof AppRadio
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppRadio
*/
public ngOnInit(): void {
if (this.codeList) {
this.items = JSON.parse(JSON.stringify(this.codeList));
}
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppRadio
*/
public onValueChange($event) {
this.onFormItemValueChange.emit($event);
}
}
<nz-select nzAllowClear [nzPlaceHolder]="placeholder" [ngModel]="itemValue" (ngModelChange)="onValueChange($event)" [ngStyle]="{width: width + 'px'}">
<nz-option *ngFor="let item of items" [nzLabel]="item.text" [nzValue]="item.value"></nz-option>
</nz-select>
\ No newline at end of file
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppSelect } from './app-select';
@NgModule({
imports: [
NzSelectModule,
CommonModule,
FormsModule,
],
declarations: [AppSelect],
exports: [AppSelect]
})
export class AppSelectModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-select',
templateUrl: './app-select.html',
styleUrls: ['./app-select.less']
})
export class AppSelect implements OnInit {
/**
* 值项
*
* @memberof AppSelect
*/
@Input()
set value(val) {
this.itemValue = val;
}
/**
* 提示语
*
* @type {string}
* @memberof AppSelect
*/
@Input() public placeholder: string = '请选择';
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppSelect
*/
@Input() public disabled: boolean = false;
/**
* 代码表
*
* @type {any[]}
* @memberof AppCheckboxList
*/
@Input() codeList: any[];
/**
* 值项
*
* @type {*}
* @memberof AppSelect
*/
public itemValue: any = null;
/**
* 代码表项集合
*
* @type {any[]}
* @memberof AppSelect
*/
public items: any[] = [];
/**
* 宽度
*
* @type {*}
* @memberof AppDatePicker
*/
@Input() public width: any;
/**
* 表单项之变化事件
*
* @memberof AppSelect
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppSelect
*/
public ngOnInit(): void {
if (this.codeList) {
this.items = JSON.parse(JSON.stringify(this.codeList));
}
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppSelect
*/
public onValueChange($event) {
this.onFormItemValueChange.emit($event);
}
}
<nz-time-picker [ngModel]="itemValue" [nzDisabled]="disabled" [nzPlaceHolder]="placeholder" (ngModelChange)="onValueChange($event)" [nzFormat]="format" [ngStyle]="{width: width + 'px'}"></nz-time-picker>
\ No newline at end of file
import { NzTimePickerModule } from 'ng-zorro-antd/time-picker';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppTimePicker } from './app-time-picker';
@NgModule({
imports: [
NzTimePickerModule,
CommonModule,
FormsModule,
],
declarations: [AppTimePicker],
exports: [AppTimePicker]
})
export class AppTimePickerModule { }
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-time-picker',
templateUrl: './app-time-picker.html',
styleUrls: ['./app-time-picker.less']
})
export class AppTimePicker implements OnInit {
/**
* 值项
*
* @memberof AppTimePicker
*/
@Input()
set value(val) {
if (!val) {
this.itemValue = null;
return;
}
let data = 'HH:mm:ss';
data = data.replace(this.format, val).replace('HH', '12').replace('mm', '32').replace('ss', '15');
let date = '2019/09/01 ' + data;
this.itemValue = new Date(date);
}
/**
* 提示语
*
* @type {string}
* @memberof AppTimePicker
*/
@Input() public placeholder: string = '请选择';
/**
* 是否禁用
*
* @type {boolean}
* @memberof AppTimePicker
*/
@Input() public disabled: boolean = false;
/**
* 值格式
*
* @type {string}
* @memberof AppTimePicker
*/
@Input() public format: string = 'HH:mm:ss';
/**
* 值项
*
* @type {Date}
* @memberof AppTimePicker
*/
public itemValue: Date = null;
/**
* 宽度
*
* @type {*}
* @memberof AppDatePicker
*/
@Input() public width: any;
/**
* 表单项之变化事件
*
* @memberof AppTimePicker
*/
@Output() public onFormItemValueChange: EventEmitter<any> = new EventEmitter<any>();
/**
* 生命周期
*
* @memberof AppTimePicker
*/
public ngOnInit(): void {
}
/**
* 值变化
*
* @param {*} $event
* @memberof AppTimePicker
*/
public onValueChange($event: any) {
let val = this.formatValue($event);
this.onFormItemValueChange.emit(val);
}
/**
* 处理值
*
* @param {Date} date
* @memberof AppTimePicker
*/
public formatValue(date: Date) {
if (!date) {
return null;
}
let data: string = this.format;
let obj: any = {
HH: this.AppendVal(date.getHours()),
mm: this.AppendVal(date.getMinutes()),
ss: this.AppendVal(date.getSeconds())
};
let keys = Object.keys(obj);
keys.forEach(key => {
let val = obj[key];
data = data.replace(key, val);
});
return data;
}
/**
* 值追加
*
* @param {number} val
* @returns
* @memberof AppTimePicker
*/
public AppendVal(val: number) {
return (val < 10 ? '0' + val : val);
}
}
import { FormDetailModel } from './form-detail';
/**
* 按钮模型
*
* @export
* @class FormButtonModel
* @extends {FormDetailModel}
*/
export class FormButtonModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
/**
* 表单成员模型
*
* @export
* @class FormDetailModel
*/
export class FormDetailModel {
/**
* 成员标题
*
* @type {string}
* @memberof FormDetailModel
*/
public caption: string = '';
/**
* 成员类型
*
* @type {string}
* @memberof FormDetailModel
*/
public detailType: string = '';
/**
* 表单对象
*
* @type {*}
* @memberof FormDetailModel
*/
public form: any = null;
/**
* 成员名称
*
* @type {string}
* @memberof FormDetailModel
*/
public name: string = '';
/**
* 成员是否显示
*
* @type {boolean}
* @memberof FormDetailModel
*/
public visible: boolean = true;
/**
* 成员是否显示标题
*
* @type {boolean}
* @memberof FormDetailModel
*/
public isShowCaption: boolean = true;
/**
* Creates an instance of FormDetailModel.
* FormDetailModel 实例
*
* @param {*} [opts={}]
* @memberof FormDetailModel
*/
constructor(opts: any = {}) {
this.caption = !Object.is(opts.caption, '') ? opts.caption : '';
this.detailType = !Object.is(opts.detailType, '') ? opts.detailType : '';
this.form = opts.form ? opts.form : {};
this.name = !Object.is(opts.name, '') ? opts.name : '';
this.visible = opts.visible ? true : false;
this.isShowCaption = opts.isShowCaption ? true : false;
}
/**
* 设置显示与隐藏
*
* @param {boolean} state
* @memberof FormDetailModel
*/
public setVisible(state: boolean): void {
this.visible = state;
}
/**
* 设置显示标题栏
*
* @param {boolean} state
* @memberof FormDetailModel
*/
public setShowCaption(state: boolean): void {
this.isShowCaption = state;
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 数据关系界面模型
*
* @export
* @class FormDRUIPartModel
* @extends {FormDetailModel}
*/
export class FormDRUIPartModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 分组面板模型
*
* @export
* @class FormGroupPanelModel
* @extends {FormDetailModel}
*/
export class FormGroupPanelModel extends FormDetailModel {
/**
* 实体界面行为组
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public uiActionGroup: any = {};
/**
* Creates an instance of FormGroupPanelModel.
* 创建 FormGroupPanelModel 实例
*
* @param {*} [opts={}]
* @memberof FormGroupPanelModel
*/
constructor(opts: any = {}) {
super(opts);
Object.assign(this.uiActionGroup, opts.uiActionGroup);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 嵌入成员模型
*
* @export
* @class FormIFrameModel
* @extends {FormDetailModel}
*/
export class FormIFrameModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单项模型
*
* @export
* @class FormItemModel
* @extends {FormDetailModel}
*/
export class FormItemModel extends FormDetailModel {
/**
* 是否启用
*
* @type {boolean}
* @memberof FormItemModel
*/
public disabled: boolean = false;
/**
* 错误信息
*
* @type {string}
* @memberof FormItemModel
*/
public error: string = '';
/**
* 校验状态
*
* @memberof FormItemModel
*/
public validateStatus = '';
/**
* 表单项启用条件
*
* 0 不启用
* 1 新建
* 2 更新
* 3 全部启用
*
* @type {(number | 0 | 1 | 2 | 3)}
* @memberof FormItemModel
*/
public enableCond: number | 0 | 1 | 2 | 3 = 3;
/**
* Creates an instance of FormItemModel.
* FormItemModel 实例
*
* @param {*} [opts={}]
* @memberof FormItemModel
*/
constructor(opts: any = {}) {
super(opts);
this.disabled = opts.disabled ? true : false;
this.enableCond = opts.enableCond;
}
/**
* 设置是否启用
*
* @param {boolean} state
* @memberof FormItemModel
*/
public setDisabled(state: boolean): void {
this.disabled = state;
}
/**
* 设置信息内容
*
* @param {string} error
* @memberof FormItemModel
*/
public setError(error: string): void {
this.error = error;
}
/**
* 设置是否启用
*
* @param {string} srfuf
* @memberof FormItemModel
*/
public setEnableCond(srfuf: string): void {
// 是否有权限
const isReadOk: boolean = true;
const _srfuf: number = parseInt(srfuf, 10);
let state: boolean = true;
if (isReadOk) {
if (_srfuf === 1) {
if ((this.enableCond & 2) === 2) {
state = false;
}
} else {
if ((this.enableCond & 1) === 1) {
state = false;
}
}
}
this.setDisabled(state);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单分页模型
*
* @export
* @class FormPageModel
* @extends {FormDetailModel}
*/
export class FormPageModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 表单部件模型
*
* @export
* @class FormPartModel
* @extends {FormDetailModel}
*/
export class FormPartModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 直接内容模型
*
* @export
* @class FormRowItemModel
* @extends {FormDetailModel}
*/
export class FormRowItemModel extends FormDetailModel {
constructor(opts: any = {}) {
super(opts);
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
import { FormTabPanelModel } from './form-tab-panel';
/**
* 分页面板模型
*
* @export
* @class FormTabPageModel
* @extends {FormDetailModel}
*/
export class FormTabPageModel extends FormDetailModel {
/**
* Creates an instance of FormTabPageModel.
* FormTabPageModel 实例
*
* @param {*} [opts={}]
* @memberof FormTabPageModel
*/
constructor(opts: any = {}) {
super(opts);
}
/**
* 设置分页是否启用
*
* @param {boolean} state
* @memberof FormTabPageModel
*/
public setVisible(state: boolean): void {
this.visible = state;
const tabPanel = this.getTabPanelModel();
if (tabPanel) {
tabPanel.setActiviePage();
}
}
/**
* 获取分页面板
*
* @returns {(FormTabPanelModel | null)}
* @memberof FormTabPageModel
*/
public getTabPanelModel(): FormTabPanelModel | null {
if (!this.form) {
return null;
}
const tabPanels: any[] = Object.values(this.form.detailsModel).filter((model: any) => Object.is(model.detailType, 'TABPANEL'));
let index = tabPanels.findIndex((tabPanel: any) => {
return tabPanel.tabPages.some((tabPag: any) => Object.is(tabPag.name, this.name));
});
if (index === -1) {
return null;
}
const tabPanel: FormTabPanelModel = tabPanels[index];
return tabPanel;
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 分页部件模型
*
* @export
* @class FormTabPanelModel
* @extends {FormDetailModel}
*/
export class FormTabPanelModel extends FormDetailModel {
/**
* 被激活分页
*
* @type {string}
* @memberof FormTabPanelModel
*/
public activiedPage: string = '';
/**
* 选中激活状态
*
* @type {string}
* @memberof FormTabPanelModel
*/
public clickActiviePage: string = '';
/**
* 分页子成员
*
* @type {any[]}
* @memberof FormTabPanelModel
*/
public tabPages: any[] = [];
/**
* Creates an instance of FormTabPanelModel.
* FormTabPanelModel 实例
*
* @param {*} [opts={}]
* @memberof FormTabPanelModel
*/
constructor(opts: any = {}) {
super(opts);
this.tabPages = [...opts.tabPages];
if (this.tabPages.length > 0) {
this.activiedPage = this.tabPages[0].name;
}
}
/**
* 设置激活分页
*
* @memberof FormTabPanelModel
*/
public setActiviePage(): void {
if (!this.form) {
return;
}
const detailsModel: any = this.form.detailsModel;
const index = this.tabPages.findIndex((tabpage: any) => Object.is(tabpage.name, this.clickActiviePage) && Object.is(tabpage.name, this.activiedPage) && detailsModel[tabpage.name].visible);
if (index !== - 1) {
return;
}
this.tabPages.some((tabpage: any) => {
if (detailsModel[tabpage.name].visible) {
this.activiedPage = tabpage.name;
return true;
}
return false;
});
}
/**
* 选中页面
*
* @param {*} $event
* @returns {void}
* @memberof FormTabPanelModel
*/
public clickPage($event: any): void {
if (!$event) {
return;
}
this.clickActiviePage = $event;
this.activiedPage = $event;
}
}
\ No newline at end of file
import { FormDetailModel } from './form-detail';
/**
* 用户控件模型
*
* @export
* @class FormUserControlModel
* @extends {FormDetailModel}
*/
export class FormUserControlModel extends FormDetailModel {
constructor(otps:any = {}) {
super(otps);
}
}
\ No newline at end of file
export { FormButtonModel } from './form-button';
export { FormPageModel } from './form-page';
export { FormItemModel } from './form-item';
export { FormDRUIPartModel } from './form-druipart';
export { FormPartModel } from './form-part';
export { FormGroupPanelModel } from './form-group-panel';
export { FormIFrameModel } from './form-iframe';
export { FormRowItemModel } from './form-row-item';
export { FormTabPageModel } from './form-tab-page';
export { FormTabPanelModel } from './form-tab-panel';
export { FormUserControlModel } from './form-user-control';
!!!!模版产生代码错误:Syntax error in template "TEMPLCODE_zh_CN" in line 402, column 29:
Encountered "Date", but was expecting one of:
".."
<DOT_DOT_LESS>
"..*"
"}"
"."
"["
"("
"?"
"!"
<TERMINATING_EXCLAM>
"??"
"+"
"-"
"*"
"/"
"%"
"!="
"="
"=="
">="
<ESCAPED_GTE>
">"
<ESCAPED_GT>
<LESS_THAN_EQUALS>
<LESS_THAN>
<AND>
<OR>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Test</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
<div style="background: #fff;height: 100%;padding: 16px;">
<dynamiclogicform-form (dataChangeEvent)="onFormDataChange($event)"></dynamiclogicform-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/dynamic-logic-form/dynamic-logic-form.module';
import { ExampleDLFEditViewPage } from './example-dlfedit-view';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: ExampleDLFEditViewPage,
data: { name: 'exapmple_exampledlfeditview' }
}
])
],
exports: [ RouterModule ]
})
export class ExampleDLFEditViewRouteModule {}
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
ExampleDLFEditViewRouteModule,
EditFormModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [ExampleDLFEditViewPage],
entryComponents: [ExampleDLFEditViewPage],
exports: [ExampleDLFEditViewPage]
})
export class ExampleDLFEditViewModule {}
import { Component } from '@angular/core';
import { Subject, Unsubscribable } from 'rxjs';
@Component({
selector: 'view-example-dlfedit-view',
templateUrl: './example-dlfedit-view.html',
styleUrls: ['./example-dlfedit-view.less']
})
export class ExampleDLFEditViewPage {
/**
* 表单数据变化
*
* @param {*} $event
* @memberof BookTestEditViewPage
*/
public onFormDataChange($event: any) {
console.log($event);
}
}
<div style="background: #fff;height: 100%;padding: 16px;">
<main-form (dataChangeEvent)="onFormDataChange($event)"></main-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/main/main.module';
import { ExampleEditViewPage } from './example-edit-view';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: ExampleEditViewPage,
data: { name: 'exapmple_exampleeditview' }
}
])
],
exports: [ RouterModule ]
})
export class ExampleEditViewRouteModule {}
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
ExampleEditViewRouteModule,
EditFormModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [ExampleEditViewPage],
entryComponents: [ExampleEditViewPage],
exports: [ExampleEditViewPage]
})
export class ExampleEditViewModule {}
import { Component } from '@angular/core';
import { Subject, Unsubscribable } from 'rxjs';
@Component({
selector: 'view-example-edit-view',
templateUrl: './example-edit-view.html',
styleUrls: ['./example-edit-view.less']
})
export class ExampleEditViewPage {
/**
* 表单数据变化
*
* @param {*} $event
* @memberof BookTestEditViewPage
*/
public onFormDataChange($event: any) {
console.log($event);
}
}
<div style="background: #fff;height: 100%;padding: 16px;">
<alleditortype-form (dataChangeEvent)="onFormDataChange($event)"></alleditortype-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/all-editor-type/all-editor-type.module';
import { ExampleEditorTypePage } from './example-editor-type';
@NgModule({
imports: [
RouterModule.forChild([
{
path: '',
component: ExampleEditorTypePage,
data: { name: 'exapmple_exampleeditortype' }
}
])
],
exports: [ RouterModule ]
})
export class ExampleEditorTypeRouteModule {}
@NgModule({
imports: [
NgZorroAntdModule,
CommonModule,
FormsModule,
ExampleEditorTypeRouteModule,
EditFormModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [ExampleEditorTypePage],
entryComponents: [ExampleEditorTypePage],
exports: [ExampleEditorTypePage]
})
export class ExampleEditorTypeModule {}
import { Component } from '@angular/core';
import { Subject, Unsubscribable } from 'rxjs';
@Component({
selector: 'view-example-editor-type',
templateUrl: './example-editor-type.html',
styleUrls: ['./example-editor-type.less']
})
export class ExampleEditorTypePage {
/**
* 表单数据变化
*
* @param {*} $event
* @memberof BookTestEditViewPage
*/
public onFormDataChange($event: any) {
console.log($event);
}
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册