├── .editorconfig ├── .gitignore ├── README.md ├── _config.yml ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── src ├── app │ ├── app.component.html │ ├── app.component.less │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── core │ │ ├── api │ │ │ ├── api.service.spec.ts │ │ │ └── api.service.ts │ │ ├── core.module.spec.ts │ │ ├── core.module.ts │ │ └── menus │ │ │ ├── menus.service.spec.ts │ │ │ └── menus.service.ts │ ├── layout │ │ ├── default │ │ │ ├── breadcrumb │ │ │ │ ├── breadcrumb.component.html │ │ │ │ ├── breadcrumb.component.less │ │ │ │ ├── breadcrumb.component.spec.ts │ │ │ │ └── breadcrumb.component.ts │ │ │ ├── default.component.html │ │ │ ├── default.component.less │ │ │ ├── default.component.spec.ts │ │ │ ├── default.component.ts │ │ │ ├── header │ │ │ │ ├── header.component.html │ │ │ │ ├── header.component.less │ │ │ │ ├── header.component.spec.ts │ │ │ │ └── header.component.ts │ │ │ └── sider │ │ │ │ ├── sider.component.html │ │ │ │ ├── sider.component.less │ │ │ │ ├── sider.component.spec.ts │ │ │ │ └── sider.component.ts │ │ ├── fullscreen │ │ │ ├── fullscreen.component.html │ │ │ ├── fullscreen.component.less │ │ │ ├── fullscreen.component.spec.ts │ │ │ └── fullscreen.component.ts │ │ ├── layout.module.spec.ts │ │ ├── layout.module.ts │ │ └── passport │ │ │ ├── passport.component.html │ │ │ ├── passport.component.less │ │ │ ├── passport.component.spec.ts │ │ │ └── passport.component.ts │ ├── routes │ │ ├── animations │ │ │ ├── animation │ │ │ │ ├── about │ │ │ │ │ ├── about.component.css │ │ │ │ │ ├── about.component.html │ │ │ │ │ ├── about.component.spec.ts │ │ │ │ │ └── about.component.ts │ │ │ │ ├── animation.component.html │ │ │ │ ├── animation.component.less │ │ │ │ ├── animation.component.spec.ts │ │ │ │ ├── animation.component.ts │ │ │ │ ├── animations.ts │ │ │ │ ├── auto-calu │ │ │ │ │ ├── auto-calu.component.css │ │ │ │ │ ├── auto-calu.component.html │ │ │ │ │ ├── auto-calu.component.spec.ts │ │ │ │ │ └── auto-calu.component.ts │ │ │ │ ├── enter-leave │ │ │ │ │ ├── enter-leave.component.css │ │ │ │ │ ├── enter-leave.component.html │ │ │ │ │ ├── enter-leave.component.spec.ts │ │ │ │ │ └── enter-leave.component.ts │ │ │ │ ├── filter │ │ │ │ │ ├── filter.component.css │ │ │ │ │ ├── filter.component.html │ │ │ │ │ ├── filter.component.spec.ts │ │ │ │ │ └── filter.component.ts │ │ │ │ ├── groups │ │ │ │ │ ├── groups.component.css │ │ │ │ │ ├── groups.component.html │ │ │ │ │ ├── groups.component.spec.ts │ │ │ │ │ └── groups.component.ts │ │ │ │ ├── home │ │ │ │ │ ├── home.component.css │ │ │ │ │ ├── home.component.html │ │ │ │ │ ├── home.component.spec.ts │ │ │ │ │ └── home.component.ts │ │ │ │ ├── open-close │ │ │ │ │ ├── open-close.component.html │ │ │ │ │ ├── open-close.component.less │ │ │ │ │ ├── open-close.component.spec.ts │ │ │ │ │ └── open-close.component.ts │ │ │ │ ├── status │ │ │ │ │ ├── status.component.html │ │ │ │ │ ├── status.component.less │ │ │ │ │ ├── status.component.spec.ts │ │ │ │ │ └── status.component.ts │ │ │ │ └── toggle │ │ │ │ │ ├── toggle.component.css │ │ │ │ │ ├── toggle.component.html │ │ │ │ │ ├── toggle.component.spec.ts │ │ │ │ │ └── toggle.component.ts │ │ │ ├── animations-routing.module.ts │ │ │ ├── animations.module.spec.ts │ │ │ └── animations.module.ts │ │ ├── charts │ │ │ ├── charts-routing.module.ts │ │ │ ├── charts.module.spec.ts │ │ │ ├── charts.module.ts │ │ │ └── line │ │ │ │ ├── line.component.html │ │ │ │ ├── line.component.less │ │ │ │ ├── line.component.spec.ts │ │ │ │ └── line.component.ts │ │ ├── experiment │ │ │ ├── demo │ │ │ │ └── demo │ │ │ │ │ ├── demo.component.html │ │ │ │ │ ├── demo.component.less │ │ │ │ │ ├── demo.component.spec.ts │ │ │ │ │ └── demo.component.ts │ │ │ ├── experiment-routing.module.ts │ │ │ ├── experiment.module.spec.ts │ │ │ ├── experiment.module.ts │ │ │ └── warning │ │ │ │ ├── warning.component.html │ │ │ │ ├── warning.component.less │ │ │ │ ├── warning.component.spec.ts │ │ │ │ └── warning.component.ts │ │ ├── index │ │ │ ├── index-routing.module.ts │ │ │ ├── index.module.spec.ts │ │ │ ├── index.module.ts │ │ │ ├── info │ │ │ │ ├── info.component.html │ │ │ │ ├── info.component.less │ │ │ │ ├── info.component.spec.ts │ │ │ │ └── info.component.ts │ │ │ ├── list │ │ │ │ ├── list.component.html │ │ │ │ ├── list.component.less │ │ │ │ ├── list.component.spec.ts │ │ │ │ └── list.component.ts │ │ │ └── services │ │ │ │ ├── info.service.spec.ts │ │ │ │ └── info.service.ts │ │ ├── list │ │ │ ├── list-routing.module.ts │ │ │ ├── list.module.spec.ts │ │ │ ├── list.module.ts │ │ │ ├── table-dynamic │ │ │ │ ├── table-dynamic.component.html │ │ │ │ ├── table-dynamic.component.less │ │ │ │ ├── table-dynamic.component.spec.ts │ │ │ │ └── table-dynamic.component.ts │ │ │ ├── table-list │ │ │ │ ├── table-list.component.html │ │ │ │ ├── table-list.component.less │ │ │ │ ├── table-list.component.spec.ts │ │ │ │ └── table-list.component.ts │ │ │ └── tree │ │ │ │ ├── tree.component.html │ │ │ │ ├── tree.component.less │ │ │ │ ├── tree.component.spec.ts │ │ │ │ └── tree.component.ts │ │ ├── map │ │ │ ├── map-demo │ │ │ │ ├── map-demo.component.html │ │ │ │ ├── map-demo.component.less │ │ │ │ ├── map-demo.component.spec.ts │ │ │ │ └── map-demo.component.ts │ │ │ ├── map-routing.module.ts │ │ │ ├── map.module.spec.ts │ │ │ ├── map.module.ts │ │ │ ├── marker │ │ │ │ ├── marker.component.css │ │ │ │ ├── marker.component.html │ │ │ │ ├── marker.component.spec.ts │ │ │ │ └── marker.component.ts │ │ │ └── start │ │ │ │ ├── start.component.html │ │ │ │ ├── start.component.less │ │ │ │ ├── start.component.spec.ts │ │ │ │ └── start.component.ts │ │ ├── outside │ │ │ ├── html2canvas │ │ │ │ ├── html2canvas.component.html │ │ │ │ ├── html2canvas.component.less │ │ │ │ ├── html2canvas.component.spec.ts │ │ │ │ └── html2canvas.component.ts │ │ │ ├── outside-routing.module.ts │ │ │ ├── outside.module.spec.ts │ │ │ ├── outside.module.ts │ │ │ └── qrious │ │ │ │ ├── qrious.component.html │ │ │ │ ├── qrious.component.less │ │ │ │ ├── qrious.component.spec.ts │ │ │ │ └── qrious.component.ts │ │ ├── passport │ │ │ ├── login │ │ │ │ ├── login.component.html │ │ │ │ ├── login.component.less │ │ │ │ ├── login.component.spec.ts │ │ │ │ └── login.component.ts │ │ │ └── services │ │ │ │ ├── login.service.spec.ts │ │ │ │ └── login.service.ts │ │ ├── routes-routing.module.ts │ │ ├── routes.module.spec.ts │ │ ├── routes.module.ts │ │ └── screen │ │ │ ├── full │ │ │ ├── full.component.html │ │ │ ├── full.component.less │ │ │ ├── full.component.spec.ts │ │ │ └── full.component.ts │ │ │ ├── screen-routing.modules.ts │ │ │ ├── screen.module.spec.ts │ │ │ └── screen.module.ts │ ├── shared │ │ ├── meta │ │ │ ├── dw-date-picker │ │ │ │ ├── dw-date-picker.component.html │ │ │ │ ├── dw-date-picker.component.less │ │ │ │ ├── dw-date-picker.component.spec.ts │ │ │ │ └── dw-date-picker.component.ts │ │ │ ├── dw-info-model │ │ │ │ ├── dw-info-model.component.html │ │ │ │ ├── dw-info-model.component.less │ │ │ │ ├── dw-info-model.component.spec.ts │ │ │ │ └── dw-info-model.component.ts │ │ │ ├── dw-pagination │ │ │ │ ├── dw-pagination.component.html │ │ │ │ ├── dw-pagination.component.less │ │ │ │ ├── dw-pagination.component.spec.ts │ │ │ │ └── dw-pagination.component.ts │ │ │ ├── dw-search │ │ │ │ ├── dw-search.component.html │ │ │ │ ├── dw-search.component.less │ │ │ │ ├── dw-search.component.spec.ts │ │ │ │ └── dw-search.component.ts │ │ │ ├── dw-table-dynamic │ │ │ │ ├── dw-table-dynamic.component.html │ │ │ │ ├── dw-table-dynamic.component.less │ │ │ │ ├── dw-table-dynamic.component.spec.ts │ │ │ │ └── dw-table-dynamic.component.ts │ │ │ └── dw-table │ │ │ │ ├── dw-table.component.html │ │ │ │ ├── dw-table.component.less │ │ │ │ ├── dw-table.component.spec.ts │ │ │ │ └── dw-table.component.ts │ │ ├── shared.module.spec.ts │ │ └── shared.module.ts │ └── styles │ │ ├── icons.less │ │ └── index.less ├── assets │ ├── .gitkeep │ ├── bd │ │ ├── w1-1.png │ │ ├── w1-2.png │ │ ├── w1-3.png │ │ ├── w1-h.png │ │ ├── w1-logo.png │ │ └── w1-sub.png │ ├── icons │ │ ├── logo.png │ │ ├── wechat.JPG │ │ └── welcome_bg.jpg │ └── map │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── 4.png │ │ └── 5.jpg ├── browserslist ├── environments │ ├── environment.local.ts │ ├── environment.prod.ts │ └── environment.ts ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.less ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 鹿途后台管理系统 2 | 3 | 4 | ## [基于Ant Design实现的Angular、Vue通用后台设计框架](https://github.com/ZhouRenYou/SunrayAD) 5 | ## [Live 鹿途后台管理系统](https://deerway.netlify.com/) 6 | #### 项目操作表格功能时,数据变动请关注console 7 | 8 | ## 准备工作 9 | * 安装 angular 环境 10 | * 安装 ng-zorro 依赖 11 | # 项目资源 12 | 13 | ## 模版 14 | 15 | ## [Live 智慧牧场](https://meadow.netlify.com) 16 | ## [Angular6基础框架](https://github.com/ZhouRenYou/ng-project) 17 | 18 | ## 文档 19 | 20 | [博客园——鹿途](https://www.cnblogs.com/zry2510/category/1096539.html) 21 | 22 | [基于qrious生成二维码](https://www.zhourenyou.com/2019/04/26/qrious/) 23 | 24 | [关于开发环境与生产环境跨域](https://www.zhourenyou.com/2019/05/15/angular-cross-domain/) 25 | 26 | [实现鹿途系统在线演示功能的方法](https://www.zhourenyou.com/2019/03/25/ng-page/#more) 27 | 28 | 29 | ## 项目说明 30 | 31 | ## 开始 32 | 33 | ### 创建项目 34 | ` 35 | ng new ng-deerway --style less 36 | ` 37 | 38 | ` 39 | cd ng-deerway 40 | ` 41 | ### 初始化配置 42 | ` 43 | ng add ng-zorro-antd 44 | ` 45 | ### 安装组件 46 | ` 47 | npm install ng-zorro-antd --save 48 | ` 49 | ## 运行 50 | 51 | `ng s -c [environment] --port [port]` 52 | 53 | 54 | ## 快捷指令 55 | 56 | 快速生成模块 57 | 58 | ` 59 | ng g m [保存位置]/modelName 60 | ` 61 | 62 | 快速生成组件 63 | 64 | ` 65 | ng g c [保存位置]/componentName 66 | ` 67 | 68 | 快速生产服务 69 | 70 | ` 71 | ng g s [保存位置]/serviceName 72 | ` 73 | 74 | 快速生产管道 75 | 76 | ` 77 | ng g pipe [保存位置]/pipeName 78 | ` 79 | 80 | ## 项目引用 81 | 82 | 地图:[maps](http://lbsyun.baidu.com/) 83 | 84 | 图表:[echarts](http://echarts.baidu.com/index.html) 85 | 86 | 用户认证:[@delon/auth](https://ng-alain.com/auth/getting-started) 87 | 88 | 项目框架:[ng-zorro](https://ng.ant.design/version/1.8.x/) 89 | 90 | ## 项目结构 91 | 92 | > * core ng-zorro组件二次封装 通用服务、管道以及通用验证 93 | > * layout 通用模版 94 | > * routes 项目主体内容 95 | > * shared 导入导出项目公用的引用 96 | > * styles 通用样式 97 | > * assets 静态资源(图片与图标) 98 | 99 | ## ng-zorro组件二次封装(app/shared/meta) 100 | > * 基础表格组件 dw-table 101 | > * 通用时间组件 dw-date-picker 102 | > * 通用搜索组件 dw-search 103 | > * 信息模态框 dw-info-model 104 | > * 分页组件 dw-pagination 105 | > * 动态表格组件 dw-table-dynamic 106 | 107 | ## 部署 108 | 109 | #### 1、打包 110 | ` 111 | ng build --prod 112 | ` 113 | #### 2、配置WEB服务服务器 114 | [nginx](http://www.nginx.cn/doc/) 115 | 116 | #### 3、推送资源 117 | 118 | ` 119 | scp -r 打包后文件路径 root@服务器IP地址:/root/www 120 | ` 121 | #### 4、域名解析,发布完成 122 | 123 | 124 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "ng-web": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": {}, 12 | "architect": { 13 | "build": { 14 | "builder": "@angular-devkit/build-angular:browser", 15 | "options": { 16 | "outputPath": "dist/ng-web", 17 | "index": "src/index.html", 18 | "main": "src/main.ts", 19 | "polyfills": "src/polyfills.ts", 20 | "tsConfig": "src/tsconfig.app.json", 21 | "assets": [ 22 | "src/favicon.ico", 23 | "src/assets", 24 | { 25 | "glob": "**/*", 26 | "input": "./node_modules/@ant-design/icons-angular/src/inline-svg/", 27 | "output": "/assets/" 28 | } 29 | ], 30 | "styles": [ 31 | "node_modules/ng-zorro-antd/src/ng-zorro-antd.min.css", 32 | "src/styles.less" 33 | ], 34 | "scripts": [ 35 | "node_modules/echarts/dist/echarts.min.js", 36 | "node_modules/qrious/dist/qrious.min.js" 37 | ] 38 | }, 39 | "configurations": { 40 | "production": { 41 | "fileReplacements": [{ 42 | "replace": "src/environments/environment.ts", 43 | "with": "src/environments/environment.prod.ts" 44 | }], 45 | "optimization": true, 46 | "outputHashing": "all", 47 | "sourceMap": false, 48 | "extractCss": true, 49 | "namedChunks": false, 50 | "aot": true, 51 | "extractLicenses": true, 52 | "vendorChunk": false, 53 | "buildOptimizer": true 54 | }, 55 | "local": { 56 | "fileReplacements": [{ 57 | "replace": "src/environments/environment.ts", 58 | "with": "src/environments/environment.local.ts" 59 | }] 60 | } 61 | } 62 | }, 63 | "serve": { 64 | "builder": "@angular-devkit/build-angular:dev-server", 65 | "options": { 66 | "browserTarget": "ng-web:build" 67 | }, 68 | "configurations": { 69 | "production": { 70 | "browserTarget": "ng-web:build:production" 71 | }, 72 | "local": { 73 | "browserTarget": "ng-web:build:local" 74 | } 75 | } 76 | }, 77 | "extract-i18n": { 78 | "builder": "@angular-devkit/build-angular:extract-i18n", 79 | "options": { 80 | "browserTarget": "ng-web:build" 81 | } 82 | }, 83 | "test": { 84 | "builder": "@angular-devkit/build-angular:karma", 85 | "options": { 86 | "main": "src/test.ts", 87 | "polyfills": "src/polyfills.ts", 88 | "tsConfig": "src/tsconfig.spec.json", 89 | "karmaConfig": "src/karma.conf.js", 90 | "styles": [ 91 | "node_modules/ng-zorro-antd/src/ng-zorro-antd.min.css", 92 | "src/styles.less" 93 | ], 94 | "scripts": [], 95 | "assets": [ 96 | "src/favicon.ico", 97 | "src/assets" 98 | ] 99 | } 100 | }, 101 | "lint": { 102 | "builder": "@angular-devkit/build-angular:tslint", 103 | "options": { 104 | "tsConfig": [ 105 | "src/tsconfig.app.json", 106 | "src/tsconfig.spec.json" 107 | ], 108 | "exclude": [ 109 | "**/node_modules/**" 110 | ] 111 | } 112 | } 113 | } 114 | }, 115 | "ng-web-e2e": { 116 | "root": "e2e/", 117 | "projectType": "application", 118 | "architect": { 119 | "e2e": { 120 | "builder": "@angular-devkit/build-angular:protractor", 121 | "options": { 122 | "protractorConfig": "e2e/protractor.conf.js", 123 | "devServerTarget": "ng-web:serve" 124 | }, 125 | "configurations": { 126 | "production": { 127 | "devServerTarget": "ng-web:serve:production" 128 | } 129 | } 130 | }, 131 | "lint": { 132 | "builder": "@angular-devkit/build-angular:tslint", 133 | "options": { 134 | "tsConfig": "e2e/tsconfig.e2e.json", 135 | "exclude": [ 136 | "**/node_modules/**" 137 | ] 138 | } 139 | } 140 | } 141 | } 142 | }, 143 | "defaultProject": "ng-web" 144 | } 145 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to ng-web!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-web", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e" 11 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^7.2.2", 15 | "@angular/common": "^6.1.0", 16 | "@angular/compiler": "^6.1.0", 17 | "@angular/core": "^6.1.0", 18 | "@angular/forms": "^6.1.0", 19 | "@angular/http": "^6.1.0", 20 | "@angular/platform-browser": "^6.1.0", 21 | "@angular/platform-browser-dynamic": "^6.1.0", 22 | "@angular/router": "^6.1.0", 23 | "@delon/acl": "^1.4.0", 24 | "@delon/auth": "^1.4.0", 25 | "@delon/theme": "^1.4.0", 26 | "angular-baidu-maps": "^2.0.1", 27 | "classlist.js": "^1.1.20150312", 28 | "core-js": "^2.5.4", 29 | "date-fns": "^1.29.0", 30 | "echarts": "^4.2.0-rc.1", 31 | "html2canvas": "^1.0.0-alpha.10", 32 | "ng-zorro-antd": "^1.8.0", 33 | "ngx-echarts": "^4.0.0", 34 | "qrious": "^4.0.2", 35 | "rxjs": "^6.0.0", 36 | "seamscroll": "0.0.12", 37 | "web-animations-js": "^2.3.1", 38 | "zone.js": "~0.8.26" 39 | }, 40 | "devDependencies": { 41 | "@angular-devkit/build-angular": "~0.7.0", 42 | "@angular/cli": "~6.1.5", 43 | "@angular/compiler-cli": "^6.1.0", 44 | "@angular/language-service": "^6.1.0", 45 | "@types/echarts": "^4.1.1", 46 | "@types/jasmine": "~2.8.6", 47 | "@types/jasminewd2": "~2.0.3", 48 | "@types/node": "~8.9.4", 49 | "codelyzer": "~4.2.1", 50 | "jasmine-core": "~2.99.1", 51 | "jasmine-spec-reporter": "~4.2.1", 52 | "karma": "~1.7.1", 53 | "karma-chrome-launcher": "~2.2.0", 54 | "karma-coverage-istanbul-reporter": "~2.0.0", 55 | "karma-jasmine": "~1.1.1", 56 | "karma-jasmine-html-reporter": "^0.2.2", 57 | "protractor": "~5.4.0", 58 | "ts-node": "~5.0.1", 59 | "tslint": "~5.9.1", 60 | "typescript": "~2.7.2" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/app.component.less: -------------------------------------------------------------------------------- 1 | :host ::ng-deep .ant-layout-sider { 2 | margin-top: 64px; 3 | position: fixed; 4 | height: 100%; 5 | } -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'ng-web'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('ng-web'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to ng-web!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.less'] 7 | }) 8 | export class AppComponent { 9 | title = 'ng-web'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { AppComponent } from './app.component'; 4 | import { CoreModule } from './core/core.module'; 5 | import { LayoutModule } from './layout/layout.module'; 6 | import { RoutesModule } from './routes/routes.module'; 7 | import { SharedModule } from './shared/shared.module'; 8 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 9 | import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http'; 10 | import { NZ_I18N, zh_CN, NZ_NOTIFICATION_CONFIG } from 'ng-zorro-antd'; 11 | import { registerLocaleData } from '@angular/common'; 12 | import zh from '@angular/common/locales/zh'; 13 | import { ApiService, API_URL } from './core/api/api.service'; 14 | import { environment } from '../environments/environment'; 15 | import { DelonAuthModule, SimpleInterceptor } from '@delon/auth'; 16 | import { DelonACLModule } from '@delon/acl'; 17 | registerLocaleData(zh); 18 | 19 | @NgModule({ 20 | declarations: [ 21 | AppComponent, 22 | ], 23 | imports: [ 24 | BrowserModule, 25 | CoreModule, 26 | LayoutModule, 27 | RoutesModule, 28 | SharedModule, 29 | HttpClientModule, 30 | DelonAuthModule.forRoot(), 31 | DelonACLModule.forRoot(), 32 | BrowserAnimationsModule, 33 | ], 34 | providers: [ 35 | { provide: HTTP_INTERCEPTORS, useClass: SimpleInterceptor, multi: true }, 36 | { provide: NZ_NOTIFICATION_CONFIG, useValue: { nzMaxStack: 1 } }, 37 | { provide: NZ_I18N, useValue: zh_CN }, 38 | ApiService, 39 | { 40 | provide: API_URL, 41 | useValue: environment.urlPrefix 42 | } 43 | ], 44 | bootstrap: [AppComponent] 45 | }) 46 | export class AppModule { } 47 | -------------------------------------------------------------------------------- /src/app/core/api/api.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { ApiService } from './api.service'; 4 | 5 | describe('ApiService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [ApiService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([ApiService], (service: ApiService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/core/api/api.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable, Inject, InjectionToken } from '@angular/core'; 2 | import { HttpClient, HttpParams } from '@angular/common/http'; 3 | import 'rxjs'; 4 | import { Observable } from 'rxjs'; 5 | 6 | export const API_URL = new InjectionToken('apiUrl'); 7 | @Injectable({ 8 | providedIn: 'root' 9 | }) 10 | export class ApiService { 11 | 12 | constructor( 13 | private http: HttpClient, 14 | @Inject(API_URL) public urlPrefix, 15 | ) { } 16 | get(url: string, params?: any): Observable { 17 | if (params && params['query']) { 18 | params['query'] = JSON.stringify(params['query']); 19 | } 20 | const p = new HttpParams({ 21 | fromObject: params 22 | }); 23 | return this.http.get(this.urlPrefix + url, { 24 | params: p, 25 | withCredentials: true 26 | }); 27 | } 28 | post(url: string, body?: any, params?: any): Observable { 29 | console.log('url', url); 30 | return this.http.post(this.urlPrefix + url, body, { 31 | params: params, 32 | withCredentials: true 33 | }); 34 | } 35 | /**全域打印 */ 36 | isConsole(...args) { 37 | // switch (args.length) { 38 | // case 1: 39 | // console.log(args[0]); 40 | // break; 41 | // case 2: 42 | // console.log(args[0], args[1]); 43 | // } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/core/core.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { CoreModule } from './core.module'; 2 | 3 | describe('CoreModule', () => { 4 | let coreModule: CoreModule; 5 | 6 | beforeEach(() => { 7 | coreModule = new CoreModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(coreModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/core/core.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | @NgModule({ 3 | imports: [ 4 | ] 5 | }) 6 | export class CoreModule { } 7 | -------------------------------------------------------------------------------- /src/app/core/menus/menus.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { MenusService } from './menus.service'; 4 | 5 | describe('MenusService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [MenusService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([MenusService], (service: MenusService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/core/menus/menus.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class MenusService { 7 | 8 | constructor() { } 9 | _Menus = [ 10 | { 11 | text: '首页', 12 | link: 'index', 13 | icon: 'home', 14 | children: [] 15 | }, 16 | { 17 | text: '图表', 18 | link: '', 19 | icon: 'line-chart', 20 | children: [ 21 | { 22 | text: '折线图', 23 | link: 'charts/line', 24 | icon: '', 25 | } 26 | ] 27 | }, 28 | { 29 | text: '列表页', 30 | link: '', 31 | icon: 'appstore', 32 | children: [ 33 | { 34 | text: '基础表格', 35 | link: 'list/list-table', 36 | icon: '', 37 | }, 38 | { 39 | text: '动态控制表格', 40 | link: 'list/dynamic-table', 41 | icon: '', 42 | }, 43 | { 44 | text: '菜单管理', 45 | link: 'list/tree', 46 | icon: '', 47 | } 48 | ] 49 | }, 50 | { 51 | text: '动画剧场', 52 | link: '', 53 | icon: 'bank', 54 | children: [ 55 | { 56 | text: '动画示例', 57 | link: 'animations/animation', 58 | icon: '', 59 | } 60 | ] 61 | }, 62 | { 63 | text: '百度地图', 64 | link: '', 65 | icon: 'compass', 66 | children: [ 67 | { 68 | text: '开始', 69 | link: 'map/start', 70 | icon: '', 71 | }, 72 | { 73 | text: '地图标点', 74 | link: 'map/marker', 75 | icon: '', 76 | }, 77 | { 78 | text: '地图围栏', 79 | link: 'map/demo', 80 | icon: '', 81 | }, 82 | ] 83 | }, 84 | { 85 | text: '插件工坊', 86 | link: '', 87 | icon: 'usb', 88 | children: [ 89 | { 90 | text: '表单打印', 91 | link: 'outside/html2canvas', 92 | icon: '', 93 | }, 94 | { 95 | text: '二维码', 96 | link: 'outside/qrious', 97 | icon: '', 98 | } 99 | ] 100 | }, 101 | { 102 | text: '全屏中心', 103 | link: '', 104 | icon: 'experiment', 105 | children: [ 106 | { 107 | text: 'Demo', 108 | link: '/fullscreen/experiment/demo', 109 | icon: '', 110 | }, 111 | { 112 | text: '设备报警', 113 | link: '/fullscreen/experiment/warining', 114 | icon: '', 115 | } 116 | ] 117 | } 118 | ]; 119 | menus() { 120 | return this._Menus; 121 | } 122 | } 123 | /** 菜单类:待用 */ 124 | export interface Menu { 125 | [key: string]: any; 126 | /** 文本 */ 127 | text: string; 128 | /** 路由 */ 129 | link?: string; 130 | target?: '_blank' | '_self' | '_parent' | '_top'; 131 | /** 图标 */ 132 | icon?: string; 133 | /** 二级菜单 */ 134 | children?: Menu[]; 135 | } 136 | -------------------------------------------------------------------------------- /src/app/layout/default/breadcrumb/breadcrumb.component.html: -------------------------------------------------------------------------------- 1 | 2 | 百度地图 3 | 地图标点 4 | -------------------------------------------------------------------------------- /src/app/layout/default/breadcrumb/breadcrumb.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/layout/default/breadcrumb/breadcrumb.component.less -------------------------------------------------------------------------------- /src/app/layout/default/breadcrumb/breadcrumb.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BreadcrumbComponent } from './breadcrumb.component'; 4 | 5 | describe('BreadcrumbComponent', () => { 6 | let component: BreadcrumbComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ BreadcrumbComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BreadcrumbComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/default/breadcrumb/breadcrumb.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MenusService } from 'src/app/core/menus/menus.service'; 3 | 4 | 5 | @Component({ 6 | selector: 'app-breadcrumb', 7 | templateUrl: './breadcrumb.component.html', 8 | styleUrls: ['./breadcrumb.component.less'] 9 | }) 10 | export class BreadcrumbComponent implements OnInit { 11 | menus; 12 | constructor( 13 | private menu: MenusService 14 | ) { } 15 | 16 | ngOnInit() { 17 | this.menus = this.menu.menus(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/app/layout/default/default.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 树深时见鹿,溪午不闻钟 ©{{date}} By 14 | 星河 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/app/layout/default/default.component.less: -------------------------------------------------------------------------------- 1 | :host ::ng-deep .ant-layout-sider { 2 | background: #fff; 3 | color: black 4 | } 5 | 6 | :host ::ng-deep .ant-menu-dark, 7 | .ant-menu-dark .ant-menu-sub { 8 | background: #fff; 9 | color: black 10 | } 11 | 12 | .layout-nz { 13 | padding: 24px 24px 24px; 14 | min-height: calc(100vh - 64px); 15 | margin-top: 64px 16 | } -------------------------------------------------------------------------------- /src/app/layout/default/default.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DefaultComponent } from './default.component'; 4 | 5 | describe('DefaultComponent', () => { 6 | let component: DefaultComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DefaultComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DefaultComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/default/default.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild, TemplateRef } from '@angular/core'; 2 | import { ApiService } from 'src/app/core/api/api.service'; 3 | 4 | @Component({ 5 | selector: 'app-default', 6 | templateUrl: './default.component.html', 7 | styleUrls: ['./default.component.less'] 8 | }) 9 | export class DefaultComponent implements OnInit { 10 | isCollapsed = false; 11 | triggerTemplate = null; 12 | date; 13 | constructor( 14 | private api: ApiService 15 | ) { } 16 | launchSidebar() { 17 | this.isCollapsed = !this.isCollapsed; 18 | } 19 | ngOnInit() { 20 | const date = new Date(); 21 | this.date = date.getFullYear(); 22 | this.api.isConsole('NoConsole'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/app/layout/default/header/header.component.html: -------------------------------------------------------------------------------- 1 | 2 | 6 |
7 | 8 |
9 |
10 |
11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 | 25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 | 44 | 45 | 星河 46 | 47 | 55 | 56 |
57 |
58 |
59 |
60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/app/layout/default/header/header.component.less: -------------------------------------------------------------------------------- 1 | @import '../../../styles/icons.less'; 2 | @import '../../../styles/index.less'; 3 | :host ::ng-deep .ant-layout-header { 4 | width: 100%; 5 | position: fixed; 6 | z-index: 999; 7 | padding: 0; 8 | color: #ffffff; 9 | font-size: 14px; 10 | cursor: pointer; 11 | background-color: #1890ff; 12 | .dw-flexItems(center); 13 | } 14 | 15 | .dw-logo { 16 | height: 100%; 17 | margin-right: 18px; 18 | .dw-flexIC(center, center); 19 | } 20 | 21 | .dw-inter { 22 | flex-grow: 2; 23 | .dw-flexItems(center); 24 | justify-content: space-between; 25 | i { 26 | font-size: 20px; 27 | } 28 | a { 29 | outline: none; 30 | color: #ffffff; 31 | } 32 | .dw-inter-left { 33 | .dw-flexItems(center); 34 | } 35 | .dw-inter-right { 36 | .dw-flexItems(center); 37 | margin-right: 50px; 38 | } 39 | .dw-inter-item { 40 | padding: 0 20px; 41 | height: 40px; 42 | .dw-flexItems(center); 43 | &:hover { 44 | height: 40px; 45 | background: cornflowerblue; 46 | .dw-flexItems(center); 47 | padding: 0 20px; 48 | } 49 | } 50 | .dw-inter-search { 51 | margin: 0 5px; 52 | } 53 | } 54 | 55 | .dw-inter-change { 56 | height: 40px; 57 | i { 58 | font-size: 20px; 59 | } 60 | &:hover { 61 | height: 40px; 62 | background: cornflowerblue; 63 | .dw-flexItems(center); 64 | padding: 0 10px; 65 | } 66 | padding: 0 10px; 67 | .dw-flexItems(center); 68 | } -------------------------------------------------------------------------------- /src/app/layout/default/header/header.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HeaderComponent } from './header.component'; 4 | 5 | describe('HeaderComponent', () => { 6 | let component: HeaderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HeaderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HeaderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/default/header/header.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Output, EventEmitter, Inject } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; 4 | import { Observable, fromEvent } from 'rxjs'; 5 | 6 | @Component({ 7 | selector: 'app-header', 8 | templateUrl: './header.component.html', 9 | styleUrls: ['./header.component.less'] 10 | }) 11 | export class HeaderComponent implements OnInit { 12 | /**屏幕尺寸 */ 13 | resize = document.body.clientWidth; 14 | isCollapsed = false; 15 | @Output() nzCollapsed = new EventEmitter(); 16 | constructor( 17 | @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, 18 | private router: Router, 19 | ) { 20 | } 21 | 22 | ngOnInit() { 23 | /**监听浏览器的变化 */ 24 | fromEvent(window, 'resize') 25 | .subscribe((e) => { 26 | this.resize = e.currentTarget['innerWidth']; 27 | }); 28 | } 29 | changeIcon() { 30 | this.isCollapsed = !this.isCollapsed; 31 | this.nzCollapsed.emit(); 32 | } 33 | logout() { 34 | this.tokenService.clear(); 35 | this.router.navigateByUrl('passport/login'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/app/layout/default/sider/sider.component.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
  • 4 | {{menu.text}} 5 |
      6 |
    • {{children.text}}
    • 7 |
      8 |
  • 9 |
  • 10 | {{menu.text}} 11 |
  • 12 |
    13 |
14 | -------------------------------------------------------------------------------- /src/app/layout/default/sider/sider.component.less: -------------------------------------------------------------------------------- 1 | li { 2 | /*取消routerLink点击出现的边框*/ 3 | &:focus { 4 | outline: none !important; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/app/layout/default/sider/sider.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SiderComponent } from './sider.component'; 4 | 5 | describe('SiderComponent', () => { 6 | let component: SiderComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SiderComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SiderComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/default/sider/sider.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input } from '@angular/core'; 2 | import { MenusService } from 'src/app/core/menus/menus.service'; 3 | @Component({ 4 | selector: 'app-sider', 5 | templateUrl: './sider.component.html', 6 | styleUrls: ['./sider.component.less'] 7 | }) 8 | export class SiderComponent implements OnInit { 9 | @Input() isCollapsed; 10 | triggerTemplate = null; 11 | menus; 12 | constructor( 13 | private menu: MenusService 14 | ) { } 15 | 16 | ngOnInit() { 17 | this.menus = this.menu.menus(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/layout/fullscreen/fullscreen.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/layout/fullscreen/fullscreen.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/layout/fullscreen/fullscreen.component.less -------------------------------------------------------------------------------- /src/app/layout/fullscreen/fullscreen.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FullscreenComponent } from './fullscreen.component'; 4 | 5 | describe('FullscreenComponent', () => { 6 | let component: FullscreenComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FullscreenComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FullscreenComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/fullscreen/fullscreen.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-fullscreen', 5 | templateUrl: './fullscreen.component.html', 6 | styleUrls: ['./fullscreen.component.less'] 7 | }) 8 | export class FullscreenComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/layout.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { LayoutModule } from './layout.module'; 2 | 3 | describe('LayoutModule', () => { 4 | let layoutModule: LayoutModule; 5 | 6 | beforeEach(() => { 7 | layoutModule = new LayoutModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(layoutModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/layout/layout.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../shared/shared.module'; 3 | import { DefaultComponent } from './default/default.component'; 4 | import { FullscreenComponent } from './fullscreen/fullscreen.component'; 5 | import { PassportComponent } from './passport/passport.component'; 6 | import { HeaderComponent } from './default/header/header.component'; 7 | import { SiderComponent } from './default/sider/sider.component'; 8 | import { BreadcrumbComponent } from './default/breadcrumb/breadcrumb.component'; 9 | 10 | const COMPONENTS = [ 11 | DefaultComponent, 12 | FullscreenComponent, 13 | PassportComponent, 14 | HeaderComponent, 15 | SiderComponent, 16 | BreadcrumbComponent 17 | ]; 18 | @NgModule({ 19 | imports: [ 20 | SharedModule 21 | ], 22 | declarations: [ 23 | ...COMPONENTS 24 | ], 25 | exports: [ 26 | ...COMPONENTS 27 | ] 28 | }) 29 | export class LayoutModule { } 30 | -------------------------------------------------------------------------------- /src/app/layout/passport/passport.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | 6 |
7 |

树深时见鹿,溪午不闻钟

8 |
9 | 13 |
14 |
-------------------------------------------------------------------------------- /src/app/layout/passport/passport.component.less: -------------------------------------------------------------------------------- 1 | .main-wrapper { 2 | width: 100%; 3 | min-height: 100%; 4 | display: flex; 5 | align-items: center; 6 | background-image: linear-gradient(to left, #0689fd 30%, #29bdd9 100%); 7 | } 8 | 9 | .layout-passport { 10 | width: 430px; 11 | height: 540px; 12 | margin-left: auto; 13 | margin-right: auto; 14 | border-radius: 4px; 15 | background: #fff; 16 | h2 { 17 | text-align: center; 18 | } 19 | } 20 | 21 | .layou-logo { 22 | display: flex; 23 | justify-content: center; 24 | padding: 20px 0; 25 | height: 80px; 26 | width: 80px; 27 | border-radius: 50%; 28 | background: url(../../../assets/icons/logo.png) center no-repeat; 29 | background-size: 100% 100%; 30 | margin: 10px auto; 31 | } 32 | 33 | .accout-slogon { 34 | display: flex; 35 | justify-content: center; 36 | align-items: center; 37 | color: #595959; 38 | font-size: 12px 39 | } 40 | 41 | .account-login { 42 | display: flex; 43 | justify-content: center; 44 | margin-top: 40px; 45 | } -------------------------------------------------------------------------------- /src/app/layout/passport/passport.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PassportComponent } from './passport.component'; 4 | 5 | describe('PassportComponent', () => { 6 | let component: PassportComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ PassportComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PassportComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/passport/passport.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-passport', 5 | templateUrl: './passport.component.html', 6 | styleUrls: ['./passport.component.less'] 7 | }) 8 | export class PassportComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/about/about.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/about/about.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/about/about.component.html: -------------------------------------------------------------------------------- 1 |

2 | Angular's animations library makes it easy to define and apply animation effects such as page and list transitions. 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/about/about.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AboutComponent } from './about.component'; 4 | 5 | describe('AboutComponent', () => { 6 | let component: AboutComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AboutComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AboutComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-about', 5 | templateUrl: './about.component.html', 6 | styleUrls: ['./about.component.css'] 7 | }) 8 | export class AboutComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/animation.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Animation

3 | Toggle All Animations 4 | 15 |
16 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/animation.component.less: -------------------------------------------------------------------------------- 1 | .animations { 2 | padding: 40px; 3 | font-size: 16px; 4 | nav { 5 | margin-top: 20px; 6 | } 7 | a { 8 | &:hover { 9 | background-color: #1890ff; 10 | color: #fff; 11 | } 12 | display: inline-block; 13 | color: #1890ff; 14 | padding: 8px 12px; 15 | margin: 0 10px 0 0; 16 | font-size: 16px; 17 | border-radius: 3px; 18 | border: 1px solid #1890ff; 19 | text-decoration: none; 20 | } 21 | .router { 22 | margin-top: 40px; 23 | } 24 | } -------------------------------------------------------------------------------- /src/app/routes/animations/animation/animation.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AnimationComponent } from './animation.component'; 4 | 5 | describe('AnimationComponent', () => { 6 | let component: AnimationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AnimationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AnimationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/animation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, HostBinding } from '@angular/core'; 2 | import { trigger, state, style, animate, transition } from '@angular/animations'; 3 | import { RouterOutlet } from '@angular/router'; 4 | import { slideInAnimation } from './animations'; 5 | 6 | @Component({ 7 | selector: 'app-animation', 8 | templateUrl: './animation.component.html', 9 | styleUrls: ['./animation.component.less'], 10 | animations: [ 11 | slideInAnimation 12 | ] 13 | 14 | }) 15 | export class AnimationComponent implements OnInit { 16 | @HostBinding('@.disabled') 17 | public animationsDisabled = false; 18 | constructor() { } 19 | 20 | ngOnInit() { 21 | } 22 | 23 | prepareRoute(outlet: RouterOutlet) { 24 | return outlet && outlet.activatedRouteData && outlet.activatedRouteData['animation']; 25 | } 26 | 27 | 28 | toggleAnimations() { 29 | this.animationsDisabled = !this.animationsDisabled; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/animations.ts: -------------------------------------------------------------------------------- 1 | import { 2 | animation, trigger, animateChild, group, 3 | transition, animate, style, query 4 | } from '@angular/animations'; 5 | 6 | export const transAnimation = animation([ 7 | style({ 8 | height: '{{ height }}', 9 | opacity: '{{ opacity }}', 10 | backgroundColor: '{{ backgroundColor }}' 11 | }), 12 | animate('{{ time }}') 13 | ]); 14 | 15 | // Routable animations 16 | export const slideInAnimation = 17 | trigger('routeAnimations', [ 18 | transition('HomePage <=> AboutPage', [ 19 | style({ position: 'relative' }), 20 | query(':enter, :leave', [ 21 | style({ 22 | position: 'absolute', 23 | top: 0, 24 | left: 0, 25 | width: '100%' 26 | }) 27 | ]), 28 | query(':enter', [ 29 | style({ left: '-100%' }) 30 | ]), 31 | query(':leave', animateChild()), 32 | group([ 33 | query(':leave', [ 34 | animate('500ms ease-out', style({ left: '100%', opacity: 1 })) 35 | ]), 36 | query(':enter', [ 37 | animate('500ms ease-out', style({ left: '0%', opacity: 0 })) 38 | ]) 39 | ]), 40 | query(':enter', animateChild()), 41 | ]), 42 | transition('* <=> FilterPage', [ 43 | style({ position: 'relative' }), 44 | query(':enter, :leave', [ 45 | style({ 46 | position: 'absolute', 47 | top: 0, 48 | left: 0, 49 | width: '100%' 50 | }) 51 | ]), 52 | query(':enter', [ 53 | style({ left: '-100%' }) 54 | ]), 55 | query(':leave', animateChild()), 56 | group([ 57 | query(':leave', [ 58 | animate('200ms ease-out', style({ left: '100%' })) 59 | ]), 60 | query(':enter', [ 61 | animate('300ms ease-out', style({ left: '0%' })) 62 | ]) 63 | ]), 64 | query(':enter', animateChild()), 65 | ]) 66 | ]); 67 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/auto-calu/auto-calu.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/auto-calu/auto-calu.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/auto-calu/auto-calu.component.html: -------------------------------------------------------------------------------- 1 |

2 | auto-calu works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/auto-calu/auto-calu.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AutoCaluComponent } from './auto-calu.component'; 4 | 5 | describe('AutoCaluComponent', () => { 6 | let component: AutoCaluComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AutoCaluComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AutoCaluComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/auto-calu/auto-calu.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-auto-calu', 5 | templateUrl: './auto-calu.component.html', 6 | styleUrls: ['./auto-calu.component.css'] 7 | }) 8 | export class AutoCaluComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/enter-leave/enter-leave.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/enter-leave/enter-leave.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/enter-leave/enter-leave.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | A {{ hero.id }} 5 | {{ hero.name }} 6 |

Touch close

7 |
8 |
9 | 10 |
11 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/enter-leave/enter-leave.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { EnterLeaveComponent } from './enter-leave.component'; 4 | 5 | describe('EnterLeaveComponent', () => { 6 | let component: EnterLeaveComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ EnterLeaveComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(EnterLeaveComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/enter-leave/enter-leave.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Output, EventEmitter } from '@angular/core'; 2 | import { 3 | trigger, 4 | state, 5 | style, 6 | animate, 7 | transition 8 | } from '@angular/animations'; 9 | @Component({ 10 | selector: 'app-enter-leave', 11 | templateUrl: './enter-leave.component.html', 12 | styleUrls: ['./enter-leave.component.css'], 13 | animations: [ 14 | trigger('flyInOut', [ 15 | state('in', style({ transform: 'translateX(0)' })), 16 | transition('void => *', [ 17 | style({ transform: 'translateX(-100%)' }), 18 | animate(100) 19 | ]), 20 | transition('* => void', [ 21 | animate(100, style({ transform: 'translateX(100%)' })) 22 | ]) 23 | ]) 24 | ] 25 | }) 26 | export class EnterLeaveComponent implements OnInit { 27 | heroes = [ 28 | { 29 | id: 1, 30 | name: 'Angular' 31 | }, 32 | { 33 | id: 2, 34 | name: 'JavaScript' 35 | }, 36 | { 37 | id: 3, 38 | name: 'Html' 39 | }, 40 | { 41 | id: 4, 42 | name: 'CSS' 43 | }, 44 | ]; 45 | constructor() { } 46 | @Output() remove = new EventEmitter(); 47 | ngOnInit() { 48 | } 49 | removeHero(id: number) { 50 | this.heroes = this.heroes.filter(hero => hero.id !== id); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/filter/filter.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/filter/filter.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/filter/filter.component.html: -------------------------------------------------------------------------------- 1 |
    2 |
  • 3 |
    4 | {{ hero.id }} 5 | {{ hero.name }} 6 |
    7 |
  • 8 |
9 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/filter/filter.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FilterComponent } from './filter.component'; 4 | 5 | describe('FilterComponent', () => { 6 | let component: FilterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FilterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FilterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/filter/filter.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, HostBinding, OnInit } from '@angular/core'; 2 | import { trigger, transition, animate, style, query, stagger } from '@angular/animations'; 3 | 4 | @Component({ 5 | selector: 'app-filter', 6 | templateUrl: './filter.component.html', 7 | styleUrls: ['./filter.component.css'], 8 | animations: [ 9 | trigger('pageAnimations', [ 10 | transition(':enter', [ 11 | query('.hero, form', [ 12 | style({ opacity: 0, transform: 'translateY(-100px)' }), 13 | stagger(-30, [ 14 | animate('500ms cubic-bezier(0.35, 0, 0.25, 1)', style({ opacity: 1, transform: 'none' })) 15 | ]) 16 | ]) 17 | ]) 18 | ]), 19 | trigger('filterAnimation', [ 20 | transition(':enter, * => 0, * => -1', []), 21 | transition(':increment', [ 22 | query(':enter', [ 23 | style({ opacity: 0, width: '0px' }), 24 | stagger(50, [ 25 | animate('300ms ease-out', style({ opacity: 1, width: '*' })), 26 | ]), 27 | ], { optional: true }) 28 | ]), 29 | transition(':decrement', [ 30 | query(':leave', [ 31 | stagger(50, [ 32 | animate('300ms ease-out', style({ opacity: 0, width: '0px' })), 33 | ]), 34 | ]) 35 | ]), 36 | ]), 37 | ] 38 | }) 39 | export class FilterComponent implements OnInit { 40 | @HostBinding('@pageAnimations') 41 | public animatePage = true; 42 | 43 | _heroes = []; 44 | heroTotal = -1; 45 | heroes = [ 46 | { 47 | id: 1, 48 | name: 'Angular' 49 | }, 50 | { 51 | id: 2, 52 | name: 'JavaScript' 53 | }, 54 | { 55 | id: 3, 56 | name: 'Html' 57 | }, 58 | { 59 | id: 4, 60 | name: 'CSS' 61 | }, 62 | ]; 63 | constructor() { } 64 | 65 | ngOnInit() { 66 | } 67 | updateCriteria(criteria: string) { 68 | criteria = criteria ? criteria.trim() : ''; 69 | 70 | this._heroes = this.heroes.filter(hero => hero.name.toLowerCase().includes(criteria.toLowerCase())); 71 | const newTotal = this.heroes.length; 72 | 73 | if (this.heroTotal !== newTotal) { 74 | this.heroTotal = newTotal; 75 | } else if (!criteria) { 76 | this.heroTotal = -1; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/groups/groups.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/groups/groups.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/groups/groups.component.html: -------------------------------------------------------------------------------- 1 |

2 | groups works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/groups/groups.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GroupsComponent } from './groups.component'; 4 | 5 | describe('GroupsComponent', () => { 6 | let component: GroupsComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ GroupsComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(GroupsComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/groups/groups.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-groups', 5 | templateUrl: './groups.component.html', 6 | styleUrls: ['./groups.component.css'], 7 | animations: [] 8 | }) 9 | export class GroupsComponent implements OnInit { 10 | 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/home/home.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/home/home.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 | Welcome to Animations in Angular! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html', 6 | styleUrls: ['./home.component.css'] 7 | }) 8 | export class HomeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/open-close/open-close.component.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

The box is now {{ isOpen ? 'Open' : 'Closed' }}!

7 |
8 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/open-close/open-close.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/open-close/open-close.component.less -------------------------------------------------------------------------------- /src/app/routes/animations/animation/open-close/open-close.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { OpenCloseComponent } from './open-close.component'; 4 | 5 | describe('OpenCloseComponent', () => { 6 | let component: OpenCloseComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ OpenCloseComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(OpenCloseComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/open-close/open-close.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { trigger, transition, state, animate, style } from '@angular/animations'; 3 | 4 | @Component({ 5 | selector: 'app-open-close', 6 | templateUrl: './open-close.component.html', 7 | styleUrls: ['./open-close.component.less'], 8 | animations: [ 9 | trigger('openClose', [ 10 | // ... 11 | state('open', style({ 12 | height: '200px', 13 | opacity: 1, 14 | backgroundColor: 'yellow' 15 | })), 16 | state('closed', style({ 17 | height: '100px', 18 | opacity: 0.5, 19 | backgroundColor: 'green' 20 | })), 21 | transition('open => closed', [ 22 | animate('1s') 23 | ]), 24 | transition('closed => open', [ 25 | animate('0.5s') 26 | ]), 27 | transition('* => closed', [ 28 | animate('1s') 29 | ]), 30 | transition('* => open', [ 31 | animate('0.5s') 32 | ]), 33 | transition('open <=> closed', [ 34 | animate('0.5s') 35 | ]), 36 | transition('* => open', [ 37 | animate('1s', 38 | style({ opacity: '*' }), 39 | ), 40 | ]), 41 | transition('* => *', [ 42 | animate('1s') 43 | ]), 44 | ]) 45 | ] 46 | }) 47 | export class OpenCloseComponent implements OnInit { 48 | isOpen = true; 49 | constructor() { } 50 | 51 | ngOnInit() { 52 | } 53 | toggle() { 54 | this.isOpen = !this.isOpen; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/status/status.component.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | {{ status == 'active' ? 'Active' : 'Inactive' }} 7 |
8 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/status/status.component.less: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | 5 | .box { 6 | width: 300px; 7 | border: 5px solid black; 8 | display: block; 9 | line-height: 300px; 10 | text-align: center; 11 | font-size: 50px; 12 | color: white; 13 | } -------------------------------------------------------------------------------- /src/app/routes/animations/animation/status/status.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StatusComponent } from './status.component'; 4 | 5 | describe('StatusComponent', () => { 6 | let component: StatusComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StatusComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StatusComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/status/status.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { trigger, transition, state, animate, style, keyframes } from '@angular/animations'; 3 | @Component({ 4 | selector: 'app-status', 5 | templateUrl: './status.component.html', 6 | styleUrls: ['./status.component.less'], 7 | animations: [ 8 | trigger('slideStatus', [ 9 | state('inactive', style({ backgroundColor: 'blue' })), 10 | state('active', style({ backgroundColor: 'orange' })), 11 | 12 | transition('* => active', [ 13 | animate('2s', keyframes([ 14 | style({ backgroundColor: 'blue', offset: 0 }), 15 | style({ backgroundColor: 'red', offset: 0.8 }), 16 | style({ backgroundColor: 'orange', offset: 1.0 }) 17 | ])), 18 | ]), 19 | transition('* => inactive', [ 20 | animate('2s', keyframes([ 21 | style({ backgroundColor: 'orange', offset: 0 }), 22 | style({ backgroundColor: 'red', offset: 0.2 }), 23 | style({ backgroundColor: 'blue', offset: 1.0 }) 24 | ])) 25 | ]), 26 | 27 | transition('* => active', [ 28 | animate('2s', keyframes([ 29 | style({ backgroundColor: 'blue' }), 30 | style({ backgroundColor: 'red' }), 31 | style({ backgroundColor: 'orange' }) 32 | ])) 33 | ]), 34 | ]) 35 | ] 36 | }) 37 | export class StatusComponent implements OnInit { 38 | status: 'active' | 'inactive' = 'inactive'; 39 | constructor() { } 40 | 41 | ngOnInit() { 42 | } 43 | toggle() { 44 | if (this.status === 'active') { 45 | this.status = 'inactive'; 46 | } else { 47 | this.status = 'active'; 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/toggle/toggle.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/animations/animation/toggle/toggle.component.css -------------------------------------------------------------------------------- /src/app/routes/animations/animation/toggle/toggle.component.html: -------------------------------------------------------------------------------- 1 |

2 | toggle works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/toggle/toggle.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ToggleComponent } from './toggle.component'; 4 | 5 | describe('ToggleComponent', () => { 6 | let component: ToggleComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ToggleComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ToggleComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/animations/animation/toggle/toggle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-toggle', 5 | templateUrl: './toggle.component.html', 6 | styleUrls: ['./toggle.component.css'] 7 | }) 8 | export class ToggleComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/animations/animations-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { AnimationComponent } from './animation/animation.component'; 4 | import { HomeComponent } from './animation/home/home.component'; 5 | import { AboutComponent } from './animation/about/about.component'; 6 | import { AutoCaluComponent } from './animation/auto-calu/auto-calu.component'; 7 | import { EnterLeaveComponent } from './animation/enter-leave/enter-leave.component'; 8 | import { FilterComponent } from './animation/filter/filter.component'; 9 | import { GroupsComponent } from './animation/groups/groups.component'; 10 | import { OpenCloseComponent } from './animation/open-close/open-close.component'; 11 | import { StatusComponent } from './animation/status/status.component'; 12 | import { ToggleComponent } from './animation/toggle/toggle.component'; 13 | const routes: Routes = [ 14 | { path: '', redirectTo: 'animation', pathMatch: 'full' }, 15 | { 16 | path: 'animation', component: AnimationComponent, 17 | children: [ 18 | { path: '', redirectTo: 'home', pathMatch: 'full' }, 19 | { path: 'home', component: HomeComponent, data: { animation: 'HomePage' } }, 20 | { path: 'about', component: AboutComponent, data: { animation: 'AboutPage' } }, 21 | { path: 'auto', component: AutoCaluComponent }, 22 | { path: 'enter', component: EnterLeaveComponent }, 23 | { path: 'filter', component: FilterComponent, data: { animation: 'FilterPage' } }, 24 | { path: 'groups', component: GroupsComponent }, 25 | { path: 'open', component: OpenCloseComponent }, 26 | { path: 'status', component: StatusComponent }, 27 | { path: 'toggle', component: ToggleComponent } 28 | ] 29 | }, 30 | ]; 31 | @NgModule({ 32 | imports: [RouterModule.forChild(routes)], 33 | exports: [RouterModule] 34 | }) 35 | export class AnimationsRoutingModules { } 36 | -------------------------------------------------------------------------------- /src/app/routes/animations/animations.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { AnimationsModule } from './animations.module'; 2 | 3 | describe('AnimationsModule', () => { 4 | let animationsModule: AnimationsModule; 5 | 6 | beforeEach(() => { 7 | animationsModule = new AnimationsModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(animationsModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/animations/animations.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AnimationComponent } from './animation/animation.component'; 3 | import { AnimationsRoutingModules } from './animations-routing.module'; 4 | import { SharedModule } from 'src/app/shared/shared.module'; 5 | import { HomeComponent } from './animation/home/home.component'; 6 | import { AboutComponent } from './animation/about/about.component'; 7 | import { OpenCloseComponent } from './animation/open-close/open-close.component'; 8 | import { StatusComponent } from './animation/status/status.component'; 9 | import { ToggleComponent } from './animation/toggle/toggle.component'; 10 | import { EnterLeaveComponent } from './animation/enter-leave/enter-leave.component'; 11 | import { AutoCaluComponent } from './animation/auto-calu/auto-calu.component'; 12 | import { FilterComponent } from './animation/filter/filter.component'; 13 | import { GroupsComponent } from './animation/groups/groups.component'; 14 | @NgModule({ 15 | imports: [ 16 | SharedModule, 17 | AnimationsRoutingModules, 18 | ], 19 | declarations: [ 20 | AnimationComponent, 21 | HomeComponent, 22 | AboutComponent, 23 | OpenCloseComponent, 24 | StatusComponent, 25 | ToggleComponent, 26 | EnterLeaveComponent, 27 | AutoCaluComponent, 28 | FilterComponent, 29 | GroupsComponent] 30 | }) 31 | export class AnimationsModule { } 32 | -------------------------------------------------------------------------------- /src/app/routes/charts/charts-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { LineComponent } from './line/line.component'; 4 | const routes: Routes = [ 5 | { path: '', redirectTo: 'line', pathMatch: 'full' }, 6 | { path: 'line', component: LineComponent } 7 | ]; 8 | @NgModule({ 9 | imports: [RouterModule.forChild(routes)], 10 | exports: [RouterModule] 11 | }) 12 | export class ChartsRoutingModules { } 13 | -------------------------------------------------------------------------------- /src/app/routes/charts/charts.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { ChartsModule } from './charts.module'; 2 | 3 | describe('ChartsModule', () => { 4 | let chartsModule: ChartsModule; 5 | 6 | beforeEach(() => { 7 | chartsModule = new ChartsModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(chartsModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/charts/charts.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { ChartsRoutingModules } from './charts-routing.module'; 3 | import { SharedModule } from '../../shared/shared.module'; 4 | import { LineComponent } from './line/line.component'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | SharedModule, 9 | ChartsRoutingModules 10 | ], 11 | declarations: [LineComponent] 12 | }) 13 | export class ChartsModule { } 14 | -------------------------------------------------------------------------------- /src/app/routes/charts/line/line.component.html: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /src/app/routes/charts/line/line.component.less: -------------------------------------------------------------------------------- 1 | .line { 2 | margin: 0 auto; 3 | } -------------------------------------------------------------------------------- /src/app/routes/charts/line/line.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LineComponent } from './line.component'; 4 | 5 | describe('LineComponent', () => { 6 | let component: LineComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LineComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LineComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/charts/line/line.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { fromEvent } from 'rxjs'; 3 | 4 | declare var echarts: any; 5 | @Component({ 6 | selector: 'app-line', 7 | templateUrl: './line.component.html', 8 | styleUrls: ['./line.component.less'] 9 | }) 10 | export class LineComponent implements OnInit { 11 | chartOption: any; 12 | constructor() { } 13 | resize = (document.body.clientHeight - 181) + 'px'; 14 | 15 | ngOnInit() { 16 | fromEvent(window, 'resize') 17 | .subscribe(() => echarts.resize()); 18 | this.chartOption = { 19 | backgroundColor: '#394056', 20 | title: { 21 | text: '航线上座率分析', 22 | textStyle: { 23 | fontWeight: 'normal', 24 | fontSize: 16, 25 | color: '#F1F1F3' 26 | }, 27 | left: '6%' 28 | }, 29 | tooltip: { 30 | trigger: 'axis', 31 | axisPointer: { 32 | lineStyle: { 33 | color: '#57617B' 34 | } 35 | } 36 | }, 37 | legend: { 38 | icon: 'rect', 39 | itemWidth: 14, 40 | itemHeight: 5, 41 | itemGap: 13, 42 | data: ['南宁-曼芭', '桂林-曼芭', '南宁-甲米'], 43 | right: '4%', 44 | textStyle: { 45 | fontSize: 12, 46 | color: '#F1F1F3' 47 | } 48 | }, 49 | grid: { 50 | left: '3%', 51 | right: '4%', 52 | bottom: '3%', 53 | containLabel: true 54 | }, 55 | xAxis: [{ 56 | type: 'category', 57 | boundaryGap: false, 58 | axisLine: { 59 | lineStyle: { 60 | color: '#57617B' 61 | } 62 | }, 63 | data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'] 64 | }], 65 | yAxis: [{ 66 | type: 'value', 67 | axisTick: { 68 | show: false 69 | }, 70 | axisLine: { 71 | lineStyle: { 72 | color: '#57617B' 73 | } 74 | }, 75 | axisLabel: { 76 | margin: 10, 77 | textStyle: { 78 | fontSize: 14 79 | } 80 | }, 81 | splitLine: { 82 | lineStyle: { 83 | color: '#57617B' 84 | } 85 | } 86 | }], 87 | series: [{ 88 | name: '南宁-曼芭', 89 | type: 'line', 90 | smooth: true, 91 | lineStyle: { 92 | normal: { 93 | width: 1 94 | } 95 | }, 96 | areaStyle: { 97 | normal: { 98 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 99 | offset: 0, 100 | color: 'rgba(137, 189, 27, 0.3)' 101 | }, { 102 | offset: 0.8, 103 | color: 'rgba(137, 189, 27, 0)' 104 | }], false), 105 | shadowColor: 'rgba(0, 0, 0, 0.1)', 106 | shadowBlur: 10 107 | } 108 | }, 109 | itemStyle: { 110 | normal: { 111 | color: 'rgb(137,189,27)' 112 | } 113 | }, 114 | data: [96.3, 96.4, 97.5, 95.6, 98.1, 94.8, 89.6, 94.1, 80.1, 52.4, 75.8, 94.7] 115 | }, { 116 | name: '桂林-曼芭', 117 | type: 'line', 118 | smooth: true, 119 | lineStyle: { 120 | normal: { 121 | width: 1 122 | } 123 | }, 124 | areaStyle: { 125 | normal: { 126 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 127 | offset: 0, 128 | color: 'rgba(0, 136, 212, 0.3)' 129 | }, { 130 | offset: 0.8, 131 | color: 'rgba(0, 136, 212, 0)' 132 | }], false), 133 | shadowColor: 'rgba(0, 0, 0, 0.1)', 134 | shadowBlur: 10 135 | } 136 | }, 137 | itemStyle: { 138 | normal: { 139 | color: 'rgb(0,136,212)' 140 | } 141 | }, 142 | data: [97.3, 99.2, 99.3, 100.0, 99.6, 90.6, 80.0, 91.5, 69.8, 67.5, 90.4, 84.9] 143 | }, { 144 | name: '南宁-甲米', 145 | type: 'line', 146 | smooth: true, 147 | lineStyle: { 148 | normal: { 149 | width: 1 150 | } 151 | }, 152 | areaStyle: { 153 | normal: { 154 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 155 | offset: 0, 156 | color: 'rgba(219, 50, 51, 0.3)' 157 | }, { 158 | offset: 0.8, 159 | color: 'rgba(219, 50, 51, 0)' 160 | }], false), 161 | shadowColor: 'rgba(0, 0, 0, 0.1)', 162 | shadowBlur: 10 163 | } 164 | }, 165 | itemStyle: { 166 | normal: { 167 | color: 'rgb(219,50,51)' 168 | } 169 | }, 170 | data: [84.2, 81.0, 67.5, 72.1, 43.7, 88.5, 91.9, 101.8, 79.7, 87.6, 92.9, 0] 171 | },] 172 | }; 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /src/app/routes/experiment/demo/demo/demo.component.html: -------------------------------------------------------------------------------- 1 |
2 |

CSS左右滚动

3 |
4 |
    5 |
  • 6 | {{item.title}} 7 |
  • 8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/app/routes/experiment/demo/demo/demo.component.less: -------------------------------------------------------------------------------- 1 | .demo { 2 | padding: 40px; 3 | font-size: 16px; 4 | 5 | p { 6 | margin-bottom: 10px; 7 | a{ 8 | text-decoration: none; 9 | } 10 | } 11 | } 12 | 13 | .demo2 { 14 | width: 100%; 15 | height: 100px; 16 | position: relative; 17 | overflow: hidden; 18 | } 19 | 20 | .list2 li { 21 | float: left; 22 | height: 100px; 23 | margin-right: 20px; 24 | text-align: center; 25 | font-size: 20px; 26 | color: #ccc; 27 | line-height: 100px; 28 | } 29 | -------------------------------------------------------------------------------- /src/app/routes/experiment/demo/demo/demo.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DemoComponent } from './demo.component'; 4 | 5 | describe('DemoComponent', () => { 6 | let component: DemoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DemoComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DemoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/experiment/demo/demo/demo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, AfterViewInit } from '@angular/core'; 2 | import { ApiService } from 'src/app/core/api/api.service'; 3 | declare var require: any; 4 | @Component({ 5 | selector: 'app-demo', 6 | templateUrl: './demo.component.html', 7 | styleUrls: ['./demo.component.less'] 8 | }) 9 | export class DemoComponent implements OnInit, AfterViewInit { 10 | seamless: any; 11 | width: '1740px'; 12 | data = []; 13 | constructor( 14 | private api: ApiService 15 | ) { } 16 | 17 | ngOnInit() { 18 | this.seamless = require('seamscroll'); 19 | this.list(); 20 | } 21 | list() { 22 | for (let index = 0; index < 5; index++) { 23 | this.data.push( 24 | { title: `2019-04-0${index} 12:23 设备编号XXXXXXXXXXXXXX 低温报警 ` } 25 | ); 26 | } 27 | } 28 | start() { 29 | this.seamless.init({ 30 | dom: document.getElementById('demo2'), 31 | direction: 2, 32 | }); 33 | } 34 | ngAfterViewInit(): void { 35 | this.start(); 36 | this.api.isConsole('e', this.data); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/app/routes/experiment/experiment-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { WarningComponent } from './warning/warning.component'; 4 | import { DemoComponent } from './demo/demo/demo.component'; 5 | const routes: Routes = [ 6 | { path: '', redirectTo: 'warining', pathMatch: 'full' }, 7 | { path: 'warining', component: WarningComponent }, 8 | { path: 'demo', component: DemoComponent } 9 | ]; 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule] 13 | }) 14 | export class ExperimentRoutingModules { } 15 | -------------------------------------------------------------------------------- /src/app/routes/experiment/experiment.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { ExperimentModule } from './experiment.module'; 2 | 3 | describe('ExperimentModule', () => { 4 | let experimentModule: ExperimentModule; 5 | 6 | beforeEach(() => { 7 | experimentModule = new ExperimentModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(experimentModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/experiment/experiment.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | import { WarningComponent } from './warning/warning.component'; 4 | import { ExperimentRoutingModules } from './experiment-routing.module'; 5 | import { DemoComponent } from './demo/demo/demo.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | ExperimentRoutingModules 11 | ], 12 | declarations: [WarningComponent, DemoComponent] 13 | }) 14 | export class ExperimentModule { } 15 | -------------------------------------------------------------------------------- /src/app/routes/experiment/warning/warning.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 设备监控报警中心(功能未开启) 5 |
6 | 主页 7 |
8 |
9 |
10 | 11 | 12 |
13 |
14 |
15 |
16 | 17 |

18 | 19 |

20 |
21 |
22 | {{data[0]?.message}} 23 |
24 |
25 |
26 |
27 | 28 |

29 | 30 |

31 |
32 |
33 | {{data[1]?.message}} 34 |
35 |
36 |
37 |
38 |
39 |
40 | 41 |

42 | 43 |

44 |
45 |
46 | {{data[2]?.message}} 47 |
48 |
49 |
50 |
51 | 52 |

53 | 54 |

55 |
56 |
57 | {{data[3]?.message}} 58 |
59 |
60 |
61 |
62 | 63 |

64 | 65 |

66 |
67 |
68 | {{data[4]?.message}} 69 |
70 |
71 |
72 |
73 |
74 | -------------------------------------------------------------------------------- /src/app/routes/experiment/warning/warning.component.less: -------------------------------------------------------------------------------- 1 | #warning { 2 | background: linear-gradient(-90deg, #29bdd9 0%, #276ace 100%); 3 | .warining-header { 4 | height: 50px; 5 | width: 100%; 6 | color: #fff; 7 | background: rgba(255, 255, 255, .2); 8 | display: flex; 9 | align-items: center; 10 | justify-content: space-between; 11 | padding: 0 40px; 12 | font-size: 20px; 13 | letter-spacing: 4px; 14 | a { 15 | color: #fff; 16 | outline: none; 17 | cursor: pointer; 18 | font-size: 14px; 19 | letter-spacing: 1px; 20 | } 21 | } 22 | #main { 23 | display: flex; 24 | flex-flow: column; 25 | align-items: center; 26 | justify-content: space-around; 27 | .warning-row { 28 | display: flex; 29 | .warning-row-item { 30 | width: 400px; 31 | height: 300px; 32 | background: rgba(255, 255, 255, .1); 33 | margin-right: 50px; 34 | .warning-row-item-header { 35 | width: 100%; 36 | height: 50px; 37 | color: #fff; 38 | align-items: center; 39 | display: flex; 40 | justify-content: space-between; 41 | p { 42 | &:hover { 43 | background: rgba(0, 0, 0, .1) 44 | } 45 | cursor: pointer; 46 | width: 40px; 47 | height: 40px; 48 | margin: 0 10px 0 0; 49 | display: flex; 50 | align-items: center; 51 | justify-content: center; 52 | } 53 | label { 54 | margin-left: 20px 55 | } 56 | } 57 | } 58 | .warning-row-item-info { 59 | color: #fff; 60 | padding: 0 20px 20px 20px; 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/app/routes/experiment/warning/warning.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WarningComponent } from './warning.component'; 4 | 5 | describe('WarningComponent', () => { 6 | let component: WarningComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ WarningComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WarningComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/experiment/warning/warning.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { webSocket } from 'rxjs/webSocket'; 3 | import { NzNotificationService } from 'ng-zorro-antd'; 4 | 5 | @Component({ 6 | selector: 'app-warning', 7 | templateUrl: './warning.component.html', 8 | styleUrls: ['./warning.component.less'] 9 | }) 10 | export class WarningComponent implements OnInit { 11 | ws: WebSocket; // 定义websocket 12 | value; 13 | constructor( 14 | private notification: NzNotificationService 15 | ) { } 16 | data = []; 17 | 18 | ngOnInit() { 19 | this.start(); 20 | // this.webSocket(); 21 | // this.connectWs(); 22 | } 23 | send() { 24 | this.ws.send(this.value); 25 | } 26 | connectWs() { 27 | console.log('开启服务'); 28 | if (this.ws != null) { this.ws.close(); } 29 | // this.ws = new WebSocket('ws://localhost:9998/echo'); 30 | const url = 'ws://192.168.1.89:1300/ws/smokeWebSocketServer/ec194e2d6a924820a80fa11cf6728d82/824f9d03649347998a2fa42797449850'; 31 | this.ws = new WebSocket(url); 32 | const that = this; 33 | this.ws.onopen = function (event) { 34 | // socket 开启后执行,可以向后端传递信息 35 | // alert('数据发送中...'); 36 | }; 37 | this.ws.onmessage = function (event) { 38 | console.log('event', event.data); 39 | for (let i = 0; i < Number(event.data); i++) { 40 | if (that.data.length < 5) { 41 | that.data.push( 42 | { 43 | time: '2019-1-16 10:09', 44 | message: Math.random() 45 | }, 46 | ); 47 | } 48 | } 49 | console.log('data', that.data); 50 | }; 51 | this.ws.onerror = function (event) { 52 | // socket error信息 53 | 54 | }; 55 | this.ws.onclose = function (event) { 56 | // socket 关闭后执行 57 | alert('连接已关闭...'); 58 | }; 59 | } 60 | start() { 61 | const warning = document.getElementById('warning'); 62 | const main = document.getElementById('main'); 63 | warning.style.width = window.innerWidth + 'px'; 64 | warning.style.height = window.innerHeight + 'px'; 65 | main.style.height = (window.innerHeight - 50) + 'px'; 66 | warning.style.width = window.innerWidth + 'px'; 67 | } 68 | close(num) { 69 | this.data.splice(num, 1); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/app/routes/index/index-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { ListComponent } from './list/list.component'; 4 | import { InfoComponent } from './info/info.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', redirectTo: 'info', pathMatch: 'full' }, 8 | { 9 | path: 'list', component: ListComponent 10 | }, 11 | { 12 | path: 'info', component: InfoComponent 13 | }, 14 | ]; 15 | @NgModule({ 16 | imports: [RouterModule.forChild(routes)], 17 | exports: [RouterModule] 18 | }) 19 | export class IndexRoutingModule { } 20 | -------------------------------------------------------------------------------- /src/app/routes/index/index.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { IndexModule } from './index.module'; 2 | 3 | describe('IndexModule', () => { 4 | let indexModule: IndexModule; 5 | 6 | beforeEach(() => { 7 | indexModule = new IndexModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(indexModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/index/index.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | import { IndexRoutingModule } from './index-routing.module'; 4 | import { ListComponent } from './list/list.component'; 5 | import { InfoComponent } from './info/info.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | IndexRoutingModule 11 | ], 12 | declarations: [ 13 | ListComponent, 14 | InfoComponent] 15 | }) 16 | export class IndexModule { } 17 | -------------------------------------------------------------------------------- /src/app/routes/index/info/info.component.html: -------------------------------------------------------------------------------- 1 |

2 | 🦌鹿途系统正在开发中。。。。。 3 |

-------------------------------------------------------------------------------- /src/app/routes/index/info/info.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/index/info/info.component.less -------------------------------------------------------------------------------- /src/app/routes/index/info/info.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { InfoComponent } from './info.component'; 4 | 5 | describe('InfoComponent', () => { 6 | let component: InfoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ InfoComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(InfoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/index/info/info.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Inject } from '@angular/core'; 2 | import { ApiService } from '../../../core/api/api.service'; 3 | import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth'; 4 | import { InfoService } from '../services/info.service'; 5 | import { Router } from '@angular/router'; 6 | 7 | @Component({ 8 | selector: 'app-info', 9 | templateUrl: './info.component.html', 10 | styleUrls: ['./info.component.less'] 11 | }) 12 | export class InfoComponent implements OnInit { 13 | title; 14 | constructor( 15 | private api: ApiService, 16 | private infoApi: InfoService, 17 | @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, 18 | private router: Router, 19 | ) { } 20 | 21 | ngOnInit() { 22 | this.title = this.api.urlPrefix; 23 | console.log(this.tokenService.get()); 24 | this.infoApi.getIdentity() 25 | .subscribe(res => { 26 | console.log(res); 27 | }); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/app/routes/index/list/list.component.html: -------------------------------------------------------------------------------- 1 |

2 | list works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/index/list/list.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/index/list/list.component.less -------------------------------------------------------------------------------- /src/app/routes/index/list/list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ListComponent } from './list.component'; 4 | 5 | describe('ListComponent', () => { 6 | let component: ListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ ListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(ListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/index/list/list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-list', 5 | templateUrl: './list.component.html', 6 | styleUrls: ['./list.component.less'] 7 | }) 8 | export class ListComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/index/services/info.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { InfoService } from './info.service'; 4 | 5 | describe('InfoService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [InfoService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([InfoService], (service: InfoService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/routes/index/services/info.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ApiService } from '../../../core/api/api.service'; 3 | 4 | @Injectable({ 5 | providedIn: 'root' 6 | }) 7 | export class InfoService { 8 | 9 | constructor( 10 | private api: ApiService 11 | ) { } 12 | getIdentity() { 13 | return this.api.get('questionnaire/party/identity'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/list/list-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { TableListComponent } from './table-list/table-list.component'; 4 | import { TableDynamicComponent } from './table-dynamic/table-dynamic.component'; 5 | import { TreeComponent } from './tree/tree.component'; 6 | 7 | const routes: Routes = [ 8 | { path: '', redirectTo: 'list-table', pathMatch: 'full' }, 9 | { path: 'list-table', component: TableListComponent }, 10 | { path: 'dynamic-table', component: TableDynamicComponent }, 11 | { path: 'tree', component: TreeComponent } 12 | ]; 13 | @NgModule({ 14 | imports: [RouterModule.forChild(routes)], 15 | exports: [RouterModule] 16 | }) 17 | export class ListRoutingModule { } 18 | -------------------------------------------------------------------------------- /src/app/routes/list/list.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { ListModule } from './list.module'; 2 | 3 | describe('ListModule', () => { 4 | let listModule: ListModule; 5 | 6 | beforeEach(() => { 7 | listModule = new ListModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(listModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/list/list.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | import { ListRoutingModule } from './list-routing.module'; 4 | import { TableListComponent } from './table-list/table-list.component'; 5 | import { CoreModule } from '../../core/core.module'; 6 | import { TableDynamicComponent } from './table-dynamic/table-dynamic.component'; 7 | import { TreeComponent } from './tree/tree.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | SharedModule, 12 | ListRoutingModule, 13 | CoreModule 14 | ], 15 | declarations: [TableListComponent, TableDynamicComponent, TreeComponent] 16 | }) 17 | export class ListModule { } 18 | -------------------------------------------------------------------------------- /src/app/routes/list/table-dynamic/table-dynamic.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | 动态表格是结合基础表格和我工作过程总结的经验进行二次封装;以下示例只为演示功能,表头在切换时可能存在缺失见谅。 5 |

6 |
7 |
8 | 表格标题: 9 |
10 |
11 | 表格尾部: 12 |
13 |
14 | 页面是否加载中: 15 |
16 |
17 | 是否展示外边框和列边框: 18 |
19 |
20 |
21 |
22 | 多选框: 23 |
24 |
25 | 单选框: 26 |
27 |
28 | 状态控制: 29 |
30 |
31 | 大小: 32 | 33 | 34 | 35 | 36 |
37 |
38 |
39 | 41 | 42 |
43 | 注:动态表格关闭了默认分页,用了分页组件,动态表格的操作列表可以根据需要做出调整,动态表格是我根据实际工作进行的封装,在实际开发中会有功能变动, 44 | 鹿途只对一些通用基础功能进行展示。 45 |
46 |
47 | -------------------------------------------------------------------------------- /src/app/routes/list/table-dynamic/table-dynamic.component.less: -------------------------------------------------------------------------------- 1 | .dynamic-table { 2 | margin: 40px 3 | } 4 | 5 | .dynamic-table-header { 6 | margin-bottom: 20px 7 | } 8 | 9 | .dynamic-table-header { 10 | margin-top: 20px; 11 | } -------------------------------------------------------------------------------- /src/app/routes/list/table-dynamic/table-dynamic.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TableDynamicComponent } from './table-dynamic.component'; 4 | 5 | describe('TableDynamicComponent', () => { 6 | let component: TableDynamicComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TableDynamicComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TableDynamicComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/list/table-dynamic/table-dynamic.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { DwDynamicTable } from 'src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component'; 3 | 4 | @Component({ 5 | selector: 'app-table-dynamic', 6 | templateUrl: './table-dynamic.component.html', 7 | styleUrls: ['./table-dynamic.component.less'] 8 | }) 9 | export class TableDynamicComponent implements OnInit { 10 | 11 | constructor() { } 12 | switchTitle = true; 13 | switchFooter = true; 14 | switchLoading = false; 15 | switchBordered = true; 16 | switchChecked = true; 17 | switchCheckedSingle = false; 18 | switchState = true; 19 | size = 'default'; 20 | tableDatas: DwDynamicTable = { 21 | title: '🦌鹿途', 22 | footer: '🦌鹿途后台管理系统', 23 | loading: false, 24 | bordered: true, 25 | checked: true, 26 | checkedSingle: false, 27 | itemLength: 0, 28 | switch: true, 29 | switchName: 'isOut', 30 | size: 'default', 31 | pagination: true, 32 | total: 0, 33 | pageSize: 10, 34 | pageIndex: 1, 35 | dataTh: [ 36 | { 37 | title: '序号', 38 | }, 39 | { 40 | title: '姓名', 41 | }, 42 | { 43 | title: '年龄', 44 | }, 45 | { 46 | title: '编号' 47 | }, 48 | { 49 | title: '地址', 50 | }, 51 | { 52 | title: '状态', 53 | }, 54 | { 55 | title: '操作', 56 | }, 57 | ], 58 | tdItem: [ 59 | { name: 'key' }, 60 | { name: 'name' }, 61 | { name: 'age' }, 62 | { name: 'number' }, 63 | { name: 'address' }, 64 | ], 65 | dataSet: [] 66 | }; 67 | ngOnInit() { 68 | this.tableList(); 69 | } 70 | tableList() { 71 | const dataSet = [ 72 | { 73 | key: '1', 74 | name: '莫希宇', 75 | age: 26, 76 | number: 10, 77 | isOut: 0, 78 | address: '上海市浦东新区盛夏路560号' 79 | }, 80 | { 81 | key: '2', 82 | name: '刘畅', 83 | age: 25, 84 | number: 8, 85 | isOut: 0, 86 | address: '上海市浦东新区高科中路333号' 87 | }, 88 | { 89 | key: '3', 90 | name: '左立军', 91 | age: 28, 92 | number: 3, 93 | isOut: 1, 94 | address: '上海市浦东新区祖冲之路40号' 95 | }, 96 | { 97 | key: '1', 98 | name: '李现', 99 | age: 22, 100 | number: 14, 101 | isOut: 0, 102 | address: '上海市浦东新区紫薇路18号' 103 | }, 104 | { 105 | key: '2', 106 | name: '陈哲', 107 | age: 42, 108 | number: 2, 109 | isOut: 1, 110 | address: '上海市浦东新区张江路88号' 111 | }, 112 | { 113 | key: '3', 114 | name: '巫景飞', 115 | age: 32, 116 | number: 13, 117 | isOut: 0, 118 | address: '上海市浦东新区斜土路599号' 119 | } 120 | ]; 121 | this.tableDatas.itemLength = dataSet.length; 122 | this.tableDatas.dataSet = dataSet; 123 | this.tableDatas.total = dataSet.length; 124 | } 125 | clickSwitch(type) { 126 | const checked = [ 127 | { 128 | title: '序号', 129 | }, 130 | { 131 | title: '姓名', 132 | }, 133 | { 134 | title: '年龄', 135 | }, 136 | { 137 | title: '编号' 138 | }, 139 | { 140 | title: '地址', 141 | }, 142 | { 143 | title: '状态', 144 | }, 145 | { 146 | title: '操作', 147 | }, 148 | ]; 149 | const single = [ 150 | { 151 | title: '选择', 152 | }, 153 | { 154 | title: '序号', 155 | }, 156 | { 157 | title: '姓名', 158 | }, 159 | { 160 | title: '年龄', 161 | }, 162 | { 163 | title: '编号' 164 | }, 165 | { 166 | title: '地址', 167 | }, 168 | { 169 | title: '状态', 170 | }, 171 | { 172 | title: '操作', 173 | }, 174 | ]; 175 | if (type === 'title') { 176 | if (this.switchTitle) { 177 | this.tableDatas.title = '🦌鹿途'; 178 | } else { 179 | delete this.tableDatas.title; 180 | } 181 | } 182 | if (type === 'footer') { 183 | if (this.switchFooter) { 184 | this.tableDatas.footer = '🦌鹿途后台管理系统'; 185 | } else { 186 | delete this.tableDatas.footer; 187 | } 188 | } 189 | if (type === 'loading') { 190 | if (this.switchLoading) { 191 | this.tableDatas.loading = true; 192 | } else { 193 | this.tableDatas.loading = false; 194 | } 195 | } 196 | if (type === 'bordered') { 197 | if (this.switchBordered) { 198 | this.tableDatas.bordered = true; 199 | } else { 200 | this.tableDatas.bordered = false; 201 | } 202 | } 203 | if (type === 'checked') { 204 | if (this.switchChecked) { 205 | this.tableDatas.checked = this.switchChecked; 206 | this.tableDatas.checkedSingle = !this.switchChecked; 207 | this.switchCheckedSingle = !this.switchChecked; 208 | this.tableDatas.dataTh = checked; 209 | } else { 210 | this.tableDatas.checked = this.switchChecked; 211 | this.tableDatas.checked = this.switchChecked; 212 | this.switchCheckedSingle = !this.switchChecked; 213 | } 214 | } 215 | if (type === 'checkedsingle') { 216 | if (this.switchCheckedSingle) { 217 | this.tableDatas.checkedSingle = this.switchCheckedSingle; 218 | this.tableDatas.checked = !this.switchCheckedSingle; 219 | this.switchChecked = !this.switchCheckedSingle; 220 | this.tableDatas.dataTh = single; 221 | } else { 222 | this.tableDatas.checkedSingle = this.switchCheckedSingle; 223 | this.tableDatas.checked = !this.switchCheckedSingle; 224 | this.switchChecked = !this.switchCheckedSingle; 225 | this.tableDatas.dataTh = checked; 226 | } 227 | } 228 | if (type === 'state') { 229 | if (this.switchState) { 230 | this.tableDatas.switch = true; 231 | this.tableDatas.dataTh = [ 232 | { 233 | title: '序号', 234 | }, 235 | { 236 | title: '姓名', 237 | }, 238 | { 239 | title: '年龄', 240 | }, 241 | { 242 | title: '编号' 243 | }, 244 | { 245 | title: '地址', 246 | }, 247 | { 248 | title: '状态', 249 | }, 250 | { 251 | title: '操作', 252 | }, 253 | ]; 254 | } else { 255 | this.tableDatas.switch = false; 256 | this.tableDatas.dataTh = [ 257 | { 258 | title: '序号', 259 | }, 260 | { 261 | title: '姓名', 262 | }, 263 | { 264 | title: '年龄', 265 | }, 266 | { 267 | title: '编号' 268 | }, 269 | { 270 | title: '地址', 271 | }, 272 | { 273 | title: '操作', 274 | }, 275 | ]; 276 | } 277 | } 278 | } 279 | checked($event) { 280 | console.log($event); 281 | } 282 | checkedSingle($event) { 283 | console.log($event); 284 | } 285 | switch($event) { 286 | console.log($event); 287 | } 288 | delete($event) { 289 | console.log($event); 290 | } 291 | edit($event) { 292 | console.log($event); 293 | } 294 | sizeClick() { 295 | this.tableDatas.size = this.size; 296 | } 297 | page($event) { 298 | console.log($event); 299 | this.tableDatas.pageIndex = $event; 300 | } 301 | } 302 | -------------------------------------------------------------------------------- /src/app/routes/list/table-list/table-list.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 | 5 |
6 | 8 | 9 |
10 | 11 |

{{itemModel?.key}}

12 |

{{itemModel?.age}}

13 |

{{itemModel?.name}}

14 |

{{itemModel?.address}}

15 | 16 |
17 | -------------------------------------------------------------------------------- /src/app/routes/list/table-list/table-list.component.less: -------------------------------------------------------------------------------- 1 | .dw-table-list { 2 | display: flex; 3 | justify-content: center; 4 | flex-direction: column; 5 | margin: 40px; 6 | .dw-table-sort { 7 | margin-bottom: 20px; 8 | display: flex; 9 | justify-content: space-between; 10 | align-items: center; 11 | } 12 | } -------------------------------------------------------------------------------- /src/app/routes/list/table-list/table-list.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TableListComponent } from './table-list.component'; 4 | 5 | describe('TableListComponent', () => { 6 | let component: TableListComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TableListComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TableListComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/list/table-list/table-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { DwTable } from '../../../shared/meta/dw-table/dw-table.component'; 3 | import { NzNotificationService } from 'ng-zorro-antd'; 4 | import { SearchData } from '../../../shared/meta/dw-search/dw-search.component'; 5 | import { DatePicker } from '../../../shared/meta/dw-date-picker/dw-date-picker.component'; 6 | import { InfoModel } from '../../../shared/meta/dw-info-model/dw-info-model.component'; 7 | 8 | @Component({ 9 | selector: 'app-table-list', 10 | templateUrl: './table-list.component.html', 11 | styleUrls: ['./table-list.component.less'] 12 | }) 13 | export class TableListComponent implements OnInit { 14 | itemModel; 15 | isLoadingSave = false; 16 | saveTitle = '保存'; 17 | Dw = { 18 | listOfSearchName: '' || [], 19 | sortName: '', 20 | sortValue: 0, 21 | searchValue: '', 22 | startTime: '', 23 | endTime: '' 24 | }; 25 | infoModel: InfoModel = { 26 | isVisible: false, 27 | nzTitle: '员工信息' 28 | }; 29 | datePicker: DatePicker = { 30 | nzSize: 'large', 31 | startPlaceHolder: '开始时间', 32 | endtPlaceHolder: '结束时间', 33 | ShowToday: false, 34 | Format: 'yyyy-MM-dd' 35 | 36 | }; 37 | searchData: SearchData = { 38 | placeholder: '搜索:姓名、地址', 39 | nzSize: 'large' 40 | }; 41 | tableDatas: DwTable = { 42 | nzShowPagination: false, 43 | nzShowAction: true, 44 | nzBordered: true, 45 | nzTitle: '基础表格封装示例', 46 | dataTh: [ 47 | { 48 | title: '姓名', 49 | }, 50 | { 51 | title: '年龄', 52 | nzShowSort: true, 53 | nzSortKey: 'age', 54 | sort: 'age' 55 | }, 56 | { 57 | title: '工龄', 58 | nzShowSort: true, 59 | nzSortKey: 'number', 60 | sort: 'number' 61 | }, 62 | { 63 | title: '地址', 64 | nzShowFilter: true, 65 | sort: 'address', 66 | nzShowFilterList: [ 67 | { text: 'hello', value: 3 }, 68 | { text: 'word', value: 4 } 69 | ] 70 | }, 71 | { 72 | title: '操作' 73 | } 74 | ], 75 | sortMap: { 76 | name: null, 77 | age: null, 78 | number: null, 79 | address: null 80 | }, 81 | dataSet: [ 82 | { 83 | key: '1', 84 | name: '莫希宇', 85 | age: 26, 86 | number: 10, 87 | address: '上海市浦东新区盛夏路560号' 88 | }, 89 | { 90 | key: '2', 91 | name: '刘畅', 92 | age: 25, 93 | number: 8, 94 | address: '上海市浦东新区高科中路333号' 95 | }, 96 | { 97 | key: '3', 98 | name: '左立军', 99 | age: 28, 100 | number: 3, 101 | address: '上海市浦东新区祖冲之路40号' 102 | }, 103 | { 104 | key: '1', 105 | name: '李现', 106 | age: 22, 107 | number: 14, 108 | address: '上海市浦东新区紫薇路18号' 109 | }, 110 | { 111 | key: '2', 112 | name: '陈哲', 113 | age: 42, 114 | number: 2, 115 | address: '上海市浦东新区张江路88号' 116 | }, 117 | { 118 | key: '3', 119 | name: '巫景飞', 120 | age: 32, 121 | number: 13, 122 | address: '上海市浦东新区斜土路599号' 123 | } 124 | ] 125 | }; 126 | 127 | constructor( 128 | private notification: NzNotificationService 129 | ) { } 130 | 131 | ngOnInit() { 132 | } 133 | /**保存修改 */ 134 | save() { 135 | this.isLoadingSave = true; 136 | this.saveTitle = '保存中...'; 137 | setTimeout(() => { 138 | this.infoModel.isVisible = false; 139 | this.isLoadingSave = false; 140 | this.saveTitle = '保存'; 141 | this.notification.create('success', '系统提示', 142 | '保存成功'); 143 | }, 1000); 144 | console.log('保存'); 145 | } 146 | /** 改变筛选状态 */ 147 | launchSort($event) { 148 | const sortName = $event.name; 149 | const sortValue = $event.value; 150 | const sortMap = this.tableDatas.sortMap; 151 | // tslint:disable-next-line:forin 152 | for (const key in sortMap) { 153 | sortMap[key] = (key === sortName ? sortValue : null) 154 | } 155 | 156 | } 157 | /** 排序筛选*/ 158 | launchTbData($event) { 159 | if ($event.hasOwnProperty('listOfSearchName')) { 160 | this.Dw.listOfSearchName = $event.listOfSearchName; 161 | } 162 | if ($event.hasOwnProperty('sortName')) { 163 | this.Dw.sortName = $event.sortName; 164 | } 165 | if ($event.hasOwnProperty('sortValue')) { 166 | this.Dw.sortValue = $event.sortValue; 167 | } 168 | console.log('筛选数据', this.Dw); 169 | this.tableDatas.dataSet = [ 170 | { 171 | key: '1', 172 | name: '李现', 173 | age: 22, 174 | number: 14, 175 | address: '上海市浦东新区紫薇路18号' 176 | }, 177 | { 178 | key: '2', 179 | name: '陈哲', 180 | age: 42, 181 | number: 2, 182 | address: '上海市浦东新区张江路88号' 183 | }, 184 | ]; 185 | 186 | } 187 | /** 删除数据*/ 188 | launchDelete($event) { 189 | console.log('delete', $event); 190 | } 191 | /** 编辑数据*/ 192 | launchEdit($event) { 193 | this.itemModel = $event; 194 | this.infoModel.isVisible = true; 195 | } 196 | /** 关闭模态框*/ 197 | launchInfoModel($event) { 198 | this.infoModel.isVisible = $event; 199 | } 200 | /** 搜索*/ 201 | launchSearch($event) { 202 | this.Dw.searchValue = $event; 203 | console.log('筛选内容', this.Dw); 204 | this.tableDatas.dataSet = [ 205 | { 206 | key: '1', 207 | name: '李现', 208 | age: 22, 209 | number: 14, 210 | address: '上海市浦东新区紫薇路18号' 211 | } 212 | ]; 213 | } 214 | /**开始时间 */ 215 | launchStart($event) { 216 | this.Dw.startTime = $event; 217 | console.log('start', $event); 218 | console.log('筛选数据', this.Dw); 219 | } 220 | /**结束时间 */ 221 | launchEnd($event) { 222 | this.Dw.endTime = $event; 223 | console.log('end', $event); 224 | console.log('筛选数据', this.Dw); 225 | } 226 | } 227 | -------------------------------------------------------------------------------- /src/app/routes/list/tree/tree.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 |
7 | 13 |
14 |
15 |

标题: {{title}}

16 |

图标: icon

17 |

排序: 1

18 |

资源路径: list/table

19 |

描述:

20 |
21 |
22 | 23 |
24 |
25 |
26 | -------------------------------------------------------------------------------- /src/app/routes/list/tree/tree.component.less: -------------------------------------------------------------------------------- 1 | .tree { 2 | padding: 20px; 3 | display: flex; 4 | } 5 | 6 | .btn { 7 | padding: 20px 20px 0 20px; 8 | 9 | [nz-button] { 10 | margin-right: 20px; 11 | } 12 | } 13 | 14 | .menu { 15 | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); 16 | width: 20%; 17 | height: 800px; 18 | font-size: 16px; 19 | 20 | input { 21 | width: 90%; 22 | margin: 20px; 23 | } 24 | } 25 | 26 | .tree-table { 27 | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); 28 | width: 95%; 29 | height: 480px; 30 | margin: 0 0 20px 50px; 31 | padding: 20px; 32 | font-size: 16px; 33 | } 34 | 35 | .tree-btn { 36 | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); 37 | width: 95%; 38 | height: 300px; 39 | margin-left: 50px; 40 | padding: 20px; 41 | font-size: 16px; 42 | } 43 | -------------------------------------------------------------------------------- /src/app/routes/list/tree/tree.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { TreeComponent } from './tree.component'; 4 | 5 | describe('TreeComponent', () => { 6 | let component: TreeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ TreeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(TreeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/list/tree/tree.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild } from '@angular/core'; 2 | import { NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd'; 3 | @Component({ 4 | selector: 'app-tree', 5 | templateUrl: './tree.component.html', 6 | styleUrls: ['./tree.component.less'] 7 | }) 8 | export class TreeComponent implements OnInit { 9 | @ViewChild('treeCom') treeCom; 10 | searchValue: any; 11 | nodes = [ 12 | { 13 | title: '安装工单', 14 | key: '100', 15 | expanded: true, 16 | children: [ 17 | { title: '安装工单', key: '1001', icon: 'anticon anticon-meh-o', isLeaf: true }, 18 | ] 19 | }, 20 | { 21 | title: 'NB烟感数据', 22 | key: '101', 23 | expanded: true, 24 | children: [ 25 | { title: '报警数据', key: '1002', icon: 'home', isLeaf: true }, 26 | { title: '设备自检', key: '1003', icon: 'exception', isLeaf: true }, 27 | { title: '设备故障', key: '1004', icon: 'setting', isLeaf: true }, 28 | { title: '设备心跳', key: '1005', icon: 'smile', isLeaf: true }, 29 | ] 30 | } 31 | ]; 32 | title = '安装工单'; 33 | 34 | constructor() { } 35 | 36 | ngOnInit() { 37 | } 38 | nzEvent(event: NzFormatEmitEvent): void { 39 | this.title = event.node.title; 40 | const key = event.keys; 41 | console.log(this.treeCom.getSelectedNodeList()); 42 | } 43 | searchNode(event: NzFormatEmitEvent): void { 44 | console.log(event, this.treeCom.getMatchedNodeList().map(v => v.title)); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/app/routes/map/map-demo/map-demo.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

牧场名称:{{data?.farmName}}

4 | 5 |

暂无牧场围栏范围,请绘制

6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 |
15 | -------------------------------------------------------------------------------- /src/app/routes/map/map-demo/map-demo.component.less: -------------------------------------------------------------------------------- 1 | .mapdemo{ 2 | padding: 20px; 3 | } 4 | .ponit{ 5 | min-height: 800px; 6 | } 7 | #scopeMap{ 8 | height: 600px; 9 | } -------------------------------------------------------------------------------- /src/app/routes/map/map-demo/map-demo.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MapDemoComponent } from './map-demo.component'; 4 | 5 | describe('MapDemoComponent', () => { 6 | let component: MapDemoComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MapDemoComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MapDemoComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/map/map-demo/map-demo.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | declare var BMap: any; 3 | declare var BMapLib: any; 4 | declare var BMAP_DRAWING_POLYGON; 5 | declare var BMAP_ANCHOR_TOP_RIGHT; 6 | declare var BMAP_DRAWING_CIRCLE; 7 | @Component({ 8 | selector: 'app-map-demo', 9 | templateUrl: './map-demo.component.html', 10 | styleUrls: ['./map-demo.component.less'] 11 | }) 12 | export class MapDemoComponent implements OnInit { 13 | 14 | map: any; 15 | overlays = []; 16 | PolygonData = [ 17 | { lng: 116.401503, lat: 39.920147 }, 18 | { lng: 116.407432, lat: 39.918791 }, 19 | { lng: 116.405024, lat: 39.915055 }, 20 | { lng: 116.399922, lat: 39.915221 }, 21 | { lng: 116.401503, lat: 39.920147 } 22 | ]; 23 | Polygon; 24 | isPolygon = false; 25 | isPolygonFisrt = false; 26 | drawingManager; 27 | overlaycomplete; 28 | styleOptions = { 29 | // tslint:disable-next-line: comment-format 30 | strokeColor: '#2E8B57', //边线颜色。 31 | // tslint:disable-next-line: comment-format 32 | fillColor: '#388E8E', //填充颜色。当参数为空时,圆形将没有填充效果。 33 | // tslint:disable-next-line: comment-format 34 | strokeWeight: 2, //边线的宽度,以像素为单位。 35 | strokeOpacity: 0.8, // 边线透明度,取值范围0 - 1。 36 | fillOpacity: 0.3, // 填充的透明度,取值范围0 - 1。 37 | strokeStyle: 'solid' // 边线的样式,solid或dashed。 38 | }; 39 | constructor() { } 40 | 41 | ngOnInit() { 42 | this.map = new BMap.Map('scopeMap'); 43 | this.start(); 44 | } 45 | start() { 46 | var that = this; 47 | const poi = new BMap.Point(116.404, 39.915); 48 | that.map.centerAndZoom(poi, 16); // 设置中心点坐标和地图级别 49 | that.map.enableScrollWheelZoom(); // 启用鼠标滚动对地图放大缩小 50 | 51 | if (that.PolygonData.length) { 52 | var ponits = []; 53 | // this.isPolygonFisrt = true; 54 | this.PolygonData.forEach(element => { 55 | ponits.push(new BMap.Point(element.lng, element.lat)); 56 | }); 57 | that.map.clearOverlays(); 58 | that.Polygon = new BMap.Polygon(ponits, this.styleOptions); //创建多边 59 | that.map.addOverlay(this.Polygon); //创建多边 60 | } 61 | // 回调获得覆盖物信息 62 | const overlaycomplete = function (e) { 63 | that.overlaycomplete = e; 64 | // 将多边形保存到数组 65 | that.overlays.push(e.overlay); 66 | // 开启编辑模式 67 | e.overlay.enableEditing(); 68 | }; 69 | 70 | // 实例化鼠标绘制工具 71 | that.drawingManager = new BMapLib.DrawingManager(this.map, { 72 | 73 | isOpen: false, // 是否开启绘制模式 74 | enableDrawingTool: true, // 是否显示工具栏 75 | drawingMode: BMAP_DRAWING_POLYGON, // 绘制模式 多边形 76 | drawingToolOptions: { 77 | anchor: BMAP_ANCHOR_TOP_RIGHT, // 位置 78 | offset: new BMap.Size(5, 5), // 偏离值 79 | drawingModes: [ 80 | BMAP_DRAWING_POLYGON,// 仅支持多边形 81 | // BMAP_DRAWING_CIRCLE 82 | ] 83 | }, 84 | polygonOptions: that.styleOptions, // 设置多边形的样式 85 | // circleOptions: that.styleOptions 86 | }); 87 | 88 | // 添加鼠标绘制工具监听事件,用于获取绘制结果 89 | that.drawingManager.addEventListener('overlaycomplete', overlaycomplete); 90 | } 91 | //保存地图 92 | save() { 93 | var map = this.map; 94 | var overlays = this.overlays;//获取存放的多边形数组 95 | var ponits = []; 96 | if (this.overlays.length) { 97 | var path = overlays[0].getPath();//获取第一个多边形 98 | for (var i = 0; i < path.length; i++) { 99 | // console.log("坐标为:lng:" + path[i].lng + " lat:" + path[i].lat); 100 | ponits.push(new BMap.Point(path[i].lng, path[i].lat)) 101 | // 保存数据 102 | this.PolygonData.push({ lng: path[i].lng, lat: path[i].lat }); 103 | 104 | } 105 | this.Polygon = new BMap.Polygon(ponits, this.styleOptions); //创建多边 106 | map.addOverlay(this.Polygon); //创建多边 107 | this.rest(); 108 | } 109 | if (this.isPolygon) { 110 | this.PolygonData.length = 0; 111 | var ponits = []; 112 | this.Polygon.ia.forEach(element => { 113 | ponits.push(new BMap.Point(element.lng, element.lat)); 114 | // 保存数据 115 | this.PolygonData.push({ lng: element.lng, lat: element.lat }); 116 | }); 117 | this.map.clearOverlays(); 118 | this.Polygon = new BMap.Polygon(ponits, this.styleOptions); //创建多边 119 | map.addOverlay(this.Polygon); //创建多边 120 | console.log(this.PolygonData); 121 | } 122 | 123 | } 124 | /**编辑范围 */ 125 | update() { 126 | this.Polygon.enableEditing(); 127 | this.isPolygon = true; 128 | } 129 | /**清除未保存前的绘制 */ 130 | rest() { 131 | for (let i = 0; i < this.overlays.length; i++) { 132 | this.map.removeOverlay(this.overlays[i]); 133 | } 134 | this.overlays.length = 0; 135 | } 136 | /** 重新绘制*/ 137 | clear() { 138 | this.PolygonData.length = 0; 139 | this.map.clearOverlays(); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /src/app/routes/map/map-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { MarkerComponent } from './marker/marker.component'; 4 | import { StartComponent } from './start/start.component'; 5 | import { MapDemoComponent } from './map-demo/map-demo.component'; 6 | const routes: Routes = [ 7 | { path: '', redirectTo: 'marker', pathMatch: 'full' }, 8 | { 9 | path: 'marker', component: MarkerComponent 10 | }, 11 | { 12 | path: 'start', component: StartComponent 13 | }, 14 | { 15 | path: 'demo', component: MapDemoComponent 16 | } 17 | ]; 18 | @NgModule({ 19 | imports: [RouterModule.forChild(routes)], 20 | exports: [RouterModule] 21 | }) 22 | export class MapRoutingModule { } 23 | -------------------------------------------------------------------------------- /src/app/routes/map/map.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { MapModule } from './map.module'; 2 | 3 | describe('MapModule', () => { 4 | let mapModule: MapModule; 5 | 6 | beforeEach(() => { 7 | mapModule = new MapModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(mapModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/map/map.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MarkerComponent } from './marker/marker.component'; 3 | import { MapRoutingModule } from './map-routing.module'; 4 | import { SharedModule } from '../../shared/shared.module'; 5 | import { StartComponent } from './start/start.component'; 6 | import { AbmModule } from 'angular-baidu-maps'; 7 | import { MapDemoComponent } from './map-demo/map-demo.component'; 8 | 9 | @NgModule({ 10 | imports: [ 11 | SharedModule, 12 | MapRoutingModule, 13 | AbmModule.forRoot({ 14 | apiKey: 'D7f130ce4be999b80a56cfd12ab06a7a' 15 | }) 16 | ], 17 | declarations: [ 18 | MarkerComponent, 19 | StartComponent, 20 | MapDemoComponent 21 | ] 22 | }) 23 | export class MapModule { } 24 | -------------------------------------------------------------------------------- /src/app/routes/map/marker/marker.component.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/map/marker/marker.component.css -------------------------------------------------------------------------------- /src/app/routes/map/marker/marker.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/routes/map/marker/marker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { MarkerComponent } from './marker.component'; 4 | 5 | describe('MarkerComponent', () => { 6 | let component: MarkerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ MarkerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(MarkerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/map/start/start.component.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/routes/map/start/start.component.less: -------------------------------------------------------------------------------- 1 | #container { 2 | height: 100% 3 | } -------------------------------------------------------------------------------- /src/app/routes/map/start/start.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { StartComponent } from './start.component'; 4 | 5 | describe('StartComponent', () => { 6 | let component: StartComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ StartComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(StartComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/map/start/start.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core'; 2 | import { AbmComponent } from 'angular-baidu-maps'; 3 | 4 | declare const BMap: any; 5 | declare const BMAP_SATELLITE_MAP: any; 6 | @Component({ 7 | selector: 'app-start', 8 | templateUrl: './start.component.html', 9 | styleUrls: ['./start.component.less'] 10 | }) 11 | export class StartComponent implements OnInit, OnDestroy { 12 | resize = (document.body.clientHeight - 181) + 'px'; 13 | options: any = {}; 14 | status = ''; 15 | @ViewChild('map') mapComp: AbmComponent; 16 | _map: any; 17 | satelliteOptions: any; 18 | mapSatellite: any; 19 | onReady(map: any) { 20 | this._map = map; 21 | map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); 22 | map.addControl(new BMap.MapTypeControl()); 23 | map.setCurrentCity('北京'); 24 | map.enableScrollWheelZoom(true); 25 | this.status = '加载完成'; 26 | // 添加监听事件 27 | map.addEventListener('tilesloaded', () => { 28 | this.status = '地图加载完毕'; 29 | }); 30 | map.addEventListener('click', this._click.bind(this)); 31 | } 32 | constructor() { } 33 | 34 | ngOnInit() { 35 | } 36 | 37 | _click(e: any) { 38 | this.status = `${e.point.lng}, ${e.point.lat}, ${+new Date()}`; 39 | } 40 | 41 | // 卫星 42 | onReadySatellite(map: any) { 43 | map.centerAndZoom(new BMap.Point(116.404, 39.915), 11); 44 | map.setMapType(BMAP_SATELLITE_MAP); 45 | this.mapSatellite = map; 46 | } 47 | ngOnDestroy(): void { 48 | this._map.removeEventListener('click', this._click.bind(this)); 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/app/routes/outside/html2canvas/html2canvas.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | (更新了版本,导出的图片部分样式丢死,不兼容svg,emmmm...以前好像没问题,再议,再议) 9 | 10 |
11 |
12 | 15 |
16 |
17 | 作者 18 | (周榜) 19 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 排名 29 | 30 | 31 | 代表作品 32 | 33 | 34 | 作者 35 | 36 | 37 | 人气 38 | 39 | 40 | 41 | 42 | 43 | 44 | -- 45 | NEW 46 | 47 | {{data.rank_change}} 48 | 49 | {{data.rank_change}} 50 | 51 | 52 | {{i+1}} 53 | 54 | {{data.writer_name}} 55 | {{data.opus }} 56 | 57 | 58 | 59 | 60 | 61 | 62 | 68 |
69 | 70 | -------------------------------------------------------------------------------- /src/app/routes/outside/html2canvas/html2canvas.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Html2canvasComponent } from './html2canvas.component'; 4 | 5 | describe('Html2canvasComponent', () => { 6 | let component: Html2canvasComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ Html2canvasComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(Html2canvasComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/outside/html2canvas/html2canvas.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import * as html2canvas from 'html2canvas'; 3 | @Component({ 4 | selector: 'app-html2canvas', 5 | templateUrl: './html2canvas.component.html', 6 | styleUrls: ['./html2canvas.component.less'] 7 | }) 8 | export class Html2canvasComponent implements OnInit { 9 | style = 'wrap-1'; 10 | styles = [ 11 | { value: 'wrap-1', label: '样式1' }, 12 | { value: 'wrap-2', label: '样式2' }, 13 | ]; 14 | data = [ 15 | { 16 | rank_change: 0, 17 | writer_name: '斗破苍穹', 18 | opus: '天蚕土豆', 19 | rank: 9.8 20 | }, 21 | { 22 | rank_change: 1, 23 | writer_name: '将夜', 24 | opus: '猫腻', 25 | rank: 8.8 26 | }, 27 | { 28 | rank_change: null, 29 | writer_name: '盗墓笔记', 30 | opus: '南派三叔', 31 | rank: 9 32 | }, 33 | { 34 | rank_change: 3, 35 | writer_name: '圣墟', 36 | opus: '辰东', 37 | rank: 8.7 38 | }, 39 | { 40 | rank_change: 0, 41 | writer_name: '飞剑问道', 42 | opus: '我吃西红柿', 43 | rank: 8.6 44 | }, 45 | { 46 | rank_change: 0, 47 | writer_name: '全职法师', 48 | opus: '乱', 49 | rank: 8.5 50 | }, 51 | { 52 | rank_change: null, 53 | writer_name: '明朝败家子', 54 | opus: '上山大老虎额', 55 | rank: 8 56 | }, 57 | { 58 | rank_change: 5, 59 | writer_name: '元尊', 60 | opus: '天蚕土豆', 61 | rank: 6.5 62 | }, 63 | { 64 | rank_change: 0, 65 | writer_name: '伏天氏', 66 | opus: '净无痕', 67 | rank: 6.3 68 | }, 69 | { 70 | rank_change: 0, 71 | writer_name: '逆天邪神', 72 | opus: '火星引力', 73 | rank: 6 74 | } 75 | ]; 76 | canvasImg: ''; 77 | constructor() { } 78 | 79 | ngOnInit() { 80 | } 81 | saveImgLocal() { 82 | const shareContent = document.getElementById('wrap'); // 需要截图的包裹的(原生的)DOM 对象 83 | const width = shareContent.offsetWidth; // 获取dom 宽度 84 | const height = shareContent.offsetHeight; // 获取dom 高度 85 | const canvas = document.createElement('canvas'); // 创建一个canvas节点 86 | const scale = 2; // 定义任意放大倍数 支持小数 87 | canvas.width = width * scale; // 定义canvas 宽度 * 缩放 88 | canvas.height = height * scale; // 定义canvas高度 *缩放 89 | canvas.getContext('2d').scale(scale, scale); // 获取context,设置scale 90 | const opts = { 91 | scale: scale, // 添加的scale 参数 92 | canvas: canvas, // 自定义 canvas 93 | logging: true, // 日志开关 94 | width: width, // dom 原始宽度 95 | height: height, // dom 原始高度 96 | useCORS: true // 【重要】开启跨域配置 97 | }; 98 | // tslint:disable-next-line:no-shadowed-variable 99 | html2canvas(shareContent, opts).then((canvas: any) => { 100 | this.canvasImg = canvas.toDataURL('image/png'); 101 | this.downloadFile('导出图片', this.canvasImg); 102 | }); 103 | 104 | } 105 | // filename: 文件名称, content: canvas图片流地址 106 | downloadFile(filename, content) { 107 | const base64Img = content; 108 | const oA = document.createElement('a'); 109 | oA.href = base64Img; 110 | oA.download = filename; 111 | const event = document.createEvent('MouseEvents'); 112 | event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 113 | oA.dispatchEvent(event); 114 | } 115 | download() { 116 | this.downloadFile('导出图片', this.canvasImg); 117 | } 118 | 119 | 120 | } 121 | -------------------------------------------------------------------------------- /src/app/routes/outside/outside-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { Html2canvasComponent } from './html2canvas/html2canvas.component'; 4 | import { QriousComponent } from './qrious/qrious.component'; 5 | const routes: Routes = [ 6 | { path: '', redirectTo: 'html2canvas', pathMatch: 'full' }, 7 | { path: 'html2canvas', component: Html2canvasComponent }, 8 | { path: 'qrious', component: QriousComponent } 9 | ]; 10 | @NgModule({ 11 | imports: [RouterModule.forChild(routes)], 12 | exports: [RouterModule] 13 | }) 14 | export class OutsideRoutingModules { } 15 | -------------------------------------------------------------------------------- /src/app/routes/outside/outside.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { OutsideModule } from './outside.module'; 2 | 3 | describe('OutsideModule', () => { 4 | let outsideModule: OutsideModule; 5 | 6 | beforeEach(() => { 7 | outsideModule = new OutsideModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(outsideModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/outside/outside.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../../shared/shared.module'; 3 | import { OutsideRoutingModules } from './outside-routing.module'; 4 | import { Html2canvasComponent } from './html2canvas/html2canvas.component'; 5 | import { QriousComponent } from './qrious/qrious.component'; 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | OutsideRoutingModules 11 | ], 12 | declarations: [Html2canvasComponent, QriousComponent] 13 | }) 14 | export class OutsideModule { } 15 | -------------------------------------------------------------------------------- /src/app/routes/outside/qrious/qrious.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | 基于qrious生成二维码。 4 |

5 |

简单用法

6 |

{{ type }}

7 | 8 |
9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /src/app/routes/outside/qrious/qrious.component.less: -------------------------------------------------------------------------------- 1 | .qrious { 2 | padding: 20px; 3 | 4 | p { 5 | font-size: 18px; 6 | margin-bottom: 20px; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/app/routes/outside/qrious/qrious.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { QriousComponent } from './qrious.component'; 4 | 5 | describe('QriousComponent', () => { 6 | let component: QriousComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ QriousComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(QriousComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/outside/qrious/qrious.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | declare var require: any; 3 | @Component({ 4 | selector: 'app-qrious', 5 | templateUrl: './qrious.component.html', 6 | styleUrls: ['./qrious.component.less'] 7 | }) 8 | export class QriousComponent implements OnInit { 9 | types = ['url', 'email', 'tel']; 10 | value = 'https://zhourenyou.com/'; 11 | type = 'url'; 12 | qr: any; 13 | constructor() { } 14 | 15 | ngOnInit() { 16 | this.qri(); 17 | } 18 | /** 初始化二维码 */ 19 | qri() { 20 | const QRious = require('qrious'); 21 | this.qr = new QRious({ 22 | element: document.getElementById('qr'), 23 | value: this.value 24 | }); 25 | } 26 | change(t: string) { 27 | this.type = t; 28 | switch (t) { 29 | case 'url': 30 | this.value = 'https://zhourenyou.com/'; 31 | break; 32 | case 'email': 33 | this.value = 'mailto:zry2510@163.com'; 34 | break; 35 | case 'tel': 36 | this.value = 'tel:8300000000'; 37 | break; 38 | } 39 | this.qr.value = this.value; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/app/routes/passport/login/login.component.html: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/app/routes/passport/login/login.component.less: -------------------------------------------------------------------------------- 1 | .login-form { 2 | max-width: 300px; 3 | } 4 | 5 | .login-form-forgot { 6 | float: right; 7 | } 8 | 9 | .login-form-button { 10 | width: 100%; 11 | } -------------------------------------------------------------------------------- /src/app/routes/passport/login/login.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LoginComponent } from './login.component'; 4 | 5 | describe('LoginComponent', () => { 6 | let component: LoginComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LoginComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LoginComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/passport/login/login.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Inject } from '@angular/core'; 2 | import { FormGroup, FormBuilder, Validators } from '@angular/forms'; 3 | import { LoginService } from '../services/login.service'; 4 | import { Router } from '@angular/router'; 5 | import { 6 | SocialService, 7 | SocialOpenType, 8 | TokenService, 9 | DA_SERVICE_TOKEN, 10 | } from '@delon/auth'; 11 | 12 | @Component({ 13 | selector: 'app-login', 14 | templateUrl: './login.component.html', 15 | styleUrls: ['./login.component.less'] 16 | }) 17 | export class LoginComponent implements OnInit { 18 | form: FormGroup; 19 | error = ''; 20 | loading = false; 21 | loadingdesc = '登录'; 22 | submitTime = new Date(); 23 | 24 | // redirectUrl = '/'; 25 | constructor( 26 | private fb: FormBuilder, 27 | private loginApi: LoginService, 28 | private router: Router, 29 | @Inject(DA_SERVICE_TOKEN) private tokenService: TokenService, 30 | ) { } 31 | 32 | ngOnInit() { 33 | this.form = this.fb.group({ 34 | userName: [null, [Validators.required]], 35 | password: [null, [Validators.required]], 36 | remember: [true] 37 | }); 38 | } 39 | submitForm(): void { 40 | this.error = ''; 41 | const loginParams = { 42 | loginId: this.userName.value, 43 | passcode: this.password.value, 44 | oneTimeCode: this.submitTime.getTime() 45 | }; 46 | if (this.form.valid) { 47 | this.loading = true; 48 | this.loadingdesc = '登录中...'; 49 | if (loginParams.loginId === 'admin' && loginParams.passcode === '12345678') { 50 | this.router.navigateByUrl('default/list'); 51 | } 52 | // this.loginApi.login(loginParams) 53 | // .subscribe(res => { 54 | // this.loading = false; 55 | // this.router.navigateByUrl('default/table'); 56 | // // 设置Token信息 57 | // this.tokenService.set({ 58 | // token: res.token, 59 | // id: res.id, 60 | // time: +new Date(), 61 | // }); 62 | // console.log(res); 63 | // }); 64 | } 65 | } 66 | 67 | get userName() { return this.form.controls.userName; } 68 | get password() { return this.form.controls.password; } 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/app/routes/passport/services/login.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { LoginService } from './login.service'; 4 | 5 | describe('LoginService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [LoginService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([LoginService], (service: LoginService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/routes/passport/services/login.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { ApiService } from '../../../core/api/api.service'; 3 | import { Observable } from 'rxjs'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class LoginService { 9 | 10 | apiUrl = 'backstage/user'; 11 | constructor( 12 | private api: ApiService 13 | ) { } 14 | login(params): Observable { 15 | return this.api.post(this.apiUrl + '/login', params); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/app/routes/routes-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { DefaultComponent } from '../layout/default/default.component'; 4 | import { FullscreenComponent } from '../layout/fullscreen/fullscreen.component'; 5 | import { PassportComponent } from '../layout/passport/passport.component'; 6 | import { LoginComponent } from './passport/login/login.component'; 7 | import { ACLGuard } from '@delon/acl'; 8 | 9 | const routes: Routes = [ 10 | { path: '', redirectTo: 'passport', pathMatch: 'full' }, 11 | /**默认布局 */ 12 | { 13 | path: 'default', 14 | component: DefaultComponent, 15 | // canActivate: [ACLGuard], 16 | children: [ 17 | { path: '', redirectTo: 'list', pathMatch: 'full' }, 18 | { 19 | path: 'index', loadChildren: './index/index.module#IndexModule' 20 | }, 21 | { 22 | path: 'map', loadChildren: './map/map.module#MapModule' 23 | }, 24 | { 25 | path: 'charts', loadChildren: './charts/charts.module#ChartsModule' 26 | }, 27 | { 28 | path: 'list', loadChildren: './list/list.module#ListModule' 29 | }, 30 | { 31 | path: 'animations', loadChildren: './animations/animations.module#AnimationsModule' 32 | }, 33 | { 34 | path: 'outside', loadChildren: './outside/outside.module#OutsideModule' 35 | } 36 | 37 | ] 38 | }, 39 | /**全屏布局 */ 40 | { 41 | path: 'fullscreen', 42 | component: FullscreenComponent, 43 | children: [ 44 | { path: '', redirectTo: 'experiment', pathMatch: 'full' }, 45 | { path: 'screen', loadChildren: './screen/screen.module#ScreenModule' }, 46 | { path: 'experiment', loadChildren: './experiment/experiment.module#ExperimentModule' } 47 | ] 48 | }, 49 | /** 登陆布局 */ 50 | { 51 | path: 'passport', 52 | component: PassportComponent, 53 | children: [ 54 | { path: '', redirectTo: 'login', pathMatch: 'full' }, 55 | { path: 'login', component: LoginComponent } 56 | ] 57 | 58 | } 59 | ]; 60 | @NgModule({ 61 | imports: [RouterModule.forRoot(routes)], 62 | exports: [RouterModule] 63 | }) 64 | export class RouteRoutingModule { } 65 | -------------------------------------------------------------------------------- /src/app/routes/routes.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { RoutesModule } from './routes.module'; 2 | 3 | describe('RoutesModule', () => { 4 | let routesModule: RoutesModule; 5 | 6 | beforeEach(() => { 7 | routesModule = new RoutesModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(routesModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/routes.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { SharedModule } from '../shared/shared.module'; 3 | import { RouteRoutingModule } from './routes-routing.module'; 4 | import { LoginComponent } from './passport/login/login.component'; 5 | 6 | 7 | @NgModule({ 8 | imports: [ 9 | SharedModule, 10 | RouteRoutingModule, 11 | ], 12 | declarations: [LoginComponent] 13 | }) 14 | export class RoutesModule { } 15 | -------------------------------------------------------------------------------- /src/app/routes/screen/full/full.component.html: -------------------------------------------------------------------------------- 1 |

2 | full works! 3 |

4 | -------------------------------------------------------------------------------- /src/app/routes/screen/full/full.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/routes/screen/full/full.component.less -------------------------------------------------------------------------------- /src/app/routes/screen/full/full.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { FullComponent } from './full.component'; 4 | 5 | describe('FullComponent', () => { 6 | let component: FullComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ FullComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(FullComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes/screen/full/full.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-full', 5 | templateUrl: './full.component.html', 6 | styleUrls: ['./full.component.less'] 7 | }) 8 | export class FullComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/routes/screen/screen-routing.modules.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | import { FullComponent } from './full/full.component'; 4 | 5 | const routes: Routes = [ 6 | { path: '', redirectTo: 'full', pathMatch: 'full' }, 7 | { path: 'full', component: FullComponent } 8 | ]; 9 | @NgModule({ 10 | imports: [RouterModule.forChild(routes)], 11 | exports: [RouterModule] 12 | }) 13 | export class ScreenRoutingModule { } 14 | -------------------------------------------------------------------------------- /src/app/routes/screen/screen.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { ScreenModule } from './screen.module'; 2 | 3 | describe('ScreenModule', () => { 4 | let screenModule: ScreenModule; 5 | 6 | beforeEach(() => { 7 | screenModule = new ScreenModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(screenModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/routes/screen/screen.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { FullComponent } from './full/full.component'; 3 | import { SharedModule } from '../../shared/shared.module'; 4 | import { ScreenRoutingModule } from './screen-routing.modules'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | SharedModule, 9 | ScreenRoutingModule 10 | ], 11 | declarations: [ 12 | FullComponent 13 | ] 14 | }) 15 | export class ScreenModule { } 16 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-date-picker/dw-date-picker.component.html: -------------------------------------------------------------------------------- 1 | 4 | - 5 | 7 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-date-picker/dw-date-picker.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/shared/meta/dw-date-picker/dw-date-picker.component.less -------------------------------------------------------------------------------- /src/app/shared/meta/dw-date-picker/dw-date-picker.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwDatePickerComponent } from './dw-date-picker.component'; 4 | 5 | describe('DwDatePickerComponent', () => { 6 | let component: DwDatePickerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwDatePickerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwDatePickerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-date-picker/dw-date-picker.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; 2 | import { differenceInCalendarDays, setHours } from 'date-fns'; 3 | @Component({ 4 | selector: 'app-dw-date-picker', 5 | templateUrl: './dw-date-picker.component.html', 6 | styleUrls: ['./dw-date-picker.component.less'] 7 | }) 8 | export class DwDatePickerComponent implements OnInit { 9 | @Input() datePicker; 10 | @Output() startTime = new EventEmitter(); 11 | @Output() endTime = new EventEmitter(); 12 | startDate = new Date(); 13 | endDate = new Date(); 14 | today = new Date(); 15 | timeDefaultValue = setHours(new Date(), 0); 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | range(start: number, end: number): number[] { 21 | const result = []; 22 | for (let i = start; i < end; i++) { 23 | result.push(i); 24 | } 25 | return result; 26 | } 27 | 28 | disabledDate = (current: Date): boolean => { 29 | // Can not select days before today and today 30 | return differenceInCalendarDays(current, this.today) > 0; 31 | } 32 | disabledDateTime = (): object => { 33 | return { 34 | nzDisabledHours: () => this.range(0, 24).splice(4, 20), 35 | nzDisabledMinutes: () => this.range(30, 60), 36 | nzDisabledSeconds: () => [55, 56] 37 | }; 38 | } 39 | 40 | disabledRangeTime = (value: Date[], type: 'start' | 'end'): object => { 41 | if (type === 'start') { 42 | return { 43 | nzDisabledHours: () => this.range(0, 60).splice(4, 20), 44 | nzDisabledMinutes: () => this.range(30, 60), 45 | nzDisabledSeconds: () => [55, 56] 46 | }; 47 | } 48 | return { 49 | nzDisabledHours: () => this.range(0, 60).splice(20, 4), 50 | nzDisabledMinutes: () => this.range(0, 31), 51 | nzDisabledSeconds: () => [55, 56] 52 | }; 53 | } 54 | startValueChange() { 55 | if (this.startDate !== null) { 56 | this.startTime.emit(this.startDate.getTime()); 57 | } 58 | } 59 | endValueChange() { 60 | if (this.endDate !== null) { 61 | this.endTime.emit(this.endDate.getTime()); 62 | } 63 | } 64 | } 65 | /** 66 | * 时间组件配置 67 | * 68 | * nzSize:large default small 大小 69 | * 70 | * startPlaceHolder: 开始时间 提示 71 | * 72 | * endtPlaceHolder:结束时间 提示 73 | * 74 | * ShowToday:boolean是否开启今天 75 | * 76 | * Format:yyyy-MM-dd yyyy-MM-dd HH:mm:ss 时间格式 77 | */ 78 | export interface DatePicker { 79 | nzSize?: string; 80 | startPlaceHolder?: string; 81 | endtPlaceHolder?: string; 82 | ShowToday?: boolean; 83 | Format?: string; 84 | } 85 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-info-model/dw-info-model.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-info-model/dw-info-model.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/shared/meta/dw-info-model/dw-info-model.component.less -------------------------------------------------------------------------------- /src/app/shared/meta/dw-info-model/dw-info-model.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwInfoModelComponent } from './dw-info-model.component'; 4 | 5 | describe('DwInfoModelComponent', () => { 6 | let component: DwInfoModelComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwInfoModelComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwInfoModelComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-info-model/dw-info-model.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dw-info-model', 5 | templateUrl: './dw-info-model.component.html', 6 | styleUrls: ['./dw-info-model.component.less'] 7 | }) 8 | export class DwInfoModelComponent implements OnInit { 9 | @Input() infoModel; 10 | @Output() showInfoModel = new EventEmitter(); 11 | constructor() { } 12 | 13 | ngOnInit() { 14 | } 15 | handleOk(): void { 16 | this.showInfoModel.emit('false'); 17 | } 18 | 19 | handleCancel(): void { 20 | this.showInfoModel.emit('false'); 21 | } 22 | } 23 | export interface InfoModel { 24 | isVisible?: boolean; 25 | nzTitle?: string; 26 | } 27 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-pagination/dw-pagination.component.html: -------------------------------------------------------------------------------- 1 |
2 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-pagination/dw-pagination.component.less: -------------------------------------------------------------------------------- 1 | .ps-pagination { 2 | display: flex; 3 | margin-top: 40px; 4 | align-items: center; 5 | justify-content: flex-end; 6 | label { 7 | display: flex; 8 | margin-left: 10px; 9 | } 10 | } -------------------------------------------------------------------------------- /src/app/shared/meta/dw-pagination/dw-pagination.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwPaginationComponent } from './dw-pagination.component'; 4 | 5 | describe('DwPaginationComponent', () => { 6 | let component: DwPaginationComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwPaginationComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwPaginationComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-pagination/dw-pagination.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dw-pagination', 5 | templateUrl: './dw-pagination.component.html', 6 | styleUrls: ['./dw-pagination.component.less'] 7 | }) 8 | export class DwPaginationComponent implements OnInit { 9 | 10 | constructor() { } 11 | @Input() tableDatas; 12 | @Output() pageIndex = new EventEmitter(); 13 | currentPage = 1; 14 | ngOnInit() { 15 | this.currentPage = this.tableDatas.pageIndex; 16 | } 17 | refreshStatus() { 18 | this.pageIndex.emit(this.currentPage); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-search/dw-search.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-search/dw-search.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/shared/meta/dw-search/dw-search.component.less -------------------------------------------------------------------------------- /src/app/shared/meta/dw-search/dw-search.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwSearchComponent } from './dw-search.component'; 4 | 5 | describe('DwSearchComponent', () => { 6 | let component: DwSearchComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwSearchComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwSearchComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-search/dw-search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; 2 | import { NzNotificationService } from 'ng-zorro-antd'; 3 | import { fromEvent } from 'rxjs'; 4 | 5 | @Component({ 6 | selector: 'app-dw-search', 7 | templateUrl: './dw-search.component.html', 8 | styleUrls: ['./dw-search.component.less'] 9 | }) 10 | export class DwSearchComponent implements OnInit { 11 | @Input() searchData; 12 | @Output() searchvalue = new EventEmitter(); 13 | /**屏幕尺寸 */ 14 | resize = document.body.clientWidth; 15 | inputValue: string; 16 | constructor( 17 | private notification: NzNotificationService 18 | ) { } 19 | 20 | ngOnInit() { 21 | /**监听浏览器的变化 */ 22 | fromEvent(window, 'resize') 23 | .subscribe((e) => { 24 | this.resize = e.currentTarget['innerWidth']; 25 | }); 26 | } 27 | searchCollapsed() { 28 | if (this.inputValue === undefined || this.inputValue === '') { 29 | this.notification.create('warning', '系统提示', 30 | '请输入搜索内容', { nzDuration: 1000 }); 31 | } else { 32 | this.searchvalue.emit(this.inputValue); 33 | } 34 | } 35 | 36 | } 37 | /** 38 | * 搜索选项配置信息: 39 | * 40 | * placeholder 提示信息 41 | * 42 | * nzSize:large default small 大小 43 | */ 44 | export interface SearchData { 45 | placeholder?: string; 46 | nzSize?: string; 47 | } 48 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | {{th.title}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{data[tb?.name]}} 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component.less -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwTableDynamicComponent } from './dw-table-dynamic.component'; 4 | 5 | describe('DwTableDynamicComponent', () => { 6 | let component: DwTableDynamicComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwTableDynamicComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwTableDynamicComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table-dynamic/dw-table-dynamic.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter, OnChanges } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dw-table-dynamic', 5 | templateUrl: './dw-table-dynamic.component.html', 6 | styleUrls: ['./dw-table-dynamic.component.less'] 7 | }) 8 | export class DwTableDynamicComponent implements OnInit, OnChanges { 9 | 10 | constructor() { } 11 | allChecked = false; 12 | dataChecked = []; 13 | @Input() tableDatas; 14 | @Output() checked = new EventEmitter(); 15 | @Output() checkedSingle = new EventEmitter(); 16 | @Output() switch = new EventEmitter(); 17 | @Output() delete = new EventEmitter(); 18 | @Output() editData = new EventEmitter(); 19 | @Output() page = new EventEmitter(); 20 | ngOnInit() { 21 | } 22 | ngOnChanges() { 23 | if (this.tableDatas.checked || this.tableDatas.checkedSingle) { 24 | this.dataChecked = []; 25 | const lth = this.tableDatas.itemLength; 26 | for (let i = 0; i < lth; i++) { 27 | this.dataChecked.push({ checked: false, id: i }); 28 | } 29 | } 30 | } 31 | refreshStatus(i): void { 32 | this.allChecked = this.dataChecked.every(e => e.checked === true); 33 | this.checkEmit(); 34 | } 35 | refreSingle(i) { 36 | this.dataChecked.filter(e => e.id !== i) 37 | .forEach(_e => _e.checked = false); 38 | this.checkedSingle.emit(i); 39 | } 40 | checkAll(): void { 41 | this.dataChecked.forEach(e => { 42 | e.checked = !e.checked; 43 | }); 44 | this.checkEmit(); 45 | } 46 | checkEmit() { 47 | const ids = []; 48 | if (this.dataChecked.some(e => e.checked) === true) { 49 | this.dataChecked.filter(e => e.checked === true) 50 | .forEach(_e => { 51 | ids.push(_e.id); 52 | }); 53 | } 54 | this.checked.emit(ids); 55 | } 56 | changeSwitch(e) { 57 | this.switch.emit(e); 58 | } 59 | edit(e) { 60 | this.editData.emit(e); 61 | } 62 | confirm(e) { 63 | this.delete.emit(e); 64 | } 65 | cancel() { 66 | 67 | } 68 | refreshData($event) { 69 | this.page.emit($event); 70 | } 71 | } 72 | /** 73 | * itemLength: 当前也数据量 74 | * title: 表格标题 75 | * footer:表格底部 76 | * loading: 加载中 77 | * bordered:是否展示外边框和列边框 78 | * checked:多选框 79 | * checkedSingle:单选框 80 | * dataTh:表头 81 | * dataSet:数据 82 | * tdItem:数据项名 83 | * switch:状态 84 | * switchName:状态字段名 85 | * size:表格大小 86 | * total:数据总理,用于分页 87 | * pagination:是否开启分页 88 | * pageSize:每页数据 89 | * pageIndex:当前页 90 | */ 91 | export interface DwDynamicTable { 92 | itemLength?: number; 93 | title?: string; 94 | footer?: string; 95 | loading?: boolean; 96 | bordered?: boolean; 97 | checked?: boolean; 98 | checkedSingle?: boolean; 99 | dataTh?: any; 100 | dataSet?: any; 101 | tdItem?: any; 102 | switch?: boolean; 103 | size: string; 104 | total?: number; 105 | switchName?: string; 106 | pagination?: boolean; 107 | pageSize?: number; 108 | pageIndex?: number; 109 | } 110 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table/dw-table.component.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | {{th.title}} 8 | 9 | 10 | 11 | 12 | {{data.name}} 13 | {{data.age}} 14 | {{data.number}} 15 | {{data.address}} 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table/dw-table.component.less: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/app/shared/meta/dw-table/dw-table.component.less -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table/dw-table.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DwTableComponent } from './dw-table.component'; 4 | 5 | describe('DwTableComponent', () => { 6 | let component: DwTableComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DwTableComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DwTableComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/shared/meta/dw-table/dw-table.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; 2 | @Component({ 3 | selector: 'app-dw-table', 4 | templateUrl: './dw-table.component.html', 5 | styleUrls: ['./dw-table.component.less'] 6 | }) 7 | export class DwTableComponent implements OnInit { 8 | dwData = {}; 9 | @Input() tableDatas; 10 | @Input() nzTitle; 11 | @Output() dwTables = new EventEmitter(); 12 | @Output() deleteTb = new EventEmitter(); 13 | @Output() editTb = new EventEmitter(); 14 | @Output() sortData = new EventEmitter(); 15 | 16 | ngOnInit() { 17 | } 18 | /**过滤内容 */ 19 | filter(listOfSearchName: string[]): void { 20 | this.dwData['listOfSearchName'] = listOfSearchName; 21 | this.dwTables.emit(this.dwData); 22 | } 23 | /**排序字段 */ 24 | sort(sortName: string, value: string): void { 25 | this.dwData['sortName'] = sortName; 26 | this.dwData['sortValue'] = value; 27 | this.dwTables.emit(this.dwData); 28 | } 29 | /**编辑 */ 30 | edit(data) { 31 | this.editTb.emit(data); 32 | } 33 | /**修改状态 */ 34 | sortChange(sortName: string, value: string): void { 35 | this.sortData.emit({ 'name': sortName, 'value': value }); 36 | } 37 | cancel() { 38 | 39 | } 40 | confirm(data): void { 41 | this.deleteTb.emit(data); 42 | } 43 | } 44 | /** 45 | * 基础表格配置信息 46 | * 47 | * nzShowPagination 是否开启分页 48 | * 49 | * nzShowAction 是否开启操作列 50 | * 51 | * nzBordered 是否展示外边框和列边框 52 | * 53 | * dataTh { 54 | * 55 | * title:string 表格title 56 | * 57 | * nzShowFilter:boolean 是否开启过滤 58 | * 59 | * nzFilters: [ { text: 'Jim', value: 'Jim' }] 过滤内容 60 | * 61 | * nzShowSort:boolean 是否开启排序 62 | * 63 | * nzSortKey: string 排序key 64 | * 65 | * sort 筛选状态名 66 | * 67 | * } 68 | * sortMap 筛选状态 69 | * 70 | * dataSet 表格数据 71 | */ 72 | export interface DwTable { 73 | nzShowPagination?: boolean; 74 | nzShowAction?: boolean; 75 | nzBordered?: boolean; 76 | nzTitle?: string; 77 | dataTh?: any; 78 | sortMap?: any; 79 | dataSet?: any; 80 | } 81 | -------------------------------------------------------------------------------- /src/app/shared/shared.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { SharedModule } from './shared.module'; 2 | 3 | describe('SharedModule', () => { 4 | let sharedModule: SharedModule; 5 | 6 | beforeEach(() => { 7 | sharedModule = new SharedModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(sharedModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { ReactiveFormsModule, FormsModule } from '@angular/forms'; 4 | import { RouterModule } from '@angular/router'; 5 | import { NgZorroAntdModule } from 'ng-zorro-antd'; 6 | import { NgxEchartsModule } from 'ngx-echarts'; 7 | import { DwInfoModelComponent } from './meta/dw-info-model/dw-info-model.component'; 8 | import { DwSearchComponent } from './meta/dw-search/dw-search.component'; 9 | import { DwDatePickerComponent } from './meta/dw-date-picker/dw-date-picker.component'; 10 | import { DwTableComponent } from './meta/dw-table/dw-table.component'; 11 | import { DwTableDynamicComponent } from './meta/dw-table-dynamic/dw-table-dynamic.component'; 12 | import { DwPaginationComponent } from './meta/dw-pagination/dw-pagination.component'; 13 | 14 | const COMPONENTS = [ 15 | DwTableComponent, 16 | DwInfoModelComponent, 17 | DwSearchComponent, 18 | DwDatePickerComponent, 19 | DwTableDynamicComponent, 20 | DwPaginationComponent 21 | ]; 22 | const SHAREDS = [ 23 | CommonModule, 24 | FormsModule, 25 | RouterModule, 26 | ReactiveFormsModule, 27 | NgZorroAntdModule, 28 | NgxEchartsModule, 29 | ]; 30 | @NgModule({ 31 | imports: [ 32 | ...SHAREDS, 33 | ], 34 | declarations: [ 35 | ...COMPONENTS, 36 | ], 37 | exports: [ 38 | ...SHAREDS, 39 | ...COMPONENTS 40 | ] 41 | }) 42 | export class SharedModule { } 43 | -------------------------------------------------------------------------------- /src/app/styles/icons.less: -------------------------------------------------------------------------------- 1 | /*阿里图标*/ 2 | @font-face { 3 | font-family: 'iconfont'; 4 | /* project id 843714 */ 5 | src: url('//at.alicdn.com/t/font_843714_e1ruant5n7o.eot'); 6 | src: url('//at.alicdn.com/t/font_843714_e1ruant5n7o.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_843714_e1ruant5n7o.woff') format('woff'), url('//at.alicdn.com/t/font_843714_e1ruant5n7o.ttf') format('truetype'), url('//at.alicdn.com/t/font_843714_e1ruant5n7o.svg#iconfont') format('svg'); 7 | } 8 | 9 | .iconfont { 10 | font-family: "iconfont" !important; 11 | font-size: 42px; 12 | font-style: normal; 13 | -webkit-font-smoothing: antialiased; 14 | -webkit-text-stroke-width: 0.2px; 15 | -moz-osx-font-smoothing: grayscale; 16 | } -------------------------------------------------------------------------------- /src/app/styles/index.less: -------------------------------------------------------------------------------- 1 | /*less学习*/ 2 | 3 | /*变量*/ 4 | 5 | // @base: #f938ab; 6 | /*混合*/ 7 | 8 | // .bkground() { 9 | // background: lightblue; 10 | // } 11 | /*函数*/ 12 | 13 | // .bkwidth(@width, @height) { 14 | // width: @width; 15 | // height: @height - 200; 16 | // } 17 | /* 函数允许有默认值 */ 18 | 19 | // .borderadius(@radius: 4px) { 20 | // border-radius: @radius; 21 | // } 22 | // p { 23 | // color: @base; 24 | // .bkground; 25 | // .bkwidth(400px, 400px); 26 | // .borderadius; 27 | // } 28 | .dw-flexItems(@items) { 29 | display: flex; 30 | align-items: @items; 31 | } 32 | 33 | .dw-flexContent(@content) { 34 | display: flex; 35 | justify-content: content; 36 | } 37 | 38 | .dw-flexIC(@i, @c) { 39 | display: flex; 40 | align-items: @i; 41 | justify-content: @c 42 | } -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/bd/w1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-1.png -------------------------------------------------------------------------------- /src/assets/bd/w1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-2.png -------------------------------------------------------------------------------- /src/assets/bd/w1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-3.png -------------------------------------------------------------------------------- /src/assets/bd/w1-h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-h.png -------------------------------------------------------------------------------- /src/assets/bd/w1-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-logo.png -------------------------------------------------------------------------------- /src/assets/bd/w1-sub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/bd/w1-sub.png -------------------------------------------------------------------------------- /src/assets/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/icons/logo.png -------------------------------------------------------------------------------- /src/assets/icons/wechat.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/icons/wechat.JPG -------------------------------------------------------------------------------- /src/assets/icons/welcome_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/icons/welcome_bg.jpg -------------------------------------------------------------------------------- /src/assets/map/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/map/1.png -------------------------------------------------------------------------------- /src/assets/map/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/map/2.png -------------------------------------------------------------------------------- /src/assets/map/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/map/3.png -------------------------------------------------------------------------------- /src/assets/map/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/map/4.png -------------------------------------------------------------------------------- /src/assets/map/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZRenu/ng-deerway/42dfae1c083fd8e955e938ede448f207b526875c/src/assets/map/5.jpg -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # 5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed 6 | 7 | > 0.5% 8 | last 2 versions 9 | Firefox ESR 10 | not dead 11 | not IE 9-11 -------------------------------------------------------------------------------- /src/environments/environment.local.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: false, 3 | urlPrefix: 'https://www.yiyudata.com/api/', 4 | }; 5 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | urlPrefix: 'https://www.yiyudata.com/api/', 4 | }; 5 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false, 7 | urlPrefix: 'http://localhost:8081/', 8 | }; 9 | 10 | /* 11 | * In development mode, for easier debugging, you can ignore zone related error 12 | * stack frames such as `zone.run`/`zoneDelegate.invokeTask` by importing the 13 | * below file. Don't forget to comment it out in production mode 14 | * because it will have a performance impact when errors are thrown 15 | */ 16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 鹿途 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | import 'core-js/es6/symbol'; 23 | import 'core-js/es6/object'; 24 | import 'core-js/es6/function'; 25 | import 'core-js/es6/parse-int'; 26 | import 'core-js/es6/parse-float'; 27 | import 'core-js/es6/number'; 28 | import 'core-js/es6/math'; 29 | import 'core-js/es6/string'; 30 | import 'core-js/es6/date'; 31 | import 'core-js/es6/array'; 32 | import 'core-js/es6/regexp'; 33 | import 'core-js/es6/map'; 34 | import 'core-js/es6/weak-map'; 35 | import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /src/styles.less: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | /*取消百度地图logo*/ 4 | 5 | .anchorBL { 6 | display: none; 7 | } 8 | 9 | /* 10 | 渐变: 11 | background-image: linear-gradient(to right, #ff9569 0%, #e92758 100%) 12 | background: linear-gradient(-90deg, #29bdd9 0%, #276ace 100%); 13 | background-image: linear-gradient( 135deg, #3C8CE7 10%, #00EAFF 100%); 14 | */ -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "exclude": [ 8 | "test.ts", 9 | "**/*.spec.ts" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "test.ts", 12 | "polyfills.ts" 13 | ], 14 | "include": [ 15 | "**/*.spec.ts", 16 | "**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "module": "es2015", 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | --------------------------------------------------------------------------------