提交 2529481f 编写于 作者: JunZai's avatar JunZai

update

上级 0dcd915f
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
# 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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
# 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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"$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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
# 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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
// @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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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));
});
});
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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>;
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
// 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
});
};
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"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"
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"/": {
"target": "http://127.0.0.1:8080/AngularR6"
}
}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
.app-layout {
height: 100%;
> .ant-layout-content {
height: 100%;
padding: 16px;
}
}
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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!');
});
});
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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]);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<nz-checkbox-group [ngModel]="items" [nzDisabled]="disabled" (ngModelChange)="onValueChange()" [ngStyle]="{width: width + 'px'}"></nz-checkbox-group>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<label nz-checkbox [ngModel]="itemValue" [disabled]="disabled" (ngModelChange)="onValueChange($event)"></label>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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));
}
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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;
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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 { }
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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);
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
/**
* 表单成员模型
*
* @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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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';
此差异已折叠。
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
<!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>
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
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));
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
此差异已折叠。
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"paths": {
"@pages": ["src/pages"],
"@pages/*": ["src/pages/*"],
"@widgets": ["src/widgets"],
"@widgets/*": ["src/widgets/*"],
"@global": ["src/global"],
"@global/*": ["src/global/*"],
"@assets": ["src/assets"],
"@assets/*": ["src/assets/*"],
"@components": ["src/components"],
"@components/*": ["src/components/*"]
}
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
<#ibiztemplate>
TARGET=PSSYSAPP
</#ibiztemplate>
{
"extends": "tslint:recommended",
"rules": {
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warning"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
false,
"element",
"app",
"kebab-case"
],
"import-blacklist": [
true,
"rxjs/Rx"
],
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
true,
2000
],
"member-access": false,
"member-ordering": [
false,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
false,
"ignore-params"
],
"no-trailing-whitespace": false,
"no-non-null-assertion": true,
"no-redundant-jsdoc": false,
"no-switch-case-fall-through": true,
"no-use-before-declare": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"object-literal-sort-keys": false,
"ordered-imports": false,
"object-literal-shorthand": false,
"prefer-for-of": false,
"prefer-const": false,
"quotemark": [
true,
"single"
],
"indent": [false, "spaces"],
"jsdoc-format": false,
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true,
"forin": false,
"variable-name": {
"options": [
"check-format",
"allow-leading-underscore",
"allow-pascal-case",
"allow-snake-case"
]
}
},
"rulesDirectory": [
"codelyzer"
]
}
\ No newline at end of file
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册