Prechádzať zdrojové kódy

修改package.json的version + 去除无用文件

林倩 3 rokov pred
rodič
commit
c8bd457e88
55 zmenil súbory, kde vykonal 48 pridanie a 1353 odobranie
  1. 0 1
      config/dev.env.js
  2. 1 1
      package.json
  3. BIN
      src/assets/images/common/demo.png
  4. BIN
      src/assets/images/dashboard/docker容器.png
  5. BIN
      src/assets/images/dashboard/dq-zs.png
  6. BIN
      src/assets/images/dashboard/icon-api创建.png
  7. BIN
      src/assets/images/dashboard/icon-api管理.png
  8. BIN
      src/assets/images/dashboard/icon-应用注册.png
  9. BIN
      src/assets/images/dashboard/icon智能分组.png
  10. BIN
      src/assets/images/dashboard/nas.png
  11. BIN
      src/assets/images/dashboard/pal.png
  12. BIN
      src/assets/images/dashboard/qg-zs.png
  13. BIN
      src/assets/images/dashboard/san.png
  14. BIN
      src/assets/images/dashboard/zy-dxcc.png
  15. BIN
      src/assets/images/dashboard/zy-fzjh.png
  16. BIN
      src/assets/images/dashboard/zy-nas.png
  17. BIN
      src/assets/images/dashboard/zy-rq.png
  18. BIN
      src/assets/images/dashboard/zy-san.png
  19. BIN
      src/assets/images/dashboard/zy-wlj.png
  20. BIN
      src/assets/images/dashboard/zy-xnj.png
  21. BIN
      src/assets/images/dashboard/zy-xnywl.png
  22. BIN
      src/assets/images/dashboard/zy-ym.png
  23. BIN
      src/assets/images/dashboard/域名.png
  24. BIN
      src/assets/images/dashboard/对象存储.png
  25. BIN
      src/assets/images/dashboard/物理机.png
  26. BIN
      src/assets/images/dashboard/虚拟专有网络.png
  27. BIN
      src/assets/images/dashboard/虚拟机.png
  28. BIN
      src/assets/images/dashboard/负载均衡.png
  29. BIN
      src/assets/images/login/L-1.png
  30. BIN
      src/assets/images/login/L-2.png
  31. BIN
      src/assets/images/login/M-close.png
  32. BIN
      src/assets/images/login/M-far.png
  33. BIN
      src/assets/images/login/R-1.png
  34. BIN
      src/assets/images/login/R-2.png
  35. BIN
      src/assets/images/login/R-3.png
  36. BIN
      src/assets/images/login/bottom.png
  37. BIN
      src/assets/images/login/login-bg.png
  38. BIN
      src/assets/images/login/login-logo.png
  39. BIN
      src/assets/images/login/logo.gif
  40. BIN
      src/assets/images/page/info-compare/demo_compare.png
  41. 0 1
      src/filters/index.js
  42. 42 51
      src/main.js
  43. 2 2
      src/pages/common/login/index.vue
  44. 0 168
      src/utils/date-utils.js
  45. 3 10
      src/utils/index.js
  46. 0 98
      src/utils/request-not-oauth.js
  47. 0 90
      src/utils/request-oauth.js
  48. 0 42
      src/utils/validate.js
  49. 0 260
      src/utils/zt-data.js
  50. 0 143
      src/utils/zt-form.js
  51. 0 52
      src/utils/zt-lodash.js
  52. 0 380
      src/utils/zt-moment.js
  53. 0 40
      src/utils/zt-service.js
  54. 0 14
      src/utils/zt-window.js
  55. BIN
      static/themes/style/images/dashboard/icon.png

+ 0 - 1
config/dev.env.js

@@ -3,7 +3,6 @@ const merge = require("webpack-merge");
 const prodEnv = require("./prod.env");
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    // DEVTOOL: '"cheap-module-eval-source-map"',
     IS_BASE_PACKAGE: "true",
     FILE_BASE_PATH: '"http://192.168.10.14:1665"',
     //以上配置一般不需要修改

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "dcuc-web-auth",
-  "version": "1.2.89",
+  "version": "2.4.0-tjdsj",
   "description": "",
   "private": false,
   "main": "lib/static/js/app.js",

BIN
src/assets/images/common/demo.png


BIN
src/assets/images/dashboard/docker容器.png


BIN
src/assets/images/dashboard/dq-zs.png


BIN
src/assets/images/dashboard/icon-api创建.png


BIN
src/assets/images/dashboard/icon-api管理.png


BIN
src/assets/images/dashboard/icon-应用注册.png


BIN
src/assets/images/dashboard/icon智能分组.png


BIN
src/assets/images/dashboard/nas.png


BIN
src/assets/images/dashboard/pal.png


BIN
src/assets/images/dashboard/qg-zs.png


BIN
src/assets/images/dashboard/san.png


BIN
src/assets/images/dashboard/zy-dxcc.png


BIN
src/assets/images/dashboard/zy-fzjh.png


BIN
src/assets/images/dashboard/zy-nas.png


BIN
src/assets/images/dashboard/zy-rq.png


BIN
src/assets/images/dashboard/zy-san.png


BIN
src/assets/images/dashboard/zy-wlj.png


BIN
src/assets/images/dashboard/zy-xnj.png


BIN
src/assets/images/dashboard/zy-xnywl.png


BIN
src/assets/images/dashboard/zy-ym.png


BIN
src/assets/images/dashboard/域名.png


BIN
src/assets/images/dashboard/对象存储.png


BIN
src/assets/images/dashboard/物理机.png


BIN
src/assets/images/dashboard/虚拟专有网络.png


BIN
src/assets/images/dashboard/虚拟机.png


BIN
src/assets/images/dashboard/负载均衡.png


BIN
src/assets/images/login/L-1.png


BIN
src/assets/images/login/L-2.png


BIN
src/assets/images/login/M-close.png


BIN
src/assets/images/login/M-far.png


BIN
src/assets/images/login/R-1.png


BIN
src/assets/images/login/R-2.png


BIN
src/assets/images/login/R-3.png


BIN
src/assets/images/login/bottom.png


BIN
src/assets/images/login/login-bg.png


BIN
src/assets/images/login/login-logo.png


BIN
src/assets/images/login/logo.gif


BIN
src/assets/images/page/info-compare/demo_compare.png


+ 0 - 1
src/filters/index.js

@@ -1,5 +1,4 @@
 import utils from "@/common/utils";
