Browse Source

前端npm包升级优化,针对访问加载时间过长问题

ZhangWenQiang 5 years ago
parent
commit
502709a9cd
5 changed files with 749 additions and 622 deletions
  1. 111 111
      package.json
  2. 1 1
      src/components/tools/UserMenu.vue
  3. 2 2
      src/main.js
  4. 480 480
      src/utils/util.js
  5. 155 28
      yarn.lock

+ 111 - 111
package.json

@@ -1,111 +1,111 @@
-{
-  "name": "vue-antd-jeecg",
-  "version": "2.2.0",
-  "private": true,
-  "scripts": {
-    "pre": "yarn --registry https://registry.npm.taobao.org || cnpm install || npm install --registry https://registry.npm.taobao.org ",
-    "serve": "vue-cli-service serve",
-    "build": "vue-cli-service build",
-    "lint": "vue-cli-service lint"
-  },
-  "dependencies": {
-    "@antv/data-set": "^0.11.2",
-    "@jeecg/antd-online-beta220": "^1.0.1",
-    "@tinymce/tinymce-vue": "^2.0.0",
-    "animate.css": "^4.1.0",
-    "ant-design-vue": "1.5.2",
-    "area-data": "^5.0.6",
-    "axios": "^0.18.0",
-    "clipboard": "^2.0.4",
-    "codemirror": "^5.46.0",
-    "dayjs": "^1.8.0",
-    "enquire.js": "^2.1.6",
-    "js-cookie": "^2.2.0",
-    "lodash.get": "^4.4.2",
-    "lodash.pick": "^4.4.0",
-    "md5": "^2.2.1",
-    "nprogress": "^0.2.0",
-    "tinymce": "^5.1.4",
-    "viser-vue": "^2.4.4",
-    "vue": "^2.6.10",
-    "vue-area-linkage": "^5.1.0",
-    "vue-cropper": "^0.4.8",
-    "vue-i18n": "^8.7.0",
-    "vue-loader": "^15.7.0",
-    "vue-ls": "^3.2.0",
-    "vue-photo-preview": "^1.1.3",
-    "vue-print-nb-jeecg": "^1.0.9",
-    "vue-router": "^3.0.1",
-    "vue-splitpane": "^1.0.4",
-    "vuedraggable": "^2.20.0",
-    "vuex": "^3.1.0"
-  },
-  "devDependencies": {
-    "@babel/polyfill": "^7.2.5",
-    "@vue/cli-plugin-babel": "^3.3.0",
-    "@vue/cli-plugin-eslint": "^3.3.0",
-    "@vue/cli-service": "^3.3.0",
-    "@vue/eslint-config-standard": "^4.0.0",
-    "babel-eslint": "^10.0.1",
-    "compression-webpack-plugin": "^3.1.0",
-    "eslint": "^5.16.0",
-    "eslint-plugin-vue": "^5.1.0",
-    "html-webpack-plugin": "^4.2.0",
-    "less": "^3.9.0",
-    "less-loader": "^4.1.0",
-    "vue-template-compiler": "^2.6.10"
-  },
-  "eslintConfig": {
-    "root": true,
-    "env": {
-      "node": true
-    },
-    "extends": [
-      "plugin:vue/strongly-recommended",
-      "@vue/standard"
-    ],
-    "parserOptions": {
-      "parser": "babel-eslint"
-    },
-    "rules": {
-      "generator-star-spacing": "off",
-      "no-mixed-operators": 0,
-      "vue/max-attributes-per-line": [
-        2,
-        {
-          "singleline": 5,
-          "multiline": {
-            "max": 1,
-            "allowFirstLine": false
-          }
-        }
-      ],
-      "vue/attribute-hyphenation": 0,
-      "vue/html-self-closing": 0,
-      "vue/component-name-in-template-casing": 0,
-      "vue/html-closing-bracket-spacing": 0,
-      "vue/singleline-html-element-content-newline": 0,
-      "vue/no-unused-components": 0,
-      "vue/multiline-html-element-content-newline": 0,
-      "vue/no-use-v-if-with-v-for": 0,
-      "vue/html-closing-bracket-newline": 0,
-      "vue/no-parsing-error": 0,
-      "no-console": 0,
-      "no-tabs": 0,
-      "indent": [
-        1,
-        4
-      ]
-    }
-  },
-  "postcss": {
-    "plugins": {
-      "autoprefixer": {}
-    }
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not ie <= 10"
-  ]
-}
+{
+  "name": "vue-antd-jeecg",
+  "version": "2.2.0",
+  "private": true,
+  "scripts": {
+    "pre": "cnpm install || yarn --registry https://registry.npm.taobao.org || npm install --registry https://registry.npm.taobao.org ",
+    "serve": "vue-cli-service serve",
+    "build": "vue-cli-service build",
+    "lint": "vue-cli-service lint"
+  },
+  "dependencies": {
+    "ant-design-vue": "^1.6.3",
+    "@antv/data-set": "^0.11.4",
+    "@jeecg/antd-online-mini": "2.2.1",
+    "viser-vue": "^2.4.8",
+    "animate.css": "^4.1.0",
+    "axios": "^0.18.0",
+    "dayjs": "^1.8.0",
+    "enquire.js": "^2.1.6",
+    "js-cookie": "^2.2.0",
+    "lodash.get": "^4.4.2",
+    "lodash.pick": "^4.4.0",
+    "md5": "^2.2.1",
+    "nprogress": "^0.2.0",
+    "vue": "^2.6.10",
+    "vue-cropper": "^0.5.4",
+    "vue-i18n": "^8.7.0",
+    "vue-loader": "^15.7.0",
+    "vue-ls": "^3.2.0",
+    "vue-router": "^3.0.1",
+    "vuex": "^3.1.0",
+    "vue-print-nb-jeecg": "^1.0.9",
+    "clipboard": "^2.0.4",
+    "vue-photo-preview": "^1.1.3",
+    "vue-splitpane": "^1.0.4",
+    "vuedraggable": "^2.20.0",
+    "codemirror": "^5.46.0",
+    "@tinymce/tinymce-vue": "^2.1.0",
+    "tinymce": "^5.3.2",
+    "@toast-ui/editor": "^2.1.2",
+    "vue-area-linkage": "^5.1.0",
+    "area-data": "^5.0.6",
+    "jsoneditor": "^9.0.0"
+  },
+  "devDependencies": {
+    "@babel/polyfill": "^7.2.5",
+    "@vue/cli-plugin-babel": "^3.3.0",
+    "@vue/cli-plugin-eslint": "^3.3.0",
+    "@vue/cli-service": "^3.3.0",
+    "@vue/eslint-config-standard": "^4.0.0",
+    "babel-eslint": "7.2.3",
+    "compression-webpack-plugin": "^3.1.0",
+    "eslint": "^5.16.0",
+    "eslint-plugin-vue": "^5.1.0",
+    "html-webpack-plugin": "^4.2.0",
+    "less": "^3.9.0",
+    "less-loader": "^4.1.0",
+    "vue-template-compiler": "^2.6.10"
+  },
+  "eslintConfig": {
+    "root": true,
+    "env": {
+      "node": true
+    },
+    "extends": [
+      "plugin:vue/strongly-recommended",
+      "@vue/standard"
+    ],
+    "parserOptions": {
+      "parser": "babel-eslint"
+    },
+    "rules": {
+      "generator-star-spacing": "off",
+      "no-mixed-operators": 0,
+      "vue/max-attributes-per-line": [
+        2,
+        {
+          "singleline": 5,
+          "multiline": {
+            "max": 1,
+            "allowFirstLine": false
+          }
+        }
+      ],
+      "vue/attribute-hyphenation": 0,
+      "vue/html-self-closing": 0,
+      "vue/component-name-in-template-casing": 0,
+      "vue/html-closing-bracket-spacing": 0,
+      "vue/singleline-html-element-content-newline": 0,
+      "vue/no-unused-components": 0,
+      "vue/multiline-html-element-content-newline": 0,
+      "vue/no-use-v-if-with-v-for": 0,
+      "vue/html-closing-bracket-newline": 0,
+      "vue/no-parsing-error": 0,
+      "no-tabs": 0,
+      "indent": ["off", 2],
+      "no-console": 0,
+      "space-before-function-paren": 0
+    }
+  },
+  "postcss": {
+    "plugins": {
+      "autoprefixer": {}
+    }
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 10"
+  ]
+}

