yangbifan 2 лет назад
Родитель
Сommit
631b79e873

+ 10 - 0
config/agdev.env.js

@@ -0,0 +1,10 @@
+'use strict'
+module.exports = {
+    NODE_ENV: '"production"',
+    ENV_CONFIG: '"agdev"',
+    ctx: '"http://finance.agilestar.cn:9501"',
+    ctxForm: '"http://finance.agilestar.cn:9500"',
+    excludeMeWhenSelectNextHandler: true,
+    excludeFormerHanlder: true,
+    envTitle: '"公司开发环境"'
+}

+ 15 - 0
config/dev.env.js

@@ -0,0 +1,15 @@
+'use strict'
+const merge = require('webpack-merge')
+const prodEnv = require('./prod.env')
+
+module.exports = merge(prodEnv, {
+  NODE_ENV: '"development"',
+  ENV_CONFIG: '"dev"',
+  ctx:'"http://127.0.0.1:8081"',
+  ctxForm: '"http://10.149.85.91:8880"',//dev
+  // ctxForm: '"http://43.138.50.94:8880"',//test
+  // ctxForm: '"http://192.168.2.124:8880"',//test
+  excludeMeWhenSelectNextHandler:false,
+  excludeFormerHanlder:false,
+  envTitle:'"本地开发环境"'
+})

+ 10 - 0
config/docker.env.js

@@ -0,0 +1,10 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"',
+  ENV_CONFIG: '"docker"',
+  ctx:'"http://172.21.137.102:9501"', 
+  ctxForm: '"http://172.21.137.102:9500"',
+  excludeMeWhenSelectNextHandler:true,
+  excludeFormerHanlder:true,
+  envTitle:'""'
+}

+ 88 - 0
config/index.js

@@ -0,0 +1,88 @@
+'use strict'
+// Template version: 1.2.7
+// see http://vuejs-templates.github.io/webpack for documentation.
+
+const path = require('path')
+// import common from '../src/assets/js/common.js';
+module.exports = {
+  dev: {
+
+    // Paths
+    assetsSubDirectory: 'static',
+    assetsPublicPath: '/',
+    proxyTable: {
+      // '/api':{
+      //     target:'http://192.168.1.79:8080',//common.ctx,//
+      //     changeOrigin:true,
+      //     pathRewrite:{
+      //         '^/api':''
+      //     }
+      // },
+      // '/ms':{
+      //   target:'http://192.168.1.79:8081',//common.ctxForm,//
+      //   changeOrigin:true,
+      //   pathRewrite:{
+      //       '^/ms':''
+      //   }
+      // }
+    },
+    // Various Dev Server settings
+    host: 'localhost', // can be overwritten by process.env.HOST
+    port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    autoOpenBrowser: false,
+    errorOverlay: true,
+    notifyOnErrors: true,
+    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
+
+    
+    /**
+     * Source Maps
+     */
+
+    // https://webpack.js.org/configuration/devtool/#development
+    devtool: 'eval-source-map',
+
+    // If you have problems debugging vue-files in devtools,
+    // set this to false - it *may* help
+    // https://vue-loader.vuejs.org/en/options.html#cachebusting
+    cacheBusting: true,
+
+    // CSS Sourcemaps off by default because relative paths are "buggy"
+    // with this option, according to the CSS-Loader README
+    // (https://github.com/webpack/css-loader#sourcemaps)
+    // In our experience, they generally work as expected,
+    // just be aware of this issue when enabling this option.
+    cssSourceMap: false,
+  },
+
+  build: {
+    // Template for index.html
+    index: path.resolve(__dirname, '../dist/index.html'),
+
+    // Paths
+    assetsRoot: path.resolve(__dirname, '../dist'),
+    assetsSubDirectory: 'static',
+    assetsPublicPath: './',
+
+    /**
+     * Source Maps
+     */
+
+    productionSourceMap: false,
+    // https://webpack.js.org/configuration/devtool/#production
+    devtool: '#source-map',
+
+    // Gzip off by default as many popular static hosts such as
+    // Surge or Netlify already gzip all static assets for you.
+    // Before setting to `true`, make sure to:
+    // npm install --save-dev compression-webpack-plugin
+    productionGzip: false,
+    productionGzipExtensions: ['js', 'css'],
+
+    // Run the build command with an extra argument to
+    // View the bundle analyzer report after build finishes:
+    // `npm run build --report`
+    // Set to `true` or `false` to always turn it on or off
+    bundleAnalyzerReport: process.env.npm_config_report,
+  }
+}