-import request from "request";
 const { ztMoment } = utils;
 
 function pluralize(time, label) {

+ 42 - 51
src/main.js

@@ -3,95 +3,86 @@
  *
  */
 // 全局样式
-import "@/assets/style/variable-theme-default.scss";
+import '@/assets/style/variable-theme-default.scss';
 
 // 兼容 IE 10 浏览器
 // import 'babel-polyfill';
 
 // 基础文件引入
-import Vue from "vue";
-import Cookies from "js-cookie";
+import Vue from 'vue';
+import Cookies from 'js-cookie';
 
 // 引入页面组件
-import App from "./app";
-import "@/utils/sys-settings";
+import App from './app';
+import '@/utils/sys-settings';
 
 // 引入路由文件
-import router from "./router";
+import router from './router';
 
 // 引入数据状态管理
-import store from "./store";
+import store from './store';
 
 // 引入国际化语言
-import i18n from "./lang";
-import "./common/login/Login";
+import i18n from './lang';
+import './common/login/Login';
 
 // global filters
-import filters from "./filters";
+import filters from './filters';
 
 // 引入jquery
-import $ from "jquery";
+import $ from 'jquery';
 
 Vue.prototype.$ = $;
 
 let BaseUI = {};
 let utils = {};
-if (!process.env.IS_BASE_PACKAGE) {
-    // 引入路由权限控制
-    require("@/router/permission");
-    // 全局引入 封装的组件
-    BaseUI = require("@/components").default;
-    // 全局引入工具类
-    utils = require("@/utils").default;
+// 引入路由权限控制
+if (process.env.NEED_LOGIN) {
+  require('@/router/dcuc_permission.js');
 } else {
-    // 引入路由权限控制
-    if (process.env.NEED_LOGIN) {
-       require("@/router/dcuc_permission.js");      
-    } else {
-        require("@/router/lxr_permission.js");  
-    }
-    // 全局引入 封装的组件
-    BaseUI = require("ui-jz-v4-common/src/components").default;
-    // 全局引入工具类
-    utils = require("ui-jz-v4-common/src/utils").default;
+  require('@/router/lxr_permission.js');
 }
+// 全局引入 封装的组件
+BaseUI = require('ui-jz-v4-common/src/components').default;
+// 全局引入工具类
+utils = require('ui-jz-v4-common/src/utils').default;
 if (process.env.IS_MOCK) {
-    let mockXHR = require("../mock").default;
-    mockXHR();
+  let mockXHR = require('../mock').default;
+  mockXHR();
 }
 
 // 全局引入 element-ui 组件
-import ElementUI from "element-ui";
+import ElementUI from 'element-ui';
 
 // 全局引入 ui-component-v4 组件
-import UiComponentV4 from "ui-component-v4";
+import UiComponentV4 from 'ui-component-v4';
 
 // 全局引入指令
-import directives from "@/directive";
+import directives from '@/directive';
 
-import XEUtils from 'xe-utils'
-import { VXETable, Table, Column, header, Grid, Icon } from 'vxe-table'
-Vue.use(VXETable)
-Vue.use(Icon)
-Vue.use(Table)
-Vue.use(Column)
-Vue.use(header)
-Vue.use(Grid)
+import XEUtils from 'xe-utils';
+import { VXETable, Table, Column, header, Grid, Icon } from 'vxe-table';
+Vue.use(VXETable);
+Vue.use(Icon);
+Vue.use(Table);
+Vue.use(Column);
+Vue.use(header);
+Vue.use(Grid);
 
-import zhCN from 'vxe-table/lib/locale/lang/zh-CN'
+import zhCN from 'vxe-table/lib/locale/lang/zh-CN';
 
 // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
 VXETable.setup({
   i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args)
-})
+});
 
 Vue.use(ElementUI, {
-    i18n: (key, value) => i18n.t(key, value)
+  i18n: (key, value) => i18n.t(key, value)
 });
 
 Vue.use(UiComponentV4, {
-    size: Cookies.get("size") || "small", // set ui-components default size
-    i18n: (key, value) => i18n.t(key, value)
+  size: Cookies.get('size') || 'small', // set ui-components default size
+  i18n: (key, value) => i18n.t(key, value)
 });
 
 Vue.use(BaseUI);
@@ -103,9 +94,9 @@ Vue.config.productionTip = false;
 
 // 实例化
 new Vue({
-    el: "#app",
-    router,
-    store,
-    i18n,
-    render: h => h(App)
+  el: '#app',
+  router,
+  store,
+  i18n,
+  render: h => h(App)
 });

+ 2 - 2
src/pages/common/login/index.vue

@@ -2,11 +2,11 @@
 	<div class="v-login-box" style="">
 		<!--logo-->
 		<div class="v-login-box__logo" style="">
-			<img src="../../../assets/images/login/login-logo.png" alt>
+			<!-- <img src="../../../assets/images/login/login-logo.png" alt> -->
 		</div>
 		<!--背景图-->
 		<div class="v-login-box__bg" style="">
-			<img src="../../../assets/images/login/login-bg.png" style="height: 80vh" alt>
+			<!-- <img src="../../../assets/images/login/login-bg.png" style="height: 80vh" alt> -->
 		</div>
 		<!--账号登入模块-->
 		<div class="v-login-box__content">

+ 0 - 168
src/utils/date-utils.js

