九山 3 éve
commit
b3402c4211

+ 3 - 0
.browserslistrc

@@ -0,0 +1,3 @@
+> 1%
+last 2 versions
+not dead

+ 2 - 0
.env.development

@@ -0,0 +1,2 @@
+// 开发
+VUE_APP_API_URL=http://10.155.32.4:8082/

+ 2 - 0
.env.production

@@ -0,0 +1,2 @@
+// 生产
+VUE_APP_API_URL=http://192.168.10.14:8082/

+ 2 - 0
.env.test

@@ -0,0 +1,2 @@
+// 测试
+VUE_APP_API_URL=http://192.168.10.14:8082/

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
+.DS_Store
+node_modules
+/dist
+
+
+# local env files
+.env.local
+.env.*.local
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?

+ 19 - 0
README.md

@@ -0,0 +1,19 @@
+# sis_web
+
+## Project setup
+```
+npm install
+```
+
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
+
+### Compiles and minifies for production
+```
+npm run build
+```
+
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 12 - 0
babel.config.js

@@ -0,0 +1,12 @@
+module.exports = {
+  presets: [["@babel/preset-env", { "modules": false}]],
+  "plugins": [
+    [
+      "component",
+      {
+        "libraryName": "element-ui",
+        "styleLibraryName": "theme-chalk"
+      }
+    ]
+  ]
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 14170 - 0
package-lock.json


+ 35 - 0
package.json

@@ -0,0 +1,35 @@
+{
+  "name": "sis_web",
+  "version": "0.1.0",
+  "private": true,
+  "scripts": {
+    "dev": "vue-cli-service serve && webpack-dev-server --open",
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "build:test": "vue-cli-service build --mode test"
+  },
+  "dependencies": {
+    "axios": "^0.21.1",
+    "core-js": "^3.6.5",
+    "crypto-js": "^4.0.0",
+    "echarts": "^5.0.2",
+    "element-ui": "^2.15.1",
+    "uglifyjs-webpack-plugin": "^2.2.0",
+    "vue": "^2.6.11",
+    "vue-router": "^3.2.0",
+    "vuex": "^3.4.0",
+    "xlsx": "^0.16.9"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "~4.5.0",
+    "@vue/cli-plugin-router": "~4.5.0",
+    "@vue/cli-plugin-vuex": "~4.5.0",
+    "@vue/cli-service": "~4.5.0",
+    "babel-plugin-component": "^1.1.1",
+    "image-webpack-loader": "^7.0.1",
+    "sass": "^1.26.5",
+    "sass-loader": "^8.0.2",
+    "vue-template-compiler": "^2.6.11",
+    "webpack-dev-server": "^3.11.2"
+  }
+}

BIN
public/favicon.ico


+ 17 - 0
public/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
+    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
+    <title><%= htmlWebpackPlugin.options.title %></title>
+  </head>
+  <body>
+    <noscript>
+      <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+  </body>
+</html>

+ 8 - 0
src/App.vue

@@ -0,0 +1,8 @@
+<template>
+  <div id="app">
+    <router-view/>
+  </div>
+</template>
+
+<style lang="scss">
+</style>

+ 32 - 0
src/api/AES.js

@@ -0,0 +1,32 @@
+import CryptoJS from 'crypto-js';
+/**
+ * CryptoJS加密
+ */
+export function localEncrypt(word, keyStr) {
+  keyStr = keyStr ? keyStr : "BTRH201911PERMIS";
+  let key = CryptoJS.enc.Utf8.parse(keyStr);
+  let srcs = CryptoJS.enc.Utf8.parse(word);
+  let encrypted = CryptoJS.AES.encrypt(srcs, key, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  return encrypted.toString();
+}
+
+/**
+ * CryptoJS解密
+ */
+export function localDecrypt(word, keyStr) {
+  keyStr = keyStr ? keyStr : "BTRH201911PERMIS";
+  var key = CryptoJS.enc.Utf8.parse(keyStr);
+  var decrypt = CryptoJS.AES.decrypt(word, key, {
+    mode: CryptoJS.mode.ECB,
+    padding: CryptoJS.pad.Pkcs7
+  });
+  return CryptoJS.enc.Utf8.stringify(decrypt).toString();
+}
+
+export default {
+  localEncrypt,
+  localDecrypt
+}

+ 159 - 0
src/api/axios.js

@@ -0,0 +1,159 @@
+// 引入axios
+import BASE from '@tools/base'
+import store from '@store/index'
+import axios from 'axios'
+import { Message } from 'element-ui';
+
+// 创建axios实例
+const httpService = axios.create({
+  withCredentials: false, // 允许携带cookie
+  baseURL: process.env.VUE_APP_API_URL || '/api/',
+  timeout: 3000, // 请求超时时间 - 3s
+  // transformRequest: [
+  //   // `transformRequest` 允许在向服务器发送前,修改请求数据
+  //   // 只能用在 'PUT', 'POST' 和 'PATCH' 这几个请求方法
+  //   // 后面数组中的函数必须返回一个字符串,或 ArrayBuffer,或 Stream
+  //   data => {
+  //     var fData = new FormData();
+  //     for(let key in data){
+  //       fData.append(key, data[key]);
+  //     }
+  //     return fData
+  //   }
+  // ],
+  //修改请求头信息
+  headers: {
+    'Content-Type': 'application/x-www-form-urlencoded'
+    // 'Content-Type': 'multipart/form-data'
+    // 'Content-Type': 'application/json;charset=UTF-8'
+  },
+});
+// httpService.defaults.withCredentials = true; // 表示跨域请求时是否需要使用凭证
+// http request 拦截器
+httpService.interceptors.request.use(
+  config => {
+    return config;
+  },
+  err => {
+    return Promise.reject(err);
+  }
+);
+// respone拦截器
+httpService.interceptors.response.use(
+  response => {
+    const {
+      data
+    } = response;
+    if(data.code === 200){
+      
+    }
+    else{
+      // let rqData = JSON.parse(response.config.data); // 请求数据
+      // console.error(BASE.getNowTime(), rqData.interfaceid+":"+data.message)
+      Message.warning(data.message);
+      store.commit('loadingStore', false); // 全局的数据 加载中.... - 开关
+      store.commit('openSubmitDDTag', false); // 防抖动 - 开关
+    }
+    return data; // 响应正确的数据
+  }, error => {
+    // 响应错误数据(错误情况分无token信息,错误码)
+    const {
+      response
+    } = error;
+    if (response) {
+      switch (error.response.status) {
+        case 400:
+          error.message = '错误请求';
+          break;
+        case 401:
+          error.message = '未授权,请重新登录';
+          break;
+        case 403:
+          error.message = '拒绝访问';
+          break;
+        case 404:
+          error.message = '请求错误,未找到该资源';
+          break;
+        case 405:
+          error.message = '请求方法未允许';
+          break;
+        case 408:
+          error.message = '请求超时';
+          break;
+        case 500:
+          error.message = '服务器端出错';
+          break;
+        case 501:
+          error.message = '网络未实现';
+          break;
+        case 502:
+          error.message = '网络错误';
+          break;
+        case 503:
+          error.message = '服务不可用';
+          break;
+        case 504:
+          error.message = '网络超时';
+          break;
+        case 505:
+          error.message = 'http版本不支持该请求';
+          break;
+        default:
+          error.message = `未知错误${error.response.status}`;
+      }
+    } else {
+      error.message = "请求超时";
+    }
+    store.commit('loadingStore', false); // 全局的数据 加载中.... - 开关
+    store.commit('openSubmitDDTag', false); // 防抖动 - 开关
+    console.error(BASE.getNowTime(), error.message)
+    Message.error(error.message + ",请稍候重试!");
+  }
+);
+
+
+/*
+ *  get请求
+ *  url: 接口地址
+ *  params: 参数,格式如下
+ * */
+export function get(url, params = {}) {
+  return new Promise((resolve, reject) => {
+    httpService({
+      url: url,
+      method: 'get',
+      params: params,
+    }).then(response => {
+      resolve(response);
+    }).catch(error => {
+      reject(error);
+    });
+  });
+}
+
+
+/*
+ *  post请求
+ *  url: 接口地址
+ *  params: 参数,格式如下
+ * */
+export function post(url, params = {}) {
+
+  return new Promise((resolve, reject) => {
+    httpService({
+      url: url,
+      method: 'post',
+      data: params,
+    }).then(response => {
+      resolve(response);
+    }).catch(error => {
+      reject(error);
+    });
+  });
+}
+
+
+export default {
+  get,
+  post,
+}

+ 3 - 0
src/assets/css/a.scss

@@ -0,0 +1,3 @@
+*{
+  color: green;
+}

+ 351 - 0
src/assets/css/base.scss

@@ -0,0 +1,351 @@
+@charset "utf-8";
+
+@import 'default.scss'; // 用于覆盖上面定义的变量
+
+/* 公共样式 */
+body {
+  font-size: $font-size-base;
+  font-weight: 500;
+  font-family: "PingFangSC-Regular", "Microsoft YaHei", "微软雅黑";
+  color: $text-color;
+  -webkit-text-size-adjust: 100%;
+  -ms-text-size-adjust: 100%;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+body,
+div,
+dl,
+dt,
+dd,
+ul,
+ol,
+li,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+pre,
+code,
+form,
+fieldset,
+legend,
+input,
+textarea,
+p,
+blockquote,
+th,
+td,
+hr,
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section {
+  margin: 0;
+  padding: 0
+}
+
+input,
+select,
+textarea {
+  font-size: 100%
+}
+
+table {
+  border-collapse: collapse;
+  border-spacing: 0
+}
+
+fieldset,
+img {
+  border: 0
+}
+
+abbr,
+acronym {
+  border: 0;
+  font-variant: normal
+}
+
+del {
+  text-decoration: line-through
+}
+
+address,
+caption,
+cite,
+code,
+dfn,
+em,
+th,
+var {
+  font-style: normal;
+  font-weight: normal
+}
+
+ol,
+ul {
+  list-style: none
+}
+
+caption,
+th {
+  text-align: left
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+  font-size: 100%;
+  font-weight: normal
+}
+
+q:before,
+q:after {
+  content: ''
+}
+
+button {
+  outline: 0;
+  border: none;
+}
+
+a:hover {
+  text-decoration: none
+}
+
+ins,
+a {
+  text-decoration: none;
+  cursor: pointer;
+}
+
+button {
+  cursor: pointer;
+}
+
+textarea {
+  resize: none;
+}
+
+iframe,
+img {
+  border: 0;
+}
+
+ul,
+ol {
+  list-style: none;
+}
+
+a {
+  color: $text-color;
+  text-decoration: none;
+}
+
+input[type="text"],
+[type="password"],
+[type="button"],
+input[type="submit"],
+input[type="reset"] {
+  -webkit-appearance: none;
+  outline: none;
+}
+
+// input  type="number" 去除上下箭头
+// 谷歌
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+  -webkit-appearance: none;
+  margin: 0;
+}
+
+// 火狐
+input[type="number"] {
+  -moz-appearance: textfield;
+}
+
+// 禁止左键选中页面内容
+* {
+  -webkit-touch-callout: none;
+  /*系统默认菜单被禁用*/
+  -webkit-user-select: none;
+  /*webkit浏览器*/
+  -khtml-user-select: none;
+  /*早期浏览器*/
+  -moz-user-select: none;
+  /*火狐*/
+  -ms-user-select: none;
+  /*IE10*/
+  user-select: none;
+}
+
+input {
+  -webkit-user-select: auto;
+  /*webkit浏览器*/
+}
+
+textarea {
+  -webkit-user-select: auto;
+  /*webkit浏览器*/
+}
+
+select {
+  /*-webkit-appearance: none;去掉select的下箭头*/
+  outline: none;
+}
+
+textarea {
+  -webkit-appearance: none;
+}
+
+* {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+
+input::-webkit-input-placeholder {
+  /* WebKit, Blink, Edge */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+input:-moz-placeholder {
+  /* Mozilla Firefox 4 to 18 */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+input::-moz-placeholder {
+  /* Mozilla Firefox 19+ */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+input:-ms-input-placeholder {
+  /* Internet Explorer 10-11 */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+textarea::-webkit-input-placeholder {
+  /* WebKit, Blink, Edge */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+textarea:-moz-placeholder {
+  /* Mozilla Firefox 4 to 18 */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+textarea::-moz-placeholder {
+  /* Mozilla Firefox 19+ */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+textarea:-ms-input-placeholder {
+  /* Internet Explorer 10-11 */
+  color: rgba(255, 255, 255, 0.25) !important;
+}
+
+/***滚动条 - 谷歌 - 开始***/
+// *::-webkit-scrollbar {
+//   width: 7px;
+//   /*对垂直流动条有效*/
+//   height: 7px;
+//   /*对水平流动条有效*/
+// }
+
+// // 滚动条的轨道(里面装有Thumb)
+// *::-webkit-scrollbar-track {
+//   -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
+//   background-color: rgba(255, 255, 255, 0.45);
+//   border-radius: 3px;
+// }
+
+// // 滚动条里面的小方块,能向上向下移动(或往左往右移动,取决于是垂直滚动条还是水平滚动条)
+// *::-webkit-scrollbar-thumb {
+//   border-radius: 5px;
+//   -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, .3);
+//   background-color: rgba(0, 0, 0, 0.65);
+// }
+
+// // 滚动条的轨道的两端按钮,允许通过点击微调小方块的位置。
+// *::-webkit-scrollbar-button {
+//   background-color: rgba(255, 255, 255, 0.75);
+//   height: 0px;
+// }
+
+// // 内层轨道,滚动条中间部分
+// *::-webkit-scrollbar-track-piece {
+//   background-color: rgba(255, 255, 255, 0.45);
+//   border-radius: 3px;
+// }
+
+/***滚动条 - 谷歌 - 结束***/
+
+/***全局公共样式 - 开始***/
+.h_10 {
+  height: 10px;
+}
+
+.h_30 {
+  height: 30px;
+}
+
+.h_55 {
+  height: 55px;
+}
+
+.h_500 {
+  height: 500px !important;
+}
+
+.no_mr {
+  margin-right: 0px !important;
+}
+
+.no_mb {
+  margin-bottom: 0px !important;
+}
+
+.no_bb {
+  border-bottom: 0px !important;
+}
+
+.no_br {
+  border-right: 0px !important;
+}
+
+.no_bl {
+  border-left: 0px !important;
+}
+
+iframe {
+  display: block;
+  border: 0px;
+}
+
+img {
+  display: block;
+}
+
+/***框架样式 - 开始***/
+// html,
+// body,
+// #app {
+//   height: 100%;
+//   overflow: hidden;
+//   position: relative;
+//   z-index: 1;
+// }
+
+/***框架样式 - 结束***/

+ 3 - 0
src/assets/css/default.scss

@@ -0,0 +1,3 @@
+
+$font-size-base: 14px; // 主字号
+$text-color: red; // 全局字体颜色

BIN
src/assets/images/login.jpg


+ 65 - 0
src/assets/js/main.js

@@ -0,0 +1,65 @@
+export default {
+  data() {
+    return {
+      userinfo: "", // 用户信息 - 从缓存中取
+      menuData: [], // 菜单数据
+      menuActive: [-1, -1, -1, -1], // 选中的菜单的层级索引
+      menuOpenData: [], // 打开的菜单数据
+      workerContentList: [], // 工作内容
+      notes: "", // 备忘功能
+      chirPage: true, // 页面模式
+
+      // 手动控制所有环节
+      control: {
+        logoutTip: false, // 注销按钮的气泡是否显示
+        skinTip: false, // 换肤按钮的气泡是否显示
+        skinValue: 0, // 换肤按钮选择值
+        panel: false, // 操作面板是否显示
+        full: false, // 是否全屏的标记,用于切换全屏和缩小按钮
+      },
+
+      // 工作导航
+      wddbMenu: [], // 工作导航接口需要的数据
+      wddbMenu: [], // 工作导航接口需要的数据
+      workNav: {
+        menu: [], // 显示的菜单
+        wddbNum: 0, // 我的待办
+        messageNum: 0, // 消息中心
+        tag: false, // 防抖 - 一次未执行完成不得执行第二次
+      },
+      tableData: [{
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1518 弄'
+      }, {
+        date: '2016-05-04',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1517 弄'
+      }, {
+        date: '2016-05-01',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1519 弄'
+      }, {
+        date: '2016-05-03',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1516 弄'
+      }]
+    }
+  },
+  created: function() {
+    this.init();
+  },
+  methods: {
+    // 初始化
+    init() {
+      console.log("测试")
+      this.API.get('/powercompare/windfarmAjax').then(res => {
+        console.log(res)
+        // if (res.code === 200) {
+        //   this.eqType = this.BASE.cascaderBugRepair(res.data.result);
+        // }
+  
+      });
+    },
+  }
+}

BIN
src/assets/logo.png


+ 59 - 0
src/components/HelloWorld.vue

@@ -0,0 +1,59 @@
+<template>
+  <div class="hello">
+    <h1>{{ msg }}</h1>
+    <p>
+      For a guide and recipes on how to configure / customize this project,<br>
+      check out the
+      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
+    </p>
+    <h3>Installed CLI Plugins</h3>
+    <ul>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
+      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
+    </ul>
+    <h3>Essential Links</h3>
+    <ul>
+      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
+      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
+      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
+      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
+      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
+    </ul>
+    <h3>Ecosystem</h3>
+    <ul>
+      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
+      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
+      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
+      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
+      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
+    </ul>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'HelloWorld',
+  props: {
+    msg: String
+  }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped lang="scss">
+h3 {
+  margin: 40px 0 0;
+}
+ul {
+  list-style-type: none;
+  padding: 0;
+}
+li {
+  display: inline-block;
+  margin: 0 10px;
+}
+a {
+  color: #42b983;
+}
+</style>

+ 25 - 0
src/main.js

@@ -0,0 +1,25 @@
+import Vue from 'vue'
+import App from './App.vue'
+import router from './router'
+import store from './store'
+
+// ElementUI
+import '@tools/elUI'
+
+import axios from "@api/axios"; // API接口访问
+Vue.prototype.API = axios;
+
+import base from "@tools/base"; // 公共方法
+Vue.prototype.BASE = base;
+// import formCheck from "@tools/formCheck"; // 表单的处理
+// Vue.prototype.FC = formCheck;
+// import echartsTool from "@tools/echartsTool"; // Echarts 工具类
+// Vue.prototype.ET = echartsTool;
+
+Vue.config.productionTip = false
+
+new Vue({
+  router,
+  store,
+  render: h => h(App)
+}).$mount('#app')

+ 63 - 0
src/router/index.js

@@ -0,0 +1,63 @@
+import Vue from 'vue'
+import VueRouter from 'vue-router'
+
+// 公共页面
+import main from '@views/main'
+
+// 子路由
+import yRouter from '@router/ylf';
+import lRouter from '@router/lzx';
+
+Vue.use(VueRouter)
+
+const routes = [
+  {
+    path: '/',
+    meta: {
+      requireAuth: true, // 添加该字段,表示进入这个路由是需要登录的
+    },
+    component: main,
+    children:[
+      ...yRouter,
+      ...lRouter
+    ]
+  },
+]
+
+const router = new VueRouter({
+  mode: 'history',
+  base: process.env.BASE_URL,
+  routes
+})
+
+/**
+ * 路由的钩子函数,处理是否登录的判断
+ * **/
+ router.beforeEach((to, from, next) => {
+  // 路由地址不存在的处理办法
+  if (to.matched.length === 0) { // 如果未匹配到路由
+    // sessionStorage.removeItem("btrh_sxsd_locationHref");
+    next('/404')   // 如果上级也未匹配到路由则跳转登录页面,如果上级能匹配到则转上级路由
+  }
+
+  if (to.matched.some(r => r.meta.requireAuth)) {
+
+    let userinfo = JSON.parse(sessionStorage.getItem("btrh_sxsd_userinfo"));
+    userinfo = "";
+    if(userinfo !== null){
+      // if(to.path !== "/"){
+      //   // 判断当前菜单是否有权限打开,如果无权限,自动退出
+      //   routerCheck(userinfo.roleId, to.path, next);
+      // }else{
+      //   next();
+      // }
+      next();
+      return;
+    }
+    next("/login");
+  } else {
+    next();
+  }
+})
+
+export default router

+ 6 - 0
src/router/lzx.js

@@ -0,0 +1,6 @@
+export default [
+  { // 路由页面注释
+    path:'/b',
+    component: r => require.ensure([], () => r(require('@views/module1/b')), 'sysManage2')
+  },
+]

+ 6 - 0
src/router/ylf.js

@@ -0,0 +1,6 @@
+export default [
+  { // 路由页面注释
+    path:'/a',
+    component: r => require.ensure([], () => r(require('@views/module1/a')), 'sysManage2')
+  },
+]

+ 24 - 0
src/store/index.js

@@ -0,0 +1,24 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+const state = {
+  submitDDTag: false,   //提交 - 防抖动 - 针对快速请求问题的拦截机制
+  loading: false,   //全局 - 加载中....
+};
+//改变状态的方法
+const mutations = {
+  openSubmitDDTag(state, tag) {
+    state.submitDDTag = tag;
+  },
+  loadingStore(state, tag) {
+    state.loading = tag;
+  },
+};
+var vuexStore = new Vuex.Store({
+  state,
+  mutations
+});
+
+export default vuexStore;

+ 326 - 0
src/tools/base.js

@@ -0,0 +1,326 @@
+import crypto from "crypto";
+//个位数字补零
+export function numberB0(n) {
+  return n < 10 ? "0" + n : n;
+}
+
+// 得到 2019-07-27 格式的日期数组,区间为7天
+export function getSevenDays() {
+  var date = new Date();
+  let nowDate =
+    date.getFullYear() +
+    "-" +
+    numberB0(date.getMonth() + 1) +
+    "-" +
+    numberB0(date.getDate());
+  let oldDate = new Date(date.setTime(date.getTime() - 3600 * 1000 * 24 * 6)).toJSON();
+  let oldDates = oldDate.split("T");
+  oldDate = oldDates[0];
+  return [oldDate, nowDate];
+}
+
+// 同上,但不包括今日
+export function getSevenDays2() {
+  var date = new Date();
+  let nowDate = new Date(date.setTime(date.getTime() - 3600 * 1000 * 24 * 1)).toJSON();
+  let nowDates = nowDate.split("T");
+  nowDate = nowDates[0];
+  let oldDate = new Date(date.setTime(date.getTime() - 3600 * 1000 * 24 * 6)).toJSON();
+  let oldDates = oldDate.split("T");
+  oldDate = oldDates[0];
+  return [oldDate, nowDate];
+}
+
+/**
+ * 将接口返回的日期(12344518976156)转换成(2019-10-10)
+ * 将接口返回的标准格式日期(Wed Oct 14 2020 10:26:34 GMT+0800 (中国标准时间))转换成(2019-10-10)
+ * */
+export function dateChange(date) {
+  let d = new Date(date);
+  return d.getFullYear() + "-" + numberB0(d.getMonth() + 1) + "-" + numberB0(d.getDate());
+}
+/**
+ * 将接口返回的日期(12344518976156)转换成(23:59:59)
+ * 将接口返回的标准格式日期(Wed Oct 14 2020 10:26:34 GMT+0800 (中国标准时间))转换成(23:59:59)
+ * */
+export function monthChange(date) {
+  let d = new Date(date);
+  return d.getFullYear() + "-" + numberB0(d.getMonth() + 1);
+}
+
+/**
+ * 将接口返回的日期(12344518976156)转换成(23:59:59)
+ * 将接口返回的标准格式日期(Wed Oct 14 2020 10:26:34 GMT+0800 (中国标准时间))转换成(23:59:59)
+ * */
+export function timeChange(date) {
+  let d = new Date(date);
+  return (
+    numberB0(d.getHours()) +
+    ":" +
+    numberB0(d.getMinutes()) +
+    ":" +
+    numberB0(d.getSeconds())
+  );
+}
+
+export function timeHMChange(date) {
+  let d = new Date(date);
+  return numberB0(d.getHours()) + ":" + numberB0(d.getMinutes());
+}
+
+/**
+ * 将接口返回的日期时间(12344518976156)转换成(2020-10-14 23:59:59)
+ * 将接口返回的标准格式日期(Wed Oct 14 2020 10:26:34 GMT+0800 (中国标准时间))转换成(2020-10-14 23:59:59)
+ * */
+export function dateTimeChange(date) {
+  if (date === "" || date === null) return date;
+  let d = new Date(date);
+  return (
+    d.getFullYear() +
+    "-" +
+    numberB0(d.getMonth() + 1) +
+    "-" +
+    numberB0(d.getDate()) +
+    " " +
+    numberB0(d.getHours()) +
+    ":" +
+    numberB0(d.getMinutes()) +
+    ":" +
+    numberB0(d.getSeconds())
+  );
+}
+
+/**
+ * getNowTime - 获取当前日期时间:2019-10-10 10:10:20
+ * axios.js在用
+ * */
+export function getNowTime() {
+  var date = new Date();
+  return (
+    date.getFullYear() +
+    "-" +
+    numberB0(date.getMonth() + 1) +
+    "-" +
+    numberB0(date.getDate()) +
+    " " +
+    numberB0(date.getHours()) +
+    ":" +
+    numberB0(date.getMinutes()) +
+    ":" +
+    numberB0(date.getSeconds())
+  );
+}
+
+/**
+ * 传入[开始日期, 结束日期]
+ * 返回格式[2020-10-01 00:00:00, 2020-10-01 23:59:59]
+ * tag: 1,补时分秒
+ *      2,补分秒
+ *      3,补秒
+ * */
+export function dateQjChange(list, tag) {
+  if (list[0] === "" || list[0] === null) return list;
+  let d1 = new Date(list[0]);
+  let d2 = new Date(list[1]);
+  if (tag === undefined) {
+    tag = 1;
+  }
+  switch (tag) {
+    case 1:
+      return [
+        d1.getFullYear() +
+          "-" +
+          numberB0(d1.getMonth() + 1) +
+          "-" +
+          numberB0(d1.getDate()) +
+          " 00:00:00",
+        d2.getFullYear() +
+          "-" +
+          numberB0(d2.getMonth() + 1) +
+          "-" +
+          numberB0(d2.getDate()) +
+          " 23:59:59",
+      ];
+    case 2:
+      return [
+        d1.getFullYear() +
+          "-" +
+          numberB0(d1.getMonth() + 1) +
+          "-" +
+          numberB0(d1.getDate()) +
+          " " +
+          numberB0(d1.getHours()) +
+          ":00:00",
+        d2.getFullYear() +
+          "-" +
+          numberB0(d2.getMonth() + 1) +
+          "-" +
+          numberB0(d2.getDate()) +
+          " " +
+          numberB0(d2.getHours()) +
+          ":59:59",
+      ];
+      break;
+    case 3:
+      return [
+        d1.getFullYear() +
+          "-" +
+          numberB0(d1.getMonth() + 1) +
+          "-" +
+          numberB0(d1.getDate()) +
+          " " +
+          numberB0(d1.getHours()) +
+          ":" +
+          numberB0(d1.getMinutes()) +
+          ":00",
+        d2.getFullYear() +
+          "-" +
+          numberB0(d2.getMonth() + 1) +
+          "-" +
+          numberB0(d2.getDate()) +
+          " " +
+          numberB0(d2.getHours()) +
+          ":" +
+          numberB0(d2.getMinutes()) +
+          ":59",
+      ];
+      break;
+  }
+}
+
+/**
+ * getNowTime2 - 获取当前日期时间:2019年10月10日 10:10:20 星期一
+ * 地图版在用
+ * */
+export function getNowTime2() {
+  var date = new Date();
+
+  var weekday = new Array(7);
+  weekday[0] = "星期日";
+  weekday[1] = "星期一";
+  weekday[2] = "星期二";
+  weekday[3] = "星期三";
+  weekday[4] = "星期四";
+  weekday[5] = "星期五";
+  weekday[6] = "星期六";
+
+  var n = weekday[date.getDay()];
+
+  return (
+    date.getFullYear() +
+    "年" +
+    numberB0(date.getMonth() + 1) +
+    "月" +
+    numberB0(date.getDate()) +
+    "日 " +
+    numberB0(date.getHours()) +
+    ":" +
+    numberB0(date.getMinutes()) +
+    ":" +
+    numberB0(date.getSeconds()) +
+    " " +
+    n
+  );
+}
+
+//金额分割符,4位分割(仅数字)
+export function getNewNum(nStr) {
+  nStr += "";
+  var x = nStr.split(".");
+  var x1 = x[0];
+  var x2 = x.length > 1 ? "." + x[1] : "";
+  var rgx = /(\d+)(\d{4})/;
+  while (rgx.test(x1)) {
+    x1 = x1.replace(rgx, "$1" + "," + "$2");
+  }
+  return x1 + x2;
+}
+
+/**
+ * 提供获取内容页面的高度,便于处理两种不同显示滚动条的兼容问题。默认页面高度自然,框架提供了滚动条无需处理;特殊情况,页面高度需保持一屏,内部页面的高度需要自己计算,因此提供该方法,便于开发者开发内部页面。
+ * type:midd居中模式;full全屏模式;
+ * */
+export function getPageHeight(type) {
+  let h = document.documentElement.clientHeight;
+  type = type === undefined ? "midd" : type;
+  if (type === "midd") {
+    h = h - 48;
+  }
+  return h;
+}
+
+/**
+ * 提供获取内容页面的宽度。
+ * type:midd居中模式;full全屏模式;
+ * 全屏模式无需计算宽度是否小于1600
+ * */
+export function getPageWidth(type) {
+  let w = document.documentElement.clientWidth;
+  type = type === undefined ? "midd" : type;
+  if (type === "midd") {
+    if (w < 1600) {
+      return 1200;
+    } else {
+      return 1500;
+    }
+  } else {
+    return w;
+  }
+}
+
+/*
+ *  Ant和element-ui 级联相同bug - 底层存在children的时候会显示空模块的问题,此方法可以完成任意级别的递归找children。
+ *  data:原型数据
+ * */
+export function cascaderBugRepair(data) {
+  if (data == null) return false;
+  let nums = data.length;
+  for (var i = 0; i < nums; i++) {
+    if (data[i].children.length <= 0) {
+      delete data[i].children;
+    } else {
+      if (data[i].children.length > 0) {
+        data[i].children = cascaderBugRepair(data[i].children);
+      }
+    }
+  }
+  return data;
+}
+
+/*
+ *  ant - 级联 - 显示名字为:宝通运维/总中心/分中心
+ *  修改为:分中心
+ * */
+export function cascaderShowName({ labels }) {
+  return labels[labels.length - 1];
+}
+
+/*
+ *  MD5加密方法
+ * */
+export function getMd5(data) {
+  const md5 = crypto.createHash("md5");
+  md5.update(data);
+  let md5password = md5.digest("hex");
+  return md5password.toString().toUpperCase();
+}
+
+export default {
+  getMd5,
+  cascaderBugRepair,
+  cascaderShowName,
+  getPageWidth,
+  getPageHeight,
+  getNewNum,
+  dateChange,
+  timeHMChange,
+  timeChange,
+  getNowTime,
+  getNowTime2,
+  dateQjChange,
+  getSevenDays,
+  getSevenDays2,
+  dateTimeChange,
+  numberB0,
+  monthChange,
+};

+ 808 - 0
src/tools/echartsTool.js

@@ -0,0 +1,808 @@
+import EC from 'echarts'
+import eWordcloud from 'echarts-wordcloud'
+import { message } from 'ant-design-vue';
+const color = ["#00FFF0","#014EB5","#A800FF","#e82edb","#B5454C","#443bff","#e8cb25","#3dffb0","#e8a425","#ff7aab","#e84b1e","#552ce2","#ffae21","#e8861e","#d441ff","#35e8e4","#9c7aff","#e86fd8","#ffee38"];
+
+/*
+ *  获取 自浮云 - 常用1
+ *  id: 元素ID
+ *  data: [{
+      name: "发动机卡了", // 值
+      value: 100, // 权重
+      textStyle: {
+        emphasis: {
+          color: 'red' // 光标移入颜色
+        }
+      }
+    },{
+      name: "发动了", // 值
+      value: 20, // 权重
+      textStyle: {
+        emphasis: {
+          color: 'red' // 光标移入颜色
+        }
+      }
+    }]
+ *  name: 提示框name
+ * */
+export function getWordCloud(id, data) {
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {},
+    series: [{
+      type: 'wordCloud',
+      gridSize: 2,
+      sizeRange: [12, 50],
+      rotationRange: [-90, 90],
+      shape: 'pentagon',
+      width: 600,
+      height: 400,
+      drawOutOfBound: true,
+      textStyle: {
+        normal: {
+          color: function() {
+            return 'rgb(' + [
+              Math.round(Math.random() * 160),
+              Math.round(Math.random() * 160),
+              Math.round(Math.random() * 160)
+            ].join(',') + ')';
+          }
+        },
+        emphasis: {
+          shadowBlur: 10,
+          shadowColor: '#333'
+        }
+      },
+      data: data
+    }]
+  };
+  myChart.setOption(option, true);
+}
+
+/*
+ *  获取 雷达图 - 常用1
+ *  id: 元素ID
+ *  horn: [
+      { name: '销售', max: 6500},
+      { name: '管理', max: 16000},
+      { name: '信息技术', max: 30000},
+      { name: '客服', max: 38000},
+      { name: '研发', max: 52000}
+    ]
+ *  data: [
+      {
+        value: [4300, 10000, 28000, 35000, 50000],
+        name: '完好率'
+      }
+    ]
+ *  name: 提示框name
+ * */
+export function getRadar(id, horn, data, name) {
+  if(name === undefined){
+    name = "雷达数据";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {},
+    radar: {
+      // shape: 'circle',
+      radius: "60%",
+      indicator: horn,
+      axisLine: {
+        lineStyle: {
+          color: "#FFF"
+        }
+      },
+      splitLine: {
+        lineStyle: {
+          color: "#2aafb7"
+        }
+      }
+    },
+    series: [{
+      name: name,
+      type: 'radar',
+      // areaStyle: {normal: {}},
+      data: data
+    }]
+  };
+  myChart.setOption(option, true);
+}
+
+/*
+ *  获取 雷达图 - 常用2 - 百分比
+ *  id: 元素ID
+ *  horn: [
+      { name: '销售', max: 100},
+      { name: '管理', max: 100},
+      { name: '信息技术', max: 100},
+      { name: '客服', max: 100},
+      { name: '研发', max: 100}
+    ]
+ *  data: [
+      {
+        value: [98, 98, 98, 98, 98],
+        name: '完好率'
+      }
+    ]
+ *  name: 提示框name
+ * */
+export function getRadar2(id, horn, data, name) {
+  if(name === undefined){
+    name = "雷达数据";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      // formatter: '{b0}<br />{a}: {c0}'
+      formatter: function (params, ticket, callback) {
+        let value = params.data.name;
+        horn.forEach((item, i)=>{
+          value += '<br />'+item.name+':'+params.data.value[i]+"%"
+        });
+        return value;
+      }
+    },
+    radar: {
+      // shape: 'circle',
+      radius: "60%",
+      indicator: horn,
+      axisLine: {
+        lineStyle: {
+          color: "#FFF"
+        }
+      },
+      splitLine: {
+        lineStyle: {
+          color: "#2aafb7"
+        }
+      }
+    },
+    series: [{
+      name: name,
+      type: 'radar',
+      // areaStyle: {normal: {}},
+      data: data
+    }]
+  };
+  myChart.setOption(option, true);
+}
+
+/*
+ *  获取 柱状图 - 横向1
+ *  id: 元素ID
+ *  x: ['TOP6', 'TOP5', 'TOP4', 'TOP3', 'TOP2', 'TOP1']
+ *  data: [{
+      value: 1000,
+      itemStyle: {
+        color: "#AAFAE0",
+        barBorderRadius: [0, 3, 3, 0] // 柱子圆角
+      }
+    },{
+      value: 2000,
+      itemStyle: {
+        color: "#FCCDBA",
+        barBorderRadius: [0, 3, 3, 0] // 柱子圆角
+      }
+    },{
+      value: 3000,
+      itemStyle: {
+        color: "#015EEA",
+        barBorderRadius: [0, 3, 3, 0] // 柱子圆角
+      }
+    }]
+ *  name: 提示框name
+ * */
+export function getBarHorizontal(id, x, data, name, tipX) {
+  if(name === undefined){
+    name = "数量";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      // formatter: '{b0}<br />{a}: {c0}'
+      formatter: function (params, ticket, callback) {
+        if(tipX === undefined){
+          return params.name+'<br />'+params.seriesName+': '+params.data.value;
+        }else{
+          return tipX[tipX.length - 1 - params.dataIndex]+'<br />'+params.seriesName+': '+params.data.value;
+        }
+      }
+    },
+    grid: {
+      top: 10,
+      left: 60,
+      right: 40,
+      bottom: 30,
+    },
+    xAxis: {
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      minInterval: 1, // 刻度不出现小数
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      splitLine: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+    },
+    yAxis: {
+      type: 'category',
+      data: x,
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    series: [
+      {
+        name: name,
+        type: 'bar',
+        barWidth: 6,
+        data: data
+      }
+    ]
+  };
+  myChart.setOption(option, true);
+}
+/*
+ *  获取 柱状图 - 纵向1
+ *  id: 元素ID
+ *  x: ['TOP3', 'TOP2', 'TOP1']
+ *  data: [{
+      value: 1000,
+      itemStyle: {
+        color: "#AAFAE0",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 2000,
+      itemStyle: {
+        color: "#FCCDBA",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 3000,
+      itemStyle: {
+        color: "#015EEA",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    }]
+ *  name: 提示框name
+ * */
+export function getBarVertical(id, x, data, name) {
+  if(name === undefined){
+    name = "数量";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      }
+    },
+    grid: {
+      top: 15,
+      left: 60,
+      right: 40,
+      bottom: 30,
+    },
+    yAxis: {
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      minInterval: 1, // 刻度不出现小数
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      splitLine: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF",
+        // 改变纵坐标的单位,过大的时候处理成万
+        formatter: function (value, index) {
+          if(value >= 10000){
+            return (value/10000).toFixed(0)+"万";
+          }else{
+            return value;
+          }
+        }
+
+      },
+    },
+    xAxis: {
+      type: 'category',
+      data: x,
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    series: [
+      {
+        name: name,
+        type: 'bar',
+        barWidth: 6,
+        data: data
+      }
+    ]
+  };
+  myChart.setOption(option, true);
+}
+/*
+ *  获取 柱状图 - 纵向2 - 一轴多线
+ *  id: 元素ID
+ *  x: ['分中心1', '分中心2', '分中心3', '分中心4']
+ *
+ *  data: [
+      {
+        name: '土建',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#4AB2EC",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [7.0, 23.2, 25.6, 76.7]
+      },
+      {
+        name: '机电',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#F8CA9D",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [2.6, 5.9, 9.0, 26.4]
+      },
+      {
+        name: '其他',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#8E6398",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [28.7, 70.7, 175.6, 182.2]
+      },
+    ]
+ * */
+export function getBarVertical2(id, x, data) {
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      }
+    },
+    grid: {
+      top: 15,
+      left: 60,
+      right: 40,
+      bottom: 30,
+    },
+    yAxis: {
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      splitLine: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF",
+        // 改变纵坐标的单位,过大的时候处理成万
+        formatter: function (value, index) {
+          if(value >= 10000){
+            return (value/10000).toFixed(0)+"万";
+          }else{
+            return value;
+          }
+        }
+      },
+    },
+    xAxis: {
+      type: 'category',
+      data: x,
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    series: data
+  };
+  myChart.setOption(option, true);
+}
+/*
+ *  获取 柱状图 - 纵向2_1 - 一轴多线百分比
+ *  id: 元素ID
+ *  x: ['分中心1', '分中心2', '分中心3', '分中心4']
+ *
+ *  data: [
+      {
+        name: '土建',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#4AB2EC",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [7.0, 23.2, 25.6, 76.7]
+      },
+      {
+        name: '机电',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#F8CA9D",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [2.6, 5.9, 9.0, 26.4]
+      },
+      {
+        name: '其他',
+        type: 'bar',
+        barWidth: 6,
+        itemStyle: {
+          color: "#8E6398",
+          barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+        },
+        data: [28.7, 70.7, 175.6, 182.2]
+      },
+    ]
+ * */
+export function getBarVertical2_1(id, x, data) {
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      },
+    },
+    grid: {
+      top: 15,
+      left: 60,
+      right: 40,
+      bottom: 30,
+    },
+    yAxis: {
+      max: 100,
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      minInterval: 1, // 刻度不出现小数
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      splitLine: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF",
+        formatter: '{value} %'
+      },
+    },
+    xAxis: {
+      type: 'category',
+      data: x,
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    series: data
+  };
+  myChart.setOption(option, true);
+}
+/*
+ *  获取 柱状图 - 纵向3
+ *  id: 元素ID
+ *  x: ['TOP6', 'TOP5', 'TOP4', 'TOP3', 'TOP2', 'TOP1']
+ *  data: [{
+      value: 1000,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 2000,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 3000,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 4000,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 5000,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },{
+      value: 5999,
+      itemStyle: {
+        color: "#D8A0FE",
+        barBorderRadius: [3, 3, 0, 0] // 柱子圆角
+      }
+    },]
+ * */
+export function getBarVertical3(id, x, data, name) {
+  if(name === undefined){
+    name = "数量";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'shadow'
+      }
+    },
+    grid: {
+      top: 25,
+      left: 80,
+      right: 40,
+      bottom: 30,
+    },
+    yAxis: {
+      type: 'value',
+      boundaryGap: [0, 0.01],
+      minInterval: 1, // 刻度不出现小数
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      splitLine: {
+        show: false
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF",
+        // 改变纵坐标的单位,过大的时候处理成万
+        formatter: function (value, index) {
+          if(value >= 10000){
+            return (value/10000).toFixed(0)+"万";
+          }else{
+            return value;
+          }
+        }
+      },
+    },
+    xAxis: {
+      type: 'category',
+      data: x,
+      axisLine: {
+        lineStyle: {
+          color: "#011A3F"
+        }
+      },
+      axisTick: {
+        show: false
+      },
+      axisLabel: {
+        fontSize: 12,
+        color: "#FFF"
+      },
+      splitLine: {
+        show: false
+      }
+    },
+    series: [
+      {
+        name: name,
+        type: 'bar',
+        barWidth: 6,
+        data: data
+      }
+    ]
+  };
+  myChart.setOption(option, true);
+}
+
+/*
+ *  获取 饼图 - 常用1
+ *  id: 元素ID
+ *  data: 饼图数据
+ *  name: 提示框name
+ *  [
+      {value: 335, name: '直接访问'},
+      {value: 310, name: '邮件营销'},
+      {value: 234, name: '联盟广告'},
+      {value: 135, name: '视频广告'},
+      {value: 1548, name: '搜索引擎'}
+    ]
+ * */
+export function getPie(id, data, name) {
+  if(name === undefined){
+    name = "占比";
+  }
+  if(data === undefined){
+    message.error("没有找到报表数据,请检查!");
+    return;
+  }
+  var myChart = EC.init(document.getElementById(id));
+  let option = {
+    tooltip: {
+      trigger: 'item',
+      formatter: "{a} <br/>{b} : {c} ({d}%)"
+    },
+    grid: {
+      left: 44,
+      right: 25,
+      top: 56,
+      bottom: 40
+    },
+    color: color,
+    series: [{
+      name: name,
+      type: 'pie',
+      radius: ['45%', '65%'],
+      center: ['50%', '50%'],
+      data: data,
+      labelLine: {
+        length: 10,
+        length2: 10,
+        lineStyle: {
+          color: "#FFF"
+        }
+      },
+      itemStyle: {
+        emphasis: {
+          shadowBlur: 10,
+          shadowOffsetX: 0,
+          shadowColor: 'rgba(0, 0, 0, 0.5)'
+        },
+        normal: {
+          label: {
+            textStyle: {
+              color:'#FFF',
+              fontSize: 14,
+            }
+          },
+        },
+      },
+      label: {
+        formatter: ['{b}','{d}%'].join('\n')
+      }
+    }]
+  };
+  myChart.setOption(option, true);
+}
+
+
+export default {
+  getWordCloud,
+
+  getRadar,
+  getRadar2,
+
+  getBarHorizontal,
+  getBarVertical,
+  getBarVertical2,
+  getBarVertical2_1,
+  getBarVertical3,
+
+  getPie,
+
+  color,
+}