+ 1 - 1
src/components/tools/UserMenu.vue

@@ -157,7 +157,7 @@
           content: '真的要注销登录吗 ?',
           onOk() {
             return that.Logout({}).then(() => {
-                window.location.href="/";
+              that.$router.push({ path: '/user/login' });
               //window.location.reload()
             }).catch(err => {
               that.$message.error({

+ 2 - 2
src/main.js

@@ -18,8 +18,8 @@ import Print from 'vue-print-nb-jeecg'
 import preview from 'vue-photo-preview'
 import 'vue-photo-preview/dist/skin.css'
 if (process.env.NODE_ENV !== 'production') {
-  require('@jeecg/antd-online-beta220')
-  require('@jeecg/antd-online-beta220/dist/OnlineForm.css')
+  require('@jeecg/antd-online-mini')
+  require('@jeecg/antd-online-mini/dist/OnlineForm.css')
 }
 import {
   ACCESS_TOKEN,

+ 480 - 480
src/utils/util.js

@@ -1,480 +1,480 @@
-import * as api from '@/api/api'
-import { isURL } from '@/utils/validate'
-import onlineCommons from '@jeecg/antd-online-beta220'
-
-export function timeFix() {
-  const time = new Date()
-  const hour = time.getHours()
-  return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
-}
-
-export function welcome() {
-  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
-  let index = Math.floor((Math.random()*arr.length))
-  return arr[index]
-}
-
-/**
- * 触发 window.resize
- */
-export function triggerWindowResizeEvent() {
-  let event = document.createEvent('HTMLEvents')
-  event.initEvent('resize', true, true)
-  event.eventType = 'message'
-  window.dispatchEvent(event)
-}
-
-/**
- * 过滤对象中为空的属性
- * @param obj
- * @returns {*}
- */
-export function filterObj(obj) {
-  if (!(typeof obj == 'object')) {
-    return;
-  }
-
-  for ( let key in obj) {
-    if (obj.hasOwnProperty(key)
-      && (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
-      delete obj[key];
-    }
-  }
-  return obj;
-}
-
-/**
- * 时间格式化
- * @param value
- * @param fmt
- * @returns {*}
- */
-export function formatDate(value, fmt) {
-  let regPos = /^\d+(\.\d+)?$/;
-  if(regPos.test(value)){
-    //如果是数字
-    let getDate = new Date(value);
-    let o = {
-      'M+': getDate.getMonth() + 1,
-      'd+': getDate.getDate(),
-      'h+': getDate.getHours(),
-      'm+': getDate.getMinutes(),
-      's+': getDate.getSeconds(),
-      'q+': Math.floor((getDate.getMonth() + 3) / 3),
-      'S': getDate.getMilliseconds()
-    };
-    if (/(y+)/.test(fmt)) {
-      fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
-    }
-    for (let k in o) {
-      if (new RegExp('(' + k + ')').test(fmt)) {
-        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
-      }
-    }
-    return fmt;
-  }else{
-    //TODO
-    value = value.trim();
-    return value.substr(0,fmt.length);
-  }
-}
-
-// 生成首页路由
-export function generateIndexRouter(data) {
-let indexRouter = [{
-          path: '/',
-          name: 'dashboard',
-          //component: () => import('@/components/layouts/BasicLayout'),
-          component: resolve => require(['@/components/layouts/TabLayout'], resolve),
-          meta: { title: '首页' },
-          redirect: '/dashboard/analysis',
-          children: [
-            ...generateChildRouters(data)
-          ]
-        },{
-          "path": "*", "redirect": "/404", "hidden": true
-        }]
-  return indexRouter;
-}
-
-// 生成嵌套路由(子路由)
-
-function  generateChildRouters (data) {
-  const routers = [];
-  for (let item of data) {
-    let component = "";
-    if(item.component.indexOf("layouts")>=0){
-       component = "components/"+item.component;
-    }else{
-       component = "views/"+item.component;
-    }
-
-    // eslint-disable-next-line
-    let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
-    if (isURL(URL)) {
-      item.meta.url = URL;
-    }
-
-    //online菜单路由加载逻辑
-    let componentPath
-    if(item.component=="modules/online/cgform/OnlCgformHeadList"){
-      componentPath = onlineCommons.OnlCgformHeadList
-    }else if(item.component=="modules/online/cgform/OnlCgformCopyList"){
-      componentPath = onlineCommons.OnlCgformCopyList
-    }else if(item.component=="modules/online/cgform/auto/OnlCgformAutoList"){
-      componentPath = onlineCommons.OnlCgformAutoList
-    }else if(item.component=="modules/online/cgform/auto/OnlCgformTreeList"){
-      componentPath = onlineCommons.OnlCgformTreeList
-    }else if(item.component=="modules/online/cgform/auto/erp/OnlCgformErpList"){
-      componentPath = onlineCommons.OnlCgformErpList
-    }else if(item.component=="modules/online/cgform/auto/innerTable/OnlCgformInnerTableList"){
-      componentPath = onlineCommons.OnlCgformInnerTableList
-    }else if(item.component=="modules/online/cgreport/OnlCgreportHeadList"){
-      componentPath = onlineCommons.OnlCgreportHeadList
-    }else if(item.component=="modules/online/cgreport/auto/OnlCgreportAutoList"){
-      componentPath = onlineCommons.OnlCgreportAutoList
-    }else{
-      componentPath = resolve => require(['@/' + component+'.vue'], resolve)
-    }
-
-    let menu =  {
-      path: item.path,
-      name: item.name,
-      redirect:item.redirect,
-      component: componentPath,
-      hidden:item.hidden,
-      //component:()=> import(`@/views/${item.component}.vue`),
-      meta: {
-        title:item.meta.title ,
-        icon: item.meta.icon,
-        url:item.meta.url ,
-        permissionList:item.meta.permissionList,
-        keepAlive:item.meta.keepAlive,
-        /*update_begin author:wuxianquan date:20190908 for:赋值 */
-        internalOrExternal:item.meta.internalOrExternal
-        /*update_end author:wuxianquan date:20190908 for:赋值 */
-      }
-    }
-    if(item.alwaysShow){
-      menu.alwaysShow = true;
-      menu.redirect = menu.path;
-    }
-    if (item.children && item.children.length > 0) {
-      menu.children = [...generateChildRouters( item.children)];
-    }
-    //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-    //判断是否生成路由
-    if(item.route && item.route === '0'){
-      //console.log(' 不生成路由 item.route:  '+item.route);
-      //console.log(' 不生成路由 item.path:  '+item.path);
-    }else{
-      routers.push(menu);
-    }
-    //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
-  }
-  return routers
-}
-
-/**
- * 深度克隆对象、数组
- * @param obj 被克隆的对象
- * @return 克隆后的对象
- */
-export function cloneObject(obj) {
-  return JSON.parse(JSON.stringify(obj))
-}
-
-/**
- * 随机生成数字
- *
- * 示例:生成长度为 12 的随机数:randomNumber(12)
- * 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
- *
- * @param1 最小值 | 长度
- * @param2 最大值
- * @return int 生成后的数字
- */
-export function randomNumber() {
-  // 生成 最小值 到 最大值 区间的随机数
-  const random = (min, max) => {
-    return Math.floor(Math.random() * (max - min + 1) + min)
-  }
-  if (arguments.length === 1) {
-    let [length] = arguments
-  // 生成指定长度的随机数字,首位一定不是 0
-    let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
-    return parseInt(nums.join(''))
-  } else if (arguments.length >= 2) {
-    let [min, max] = arguments
-    return random(min, max)
-  } else {
-    return Number.NaN
-  }
-}
-
-/**
- * 随机生成字符串
- * @param length 字符串的长度
- * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
- * @return string 生成的字符串
- */
-export function randomString(length, chats) {
-  if (!length) length = 1
-  if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
-  let str = ''
-  for (let i = 0; i < length; i++) {
-    let num = randomNumber(0, chats.length - 1)
-    str += chats[num]
-  }
-  return str
-}
-
-/**
- * 随机生成uuid
- * @return string 生成的uuid
- */
-export function randomUUID() {
-  let chats = '0123456789abcdef'
-  return randomString(32, chats)
-}
-
-/**
- * 下划线转驼峰
- * @param string
- * @returns {*}
- */
-export function underLine2CamelCase(string){
-  return string.replace( /_([a-z])/g, function( all, letter ) {
-    return letter.toUpperCase();
-  });
-}
-
-/**
- * 判断是否显示办理按钮
- * @param bpmStatus
- * @returns {*}
- */
-export function showDealBtn(bpmStatus){
-  if(bpmStatus!="1"&&bpmStatus!="3"&&bpmStatus!="4"){
-    return true;
-  }
-  return false;
-}
-
-/**
- * 增强CSS,可以在页面上输出全局css
- * @param css 要增强的css
- * @param id style标签的id,可以用来清除旧样式
- */
-export function cssExpand(css, id) {
-  let style = document.createElement('style')
-  style.type = "text/css"
-  style.innerHTML = `@charset "UTF-8"; ${css}`
-  // 清除旧样式
-  if (id) {
-    let $style = document.getElementById(id)
-    if ($style != null) $style.outerHTML = ''
-    style.id = id
-  }
-  // 应用新样式
-  document.head.appendChild(style)
-}
-
-
-/** 用于js增强事件,运行JS代码,可以传参 */
-// options 所需参数:
-//    参数名         类型            说明
-//    vm             VueComponent    vue实例
-//    event          Object          event对象
-//    jsCode         String          待执行的js代码
-//    errorMessage   String          执行出错后的提示(控制台)
-export function jsExpand(options = {}) {
-
-  // 绑定到window上的keyName
-  let windowKeyName = 'J_CLICK_EVENT_OPTIONS'
-  if (typeof window[windowKeyName] != 'object') {
-    window[windowKeyName] = {}
-  }
-
-  // 随机生成JS增强的执行id,防止冲突
-  let id = randomString(16, 'qwertyuioplkjhgfdsazxcvbnm'.toUpperCase())
-  // 封装按钮点击事件
-  let code = `
-    (function (o_${id}) {
-      try {
-        (function (globalEvent, vm) {
-          ${options.jsCode}
-        })(o_${id}.event, o_${id}.vm)
-      } catch (e) {
-        o_${id}.error(e)
-      }
-      o_${id}.done()
-    })(window['${windowKeyName}']['EVENT_${id}'])
-  `
-  // 创建script标签
-  const script = document.createElement('script')
-  // 将需要传递的参数挂载到window对象上
-  window[windowKeyName]['EVENT_' + id] = {
-    vm: options.vm,
-    event: options.event,
-    // 当执行完成时,无论如何都会调用的回调事件
-    done() {
-      // 执行完后删除新增的 script 标签不会撤销执行结果(已产生的结果不会被撤销)
-      script.outerHTML = ''
-      delete window[windowKeyName]['EVENT_' + id]
-    },
-    // 当js运行出错的时候调用的事件
-    error(e) {
-      console.group(`${options.errorMessage || '用户自定义JS增强代码运行出错'}(${new Date()})`)
-      console.error(e)
-      console.groupEnd()
-    }
-  }
-  // 将事件挂载到document中
-  script.innerHTML = code
-  document.body.appendChild(script)
-}
-
-
-/**
- * 重复值验证工具方法
- *
- * 使用示例:
- * { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) }
- *
- * @param tableName 被验证的表名
- * @param fieldName 被验证的字段名
- * @param fieldVal 被验证的值
- * @param dataId 数据ID,可空
- * @param callback
- */
-export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) {
-  if (fieldVal) {
-    let params = { tableName, fieldName, fieldVal, dataId }
-    api.duplicateCheck(params).then(res => {
-      res['success'] ? callback() : callback(res['message'])
-    }).catch(err => {
-      callback(err.message || err)
-    })
-  } else {
-    callback()
-  }
-}
-
-/**
- * 根据编码校验规则code,校验传入的值是否合法
- *
- * 使用示例:
- * { validator: (rule, value, callback) => validateCheckRule('common', value, callback) }
- *
- * @param ruleCode 编码校验规则 code
- * @param value 被验证的值
- * @param callback
- */
-export function validateCheckRule(ruleCode, value, callback) {
-  if (ruleCode && value) {
-    value = encodeURIComponent(value)
-    api.checkRuleByCode({ ruleCode, value }).then(res => {
-      res['success'] ? callback() : callback(res['message'])
-    }).catch(err => {
-      callback(err.message || err)
-    })
-  } else {
-    callback()
-  }
-}
-
-/**
- * 如果值不存在就 push 进数组,反之不处理
- * @param array 要操作的数据
- * @param value 要添加的值
- * @param key 可空,如果比较的是对象,可能存在地址不一样但值实际上是一样的情况,可以传此字段判断对象中唯一的字段,例如 id。不传则直接比较实际值
- * @returns {boolean} 成功 push 返回 true,不处理返回 false
- */
-export function pushIfNotExist(array, value, key) {
-  for (let item of array) {
-    if (key && (item[key] === value[key])) {
-      return false
-    } else if (item === value) {
-      return false
-    }
-  }
-  array.push(value)
-  return true
-}
-
-/**
- * 可用于判断是否成功
- * @type {symbol}
- */
-export const succeedSymbol = Symbol()
-/**
- * 可用于判断是否失败
- * @type {symbol}
- */
-export const failedSymbol = Symbol()
-
-/**
- * 使 promise 无论如何都会 resolve,除非传入的参数不是一个Promise对象或返回Promise对象的方法
- * 一般用在 Promise.all 中
- *
- * @param promise 可传Promise对象或返回Promise对象的方法
- * @returns {Promise<any>}
- */
-export function alwaysResolve(promise) {
-  return new Promise((resolve, reject) => {
-    let p = promise
-    if (typeof promise === 'function') {
-      p = promise()
-    }
-    if (p instanceof Promise) {
-      p.then(data => {
-        resolve({ type: succeedSymbol, data })
-      }).catch(error => {
-        resolve({ type: failedSymbol, error })
-      })
-    } else {
-      reject('alwaysResolve: 传入的参数不是一个Promise对象或返回Promise对象的方法')
-    }
-  })
-}
-
-/**
- * 简单实现防抖方法
- *
- * 防抖(debounce)函数在第一次触发给定的函数时,不立即执行函数,而是给出一个期限值(delay),比如100ms。
- * 如果100ms内再次执行函数,就重新开始计时,直到计时结束后再真正执行函数。
- * 这样做的好处是如果短时间内大量触发同一事件,只会执行一次函数。
- *
- * @param fn 要防抖的函数
- * @param delay 防抖的毫秒数
- * @returns {Function}
- */
-export function simpleDebounce(fn, delay = 100) {
-  let timer = null
-  return function () {
-    let args = arguments
-    if (timer) {
-      clearTimeout(timer)
-    }
-    timer = setTimeout(() => {
-      fn.apply(null, args)
-    }, delay)
-  }
-}
-
-/**
- * 不用正则的方式替换所有值
- * @param text 被替换的字符串
- * @param checker  替换前的内容
- * @param replacer 替换后的内容
- * @returns {String} 替换后的字符串
- */
-export function replaceAll(text, checker, replacer) {
-  let lastText = text
-  text = text.replace(checker, replacer)
-  if (lastText !== text) {
-    return replaceAll(text, checker, replacer)
-  }
-  return text
-}
+import * as api from '@/api/api'
+import { isURL } from '@/utils/validate'
+import onlineCommons from '@jeecg/antd-online-mini'
+
+export function timeFix() {
+  const time = new Date()
+  const hour = time.getHours()
+  return hour < 9 ? '早上好' : (hour <= 11 ? '上午好' : (hour <= 13 ? '中午好' : (hour < 20 ? '下午好' : '晚上好')))
+}
+
+export function welcome() {
+  const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了']
+  let index = Math.floor((Math.random()*arr.length))
+  return arr[index]
+}
+
+/**
+ * 触发 window.resize
+ */
+export function triggerWindowResizeEvent() {
+  let event = document.createEvent('HTMLEvents')
+  event.initEvent('resize', true, true)
+  event.eventType = 'message'
+  window.dispatchEvent(event)
+}
+
+/**
+ * 过滤对象中为空的属性
+ * @param obj
+ * @returns {*}
+ */
+export function filterObj(obj) {
+  if (!(typeof obj == 'object')) {
+    return;
+  }
+
+  for ( let key in obj) {
+    if (obj.hasOwnProperty(key)
+      && (obj[key] == null || obj[key] == undefined || obj[key] === '')) {
+      delete obj[key];
+    }
+  }
+  return obj;
+}
+
+/**
+ * 时间格式化
+ * @param value
+ * @param fmt
+ * @returns {*}
+ */
+export function formatDate(value, fmt) {
+  let regPos = /^\d+(\.\d+)?$/;
+  if(regPos.test(value)){
+    //如果是数字
+    let getDate = new Date(value);
+    let o = {
+      'M+': getDate.getMonth() + 1,
+      'd+': getDate.getDate(),
+      'h+': getDate.getHours(),
+      'm+': getDate.getMinutes(),
+      's+': getDate.getSeconds(),
+      'q+': Math.floor((getDate.getMonth() + 3) / 3),
+      'S': getDate.getMilliseconds()
+    };
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (getDate.getFullYear() + '').substr(4 - RegExp.$1.length))
+    }
+    for (let k in o) {
+      if (new RegExp('(' + k + ')').test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+      }
+    }
+    return fmt;
+  }else{
+    //TODO
+    value = value.trim();
+    return value.substr(0,fmt.length);
+  }
+}
+
+// 生成首页路由
+export function generateIndexRouter(data) {
+let indexRouter = [{
+          path: '/',
+          name: 'dashboard',
+          //component: () => import('@/components/layouts/BasicLayout'),
+          component: resolve => require(['@/components/layouts/TabLayout'], resolve),
+          meta: { title: '首页' },
+          redirect: '/dashboard/analysis',
+          children: [
+            ...generateChildRouters(data)
+          ]
+        },{
+          "path": "*", "redirect": "/404", "hidden": true
+        }]
+  return indexRouter;
+}
+
+// 生成嵌套路由(子路由)
+
+function  generateChildRouters (data) {
+  const routers = [];
+  for (let item of data) {
+    let component = "";
+    if(item.component.indexOf("layouts")>=0){
+       component = "components/"+item.component;
+    }else{
+       component = "views/"+item.component;
+    }
+
+    // eslint-disable-next-line
+    let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
+    if (isURL(URL)) {
+      item.meta.url = URL;
+    }
+
+    //online菜单路由加载逻辑
+    let componentPath
+    if(item.component=="modules/online/cgform/OnlCgformHeadList"){
+      componentPath = onlineCommons.OnlCgformHeadList
+    }else if(item.component=="modules/online/cgform/OnlCgformCopyList"){
+      componentPath = onlineCommons.OnlCgformCopyList
+    }else if(item.component=="modules/online/cgform/auto/OnlCgformAutoList"){
+      componentPath = onlineCommons.OnlCgformAutoList
+    }else if(item.component=="modules/online/cgform/auto/OnlCgformTreeList"){
+      componentPath = onlineCommons.OnlCgformTreeList
+    }else if(item.component=="modules/online/cgform/auto/erp/OnlCgformErpList"){
+      componentPath = onlineCommons.OnlCgformErpList
+    }else if(item.component=="modules/online/cgform/auto/innerTable/OnlCgformInnerTableList"){
+      componentPath = onlineCommons.OnlCgformInnerTableList
+    }else if(item.component=="modules/online/cgreport/OnlCgreportHeadList"){
+      componentPath = onlineCommons.OnlCgreportHeadList
+    }else if(item.component=="modules/online/cgreport/auto/OnlCgreportAutoList"){
+      componentPath = onlineCommons.OnlCgreportAutoList
+    }else{
+      componentPath = resolve => require(['@/' + component+'.vue'], resolve)
+    }
+
+    let menu =  {
+      path: item.path,
+      name: item.name,
+      redirect:item.redirect,
+      component: componentPath,
+      hidden:item.hidden,
+      //component:()=> import(`@/views/${item.component}.vue`),
+      meta: {
+        title:item.meta.title ,
+        icon: item.meta.icon,
+        url:item.meta.url ,
+        permissionList:item.meta.permissionList,
+        keepAlive:item.meta.keepAlive,
+        /*update_begin author:wuxianquan date:20190908 for:赋值 */
+        internalOrExternal:item.meta.internalOrExternal
+        /*update_end author:wuxianquan date:20190908 for:赋值 */
+      }
+    }
+    if(item.alwaysShow){
+      menu.alwaysShow = true;
+      menu.redirect = menu.path;
+    }
+    if (item.children && item.children.length > 0) {
+      menu.children = [...generateChildRouters( item.children)];
+    }
+    //--update-begin----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+    //判断是否生成路由
+    if(item.route && item.route === '0'){
+      //console.log(' 不生成路由 item.route:  '+item.route);
+      //console.log(' 不生成路由 item.path:  '+item.path);
+    }else{
+      routers.push(menu);
+    }
+    //--update-end----author:scott---date:20190320------for:根据后台菜单配置,判断是否路由菜单字段,动态选择是否生成路由(为了支持参数URL菜单)------
+  }
+  return routers
+}
+
+/**
+ * 深度克隆对象、数组
+ * @param obj 被克隆的对象
+ * @return 克隆后的对象
+ */
+export function cloneObject(obj) {
+  return JSON.parse(JSON.stringify(obj))
+}
+
+/**
+ * 随机生成数字
+ *
+ * 示例:生成长度为 12 的随机数:randomNumber(12)
+ * 示例:生成 3~23 之间的随机数:randomNumber(3, 23)
+ *
+ * @param1 最小值 | 长度
+ * @param2 最大值
+ * @return int 生成后的数字
+ */
+export function randomNumber() {
+  // 生成 最小值 到 最大值 区间的随机数
+  const random = (min, max) => {
+    return Math.floor(Math.random() * (max - min + 1) + min)
+  }
+  if (arguments.length === 1) {
+    let [length] = arguments
+  // 生成指定长度的随机数字,首位一定不是 0
+    let nums = [...Array(length).keys()].map((i) => (i > 0 ? random(0, 9) : random(1, 9)))
+    return parseInt(nums.join(''))
+  } else if (arguments.length >= 2) {
+    let [min, max] = arguments
+    return random(min, max)
+  } else {
+    return Number.NaN
+  }
+}
+
+/**
+ * 随机生成字符串
+ * @param length 字符串的长度
+ * @param chats 可选字符串区间(只会生成传入的字符串中的字符)
+ * @return string 生成的字符串
+ */
+export function randomString(length, chats) {
+  if (!length) length = 1
+  if (!chats) chats = '0123456789qwertyuioplkjhgfdsazxcvbnm'
+  let str = ''
+  for (let i = 0; i < length; i++) {
+    let num = randomNumber(0, chats.length - 1)
+    str += chats[num]
+  }
+  return str
+}
+
+/**
+ * 随机生成uuid
+ * @return string 生成的uuid
+ */
+export function randomUUID() {
+  let chats = '0123456789abcdef'
+  return randomString(32, chats)
+}
+
+/**
+ * 下划线转驼峰
+ * @param string
+ * @returns {*}
+ */
+export function underLine2CamelCase(string){
+  return string.replace( /_([a-z])/g, function( all, letter ) {
+    return letter.toUpperCase();
+  });
+}
+
+/**
+ * 判断是否显示办理按钮
+ * @param bpmStatus
+ * @returns {*}
+ */
+export function showDealBtn(bpmStatus){
+  if(bpmStatus!="1"&&bpmStatus!="3"&&bpmStatus!="4"){
+    return true;
+  }
+  return false;
+}
+
+/**
+ * 增强CSS,可以在页面上输出全局css
+ * @param css 要增强的css
+ * @param id style标签的id,可以用来清除旧样式
+ */
+export function cssExpand(css, id) {
+  let style = document.createElement('style')
+  style.type = "text/css"
+  style.innerHTML = `@charset "UTF-8"; ${css}`
+  // 清除旧样式
+  if (id) {
+    let $style = document.getElementById(id)
+    if ($style != null) $style.outerHTML = ''
+    style.id = id
+  }
+  // 应用新样式
+  document.head.appendChild(style)
+}
+
+
+/** 用于js增强事件,运行JS代码,可以传参 */
+// options 所需参数:
+//    参数名         类型            说明
+//    vm             VueComponent    vue实例
+//    event          Object          event对象
+//    jsCode         String          待执行的js代码
+//    errorMessage   String          执行出错后的提示(控制台)
+export function jsExpand(options = {}) {
+
+  // 绑定到window上的keyName
+  let windowKeyName = 'J_CLICK_EVENT_OPTIONS'
+  if (typeof window[windowKeyName] != 'object') {
+    window[windowKeyName] = {}
+  }
+
+  // 随机生成JS增强的执行id,防止冲突
+  let id = randomString(16, 'qwertyuioplkjhgfdsazxcvbnm'.toUpperCase())
+  // 封装按钮点击事件
+  let code = `
+    (function (o_${id}) {
+      try {
+        (function (globalEvent, vm) {
+          ${options.jsCode}
+        })(o_${id}.event, o_${id}.vm)
+      } catch (e) {
+        o_${id}.error(e)
+      }
+      o_${id}.done()
+    })(window['${windowKeyName}']['EVENT_${id}'])
+  `
+  // 创建script标签
+  const script = document.createElement('script')
+  // 将需要传递的参数挂载到window对象上
+  window[windowKeyName]['EVENT_' + id] = {
+    vm: options.vm,
+    event: options.event,
+    // 当执行完成时,无论如何都会调用的回调事件
+    done() {
+      // 执行完后删除新增的 script 标签不会撤销执行结果(已产生的结果不会被撤销)
+      script.outerHTML = ''
+      delete window[windowKeyName]['EVENT_' + id]
+    },
+    // 当js运行出错的时候调用的事件
+    error(e) {
+      console.group(`${options.errorMessage || '用户自定义JS增强代码运行出错'}(${new Date()})`)
+      console.error(e)
+      console.groupEnd()
+    }
+  }
+  // 将事件挂载到document中
+  script.innerHTML = code
+  document.body.appendChild(script)
+}
+
+
+/**
+ * 重复值验证工具方法
+ *
+ * 使用示例:
+ * { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) }
+ *
+ * @param tableName 被验证的表名
+ * @param fieldName 被验证的字段名
+ * @param fieldVal 被验证的值
+ * @param dataId 数据ID,可空
+ * @param callback
+ */
+export function validateDuplicateValue(tableName, fieldName, fieldVal, dataId, callback) {
+  if (fieldVal) {
+    let params = { tableName, fieldName, fieldVal, dataId }
+    api.duplicateCheck(params).then(res => {
+      res['success'] ? callback() : callback(res['message'])
+    }).catch(err => {
+      callback(err.message || err)
+    })
+  } else {
+    callback()
+  }
+}
+
+/**
+ * 根据编码校验规则code,校验传入的值是否合法
+ *
+ * 使用示例:
+ * { validator: (rule, value, callback) => validateCheckRule('common', value, callback) }
+ *
+ * @param ruleCode 编码校验规则 code
+ * @param value 被验证的值
+ * @param callback
+ */
+export function validateCheckRule(ruleCode, value, callback) {
+  if (ruleCode && value) {
+    value = encodeURIComponent(value)
+    api.checkRuleByCode({ ruleCode, value }).then(res => {
+      res['success'] ? callback() : callback(res['message'])
+    }).catch(err => {
+      callback(err.message || err)
+    })
+  } else {
+    callback()
+  }
+}
+
+/**
+ * 如果值不存在就 push 进数组,反之不处理
+ * @param array 要操作的数据
+ * @param value 要添加的值
+ * @param key 可空,如果比较的是对象,可能存在地址不一样但值实际上是一样的情况,可以传此字段判断对象中唯一的字段,例如 id。不传则直接比较实际值
+ * @returns {boolean} 成功 push 返回 true,不处理返回 false
+ */
+export function pushIfNotExist(array, value, key) {
+  for (let item of array) {
+    if (key && (item[key] === value[key])) {
+      return false
+    } else if (item === value) {
+      return false
+    }
+  }
+  array.push(value)
+  return true
+}
+
+/**
+ * 可用于判断是否成功
+ * @type {symbol}
+ */
+export const succeedSymbol = Symbol()
+/**
+ * 可用于判断是否失败
+ * @type {symbol}
+ */
+export const failedSymbol = Symbol()
+
+/**
+ * 使 promise 无论如何都会 resolve,除非传入的参数不是一个Promise对象或返回Promise对象的方法
+ * 一般用在 Promise.all 中
+ *
+ * @param promise 可传Promise对象或返回Promise对象的方法
+ * @returns {Promise<any>}
+ */
+export function alwaysResolve(promise) {
+  return new Promise((resolve, reject) => {
+    let p = promise
+    if (typeof promise === 'function') {
+      p = promise()
+    }
+    if (p instanceof Promise) {
+      p.then(data => {
+        resolve({ type: succeedSymbol, data })
+      }).catch(error => {
+        resolve({ type: failedSymbol, error })
+      })
+    } else {
+      reject('alwaysResolve: 传入的参数不是一个Promise对象或返回Promise对象的方法')
+    }
+  })
+}
+
+/**
+ * 简单实现防抖方法
+ *
+ * 防抖(debounce)函数在第一次触发给定的函数时,不立即执行函数,而是给出一个期限值(delay),比如100ms。
+ * 如果100ms内再次执行函数,就重新开始计时,直到计时结束后再真正执行函数。
+ * 这样做的好处是如果短时间内大量触发同一事件,只会执行一次函数。
+ *
+ * @param fn 要防抖的函数
+ * @param delay 防抖的毫秒数
+ * @returns {Function}
+ */
+export function simpleDebounce(fn, delay = 100) {
+  let timer = null
+  return function () {
+    let args = arguments
+    if (timer) {
+      clearTimeout(timer)
+    }
+    timer = setTimeout(() => {
+      fn.apply(null, args)
+    }, delay)
+  }
+}
+
+/**
+ * 不用正则的方式替换所有值
+ * @param text 被替换的字符串
+ * @param checker  替换前的内容
+ * @param replacer 替换后的内容
+ * @returns {String} 替换后的字符串
+ */
+export function replaceAll(text, checker, replacer) {
+  let lastText = text
+  text = text.replace(checker, replacer)
+  if (lastText !== text) {
+    return replaceAll(text, checker, replacer)
+  }
+  return text
+}

+ 155 - 28
yarn.lock

@@ -53,10 +53,10 @@
   dependencies:
     "@antv/util" "~1.3.1"
 
-"@antv/data-set@^0.11.2":
+"@antv/data-set@^0.11.4":
   version "0.11.4"
-  resolved "https://registry.npmjs.org/@antv/data-set/-/data-set-0.11.4.tgz#c3fbd255945c6ff9dd1c4cf20029d3f3e42869c8"
-  integrity sha512-rS0xMvclsv59wh2yDmCshC55/HvXBbwpEmoTr+ErSY4SKGKSTOwXjZ90W/fJMSfacMPOGDbG7R77kCP8cSTu5w==
+  resolved "https://registry.npm.taobao.org/@antv/data-set/download/@antv/data-set-0.11.4.tgz#c3fbd255945c6ff9dd1c4cf20029d3f3e42869c8"
+  integrity sha1-w/vSVZRcb/ndHEzyACnT8+Qoacg=
   dependencies:
     "@antv/hierarchy" "^0.6.0"
     "@antv/util" "^2.0.0"
@@ -871,10 +871,10 @@
     cssnano-preset-default "^4.0.0"
     postcss "^7.0.0"
 
-"@jeecg/antd-online-beta220@^1.0.1":
-  version "1.0.1"
-  resolved "https://registry.npmjs.org/@jeecg/antd-online-beta220/-/antd-online-beta220-1.0.1.tgz#b8653176ae878d87298e7dca9312ce28c34bac5e"
-  integrity sha512-gVp+oapuEqIpDTt0Gp57o2ktYo2RdrzTLpzYZ8cDRDPdz33BAH2ed92PMITXsZ2O2GL/yW1b8dRsRjAAAFaXLA==
+"@jeecg/antd-online-mini@2.2.1":
+  version "2.2.1"
+  resolved "https://registry.npm.taobao.org/@jeecg/antd-online-mini/download/@jeecg/antd-online-mini-2.2.1.tgz#710613f2979ee31fea48657a067370387de6fa1a"
+  integrity sha1-cQYT8pee4x/qSGV6BnNwOH3m+ho=
 
 "@mrmlnc/readdir-enhanced@^2.2.1":
   version "2.2.1"
@@ -889,6 +889,14 @@
   resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
   integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
 
+"@simonwep/pickr@~1.7.0":
+  version "1.7.2"
+  resolved "https://registry.npm.taobao.org/@simonwep/pickr/download/@simonwep/pickr-1.7.2.tgz#99c73a3852633f749c8c187c82627a448b76b1ef"
+  integrity sha1-mcc6OFJjP3ScjBh8gmJ6RIt2se8=
+  dependencies:
+    core-js "^3.6.5"
+    nanopop "^1.3.0"
+
 "@soda/friendly-errors-webpack-plugin@^1.7.1":
   version "1.7.1"
   resolved "https://registry.npmjs.org/@soda/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.1.tgz#706f64bcb4a8b9642b48ae3ace444c70334d615d"
@@ -898,18 +906,38 @@
     error-stack-parser "^2.0.0"
     string-width "^2.0.0"
 
-"@tinymce/tinymce-vue@^2.0.0":
+"@sphinxxxx/color-conversion@^2.2.2":
+  version "2.2.2"
+  resolved "https://registry.npm.taobao.org/@sphinxxxx/color-conversion/download/@sphinxxxx/color-conversion-2.2.2.tgz#03ecc29279e3c0c832f6185a5bfa3497858ac8ca"
+  integrity sha1-A+zCknnjwMgy9hhaW/o0l4WKyMo=
+
+"@tinymce/tinymce-vue@^2.1.0":
   version "2.1.0"
-  resolved "https://registry.npmjs.org/@tinymce/tinymce-vue/-/tinymce-vue-2.1.0.tgz#cac3e935b217a277424f2258f3235824aa3c17c0"
-  integrity sha512-lDIpeLbkaobS/f00wWaOhGJdiZLdtL0dEDYB4JvqgVeAAoaDFG2PvXXP/kN49xpHpUe8vOdt7xFaN48nrPmsbQ==
+  resolved "https://registry.npm.taobao.org/@tinymce/tinymce-vue/download/@tinymce/tinymce-vue-2.1.0.tgz#cac3e935b217a277424f2258f3235824aa3c17c0"
+  integrity sha1-ysPpNbIXondCTyJY8yNYJKo8F8A=
   dependencies:
     vue "^2.5.17"
 
+"@toast-ui/editor@^2.1.2":
+  version "2.2.0"
+  resolved "https://registry.npm.taobao.org/@toast-ui/editor/download/@toast-ui/editor-2.2.0.tgz#77fd790c6ae876d5de738bc022d6ebc5c84a6feb"
+  integrity sha1-d/15DGrodtXec4vAItbrxchKb+s=
+  dependencies:
+    "@types/codemirror" "0.0.71"
+    codemirror "^5.48.4"
+
 "@types/anymatch@*":
   version "1.3.1"
   resolved "https://registry.npmjs.org/@types/anymatch/-/anymatch-1.3.1.tgz#336badc1beecb9dacc38bea2cf32adf627a8421a"
   integrity sha512-/+CRPXpBDpo2RK9C68N3b2cOvO0Cf5B9aPijHsoDQTHivnGSObdOF2BRQOYjojWTDy6nQvMjmqRXIxH55VjxxA==
 
+"@types/codemirror@0.0.71":
+  version "0.0.71"
+  resolved "https://registry.npm.taobao.org/@types/codemirror/download/@types/codemirror-0.0.71.tgz?cache=0&sync_timestamp=1594543706368&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fcodemirror%2Fdownload%2F%40types%2Fcodemirror-0.0.71.tgz#861f1bcb3100c0a064567c5400f2981cf4ae8ca7"
+  integrity sha1-hh8byzEAwKBkVnxUAPKYHPSujKc=
+  dependencies:
+    "@types/tern" "*"
+
 "@types/color-name@^1.1.1":
   version "1.1.1"
   resolved "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@@ -920,6 +948,11 @@
   resolved "https://registry.npmjs.org/@types/d3-format/-/d3-format-1.3.1.tgz#35bf88264bd6bcda39251165bb827f67879c4384"
   integrity sha512-KAWvReOKMDreaAwOjdfQMm0HjcUMlQG47GwqdVKgmm20vTd2pucj0a70c3gUSHrnsmo6H2AMrkBsZU2UhJLq8A==
 
+"@types/estree@*":
+  version "0.0.45"
+  resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884"
+  integrity sha1-6Th1cpmOXs2sIhlQ2rPow7Fq+IQ=
+
 "@types/events@*":
   version "3.0.0"
   resolved "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7"
@@ -979,6 +1012,13 @@
   resolved "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.5.tgz#9adbc12950582aa65ead76bffdf39fe0c27a3c02"
   integrity sha512-/gG2M/Imw7cQFp8PGvz/SwocNrmKFjFsm5Pb8HdbHkZ1K8pmuPzOX4VeVoiEecFCVf4CsN1r3/BRvx+6sNqwtQ==
 
+"@types/tern@*":
+  version "0.23.3"
+  resolved "https://registry.npm.taobao.org/@types/tern/download/@types/tern-0.23.3.tgz#4b54538f04a88c9ff79de1f6f94f575a7f339460"
+  integrity sha1-S1RTjwSojJ/3neH2+U9XWn8zlGA=
+  dependencies:
+    "@types/estree" "*"
+
 "@types/uglify-js@*":
   version "3.9.0"
   resolved "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.9.0.tgz#4490a140ca82aa855ad68093829e7fd6ae94ea87"
@@ -1406,6 +1446,11 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
     mime-types "~2.1.24"
     negotiator "0.6.2"
 
+ace-builds@^1.4.11:
+  version "1.4.12"
+  resolved "https://registry.npm.taobao.org/ace-builds/download/ace-builds-1.4.12.tgz#888efa386e36f4345f40b5233fcc4fe4c588fae7"
+  integrity sha1-iI76OG429DRfQLUjP8xP5MWI+uc=
+
 acorn-dynamic-import@^2.0.0:
   version "2.0.2"
   resolved "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4"
@@ -1528,6 +1573,16 @@ ajv@^6.12.0:
     json-schema-traverse "^0.4.1"
     uri-js "^4.2.2"
 
+ajv@^6.12.2:
+  version "6.12.3"
+  resolved "https://registry.npm.taobao.org/ajv/download/ajv-6.12.3.tgz?cache=0&sync_timestamp=1593878551850&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.3.tgz#18c5af38a111ddeb4f2697bd78d68abc1cabd706"
+  integrity sha1-GMWvOKER3etPJpe9eNaKvByr1wY=
+  dependencies:
+    fast-deep-equal "^3.1.1"
+    fast-json-stable-stringify "^2.0.0"
+    json-schema-traverse "^0.4.1"
+    uri-js "^4.2.2"
+
 align-text@^0.1.1, align-text@^0.1.3:
   version "0.1.4"
   resolved "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
@@ -1607,13 +1662,14 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
     "@types/color-name" "^1.1.1"
     color-convert "^2.0.1"
 
-ant-design-vue@1.5.2:
-  version "1.5.2"
-  resolved "https://registry.npm.taobao.org/ant-design-vue/download/ant-design-vue-1.5.2.tgz#0943f17d7908de16e633da7ab7133fb856eedd2c"
-  integrity sha1-CUPxfXkI3hbmM9p6txM/uFbu3Sw=
+ant-design-vue@^1.6.3:
+  version "1.6.3"
+  resolved "https://registry.npm.taobao.org/ant-design-vue/download/ant-design-vue-1.6.3.tgz#48a16dfc2acd73cbd748a59a19bb6cedb45bfbea"
+  integrity sha1-SKFt/CrNc8vXSKWaGbts7bRb++o=
   dependencies:
     "@ant-design/icons" "^2.1.1"
     "@ant-design/icons-vue" "^2.0.0"
+    "@simonwep/pickr" "~1.7.0"
     add-dom-event-listener "^1.0.2"
     array-tree-filter "^2.1.0"
     async-validator "^3.0.3"
@@ -1909,6 +1965,16 @@ babel-core@^6.26.0:
     slash "^1.0.0"
     source-map "^0.5.7"
 
+babel-eslint@7.2.3:
+  version "7.2.3"
+  resolved "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827"
+  integrity sha1-sv4tgBJkcPXBlELcdXJTqJdxCCc=
+  dependencies:
+    babel-code-frame "^6.22.0"
+    babel-traverse "^6.23.1"
+    babel-types "^6.23.0"
+    babylon "^6.17.0"
+
 babel-eslint@^10.0.1:
   version "10.1.0"
   resolved "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@@ -2417,7 +2483,7 @@ babel-template@^6.24.1, babel-template@^6.26.0:
     babylon "^6.18.0"
     lodash "^4.17.4"
 
-babel-traverse@^6.24.1, babel-traverse@^6.26.0:
+babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.26.0:
   version "6.26.0"
   resolved "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
   integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=
@@ -2432,7 +2498,7 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0:
     invariant "^2.2.2"
     lodash "^4.17.4"
 
-babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
+babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.26.0:
   version "6.26.0"
   resolved "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
   integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=
@@ -2442,7 +2508,7 @@ babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
     lodash "^4.17.4"
     to-fast-properties "^1.0.3"
 
-babylon@^6.18.0:
+babylon@^6.17.0, babylon@^6.18.0:
   version "6.18.0"
   resolved "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
   integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==
@@ -3206,6 +3272,11 @@ codemirror@^5.46.0:
   resolved "https://registry.npmjs.org/codemirror/-/codemirror-5.52.0.tgz#4dbd6aef7f0e63db826b9a23922f0c03ac75c0a7"
   integrity sha512-K2UB6zjscrfME03HeRe/IuOmCeqNpw7PLKGHThYpLbZEuKf+ZoujJPhxZN4hHJS1O7QyzEsV7JJZGxuQWVaFCg==
 
+codemirror@^5.48.4:
+  version "5.55.0"
+  resolved "https://registry.npm.taobao.org/codemirror/download/codemirror-5.55.0.tgz?cache=0&sync_timestamp=1592745428423&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcodemirror%2Fdownload%2Fcodemirror-5.55.0.tgz#23731f641288f202a6858fdc878f3149e0e04363"
+  integrity sha1-I3MfZBKI8gKmhY/ch48xSeDgQ2M=
+
 collection-visit@^1.0.0:
   version "1.0.0"
   resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
@@ -3489,6 +3560,11 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5:
   resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
   integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==
 
+core-js@^3.6.5:
+  version "3.6.5"
+  resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.6.5.tgz#7395dc273af37fb2e50e9bd3d9fe841285231d1a"
+  integrity sha1-c5XcJzrzf7LlDpvT2f6EEoUjHRo=
+
 core-util-is@1.0.2, core-util-is@~1.0.0:
   version "1.0.2"
   resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -6602,11 +6678,21 @@ isstream@~0.1.2:
   resolved "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
   integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
 
+javascript-natural-sort@^0.7.1:
+  version "0.7.1"
+  resolved "https://registry.npm.taobao.org/javascript-natural-sort/download/javascript-natural-sort-0.7.1.tgz#f9e2303d4507f6d74355a73664d1440fb5a0ef59"
+  integrity sha1-+eIwPUUH9tdDVac2ZNFED7Wg71k=
+
 javascript-stringify@^1.6.0:
   version "1.6.0"
   resolved "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3"
   integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM=
 
+jmespath@^0.15.0:
+  version "0.15.0"
+  resolved "https://registry.npm.taobao.org/jmespath/download/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217"
+  integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=
+
 js-base64@^2.1.9:
   version "2.5.2"
   resolved "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"
@@ -6705,6 +6791,11 @@ json-schema@0.2.3:
   resolved "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
   integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
 
+json-source-map@^0.6.1:
+  version "0.6.1"
+  resolved "https://registry.npm.taobao.org/json-source-map/download/json-source-map-0.6.1.tgz#e0b1f6f4ce13a9ad57e2ae165a24d06e62c79a0f"
+  integrity sha1-4LH29M4Tqa1X4q4WWiTQbmLHmg8=
+
 json-stable-stringify-without-jsonify@^1.0.1:
   version "1.0.1"
   resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
@@ -6753,6 +6844,20 @@ json5@^2.1.0:
   dependencies:
     minimist "^1.2.0"
 
+jsoneditor@^9.0.0:
+  version "9.0.3"
+  resolved "https://registry.npm.taobao.org/jsoneditor/download/jsoneditor-9.0.3.tgz#8e476ef327043e2f8fdc5dca67950f19accb0518"
+  integrity sha1-jkdu8ycEPi+P3F3KZ5UPGazLBRg=
+  dependencies:
+    ace-builds "^1.4.11"
+    ajv "^6.12.2"
+    javascript-natural-sort "^0.7.1"
+    jmespath "^0.15.0"
+    json-source-map "^0.6.1"
+    mobius1-selectr "^2.4.13"
+    picomodal "^3.0.0"
+    vanilla-picker "^2.10.1"
+
 jsonfile@^4.0.0:
   version "4.0.0"
   resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
@@ -7485,6 +7590,11 @@ mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1:
   dependencies:
     minimist "0.0.8"
 
+mobius1-selectr@^2.4.13:
+  version "2.4.13"
+  resolved "https://registry.npm.taobao.org/mobius1-selectr/download/mobius1-selectr-2.4.13.tgz#0019dfd9f984840d6e40f70683ab3ec78ce3b5df"
+  integrity sha1-ABnf2fmEhA1uQPcGg6s+x4zjtd8=
+
 moment@^2.21.0:
   version "2.24.0"
   resolved "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
@@ -7571,6 +7681,11 @@ nanomatch@^1.2.9:
     snapdragon "^0.8.1"
     to-regex "^3.0.1"
 
+nanopop@^1.3.0:
+  version "1.3.0"
+  resolved "https://registry.npm.taobao.org/nanopop/download/nanopop-1.3.0.tgz#831df018169fb0a699d55a8d70a2ecd82abe7d00"
+  integrity sha1-gx3wGBafsKaZ1VqNcKLs2Cq+fQA=
+
 natural-compare@^1.4.0:
   version "1.4.0"
   resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
@@ -8270,6 +8385,11 @@ photoswipe@^4.1.2:
   resolved "https://registry.npmjs.org/photoswipe/-/photoswipe-4.1.3.tgz#59f49494eeb9ddab5888d03392926a19bc197550"
   integrity sha512-89Z43IRUyw7ycTolo+AaiDn3W1EEIfox54hERmm9bI12IB9cvRfHSHez3XhAyU8XW2EAFrC+2sKMhh7SJwn0bA==
 
+picomodal@^3.0.0:
+  version "3.0.0"
+  resolved "https://registry.npm.taobao.org/picomodal/download/picomodal-3.0.0.tgz#facd30f4fbf34a809c1e04ea525f004f399c0b82"
+  integrity sha1-+s0w9PvzSoCcHgTqUl8ATzmcC4I=
+
 pify@^2.0.0:
   version "2.3.0"
   resolved "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -10650,10 +10770,10 @@ tinycolor2@^1.4.1:
   resolved "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"
   integrity sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=
 
-tinymce@^5.1.4:
-  version "5.2.0"
-  resolved "https://registry.npmjs.org/tinymce/-/tinymce-5.2.0.tgz#e838640f61c8a936317bc27a5d2e16c297df3418"
-  integrity sha512-Q7KAu9sLB6TBhKFdb2LHPGy770zkSEjpN1VRqZ6pxNuVQ0mbGWgMocHDvM9XL9yJaOhFrJP6s9XM7zG2gapGpA==
+tinymce@^5.3.2:
+  version "5.4.1"
+  resolved "https://registry.npm.taobao.org/tinymce/download/tinymce-5.4.1.tgz?cache=0&sync_timestamp=1594691790716&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftinymce%2Fdownload%2Ftinymce-5.4.1.tgz#4c101e78cbd22c148d6013f7c66eb0cb480723db"
+  integrity sha1-TBAeeMvSLBSNYBP3xm6wy0gHI9s=
 
 tmp@^0.0.33:
   version "0.0.33"
@@ -11023,6 +11143,13 @@ validate-npm-package-license@^3.0.1:
     spdx-correct "^3.0.0"
     spdx-expression-parse "^3.0.0"
 
+vanilla-picker@^2.10.1:
+  version "2.10.1"
+  resolved "https://registry.npm.taobao.org/vanilla-picker/download/vanilla-picker-2.10.1.tgz#b07d6df8e0c3655e39a7da11e68adc00affa2b12"
+  integrity sha1-sH1t+ODDZV45p9oR5orcAK/6KxI=
+  dependencies:
+    "@sphinxxxx/color-conversion" "^2.2.2"
+
 vary@~1.1.2:
   version "1.1.2"
   resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
@@ -11051,10 +11178,10 @@ verror@1.10.0:
     core-util-is "1.0.2"
     extsprintf "^1.2.0"
 
-viser-vue@^2.4.4:
+viser-vue@^2.4.8:
   version "2.4.8"
-  resolved "https://registry.npmjs.org/viser-vue/-/viser-vue-2.4.8.tgz#3fdb058445cba59c1ccee9cc9c2024bec29926d4"
-  integrity sha512-ERAREN+6k/ywrwT+swcMo4CDIAq6dBjnB0+lhmsSfaip06BGHSBfNKg6yl7/4GJ9Nk2kioUw3llNhEboJuIKmQ==
+  resolved "https://registry.npm.taobao.org/viser-vue/download/viser-vue-2.4.8.tgz#3fdb058445cba59c1ccee9cc9c2024bec29926d4"
+  integrity sha1-P9sFhEXLpZwczunMnCAkvsKZJtQ=
   dependencies:
     "@types/node" "*"
     viser "^2.0.0"
@@ -11086,10 +11213,10 @@ vue-area-linkage@^5.1.0:
   dependencies:
     lodash.find "^4.6.0"
 
-vue-cropper@^0.4.8:
-  version "0.4.9"
-  resolved "https://registry.npmjs.org/vue-cropper/-/vue-cropper-0.4.9.tgz#fe650f32516ecf29014bbd4a9079191c8dc5a5ae"
-  integrity sha512-Uf1i/sCh+ZqSM9hb2YTGRENzJFH+mvDuv8N2brGLjK7UBuF7XDP7zbis8g/dcqZiMojAcBDtObFCn4ERFbRMxQ==
+vue-cropper@^0.5.4:
+  version "0.5.5"
+  resolved "https://registry.npm.taobao.org/vue-cropper/download/vue-cropper-0.5.5.tgz?cache=0&sync_timestamp=1594806733920&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-cropper%2Fdownload%2Fvue-cropper-0.5.5.tgz#9bd1ba563c7faa268abd52fb2af4c6c28d33c962"
+  integrity sha1-m9G6Vjx/qiaKvVL7KvTGwo0zyWI=
 
 vue-eslint-parser@^2.0.3:
   version "2.0.3"