@@ -1,168 +0,0 @@
-let SIGN_REGEXP = /([yMdHsm])(\1*)/g;
-let DEFAULT_PATTERN = 'yyyy-MM-dd';
-function padding(s, len){
-    len = len - (s + '').length;
-    for (let i = 0; i < len; i++) { s = '0' + s; }
-    return s;
-}
-export default {
-    /**
-     * 获取日期
-     * days天数
-     * outFmt输出格式
-     */
-    getData: function (days, outFmt) {
-        let date = new Date();
-        date.setDate(date.getDate() - days);
-        return this.format(date,outFmt);
-    },
-    /**
-     * 距离现在几分钟
-     * dateTimeStamp时间戳
-     */
-    timeAgo:function (dateString,inFmt){
-        let dateTimeStamp=this.strToDate(dateString,inFmt,'',true).getTime();
-        let minute = 1000 * 60;
-        let hour = minute * 60;
-        let day = hour * 24;
-        let week = day * 7;
-        let halfamonth = day * 15;
-        let month = day * 30;
-        let now = new Date().getTime();   //获取当前时间毫秒
-        let diffValue = now - dateTimeStamp;//时间差
-        let result="";
-        if(diffValue < 0){
-            return;
-        }
-        let minC = diffValue/minute;  //计算时间差的分,时,天,周,月
-        let hourC = diffValue/hour;
-        let dayC = diffValue/day;
-        let weekC = diffValue/week;
-        let monthC = diffValue/month;
-        if(monthC >= 1 && monthC < 3){
-            result = " " + parseInt(monthC) + "月前"
-        }else if(weekC >= 1 && weekC < 3){
-            result = " " + parseInt(weekC) + "周前"
-        }else if(dayC >= 1 && dayC <6){
-            result = " " + parseInt(dayC) + "天前"
-        }else if(hourC >= 1 && hourC < 24){
-            result = " " + parseInt(hourC) + "小时前"
-        }else if(minC >= 1 && minC < 60){
-            result =" " + parseInt(minC) + "分钟前"
-        }else if(diffValue >= 0 && diffValue < minute){
-            result = "刚刚"
-        }else {
-            let datetime = new Date();
-            datetime.setTime(dateTimeStamp);
-            let Nyear = datetime.getFullYear();
-            let Nmonth = datetime.getMonth() + 1 < 10 ? "0" + (datetime.getMonth() + 1) : datetime.getMonth() + 1;
-            let Ndate = datetime.getDate() < 10 ? "0" + datetime.getDate() : datetime.getDate();
-            let Nhour = datetime.getHours() < 10 ? "0" + datetime.getHours() : datetime.getHours();
-            let Nminute = datetime.getMinutes() < 10 ? "0" + datetime.getMinutes() : datetime.getMinutes();
-            let Nsecond = datetime.getSeconds() < 10 ? "0" + datetime.getSeconds() : datetime.getSeconds();
-            result = Nyear + "-" + Nmonth + "-" + Ndate
-        }
-        return result;
-    },
-    /*
-    日期格式化
-     */
-    format: function (date, pattern) {
-        pattern = pattern || DEFAULT_PATTERN;
-        return pattern.replace(SIGN_REGEXP, function ($0) {
-            switch ($0.charAt(0)) {
-                case 'y':
-                    return padding(date.getFullYear(), $0.length);
-                case 'M':
-                    return padding(date.getMonth() + 1, $0.length);
-                case 'd':
-                    return padding(date.getDate(), $0.length);
-                case 'w':
-                    return date.getDay() + 1;
-                case 'H':
-                    return padding(date.getHours(), $0.length);
-                case 'm':
-                    return padding(date.getMinutes(), $0.length);
-                case 's':
-                    return padding(date.getSeconds(), $0.length);
-            }
-        });
-    },
-    parse: function (dateString, pattern) {
-        let matchs1 = pattern.match(SIGN_REGEXP);
-        let matchs2 = dateString.match(/(\d)+/g);
-        if (matchs1.length == matchs2.length) {
-            let _date = new Date(1970, 0, 1);
-            for (let i = 0; i < matchs1.length; i++) {
-                let _int = parseInt(matchs2[i]);
-                let sign = matchs1[i];
-                switch (sign.charAt(0)) {
-                    case 'y':
-                        _date.setFullYear(_int);
-                        break;
-                    case 'M':
-                        _date.setMonth(_int - 1);
-                        break;
-                    case 'd':
-                        _date.setDate(_int);
-                        break;
-                    case 'H':
-                        _date.setHours(_int);
-                        break;
-                    case 'm':
-                        _date.setMinutes(_int);
-                        break;
-                    case 's':
-                        _date.setSeconds(_int);
-                        break;
-                }
-            }
-            return _date;
-        }
-        return null;
-    },
-    strToDate: function (str, inFmt, outFmt,isDate) {
-        if (str) {
-            inFmt = inFmt ? inFmt : "yyyyMMddHHmmss";
-            let date = new Date();
-            //获取年
-            let yearStart = inFmt.indexOf("y");
-            let yearEnd = inFmt.lastIndexOf("y");
-            let year = str.substring(yearStart, yearEnd + 1);
-            year && date.setYear(parseInt(year));
-
-            //获取月
-            let monthStart = inFmt.indexOf("M");
-            let monthEnd = inFmt.lastIndexOf("M");
-            let month = str.substring(monthStart, monthEnd + 1);
-            month && date.setMonth(parseInt(month) - 1);
-
-            //获取日
-            let dayStart = inFmt.indexOf("d");
-            let dayEnd = inFmt.lastIndexOf("d");
-            let day = str.substring(dayStart, dayEnd + 1);
-            day && date.setDate(parseInt(day));
-
-            //获取时
-            let hourStart = inFmt.indexOf("H");
-            let hourEnd = inFmt.lastIndexOf("H");
-            let hour = str.substring(hourStart, hourEnd + 1);
-            hour && date.setHours(parseInt(hour));
-
-            //获取分
-            let minStart = inFmt.indexOf("m");
-            let minEnd = inFmt.lastIndexOf("m");
-            let min = str.substring(minStart, minEnd + 1);
-            min && date.setMinutes(parseInt(min));
-
-            //获取秒
-            let secondStart = inFmt.indexOf("s");
-            let secondEnd = inFmt.lastIndexOf("s");
-            let second = str.substring(secondStart, secondEnd + 1);
-            second && date.setSeconds(parseInt(second));
-            return isDate?date:this.format(date, outFmt);
-        } else {
-            return str;
-        }
-    }
-}

+ 3 - 10
src/utils/index.js

@@ -4,20 +4,13 @@
  * @Date:   2019-04-08
  * @Project jz
  */
-let utils = {};
-if (!process.env.IS_BASE_PACKAGE) {
-    utils = require("../common/utils").default;
-} else {
-    utils = require("ui-jz-v4-common/src/common/utils").default;
-}
-const { ztService, ztMoment, ztLodash, ztForm, ztWin } = utils;
+let utils  = require("ui-jz-v4-common/src/common/utils").default;
+
+const { ztMoment, ztLodash } = utils;
 
 const install = function(Vue) {
     Object.defineProperty(Vue.prototype, "$moment", { value: ztMoment });
     Object.defineProperty(Vue.prototype, "$lodash", { value: ztLodash });
-    Object.defineProperty(Vue.prototype, "$req", { value: ztService });
-    Object.defineProperty(Vue.prototype, "$form", { value: ztForm });
-    Object.defineProperty(Vue.prototype, "$win", { value: ztWin });
 };
 
 /* istanbul ignore if */

+ 0 - 98
src/utils/request-not-oauth.js