+ 5 - 0
src/tools/elUI.js

@@ -0,0 +1,5 @@
+import Vue from 'vue';
+
+import ElementUI from 'element-ui';
+import 'element-ui/lib/theme-chalk/index.css';
+Vue.use(ElementUI);

+ 101 - 0
src/tools/formCheck.js

@@ -0,0 +1,101 @@
+/**
+ *  带小数点的数字输入 - 默认4为小数
+ *  例如:FC.numDxsCheck(form, 3,'phone')
+ *  form:表单对象,其中包括phone
+ *  ws:几位小数,默认2位小数,传1代表1位小数
+ *  key:键名不叫phone时需要传入新的键名
+ * */
+export function numDxsCheck(form, ws, key) {
+  if (key === undefined) {
+    key = "cost";
+  }
+  form[key] = form[key] + "";
+
+  //先把非数字的都替换掉,除了数字和.
+  form[key] = form[key].replace(/[^\d.]/g, "");
+  //必须保证第一个为数字而不是.
+  form[key] = form[key].replace(/^\./g, "");
+  //保证只有出现一个.而没有多个.
+  form[key] = form[key].replace(/\.{2,}/g, ".");
+  //保证.只出现一次,而不能出现两次以上
+  form[key] = form[key].replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
+
+  //只能输入4个小数
+  let c = null;
+  switch (ws) {
+    case 1:
+      c = /^(\-)*(\d+)\.(\d).*$/;
+      break;
+    case 2:
+      c = /^(\-)*(\d+)\.(\d\d).*$/;
+      break;
+    case 3:
+      c = /^(\-)*(\d+)\.(\d\d\d).*$/;
+      break;
+    case 4:
+      c = /^(\-)*(\d+)\.(\d\d\d\d).*$/;
+      break;
+    default:
+      c = /^(\-)*(\d+)\.(\d\d).*$/;
+  }
+  //只能输入两个小数
+  form[key] = form[key].replace(c, "$1$2.$3");
+}
+
+/**
+ *  只能输入数字
+ *  例如:FC.numCheck(form,'num')
+ *  form:表单对象,其中包括num
+ *  key:键名不叫num时需要传入新的键名
+ * */
+export function numCheck(form, key) {
+  if (key === undefined) {
+    key = "num";
+  }
+  form[key] = form[key].replace(/[^\d]/g, "");
+}
+
+/**
+ *  只能输入:英文字母或数字
+ *  例如:FC.numEnCheck(form,'num')
+ *  form:表单对象,其中包括num
+ *  key:键名不叫num时需要传入新的键名
+ * */
+export function numEnCheck(form, key) {
+  if (key === undefined) {
+    key = "num";
+  }
+  form[key] = form[key].replace(/[^\w\.\/]/gi, "");
+}
+
+/*
+ *  手机号 长度
+ *  处理手机号长度,默认对象内手机号的字段名称为phone
+ *  form:表单对象,其中包括phone
+ *  key:键名不叫phone时需要传入新的键名
+ * */
+export function phoneMaxLength(form, key) {
+  if (key === undefined) {
+    key = "phone";
+  }
+  if (form[key].length > 11) {
+    form[key] = form[key].substring(0, 11);
+  }
+}
+
+/*
+ *  禁止选择的日期区间
+ *  禁止选择今天以后的日期 - 今天可选
+ *  num: 天,0:今天可选,1:今天不可选,2:昨天也不可选,-1:明天可选,-2:后天也可选,类推
+ * */
+export function rangePickerDisabledDate(current, num) {
+  return current && current > new Date().getTime() - 3600 * 1000 * 24 * num;
+}
+
+export default {
+  rangePickerDisabledDate,
+  numCheck,
+  numEnCheck,
+  phoneMaxLength,
+  numDxsCheck,
+};