+ 11 - 0
config/prod.env.js

@@ -0,0 +1,11 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"',
+  ENV_CONFIG: '"prod"',
+  ctx:'"http://10.2.110.201:9501"',
+  ctxForm: '"http://10.2.110.201:9500"',
+  excludeMeWhenSelectNextHandler:true,
+  excludeFormerHanlder:true,
+  envTitle:'""'
+}
+

+ 10 - 0
config/test.env.js

@@ -0,0 +1,10 @@
+'use strict'
+module.exports = {
+  NODE_ENV: '"production"',
+  ENV_CONFIG: '"test"',
+  ctx:'"http://10.2.110.203:8601"',
+  ctxForm: '"http://10.2.110.203:8600"',
+  excludeMeWhenSelectNextHandler:true,
+  excludeFormerHanlder:true,
+  envTitle:'"测试环境"'
+}

Разница между файлами не показана из-за своего большого размера
+ 1349 - 0
src/assets/js/common.js


+ 45 - 0
src/assets/js/http.js

@@ -0,0 +1,45 @@
+
+import axios from 'axios'
+import common from "./common.js";
+import vue from '../../components/common/bus';
+axios.defaults.baseURL = common.ctx//'bus.common.ctx';//配置你的接口请求地址
+axios.defaults.headers.post['Content-Type'] = 'application/json';//'multipart/form-data';//配置请求头信息。
+
+
+// http response 拦截器
+axios.interceptors.response.use(
+  response => {
+    //vue.$store.commit('endLoading');
+    if(response.config.url.indexOf('8880')!=-1 || response.config.url.indexOf('8099')!=-1){
+      return response.data;
+    }else{
+      return response;
+    }
+  },
+  error => {
+    //vue.$store.commit('endLoading');
+    if (error.response) {
+      switch (error.response.status) {
+        case 401:
+          // 401 清除token信息并跳转到登录页面
+          vue.$store.commit('signOut');
+          vue.$router.push('/login');
+          break;
+        case 500:
+
+          vue.$store.commit('signOut');
+
+          vue.$router.push('/login');
+
+          break;
+        default:
+          break;
+      }
+    }
+    let msg = "系统出现错误,请重试";
+    vue.$message.error(msg);
+    return Promise.reject(msg)
+
+  });
+
+export default axios;

Разница между файлами не показана из-за своего большого размера
+ 1720 - 0
src/assets/js/url.js


+ 772 - 0
src/assets/js/util.js