@@ -1,98 +0,0 @@
-import axios from "axios";
-import { Loading } from "element-ui";
-import store from "@/store";
-const { getSetting } = window.systemParamsUtils;
-
-const NEED_TO_LOGIN = {
-    "9": "登出成功",
-    "10": "未登录",
-    "11": "登录超时",
-    "13": "登出"
-};
-
-console.log("BASE_API:" + getSetting("BASE_API"));
-let loadingMap = {};
-let loadingShow = function(config) {
-    if (!config["loading"]) {
-        return;
-    }
-    let loading = Loading.service({
-        lock: true,
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.8)",
-        text: "数据加载中..."
-    });
-    config.uuid = new Date().getTime() + "=" + config.url;
-    loadingMap[config.uuid] = loading;
-};
-let loadingHide = function(config) {
-    if (!config["loading"]) {
-        return;
-    }
-    loadingMap[config.uuid] && loadingMap[config.uuid].close();
-    delete loadingMap[config.uuid];
-};
-// create an axios instance
-const service = axios.create({
-    baseURL: getSetting("BASE_API"), // api 的 base_url
-    timeout: getSetting("REQ_TIMEOUT") || 5000 // request timeout
-});
-
-// request interceptor
-service.interceptors.request.use(
-    config => {
-        config.headers["X-Requested-With"] = "XMLHttpRequest";
-        loadingShow(config);
-
-        return config;
-    },
-    error => {
-        // Do something with request error
-        console.log(error); // for debug
-        Promise.reject(error);
-    }
-);
-
-// response interceptor
-service.interceptors.response.use(
-    response => {
-        loadingHide(response.config);
-        const res = response.data;
-        if (res.statusCode === "401") {
-            window.location.href = res.link;
-        }
-        if (NEED_TO_LOGIN[res.statusCode]) {
-            if (res.link) {
-                if (res.loginType === "dids") {
-                    res.link = res.link.replace(
-                        "forwardUrl=",
-                        "forwardUrl=" + encodeURIComponent(encodeURIComponent(window.location.href))
-                    );
-                } else if (res.loginType === "dcuc") {
-                    res.link = res.link.replace(
-                        "forwardUrl=",
-                        "forwardUrl=" + encodeURIComponent(window.location.href)
-                    );
-                }
-                window.location.href = res.link;
-                return Promise.reject({ link: res.link });
-            } else {
-                //dssoac登录方式
-                store.dispatch("FedLogout").then(() => {
-                    if (!response.config.url.endsWith("/api/user/info")) {
-                        location.reload(); // 为了重新实例化vue-router对象 避免bug
-                    }
-                });
-            }
-        } else {
-            return response;
-        }
-    },
-    error => {
-        loadingHide(error.config);
-        console.error("err" + error); // for debug
-        return Promise.reject(error);
-    }
-);
-
-export default service;

+ 0 - 90
src/utils/request-oauth.js

@@ -1,90 +0,0 @@
-import axios from "axios";
-import { Message, Loading } from "element-ui";
-import store from "@/store";
-import { getToken } from "@/utils/auth";
-import { getSetting } from "./sys-settings";
-
-console.log("BASE_API:" + getSetting("BASE_API"));
-let loadingMap = {};
-let loadingShow = function(config) {
-    if (!config["loading"]) {
-        return;
-    }
-    let loading = Loading.service({
-        lock: true,
-        spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.8)",
-        text: "数据加载中..."
-    });
-    config.uuid = new Date().getTime() + "=" + config.url;
-    loadingMap[config.uuid] = loading;
-};
-let loadingHide = function(config) {
-    if (!config["loading"]) {
-        return;
-    }
-    if (loadingMap[config.uuid]) {
-        loadingMap[config.uuid].close();
-    }
-    delete loadingMap[config.uuid];
-};
-// create an axios instance
-const service = axios.create({
-    baseURL: getSetting("BASE_API"), // api 的 base_url
-    timeout: getSetting("REQ_TIMEOUT") || 5000 // request timeout
-});
-
-// request interceptor
-service.interceptors.request.use(
-    config => {
-        // Do something before request is sent
-        if (store.getters.token) {
-            // 让每个请求携带authorization-- ['authorization']为自定义key 请根据实际情况自行修改
-            config.headers["access_token"] = getToken();
-        }
-        // config.headers["Content-Type"] = "application/x-www-form-urlencoded";
-        // config.headers["X-Requested-With"] = "XMLHttpRequest";
-
-        loadingShow(config);
-
-        return config;
-    },
-    error => {
-        // Do something with request error
-        console.log(error); // for debug
-        return Promise.reject(error);
-    }
-);
-
-// response interceptor
-service.interceptors.response.use(
-    response => {
-        loadingHide(response.config);
-        return response;
-    },
-    error => {
-        if (error.response.status === 403 && error.response.data.statusCode === "403") {
-            let link = error.response.data.link;
-            !link && (link = error.response.data.authorizeUrl);
-            sessionStorage["authorizeUrl"] = link;
-
-            //Oauth2登录方式
-            let paramArr = [];
-            paramArr.push(`response_type=code`);
-            paramArr.push(`client_id=${getSetting("CLIENT_ID")}`);
-            paramArr.push(`is_oauth=1`);
-            paramArr.push(`loginPage=${getSetting("LOGIN_PAGE")}`);
-            paramArr.push(`redirect_uri=${location.href}`);
-            link += `/authorize?${paramArr.join("&")}`;
-            link = link.replace("/authorize/authorize", "/authorize");
-
-            window.location.href = link;
-            return Promise.reject(link);
-        }
-        loadingHide(error.config);
-        console.error("err" + error); // for debug
-        return Promise.reject(error);
-    }
-);
-
-export default service;

+ 0 - 42
src/utils/validate.js

@@ -1,42 +0,0 @@
-/**
- * Created by jiachenpan on 16/11/18.
- */
-
-export function isvalidUsername(str) {
-    const valid_map = ["admin", "editor"];
-    return valid_map.indexOf(str.trim()) >= 0;
-}
-
-/* 合法uri*/
-export function validateURL(textval) {
-    const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
-    return urlregex.test(textval);
-}
-
-/* 小写字母*/
-export function validateLowerCase(str) {
-    const reg = /^[a-z]+$/;
-    return reg.test(str);
-}
-
-/* 大写字母*/
-export function validateUpperCase(str) {
-    const reg = /^[A-Z]+$/;
-    return reg.test(str);
-}
-
-/* 大小写字母*/
-export function validateAlphabets(str) {
-    const reg = /^[A-Za-z]+$/;
-    return reg.test(str);
-}
-
-/**
- * validate email
- * @param email
- * @returns {boolean}
- */
-export function validateEmail(email) {
-    const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-    return re.test(email);
-}

