沈斌
2018-07-12 99554af658a50d432ff223b31bf2f7deac1104e4
updates
7 files added
3 files modified
5527 ■■■■ changed files
.angular-cli.json 93 ●●●●● patch | view | raw | blame | history
.dockerignore 12 ●●●●● patch | view | raw | blame | history
.editorconfig 13 ●●●●● patch | view | raw | blame | history
.gitignore 43 ●●●●● patch | view | raw | blame | history
.npmignore 6 ●●●●● patch | view | raw | blame | history
.stylelintrc 30 ●●●●● patch | view | raw | blame | history
.travis.yml 27 ●●●●● patch | view | raw | blame | history
package-lock.json 5091 ●●●● patch | view | raw | blame | history
src/app/app.component.ts 16 ●●●● patch | view | raw | blame | history
src/assets/app-data.json 196 ●●●●● patch | view | raw | blame | history
.angular-cli.json
New file
@@ -0,0 +1,93 @@
{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "project": {
        "name": "ng-alain"
    },
    "apps": [{
        "root": "src",
        "outDir": "dist",
        "assets": [
            "assets",
            "favicon.ico"
        ],
        "index": "index.html",
        "main": "main.ts",
        "polyfills": "polyfills.ts",
        "test": "test.ts",
        "tsconfig": "tsconfig.app.json",
        "testTsconfig": "tsconfig.spec.json",
        "prefix": "app",
        "styles": [
            "styles.less"
        ],
        "scripts": [
            "../node_modules/@antv/g2/dist/g2.min.js",
            "../node_modules/@antv/data-set/dist/data-set.min.js",
            "../node_modules/@antv/g2-plugin-slider/dist/g2-plugin-slider.min.js",
            "../node_modules/echarts/dist/echarts.min.js"
        ],
        "environmentSource": "environments/environment.ts",
        "environments": {
            "dev": "environments/environment.ts",
            "prod": "environments/environment.prod.ts",
            "hmr": "environments/environment.hmr.ts",
            "chore": "environments/environment.chore.ts"
        }
    }],
    "e2e": {
        "protractor": {
            "config": "./protractor.conf.js"
        }
    },
    "lint": [{
            "project": "src/tsconfig.app.json",
            "exclude": "**/node_modules/**"
        },
        {
            "project": "src/tsconfig.spec.json",
            "exclude": "**/node_modules/**"
        },
        {
            "project": "e2e/tsconfig.e2e.json",
            "exclude": "**/node_modules/**"
        }
    ],
    "test": {
        "karma": {
            "config": "./karma.conf.js"
        }
    },
    "defaults": {
        "schematics": {
          "collection": "@delon/cli"
        },
        "styleExt": "less",
        "class": {
            "spec": false
        },
        "component": {
            "flat": false,
            "spec": false,
            "inlineStyle": true,
            "inlineTemplate": false
        },
        "directive": {
            "spec": false
        },
        "guard": {
            "spec": false
        },
        "interface": {
            "prefix": "I"
        },
        "module": {
            "spec": false
        },
        "pipe": {
            "spec": true
        },
        "service": {
            "spec": false
        }
    }
}
.dockerignore
New file
@@ -0,0 +1,12 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
_screenshot
_documents
.editorconfig
New file
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
.gitignore
New file
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
# System Files
.DS_Store
Thumbs.db
.angulardoc.json
yarn.lock
/_nginx/*
.github/*
.npmignore
New file
@@ -0,0 +1,6 @@
.github
_screenshot
node_modules
dist
tmp
.stylelintrc
New file
@@ -0,0 +1,30 @@
{
  "extends": "stylelint-config-standard",
  "rules": {
    "comment-empty-line-before": null,
    "declaration-empty-line-before": null,
    "function-comma-newline-after": null,
    "function-name-case": null,
    "function-parentheses-newline-inside": null,
    "function-max-empty-lines": null,
    "function-whitespace-after": null,
    "indentation": null,
    "number-leading-zero": null,
    "number-no-trailing-zeros": null,
    "rule-empty-line-before": null,
    "selector-combinator-space-after": null,
    "selector-list-comma-newline-after": null,
    "selector-pseudo-element-colon-notation": null,
    "unit-no-unknown": null,
    "value-list-max-empty-lines": null,
    "selector-type-no-unknown": null,
    "selector-pseudo-element-no-unknown": [
        true,
        {
            "ignorePseudoElements": [
                "ng-deep"
            ]
        }
    ]
  }
}
.travis.yml
New file
@@ -0,0 +1,27 @@
sudo: required
language: node_js
node_js:
  - "8.5.0"
addons:
  chrome: stable
git:
  depth: 1
before_install:
  - export CHROME_BIN=chromium-browser
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - npm install -g npm@~5.3.0
install:
  - npm install
script:
  - npm run test
  - npm run test-coverage
after_success:
  - ./node_modules/.bin/codecov
package-lock.json
Diff too large
src/app/app.component.ts
@@ -1,10 +1,12 @@
import { element } from 'protractor';
import { LoginService } from '@business/services/http/login.service';
import { Component, HostBinding, OnInit } from '@angular/core';
import { Component, HostBinding, OnInit, Inject } from '@angular/core';
import { Router, NavigationEnd, NavigationStart } from '@angular/router';
import { ThemesService, SettingsService, TitleService } from '@delon/theme';
import { filter } from 'rxjs/operators';
import * as $ from 'jquery';
import { TokenService, DA_SERVICE_TOKEN } from '@delon/auth';
@Component({
  selector: 'app-root',
  template: `<router-outlet></router-outlet>`
@@ -20,10 +22,20 @@
    private settings: SettingsService,
    private router: Router,
    private titleSrv: TitleService,
    private loginService: LoginService) {
    private loginService: LoginService,
    @Inject(DA_SERVICE_TOKEN) private tokenService: TokenService) {
  }
  ngOnInit() {
    // 设置Token信息
    this.tokenService.set({
      token: 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsIm9pZCI6NSwibW9kZSI6IldlYiIsInNjb3BlcyI6WyJ0ZW1wIl0sImlzcyI6Imh0dHA6Ly9tb25pdG9yLjdkcmxiLmNvbSIsImlhdCI6MTUzMTMxNjU4MCwiZXhwIjoxNTM5MDkyNTgwfQ.tWE7AqGfLwwK-nO1FUveJ8xKqpxitqG1GdhKHp9JDyRPjNDYX7ocgkEw0W2G8hKL_tJIjjrQ1pc0zvCmLTJ-pg',
      name: 'admin',
      email: `admin@qq.com`,
      id: 10000,
      time: +new Date(),
    });
    this.router.events
      .pipe(filter(evt => evt instanceof NavigationEnd))
      .subscribe(() => this.titleSrv.setTitle());
src/assets/app-data.json
@@ -1,101 +1,125 @@
{
    "app": {
        "name": "七星瓢虫环境监测",
        "description": "七星瓢虫环境监测后台配置中心"
        "description": "七星瓢虫环境监测"
    },
    "user": {
        "name": "Admin",
        "avatar": "./assets/img/zorro.svg",
        "email": "admin@qq.com"
    },
    "menu": [{
            "text": "主导航",
            "translate": "main_navigation",
            "group": true,
            "children": [{
                "text": "工作台",
                "link": "/dashboard/workplace",
                "icon": "icon-speedometer",
                "translate": "dashboard_workplace"
            }]
        }, {
            "text": "系统模块",
            "group": true,
            "children": [{
                "text": "用户管理",
                "icon": "icon-user",
                "children": [{
                  "text": "安装用户",
                  "link": "/users/installer"
                }, {
                  "text": "报警用户",
                  "link": "/users/alarm-user"
                }]
              }, {
                "text": "设备管理",
                "icon": "icon-grid",
                "children": [{
                  "text": "设备配置",
                  "link": "/devices/basic"
                }, {
                  "text": "型号配置",
                  "link": "/devices/version"
                }, {
                  "text": "监测站点管理",
                  "link": "/devices/monitor-point"
                }]
              }, {
                "text": "传感器管理",
                "icon": "icon-note",
                "children": [{
                  "text": "基本信息",
                  "link": "/sensors/basic"
                }]
              },{
                "text": "报表管理",
                "icon": "icon-chart",
                "children": [
    "menu": [
        {
          "text": "系统导航",
          "group": true,
          "hideInBreadcrumb": true,
          "children": [
            {
              "text": "首页概览",
              "icon": "icon-speedometer",
              "link": "/home-page"
            },
            {
              "text": "预报预警",
              "icon": "icon-pie-chart",
              "children": [
                  {
                  "text": "数据查询",
                  "link": "/reports/query"
                  },
                  {
                  "text": "报表展示",
                  "link": "/reports/demo"
                  },
                  {
                  "text": "报警数据",
                  "link": "/reports/alarm"
                  },
                  {
                  "text": "数据导出",
                  "link": "/reports/excel"
                    "text": "预警",
                    "link": "/"
                  }
                ]
              }, {
                "text": "系统管理",
                "icon": "icon-settings",
                "children": [
                  ,
                  {
                  "text": "账户管理",
                  "link": "/systems/account"
                  },
                    "text": "预报",
                    "link": "/"
                  }
                  ,
                  {
                    "text": "组织管理",
                    "link": "/systems/organization"
                    },
                    {
                        "text": "注册码管理",
                        "link": "/systems/registration",
                        "hide": true
                    }
                ]
              }
            ]
                    "text": "因子数据",
                    "link": "/"
                  }
              ]
            },
            {
              "text": "环境管理",
              "icon": "icon-directions",
              "children": [
                {
                  "text": "考核指标",
                  "link": "/"
                }
                ,
                {
                  "text": "分析",
                  "link": "/"
                }
              ]
            },
            {
              "text": "污染管控",
              "icon": "icon-chemistry",
              "link": "/"
            },
            {
              "text": "企业污染管理",
              "icon": "icon-puzzle",
               "children": [
                {
                  "text": "gis显示",
                  "link": "/"
                }
                ,
                {
                  "text": "企业数据",
                  "link": "/"
                }
                ,
                {
                  "text": "超标报警",
                  "link": "/"
                }
               ]
            },
            {
              "text": "统计分析",
              "icon": "icon-note",
              "link": "/"
            },
            {
              "text": "网络溯源",
              "icon": "icon-support",
              "link": "/"
            },
            {
              "text": "运维运营",
              "icon": "icon-wrench",
              "children": [
            {
                  "text": "数据审核",
                  "link": "/maintenance/data-check"
                }
                ,
                {
                  "text": "设备状态",
                  "link": "/"
                }
                ,
                {
                  "text": "设备维护",
                  "link": "/"
                }
          ]
            },
            {
              "text": "扬尘监控",
              "icon": "icon-flag",
              "link": "/"
            },
            {
              "text": "会商沙盘",
              "icon": "icon-people",
              "link": "/"
            }
          ]
        }
    ]
      ]
}