+ 23 - 0
src/views/main.vue

@@ -0,0 +1,23 @@
+<template>
+  <div class="home">
+  <el-button type="primary">主要按钮</el-button>
+  <el-button type="success">成功按钮</el-button>
+  <el-button type="info">信息按钮</el-button>
+  <el-button type="warning">警告按钮</el-button>
+  <el-button type="danger">危险按钮</el-button>
+    <img alt="Vue logo" src="@assets/images/login.jpg" />
+    防静电卡萨龙卷风看了大神接口了放大
+    
+    <router-view/>
+  </div>
+</template>
+
+
+<script>
+  import main from '@assets/js/main'
+  export default main
+</script>
+
+<style lang="scss" scoped>
+  @import "@assets/css/a.scss";
+</style>

+ 13 - 0
src/views/module1/a.vue

@@ -0,0 +1,13 @@
+<template>
+  <div class="home">
+    a页面
+  </div>
+</template>
+
+
+<script>
+
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 13 - 0
src/views/module1/b.vue

@@ -0,0 +1,13 @@
+<template>
+  <div class="home">
+    b页面
+  </div>
+</template>
+
+
+<script>
+
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 79 - 0
vue.config.js

@@ -0,0 +1,79 @@
+// vue.config.js
+const path = require('path');
+const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV);
+const resolve = (dir) => path.join(__dirname, dir);
+const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); // 去掉 console.log
+module.exports = {
+  publicPath: IS_PROD ? process.env.VUE_APP_PUBLIC_PATH : "./", // 默认'/',部署应用包时的基本 URL
+  indexPath: 'index.html', // 相对于打包路径index.html的路径
+  outputDir: process.env.outputDir || 'dist', // 'dist', 生产环境构建文件的目录
+  assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录
+  lintOnSave: false, // 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码
+  runtimeCompiler: true, // 是否使用包含运行时编译器的 Vue 构建版本
+  productionSourceMap: !IS_PROD, // 生产环境的 source map
+  parallel: require("os").cpus().length > 1, // 是否为 Babel 或 TypeScript 使用 thread-loader。该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建。
+  pwa: {}, // 向 PWA 插件传递选项。
+  chainWebpack: config => {
+    config.resolve.symlinks(true); // 修复热更新失效
+    // 添加别名
+    config.resolve.alias
+      .set('@', resolve('src'))
+      .set('@api', resolve('src/api'))
+      .set('@tools', resolve('src/tools'))
+      .set('@assets', resolve('src/assets'))
+      .set('@components', resolve('src/components'))
+      .set('@views', resolve('src/views'))
+      .set('@router', resolve('src/router'))
+      .set('@store', resolve('src/store'));
+    // 压缩图片
+    // if (IS_PROD) {
+    //   config.module
+    //     .rule("images")
+    //     .use("image-webpack-loader")
+    //     .loader("image-webpack-loader")
+    //     .options({
+    //       mozjpeg: { progressive: true, quality: 65 },
+    //       optipng: { enabled: false },
+    //       pngquant: { quality: [0.65, 0.9], speed: 4 },
+    //       gifsicle: { interlaced: false }
+    //       // webp: { quality: 75 }
+    //     });
+    // }
+  },
+  css: {
+    // extract: IS_PROD,
+    sourceMap: false,
+    loaderOptions: {
+      scss: {
+        // 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
+        // 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
+        // 全局都会使用的文件
+        prependData: `
+        @import "@assets/css/base.scss";
+        $src: "${process.env.VUE_APP_OSS_SRC}";
+        `
+      }
+    }
+  }, 
+  // 去掉console.log
+  configureWebpack: config => {
+    if (IS_PROD) {
+      const plugins = [];
+      plugins.push(
+        new UglifyJsPlugin({
+          uglifyOptions: {
+            compress: {
+              drop_console: true,
+              drop_debugger: false,
+              pure_funcs: ["console.log"] //移除console
+            }
+          },
+          sourceMap: false,
+          parallel: true
+        })
+      );
+      config.plugins = [...config.plugins, ...plugins];
+    }
+  },
+
+}