+ 0 - 260
src/utils/zt-data.js

@@ -1,260 +0,0 @@
-/**
- * 数据请求处理类
- * @Author: huangjq
- * @Date:   2019-02-26
- * @Project jz
- */
-import baseApi from "../api/jz-base";
-
-export default {
-    /**
-     * code/enum 缓存数组
-     */
-    codeCaches: [],
-
-    /**
-     * 请求等待池
-     */
-    waitPools: [],
-
-    get(url, params) {
-        return baseApi.getData(url, params);
-    },
-    post(url, data) {
-        return baseApi.postData(url, data);
-    },
-    put(url, data) {
-        return baseApi.putData(url, data);
-    },
-    delete(url, params) {
-        return baseApi.deleteData(url, params);
-    },
-
-    /**
-     * 根据传入参数判断返回什么格式的数据
-     * @param {Object} props 组件属性
-     * @param {Function} callback 回调函数
-     * @param {String} type 返回数据类型
-     */
-    fetchData: function(props, callback, type = "data") {
-        if (type === "codeArr") {
-            this.getCodeArr(props, callback);
-        } else if (type === "codeObj") {
-            this.getCodeObj(props, callback);
-        } else if (type === "data") {
-            this.reqData.apply(this, [props, callback]);
-        } else {
-            error.error(`没有符合${type}的请求方法,请确认type是否填写正确`);
-        }
-    },
-
-    /**
-     * 获取请求的类型
-     * @param {Object} props 转换参数(code,enum,url,valueName,labelName)
-     * @return {string} 类型关键字
-     */
-    getKey: props => {
-        let module = props.module || "";
-        if (props.code) return "code_" + module + "_" + props.code;
-        if (props.enum) return "enum_" + module + "_" + props.enum;
-        return "";
-    },
-
-    /**
-     * 获取需要调用的请求方法
-     * @param {Object} props 转换参数(code,enum,url,valueName,labelName)
-     * @return {*} {function} 数据请求函数
-     */
-    getReqFun: props => {
-        if (props.code) return baseApi.fetchCode;
-        if (props.enum) return baseApi.fetchEnum;
-        if (props.url) return baseApi.fetchUrl;
-        return () =>
-            new Promise(resolve => {
-                resolve({ data: props.data });
-            });
-    },
-
-    /**
-     * 获取请求的关键字
-     * @param {Object} props 转换参数(code,enum,url,valueName,labelName)
-     * @return {*} {String} 请求的关键字
-     */
-    getReqKeyWord: props => {
-        if (props.code) return props.code;
-        if (props.enum) return props.enum;
-        if (props.url) return props.url;
-    },
-
-    /**
-     * 将表码、枚举、url转换为数据
-     * @param {Object} props 组件参数
-     * @param {function} callback 回调函数
-     * @return {Promise<any>} 请求数据的Promise对象
-     */
-    reqData: function(props, callback) {
-        let key = this.getKey(props);
-        if (key.startsWith("code_") || key.startsWith("enum_")) {
-            this.getCodeArr(props, callback);
-        } else {
-            let reqFun = this.getReqFun(props);
-            let reqKeyWord = this.getReqKeyWord(props);
-
-            return reqFun
-                .apply(baseApi, [reqKeyWord, props.module])
-                .then(({ data }) => {
-                    callback(data);
-                })
-                .catch(error => {
-                    console.error(error);
-                });
-        }
-    },
-
-    /**
-     * 获取表码、枚举、url数据对象
-     * @param {Object} props 组件参数
-     * @param {Function} callback
-     */
-    getCodeObj: function(props, callback) {
-        this.getCodeArr(props, data => {
-            callback(this.arr2Obj(data, props.valueName, props.labelName));
-        });
-    },
-
-    /**
-     * 获取表码、枚举、url数据数组
-     * @param {Object} props 组件参数
-     * @param {Function} callback 回调函数
-     */
-    getCodeArr: function(props, callback) {
-        let waitPools = this.waitPools;
-        let key = this.getKey(props);
-        let noCache = props.noCache;
-        if (!noCache) {
-            let code = this.searchCodeOfCaches(key);
-            if (code) {
-                callback(code);
-                return;
-            }
-        }
-        let waitPool = waitPools[key];
-        if (waitPool) {
-            // 等待池返回后再执行操作
-            waitPool
-                .then(function(map) {
-                    callback(map);
-                })
-                .catch(err => {
-                    console.error(err);
-                });
-        } else {
-            waitPool = new Promise((resolve, reject) => {
-                let reqFun = this.getReqFun(props);
-                let reqParam = this.getReqKeyWord(props);
-
-                reqFun
-                    .apply(baseApi, [reqParam, props.module])
-                    .then(({ data }) => {
-                        if (key.startsWith("code_") || key.startsWith("enum_")) {
-                            this.bufferCode(key, data);
-                        }
-                        delete waitPools[key];
-                        resolve(data);
-                        callback(data);
-                    })
-                    .catch(error => {
-                        console.error(error);
-                    });
-            });
-            waitPools[key] = waitPool;
-        }
-    },
-
-    /**
-     * 查询缓存中是否有code/enum的缓存
-     * @param key 关键字
-     * @return {*} code/enum或者undefined
-     */
-    searchCodeOfCaches: function(key) {
-        return this.codeCaches[key];
-    },
-
-    /**
-     * 将数组转为对象
-     * @param arr 待转换数组
-     * @param codeName 对象的key名
-     * @param valueName 对象的value名
-     * @return 对象
-     */
-    arr2Obj: function(arr, valueName, labelName) {
-        let tmpObj = {};
-        if (!valueName) valueName = "value";
-        if (!labelName) labelName = "label";
-        arr.map(function(item) {
-            tmpObj[item[valueName]] = item[labelName];
-        });
-        return tmpObj;
-    },
-
-    /**
-     * 将code/enum放进缓存
-     * @param key 表码/枚举名
-     * @param data code/enum数组
-     * @return code/enum对象
-     */
-    bufferCode: function(key, data) {
-        this.codeCaches[key] = data;
-        return data;
-    },
-
-    /**
-     * 请求表格数据
-     * @param {Object} props 组件参数
-     * @param {Object} params 请求参数
-     * @return {Promise<any>} 请求数据的Promise对象
-     */
-    reqTableData: function(props, params) {
-        let url = props.url;
-        let result = {};
-        if (url) {
-            result = baseApi.reqTableData(url, params, props.module);
-        } else {
-            result = Promise.resolve({ data: props.data });
-        }
-        return result;
-    },
-
-    /**
-     * 将扁平化的数据转为树结构数据
-     * @param arr 待转换数据数组
-     * @param idStr id字段名称
-     * @param pidStr pid字段名称
-     * @param childrenStr 转换后的children字段名称
-     * @return {Array} 转换后的树结构数据
-     */
-    toTreeData: function(arr, idStr, pidStr, childrenStr) {
-        let r = [],
-            hash = {},
-            id = idStr,
-            pid = pidStr,
-            children = childrenStr,
-            i = 0,
-            j = 0,
-            len = arr.length;
-        for (; i < len; i++) {
-            hash[arr[i][id]] = arr[i];
-        }
-        for (; j < len; j++) {
-            let aVal = arr[j],
-                hashVP = hash[aVal[pid]];
-            if (hashVP) {
-                !hashVP[children] && (hashVP[children] = []);
-                hashVP[children].push(aVal);
-            } else {
-                r.push(aVal);
-            }
-        }
-        return r;
-    }
-};