@@ -0,0 +1,772 @@
+//
+// import accounting from 'accounting-js'
+// import idcard from 'idcard' //https://www.npmjs.com/package/idcard
+let moment = require("moment");
+let Decimal = require('decimal');
+let util = {
+   
+  ui: {
+
+  }
+};
+util.rules={ // 就是我们在el-form中绑定的rules,进行表单的验证
+  
+  name: { required: true, message: '必填项' },
+  id: { required: true, message: '必填项' },
+  code: { required: true, message: '必填项' },
+  email:[
+    { required: true, message: '必填项' },
+    { pattern:/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/, message: '填写正确邮箱格式' }
+  ],
+  mobile:[
+    { pattern:/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/, message: '填写正确手机号' }
+  ],
+  name1:[
+    { required: true, message: '必填项' },
+    { min: 1, max: 32, message: '长度在1 到 32之间', trigger: 'blur' }
+  ]
+ 
+}
+//前端权限校验
+util.hasPermission = function(permission) {
+  let vm = window.vue;
+  let permissions = vm.$store.state.app.user.userPermissions || [];
+  let found = permissions.includes(permission);
+
+  return found;
+};
+//获取前端地址参数对象
+util.getRequestSearchObject = function() {
+  var url = window.location.search; //获取url中"?"符后的字串
+  var theRequest = new Object();
+  if (url.indexOf("?") != -1) {
+    var str = url.substr(1);
+    strs = str.split("&");
+    for (var i = 0; i < strs.length; i++) {
+      //就是这句的问题
+      theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
+      //之前用了unescape()
+      //才会出现乱码
+    }
+  }
+  return theRequest;
+};
+//字符串转化为日期类型
+util.toLocalDate = function(input) {
+  if (!input) {
+    return null;
+  }
+  let a = moment(input);
+
+  let b = a.toDate();
+  return b;
+};
+//根据数据字典Id,获取显示名称
+util.dataDicFormat = function(dicType, dicId) {
+  if (!dicId) {
+    return '';
+  }
+  let dic = tapp.datadictionary[dicType];
+  if (!dic) {
+    return '';
+  }
+
+  let dicItem = dic.find(i => i.Id === dicId);
+  if (!dicItem) {
+    return '';
+  }
+  return dicItem.Name || '';
+};
+//根据数据字典Id列表,获取用','分隔的显示名称
+util.dataDicsFormat = function(dicType, dicIds) {
+  if (!dicIds) {
+    return '';
+  }
+  let dic = tapp.datadictionary[dicType];
+  if (!dic) {
+    return '';
+  }
+  let checkedDicItemIds = dicIds.split(',');
+  let dicItems = dic.filter(i => checkedDicItemIds.includes(i.Id));
+  return dicItems.map(p => p.Name).join(",");
+};
+//根据字典类别生成grid探件的过滤条件
+util.getListDataDicFilters = function(dicType) {
+    let data = tapp.datadictionary[dicType];
+    if (!data) {
+      return [];
+    }
+    return data.map(p => {
+      return {
+        text: p.Name,
+        value: p.Id
+      };
+    });
+  },
+  //日期时间格式化,:YYYY-MM-DD HH:mm:ss格式
+  util.datetimeFormat = function(input) {
+    if (!input) {
+      return '';
+    }
+    let a = moment(input).utc(8);
+    return a.format('YYYY-MM-DD HH:mm:ss');
+  };
+//日期格式化,:YYYY-MM-DD格式
+util.dateFormat = function(input) {
+  if (!input) {
+    return '';
+  }
+  let a = moment(input).utc(8);
+  return a.format('YYYY-MM-DD');
+};
+//根据输入datePattern做日期格式化
+util.datePatternFormat = function(input, fmt) {
+  if (!input) {
+    return '';
+  }
+  let a = moment(input).utc(8);
+  return a.format(fmt);
+};
+//货币格式化,如:数字输入100000,格式化后:¥100,000
+// util.moneyFormat = function(input) {
+//   if (input == null) {
+//     return '';
+//   }
+//   let s = accounting.formatMoney(input, {
+//     symbol: '¥',
+
+//   })
+//   return s;
+// };
+//货币阿拉伯数字转中文大写格式
+util.moneyArabiaToChinese = function(Num) {
+  let isNegative = false; // 是否负数
+  if (Num < 0) {
+    Num = -Num;
+    isNegative = true;
+  }
+  if (typeof Num == 'number') {
+    Num = Num.toString();
+  }
+  for (var i = Num.length - 1; i >= 0; i--) {
+    Num = Num.replace(",", ""); // 替换money中的“,”
+    Num = Num.replace(" ", ""); // 替换money中的空格
+  }
+  Num = Num.replace("¥", ""); // 替换掉可能出现的¥字符
+  if (isNaN(Num)) { // 验证输入的字符是否为数字
+    return;
+  }
+  // ---字符处理完毕,开始转换,转换采用前后两部分分别转换---//
+  let part = String(Num).split(".");
+  let newchar = "";
+  // 小数点前进行转化
+  for (let i = part[0].length - 1; i >= 0; i--) {
+    if (part[0].length > 10) {
+      alert("位数过大,无法计算");
+      return "";
+    } // 若数量超过拾亿单位,提示
+    let tmpnewchar = "";
+    let perchar = part[0].charAt(i);
+    switch (perchar) {
+      case "0":
+        tmpnewchar = "零" + tmpnewchar;
+        break;
+      case "1":
+        tmpnewchar = "壹" + tmpnewchar;
+        break;
+      case "2":
+        tmpnewchar = "贰" + tmpnewchar;
+        break;
+      case "3":
+        tmpnewchar = "叁" + tmpnewchar;
+        break;
+      case "4":
+        tmpnewchar = "肆" + tmpnewchar;
+        break;
+      case "5":
+        tmpnewchar = "伍" + tmpnewchar;
+        break;
+      case "6":
+        tmpnewchar = "陆" + tmpnewchar;
+        break;
+      case "7":
+        tmpnewchar = "柒" + tmpnewchar;
+        break;
+      case "8":
+        tmpnewchar = "捌" + tmpnewchar;
+        break;
+      case "9":
+        tmpnewchar = "玖" + tmpnewchar;
+        break;
+    }
+    switch (part[0].length - i - 1) {
+      case 0:
+        tmpnewchar = tmpnewchar + "元";
+        break;
+      case 1:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "拾";
+        break;
+      case 2:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "佰";
+        break;
+      case 3:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "仟";
+        break;
+      case 4:
+        tmpnewchar = tmpnewchar + "万";
+        break;
+      case 5:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "拾";
+        break;
+      case 6:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "佰";
+        break;
+      case 7:
+        if (perchar != 0)
+          tmpnewchar = tmpnewchar + "仟";
+        break;
+      case 8:
+        tmpnewchar = tmpnewchar + "亿";
+        break;
+      case 9:
+        tmpnewchar = tmpnewchar + "拾";
+        break;
+    }
+    newchar = tmpnewchar + newchar;
+  }
+  // 小数点之后进行转化
+  if (Num.indexOf(".") != -1) {
+    if (part[1].length > 2) {
+      alert("小数点之后只能保留两位,系统将自动截段");
+      part[1] = part[1].substr(0, 2);
+    }
+    for (var i = 0; i < part[1].length; i++) {
+      let tmpnewchar = "";
+      let perchar = part[1].charAt(i);
+      switch (perchar) {
+        case "0":
+          tmpnewchar = "零" + tmpnewchar;
+          break;
+        case "1":
+          tmpnewchar = "壹" + tmpnewchar;
+          break;
+        case "2":
+          tmpnewchar = "贰" + tmpnewchar;
+          break;
+        case "3":
+          tmpnewchar = "叁" + tmpnewchar;
+          break;
+        case "4":
+          tmpnewchar = "肆" + tmpnewchar;
+          break;
+        case "5":
+          tmpnewchar = "伍" + tmpnewchar;
+          break;
+        case "6":
+          tmpnewchar = "陆" + tmpnewchar;
+          break;
+        case "7":
+          tmpnewchar = "柒" + tmpnewchar;
+          break;
+        case "8":
+          tmpnewchar = "捌" + tmpnewchar;
+          break;
+        case "9":
+          tmpnewchar = "玖" + tmpnewchar;
+          break;
+      }
+      if (i == 0)
+        tmpnewchar = tmpnewchar + "角";
+      if (i == 1)
+        tmpnewchar = tmpnewchar + "分";
+      newchar = newchar + tmpnewchar;
+    }
+  }
+  // 替换所有无用汉字
+  while (newchar.search("零零") != -1)
+    newchar = newchar.replace("零零", "零");
+  newchar = newchar.replace("零亿", "亿");
+  newchar = newchar.replace("亿万", "亿");
+  newchar = newchar.replace("零万", "万");
+  newchar = newchar.replace("零元", "元");
+  newchar = newchar.replace("零角", "");
+  newchar = newchar.replace("零分", "");
+
+  if (newchar.charAt(newchar.length - 1) == "元" || newchar.charAt(newchar.length - 1) == "角") {
+    newchar = newchar + "整";
+  }
+
+  if (isNegative) {
+    newchar = '负' + newchar;
+  }
+
+  return newchar;
+};
+//百分比格式化,如0.15,格式化后 15%
+// util.percentFormat = function(input) {
+//   if (input == null) {
+//     return '';
+//   }
+
+//   let s = accounting.formatMoney(input, {
+//     symbol: '%',
+//     format: "%v %s"
+//   })
+//   return s;
+// };
+//验证输入字符串是否是有效的手机号码
+util.verifyMobile = function(str) {
+  let re = /^1\d{10}$/;
+  return re.test(str);
+};
+//验证输入字符串字符是否都是数字
+util.verifyNumber = function(str) {
+  let re = /^\d+(?=\.{0,1}\d+$|$)/ ;
+  return re.test(str);
+};
+//验证输入日期是否小于等于当前日期
+util.verifyLTDateNow = function(input) {
+  let a = moment(input);
+  let b = a.toDate();
+  let r = b <= Date.now();
+  return r;
+};
+//验证输入日期是否大于等于当前日期
+util.verifyGTDateNow = function(input) {
+  let now = new Date();
+  let a = moment(input);
+  let b = a.toDate();
+  let r = b >= new Date(now.getFullYear(),now.getMonth(),now.getDate());
+  return r;
+};
+//验证输入字符串字符是否有效的身份证号码
+util.verifyIdCard = function(input) {
+  if (input == null) {
+    return true;
+  }
+  return idcard.verify(input);
+};
+// 解析身份证号码字符串的信息
+util.parseIdCard = function(input) {
+  if (input == null) {
+    return '';
+  }
+
+  let cardNoInfo = idcard.info(input);
+  if (cardNoInfo && cardNoInfo.valid) {
+    let birthdayStr = cardNoInfo.birthday.toString();
+    cardNoInfo.birthdayString = birthdayStr.substr(0, 4) + "-" +
+      birthdayStr.substr(4, 2) +
+      "-" +
+      birthdayStr.substr(6, 2) +
+      " 00:00:00";
+  }
+  return cardNoInfo;
+};
+// 转化替换-年月日
+util.TimeLanguage = function (row, column,cellValue) {
+  if (!cellValue) {
+    return '';
+  }
+  moment.locale('zh-cn')
+  return moment(cellValue).format('LL');
+}
+//修改当前网页标题
+util.ui.title = function(title) {
+  title = title || window.SITE_CONFIG.appName;
+  window.document.title = title;
+};
+//关闭导航tab,formName:关闭的导航name,toName:激活的导航name,如果已打开则激活,如果未打开,则打开页面
+util.closeTabNav = function(fromName, toName) {
+
+  if (!fromName) {
+    return;
+  }
+  let vm = window.vue;
+  let contentTabsActiveName = vm.$store.state.ui.contentTabsActiveName;
+  var newTabs = vm.$store.state.ui.contentTabs.filter(item => item.name !== fromName);
+
+  vm.$store.commit('UPDATE_CONTENT_TABS', newTabs);
+  if (newTabs == null || newTabs.length == 0) {
+    vm.$router.push({
+      path: '/'
+    }, () => {
+      vm.$store.commit('UPDATE_CONTENT_TABS', []);
+    })
+    return;
+  }
+  if (toName) {
+    let routerObj = newTabs.find(p => {
+      return p.name == toName
+    })
+
+    vm.$router.push({
+      // 'name': routerObj.name
+      path: routerObj.url
+    }, () => {
+      vm.$store.commit('UPDATE_CONTENT_TABS', newTabs);
+      vm.$store.commit('UPDATE_CONTENT_TABS_ACTIVE_NAME', routerObj.name);
+    })
+  }
+};
+//关闭当前导航tab并激活toName导航,toName:激活的导航name,如果已打开则激活,如果未打开,则打开页面
+util.closeCurrentTabNav = function(toName) {
+  let vm = window.vue;
+  if (!vm.$router.currentRoute) {
+    return;
+  }
+  let fromName = vm.$router.currentRoute.name;
+  util.closeTabNav(fromName, toName);
+};
+//遍历树形实体(服务器端定义有树形结构)
+util.retriveTree = function(items, func) {
+  function innerRetriveTrees(nodes) {
+    for (let i = 0; i < nodes.length; i++) {
+      let node = nodes[i];
+      func(node);
+
+      if (node.items && node.items.length > 0) {
+        innerRetriveTrees(nodes[i].items);
+      }
+    }
+  }
+  innerRetriveTrees(items);
+}
+//读取树形实体的所有叶子结点
+util.getTreeLeafNodes = function(nodes) {
+  let leaftNodes = [];
+  util.retriveTree(nodes, (node) => {
+    if (!node.items || node.items.length == 0) {
+      leaftNodes.push(node);
+    }
+  })
+  return leaftNodes;
+};
+//树形实体转换为数组结构
+util.treeToArray = function(nodes) {
+  let allnodes = [];
+
+  util.retriveTree(nodes, (node) => {
+    let {
+      self
+    } = node;
+    Object.assign(node, self);
+    if (node._expanded === undefined) {
+      node._expanded = true;  
+    }
+    allnodes.push(node);
+  })
+  return allnodes;
+};
+//设置cookie
+util.setCookie = function(cname, cvalue, exdays) {
+  var d = new Date();
+  d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
+  var expires = "expires=" + d.toUTCString();
+  document.cookie = cname + "=" + escape(cvalue) + "; " + expires;
+};
+//获取cookie
+util.getCookie = function(cname) {
+  var name = cname + "=";
+  var ca = document.cookie.split(';');
+  for (var i = 0; i < ca.length; i++) {
+    var c = ca[i];
+    while (c.charAt(0) == ' ') c = c.substring(1);
+    if (c.indexOf(name) != -1) return unescape(c.substring(name.length, c.length));
+  }
+  return "";
+};
+//清除cookie
+util.clearCookie = function(cname) {
+  util.setCookie(cname, "", -1);
+};
+// 根据文件名后缀区分 文件类型
+util.getFileType = function(fileName) {
+  /*
+   * @param: fileName - 文件名称
+   * @param: 数据返回 1) 无后缀匹配 - false
+   * @param: 数据返回 2) 匹配图片 - image
+   * @param: 数据返回 3) 匹配 txt - txt
+   * @param: 数据返回 4) 匹配 excel - excel
+   * @param: 数据返回 5) 匹配 word - word
+   * @param: 数据返回 6) 匹配 pdf - pdf
+   * @param: 数据返回 7) 匹配 ppt - ppt
+   * @param: 数据返回 8) 匹配 视频 - video
+   * @param: 数据返回 9) 匹配 音频 - audio
+   * @param: 数据返回 10) 其他匹配项 - other
+   */
+
+
+
+  // 后缀获取
+  var suffix = '';
+  // 获取类型结果
+  var result = '';
+  try {
+
+    var flieArr = fileName.split('.');
+    suffix = flieArr[flieArr.length - 1];
+  } catch (err) {
+    suffix = '';
+  }
+  // fileName无后缀返回 false
+
+  if (!suffix) {
+    result = false;
+    return result;
+  }
+  // 图片格式
+  var imglist = ['png', 'jpg', 'jpeg', 'bmp', 'gif'];
+  // 进行图片匹配
+  result = imglist.some(function(item) {
+    return item == suffix;
+  });
+  if (result) {
+    result = 'image';
+    return result;
+  };
+
+  // 匹配txt
+  var txtlist = ['txt'];
+  result = txtlist.some(function(item) {
+    return item == suffix;
+  });
+  if (result) {
+    result = 'txt';
+    return result;
+  };
+  // 匹配 excel
+  var excelist = ['xls', 'xlsx'];
+  result = excelist.some(function(item) {
+    return item == suffix;
+  });
+  if (result) {
+    result = 'excel';
+    return result;
+  };
+  // 匹配 word
+  var wordlist = ['doc', 'docx'];
+  result = wordlist.some(function(item) {
+    return item == suffix;
+  });
+  if (result) {
+    result = 'word';
+    return result;
+  };
+  // 匹配 pdf
+  var pdflist = ['pdf'];
+  result = pdflist.some(function(item) {
+    return item == suffix;
+  });
+
+  if (result) {
+    result = 'pdf';
+    return result;
+  };
+
+  // 匹配 ppt
+  var pptlist = ['ppt'];
+  result = pptlist.some(function(item) {
+    return item == suffix;
+  });
+
+  if (result) {
+    result = 'ppt';
+    return result;
+  };
+
+
+  // 匹配 视频
+  var videolist = ['mp4', 'm2v', 'mkv'];
+  result = videolist.some(function(item) {
+    return item == suffix;
+  });
+
+  if (result) {
+    result = 'video';
+    return result;
+  };
+
+  // 匹配 音频
+  var radiolist = ['mp3', 'wav', 'wmv'];
+  result = radiolist.some(function(item) {
+    return item == suffix;
+  });
+  if (result) {
+    result = 'audio';
+    return result;
+
+  }
+  // 其他 文件类型
+  result = 'other';
+  return result;
+};
+util.download = function(fileName, url, params) {
+  window.vue.$http.request({
+    url: url,
+    method: 'post',
+    data: params,
+    responseType: 'blob'
+  }).then(res => {
+    const content = res
+    const blob = new Blob([content])
+    if ('download' in document.createElement('a')) { // 非IE下载
+      const elink = document.createElement('a')
+      elink.download = fileName
+      elink.style.display = 'none'
+      elink.href = URL.createObjectURL(blob)
+      document.body.appendChild(elink)
+      elink.click()
+      URL.revokeObjectURL(elink.href) // 释放URL 对象
+      document.body.removeChild(elink)
+    } else { // IE10+下载
+      navigator.msSaveBlob(blob, fileName)
+    }
+  }).catch(err => {
+    alert(err);
+  })
+};
+util.YYMM = function (row, column,cellValue){
+  return util.datetimeFormat(cellValue)
+}
+util.toFixed2 = function (row, column,cellValue){
+  if(!cellValue){
+    return '';
+  }
+  return cellValue.toFixed(2)
+}
+util.ThNum = function (row, column,cellValue){
+  let a = cellValue;
+  if (!cellValue){
+    return '0.00'
+  }
+  cellValue = Number(cellValue)
+ 
+  if(!(typeof(cellValue)=="number")||isNaN(cellValue)){
+    
+    return '-'
+  }
+  // cellValue = (new Decimal(cellValue).div(100)).toFixed(2);
+  // cellValue = (new Decimal(cellValue).div(100));
+  let dcmlVal = new Decimal(cellValue).div(100);
+  if(dcmlVal.toFixed){
+      dcmlVal = (new Decimal(cellValue).div(100)).toFixed(2)
+  }else{
+      dcmlVal = (new Decimal(cellValue).div(100)).toNumber().toFixed(2)
+  }
+  cellValue = dcmlVal;//
+    
+  var intPart =  cellValue.toString().split(".")[0] // 获取整数部分
+
+  var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
+  intPartFormat= intPartFormat+"."+cellValue.toString().split(".")[1]
+  if(!intPartFormat){
+    intPartFormat = 0.00;
+  }
+  
+  return intPartFormat
+}
+util.ThNum4 = function (row, column,cellValue){
+  let a = cellValue;
+  if (!cellValue){
+    return '0.00'
+  }
+  cellValue = Number(cellValue)
+ 
+  if(!(typeof(cellValue)=="number")||isNaN(cellValue)){
+    
+    return '——'
+  }
+  // cellValue = (new Decimal(cellValue).div(100)).toFixed(2);
+  // cellValue = (new Decimal(cellValue).div(100));
+  let dcmlVal = new Decimal(cellValue).div(100);
+  if(dcmlVal.toFixed){
+      dcmlVal = (new Decimal(cellValue).div(100)).toFixed(4)
+  }else{
+      dcmlVal = (new Decimal(cellValue).div(100)).toNumber().toFixed(4)
+  }
+  cellValue = dcmlVal;//
+    
+  var intPart =  cellValue.toString().split(".")[0] // 获取整数部分
+
+  var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
+  intPartFormat= intPartFormat+"."+cellValue.toString().split(".")[1]
+  if(!intPartFormat){
+    intPartFormat = 0.00;
+  }
+  
+  return intPartFormat
+}
+ 
+util.YYMMDD = function (row, column,cellValue){
+  return util.dateFormat(cellValue)
+}
+util.ThNumW = function (row, column,cellValue) {
+
+  if (!cellValue) return ' '
+  if(!(typeof(cellValue)=="number")||isNaN(cellValue)){
+
+      return '——'
+  }
+  // cellValue = (new Decimal(cellValue).div(1000000)).toFixed(2);
+  // cellValue = (new Decimal(cellValue).div(100));
+  let dcmlVal = new Decimal(cellValue).div(1000000);
+  if(dcmlVal.toFixed){
+      dcmlVal = (new Decimal(cellValue).div(1000000)).toFixed(2)
+  }else{
+      dcmlVal = (new Decimal(cellValue).div(1000000)).toNumber().toFixed(2)
+  }
+  cellValue = dcmlVal;//
+   
+  var intPart =  cellValue.toString().split(".")[0] // 获取整数部分
+
+  var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断
+  intPartFormat= intPartFormat+"."+cellValue.toString().split(".")[1]
+  
+  return intPartFormat
+   
+  
+}
+util.dieTausendstel = function (model,str,num=2){
+  // var value = modelp[str].toString();
+  var amount = model[str];
+  if(Object.is(Number(amount),NaN)) return  model[str] = '0.00'
+  if (amount) {
+    model[str] = Number(model[str]).toFixed(num)
+    var intPart =  model[str].toString().split(".")[0] // 获取整数部分
+    var intpart1 = model[str].toString().split(".")[1]
+    intPart= intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') ;
+     
+    if(intpart1){
+      model[str] = intPart+"."+intpart1 
+    }else{
+      model[str] = intPart+".00"
+    }
+    return model[str];
+  }
+}
+util.rushTausendstel = function (model,str){
+  var amount = model[str];
+  if (amount) {
+      
+      var intPart =  model[str].toString().split(".")[0] // 获取整数部分
+      var intpart1 = model[str].toString().split(".")[1]
+      
+      if(intPart.indexOf(",")>0){
+        intPart = intPart.replace(/,/g,"")
+      }
+      if(intpart1){
+        model[str] = intPart+"."+intpart1 
+      }else{
+        model[str] = intPart+".00"
+      }
+      return model[str];
+  }
+}
+
+export default util;