+ 0 - 143
src/utils/zt-form.js

@@ -1,143 +0,0 @@
-/**
- * 此处填写文件描述
- * @Author: huangjq
- * @Date:   2019-03-29
- * @Project jz
- */
-import request from "@/utils/request";
-const { getSetting } = window.systemParamsUtils;
-
-let Form = function(module = "BASE_API") {
-    this.module = module;
-    return new FormModel(this);
-};
-
-let FormModel = function(self) {
-    this.module = self.module;
-    this.$refs = self.$refs;
-    this.$message = self.$message;
-    this.$alert = self.$alert;
-    this.$confirm = self.$confirm;
-    this.$emit = self.$emit;
-};
-
-FormModel.prototype = {
-    /**
-     * 获取form表单的ref
-     * @param refName 表单名
-     * @return 表单名
-     */
-    _getRefName(refName) {
-        if (!refName) {
-            for (let item in this.$refs) {
-                let $el = this.$refs[item].$el;
-                if ($el && $el.tagName && $el.tagName.toUpperCase() === "FORM") {
-                    refName = item;
-                    break;
-                }
-            }
-        }
-        return refName;
-    },
-
-    /**
-     * 提交表单
-     * @param url 提交地址
-     * @param refName 表单名称
-     * @param postMethods 提交方法
-     * @return {*}
-     * @private true
-     */
-    _submitForm(url, refName, postMethods) {
-        let result;
-        refName = this._getRefName(refName);
-
-        this.$refs[refName].validate(valid => {
-            if (valid) {
-                result = request({
-                    url: url,
-                    method: postMethods,
-                    loading: true,
-                    data: this.$refs[refName].model,
-                    baseURL: this._getBaseURL(this.module)
-                })
-                    .then(response => {
-                        return response;
-                    })
-                    .catch(response => {
-                        return Promise.reject(response);
-                    });
-            } else {
-                result = Promise.reject({
-                    data: {
-                        valid: valid,
-                        message: "表单校验失败"
-                    }
-                });
-            }
-        });
-        return result;
-    },
-
-    add(url, refName) {
-        return this._submitForm(url, refName, "POST");
-    },
-
-    update(url, refName) {
-        return this._submitForm(url, refName, "PUT");
-    },
-
-    delete(url, params) {
-        return new Promise((resolve, reject) => {
-            this.$confirm("确认删除?")
-                .then(() => {
-                    return request({
-                        url: url,
-                        method: "DELETE",
-                        params: params,
-                        loading: true,
-                        baseURL: this._getBaseURL(this.module)
-                    })
-                        .then(response => {
-                            resolve(response);
-                        })
-                        .catch(response => {
-                            reject(response);
-                        });
-                })
-                .catch(reason => {
-                    return Promise.reject(reason);
-                });
-        });
-    },
-
-    load(url, params) {
-        return request({
-            url: url,
-            method: "GET",
-            params: params,
-            loading: true,
-            baseURL: this._getBaseURL(this.module)
-        })
-            .then(function(response) {
-                return response;
-            })
-            .catch(response => {
-                return Promise.reject(response);
-            });
-    },
-
-    /**
-     * 根据module获取上下文
-     * @param module
-     * @private
-     */
-    _getBaseURL(module) {
-        if (module === "" || !module) {
-            module = "BASE_API";
-        }
-        return getSetting(module);
-    }
-};
-
-export default Form;

+ 0 - 52
src/utils/zt-lodash.js

@@ -1,52 +0,0 @@
-/**
- * 对lodash进行封装和补充
- *
- * @Author: huangjq
- * @Date: 2019-02-19
- * @Project jz
- */
-
-import lodash from "lodash";
-
-/**
- * 将json对象中的key改为大写
- * @param {Object} jsonObj json对象
- * @return {*} json对象
- */
-lodash.upperJSONKey = function(jsonObj) {
-    for (let key in jsonObj) {
-        jsonObj[key.toUpperCase()] = jsonObj[key];
-        delete jsonObj[key];
-    }
-    return jsonObj;
-};
-
-/**
- * 将json字符串中的key改为小写
- * @param {Object} jsonObj json对象
- * @return {*} json对象
- */
-lodash.lowerJSONKey = function(jsonObj) {
-    for (let key in jsonObj) {
-        jsonObj[key.toLowerCase()] = jsonObj[key];
-        delete jsonObj[key];
-    }
-    return jsonObj;
-};
-
-/**
- * 获取url中的变量值
- * @param {String} name 变量的name
- * @return {string} 变量值
- */
-lodash.getQueryStringByName = function(name) {
-    let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
-    let r = window.location.search.substr(1).match(reg);
-    let context = "";
-    if (r != null) context = r[2];
-    reg = null;
-    r = null;
-    return context == null || context == "" || context == "undefined" ? "" : context;
-};
-
-export default lodash;

+ 0 - 380
src/utils/zt-moment.js

@@ -1,380 +0,0 @@
-/**
- * 提供时间操作函数
- *  @Author: huangjq
- *  @Date:   2019-02-18
- */
-// let moment = require("moment");
-import moment from "moment";
-moment.locale("zh-cn");
-
-/**
- * 获取当前的日期
- * @return {String} 当前日期
- */
-moment.prototype.getCurrentDate = function() {
-    // 获取当天时间
-    let _date = new Date(),
-        _str = "";
-
-    // 日期
-    _str += _date.getFullYear() + "年";
-    _str += _date.getMonth() + 1 + "月";
-    _str += _date.getDate() + "日";
-
-    return _str;
-};
-
-/**
- * 求两个时间的天数差 日期格式为 YYYY-MM-dd
- * @param {String} DateOne 第一个日期
- * @param {String} DateTwo 第二个日期
- * @return {Number} 日期天数差
- */
-moment.prototype.daysBetween = (DateOne, DateTwo) => {
-    let OneMonth = DateOne.substring(5, DateOne.lastIndexOf("-"));
-    let OneDay = DateOne.substring(DateOne.length, DateOne.lastIndexOf("-") + 1);
-    let OneYear = DateOne.substring(0, DateOne.indexOf("-"));
-    let TwoMonth = DateTwo.substring(5, DateTwo.lastIndexOf("-"));
-    let TwoDay = DateTwo.substring(DateTwo.length, DateTwo.lastIndexOf("-") + 1);
-    let TwoYear = DateTwo.substring(0, DateTwo.indexOf("-"));
-    let cha =
-        (Date.parse(OneMonth + "/" + OneDay + "/" + OneYear) - Date.parse(TwoMonth + "/" + TwoDay + "/" + TwoYear)) /
-        86400000;
-
-    return Math.abs(cha);
-};
-
-/***
- * 获得本月的起止时间
- * @return {Array} 本月的起止时间
- */
-moment.prototype.getCurrentMonth = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前月份0-11
-    let currentMonth = currentDate.getMonth();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-    //求出本月第一天
-    let firstDay = new Date(currentYear, currentMonth, 1);
-
-    //当为12月的时候年份需要加1
-    //月份需要更新为0 也就是下一年的第一个月
-    if (currentMonth == 11) {
-        currentYear++;
-        currentMonth = 0; //就为
-    } else {
-        //否则只是月份增加,以便求的下一月的第一天
-        currentMonth++;
-    }
-
-    //一天的毫秒数
-    let millisecond = 1000 * 60 * 60 * 24;
-    //下月的第一天
-    let nextMonthDayOne = new Date(currentYear, currentMonth, 1);
-    //求出上月的最后一天
-    let lastDay = new Date(nextMonthDayOne.getTime() - millisecond);
-
-    //添加至数组中返回
-    startStop.push(firstDay);
-    startStop.push(lastDay);
-    //返回
-    return startStop;
-};
-
-/**
- * 得到本季度开始的月份
- * @param {number} month 需要计算的月份
- * @return {number} 月份
- **/
-moment.prototype.getQuarterSeasonStartMonth = function(month) {
-    let spring = 1; //春
-    let summer = 4; //夏
-    let fall = 7; //秋
-    let winter = 10; //冬
-    if (month) {
-        month = new Date().getMonth() + 1;
-    }
-
-    //月份从0-11
-    if (month < 4) {
-        return spring;
-    }
-
-    if (month < 7) {
-        return summer;
-    }
-
-    if (month < 10) {
-        return fall;
-    }
-
-    return winter;
-};
-
-/**
- * 获得该月的天数
- * @param {number} year 年份
- * @param {number} month 月份
- * @return {number} 天数
- **/
-moment.prototype.getMonthDays = function(year, month) {
-    month--;
-    //本月第一天 1-31
-    let relativeDate = new Date(year, month, 1);
-    //获得当前月份0-11
-    let relativeMonth = relativeDate.getMonth();
-    //获得当前年份4位年
-    let relativeYear = relativeDate.getFullYear();
-
-    //当为12月的时候年份需要加1
-    //月份需要更新为0 也就是下一年的第一个月
-    if (relativeMonth == 11) {
-        relativeYear++;
-        relativeMonth = 0;
-    } else {
-        //否则只是月份增加,以便求的下一月的第一天
-        relativeMonth++;
-    }
-    //一天的毫秒数
-    let millisecond = 1000 * 60 * 60 * 24;
-    //下月的第一天
-    let nextMonthDayOne = new Date(relativeYear, relativeMonth, 1);
-    //返回得到上月的最后一天,也就是本月总天数
-    return new Date(nextMonthDayOne.getTime() - millisecond).getDate();
-};
-
-/**
- * 获得本季度的起止日期
- * @return {Array} 日期数组
- */
-moment.prototype.getCurrentSeason = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前月份0-11
-    let currentMonth = currentDate.getMonth();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-    //获得本季度开始月份
-    let quarterSeasonStartMonth = this.getQuarterSeasonStartMonth(currentMonth + 1);
-    //获得本季度结束月份
-    let quarterSeasonEndMonth = quarterSeasonStartMonth + 2;
-
-    //获得本季度开始的日期
-    let quarterSeasonStartDate = new Date(currentYear, quarterSeasonStartMonth - 1, 1);
-    //获得本季度结束的日期
-    let quarterSeasonEndDate = new Date(
-        currentYear,
-        quarterSeasonEndMonth - 1,
-        this.getMonthDays(currentYear, quarterSeasonEndMonth++)
-    );
-    //加入数组返回
-    startStop.push(quarterSeasonStartDate);
-    startStop.push(quarterSeasonEndDate);
-    //返回
-    return startStop;
-};
-
-/***
- * 得到本年的起止日期
- * @return {Object} 起止日期数组
- */
-moment.prototype.getCurrentYear = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-
-    //本年第一天
-    let currentYearFirstDate = new Date(currentYear, 0, 1);
-    //本年最后一天
-    let currentYearLastDate = new Date(currentYear, 11, 31);
-    //添加至数组
-    startStop.push(currentYearFirstDate);
-    startStop.push(currentYearLastDate);
-    //返回
-    return startStop;
-};
-
-/**
- * 返回上一个月的第一天
- * @param {number} year 年
- * @param {number} month 月
- * @return {Date} 日期
- **/
-moment.prototype.getPriorMonthFirstDay = function(year, month) {
-    if (!year) {
-        year = new Date().getFullYear();
-    }
-    if (!month) {
-        month = new Date().getMonth();
-    } else {
-        month--;
-    }
-    //年份为0代表,是本年的第一月,所以不能减
-    if (!month) {
-        month = 11; //月份为上年的最后月份
-        year--; //年份减1
-        return new Date(year, month, 1);
-    }
-    //否则,只减去月份
-    month--;
-    return new Date(year, month, 1);
-};
-
-/**
- * 获得上一月的起止日期
- * @return {Array} 上个月起止日期
- **/
-moment.prototype.getPreviousMonth = function() {
-    //起止日期数组
-    let startStop = [];
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前月份0-11
-    let currentMonth = currentDate.getMonth();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-    //获得上一个月的第一天
-    let priorMonthFirstDay = this.getPriorMonthFirstDay(currentYear, currentMonth + 1);
-    //获得上一月的最后一天
-    let priorMonthLastDay = new Date(
-        priorMonthFirstDay.getFullYear(),
-        priorMonthFirstDay.getMonth(),
-        this.getMonthDays(priorMonthFirstDay.getFullYear(), priorMonthFirstDay.getMonth() + 1)
-    );
-    //添加至数组
-    startStop.push(priorMonthFirstDay);
-    startStop.push(priorMonthLastDay);
-    //返回
-    return startStop;
-};
-
-/**
- * 获得上一周的起止日期
- * @return {Array} 上一周起止日期
- **/
-moment.prototype.getPreviousWeek = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //返回date是一周中的某一天
-    let week = currentDate.getDay();
-    //返回date是一个月中的某一天
-    let month = currentDate.getDate();
-    //一天的毫秒数
-    let millisecond = 1000 * 60 * 60 * 24;
-    //减去的天数
-    let minusDay = week ? week - 1 : 6;
-    //获得当前周的第一天
-    let currentWeekDayOne = new Date(currentDate.getTime() - millisecond * minusDay);
-    //上周最后一天即本周开始的前一天
-    let priorWeekLastDay = new Date(currentWeekDayOne.getTime() - millisecond);
-    //上周的第一天
-    let priorWeekFirstDay = new Date(priorWeekLastDay.getTime() - millisecond * 6);
-
-    //添加至数组
-    startStop.push(priorWeekFirstDay);
-    startStop.push(priorWeekLastDay);
-
-    return startStop;
-};
-
-/**
- * 获取上季度的起始日期
- * @param {number} year 这个年应该是运算后得到的当前本季度的年份
- * @param {number} month 这个应该是运算后得到的当前季度的开始月份
- * @return {Date} 上季度的起始日期
- * */
-moment.prototype.getPriorSeasonFirstDay = function(year, month) {
-    if (!year) {
-        year = new Date().getFullYear();
-    }
-    if (!month) {
-        month = this.getQuarterSeasonStartMonth(new Date().getMonth()) - 1;
-    } else {
-        month--;
-        month = this.getQuarterSeasonStartMonth(month) - 1;
-    }
-    let spring = 0; //春
-    let summer = 3; //夏
-    let fall = 6; //秋
-    let winter = 9; //冬
-    //月份从0-11
-    switch (
-        month //季度的真实月份
-    ) {
-        case spring:
-            //如果是第一季度则应该到去年的冬季
-            year--;
-            month = winter;
-            break;
-        case summer:
-            month = spring;
-            break;
-        case fall:
-            month = summer;
-            break;
-        case winter:
-            month = fall;
-            break;
-    }
-
-    return new Date(year, month, 1);
-};
-
-/**
- * 获取上季度的起止日期
- * @return {Array} 上季度的起止日期
- **/
-moment.prototype.getPreviousSeason = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前月份0-11
-    let currentMonth = currentDate.getMonth();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-    //上季度的第一天
-    let priorSeasonFirstDay = this.getPriorSeasonFirstDay(currentYear, currentMonth + 1);
-    //上季度的最后一天
-    let priorSeasonLastDay = new Date(
-        priorSeasonFirstDay.getFullYear(),
-        priorSeasonFirstDay.getMonth() + 2,
-        this.getMonthDays(priorSeasonFirstDay.getFullYear(), priorSeasonFirstDay.getMonth() + 1 + 2)
-    );
-    //添加至数组
-    startStop.push(priorSeasonFirstDay);
-    startStop.push(priorSeasonLastDay);
-    return startStop;
-};
-
-/**
- * 获取去年的起止日期
- * @return {Array} 去年的起止日期
- **/
-moment.prototype.getPreviousYear = function() {
-    //起止日期数组
-    let startStop = new Array();
-    //获取当前时间
-    let currentDate = new Date();
-    //获得当前年份4位年
-    let currentYear = currentDate.getFullYear();
-    currentYear--;
-    let priorYearFirstDay = new Date(currentYear, 0, 1);
-    let priorYearLastDay = new Date(currentYear, 11, this.getMonthDays(currentYear, 12));
-    //添加至数组
-    startStop.push(priorYearFirstDay);
-    startStop.push(priorYearLastDay);
-    return startStop;
-};
-
-export default moment;