+ 6 - 0
src/components/common/bus.js

@@ -0,0 +1,6 @@
+import Vue from 'vue';
+
+// 使用 Event Bus
+const bus = new Vue();
+
+export default bus;

+ 9 - 0
src/components/components/approvalDialog/index-mixins.js

@@ -0,0 +1,9 @@
+export default {
+  created() {
+    processDefinitionKey.call(this, this.processDefinitionKey, false)
+  }
+}
+export const processDefinitionKey = function(processDefinitionKey, isGetService) {
+ 
+  
+}

+ 16 - 0
src/components/components/approvalDialog/index.vue

@@ -0,0 +1,16 @@
+<script>
+import index from './index-mixins'
+export default {
+  mixins:[index],
+  name: 'rootApprovaComponent',
+  data() {
+    return {}
+  },
+  props: {
+    processDefinitionKey: {
+      type: String,
+      default: '',
+    }
+  }
+}
+</script>

+ 4 - 0
src/config/index.js

@@ -0,0 +1,4 @@
+'use strict'
+// 根据环境引入不同配置 process.env.ENV_CONFIG  ex:dev.conf.js
+const config = require('../../config/dev.env')
+module.exports = config

+ 9 - 1
src/main.js

@@ -11,12 +11,20 @@ import './assets/mc-inconfont/iconfont.css'
 import fullscreen from 'vue-fullscreen'
 import VueContextMenu from 'vue-contextmenu'
 
+import Urls from './assets/js/url.js' //路径共用
+import util from './assets/js/util.js'
+import common from './assets/js/common.js' //公共注册
+import http from './assets/js/http.js'
+
 import FormMaking from 'form-making'
 import 'form-making/dist/FormMaking.css'
 import VueEditor from "vue2-editor"
 Vue.use(VueEditor)
 Vue.use(FormMaking)
-
+Vue.prototype.$url = Urls
+Vue.prototype.$util = util
+Vue.prototype.common = common
+Vue.prototype.$axios = http //axios 设置
 Vue.use(fullscreen)
 Vue.use(VueCookie);
 Vue.use(VueContextMenu)