+ 0 - 40
src/utils/zt-service.js

@@ -1,40 +0,0 @@
-/**
- * 此处填写文件描述
- * @Author: huangjq
- * @Date:   2019-10-11
- * @Project jz
- */
-import baseApi from "../api/jz-base";
-
-const ztService = {
-    get(url, params) {
-        return baseApi.getData(url, params, this.module);
-    },
-    post(url, data) {
-        return baseApi.postData(url, data, this.module);
-    },
-    put(url, data) {
-        return baseApi.putData(url, data, this.module);
-    },
-    delete(url, params) {
-        return baseApi.deleteData(url, params, this.module);
-    }
-};
-
-let ztServiceFn = function(module = "BASE_API") {
-    ztService.module = module;
-    return ztService;
-};
-ztServiceFn.get = (url, params) => {
-    return baseApi.getData(url, params);
-};
-ztServiceFn.post = (url, data) => {
-    return baseApi.postData(url, data);
-};
-ztServiceFn.put = (url, data) => {
-    return baseApi.putData(url, data);
-};
-ztServiceFn.delete = (url, params) => {
-    return baseApi.deleteData(url, params);
-};
-export default ztServiceFn;

+ 0 - 14
src/utils/zt-window.js

@@ -1,14 +0,0 @@
-/**
- * 数据请求处理类
- * @Author: huangjq
- * @Date:   2019-02-26
- * @Project jz
- */
-export default {
-    dlgH: function(h) {
-        return Math.min(h, window.innerHeight - 150);
-    },
-    dlgW: function(w) {
-        return Math.min(w, window.innerWidth - 100);
-    }
-};

BIN
static/themes/style/images/dashboard/icon.png