| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 | import Vue from 'vue';import axios from './router/axios';import VueAxios from 'vue-axios';import App from './App';import router from './router/router';import './permission'; // 权限import './error'; // 日志import './cache'; //页面缓存import store from './store';import {  loadStyle} from './util/util'import * as urls from '@/config/env';import Element from 'element-ui';import {  iconfontUrl,  iconfontVersion} from '@/config/env';import i18n from './lang'; // Internationalizationimport './styles/common.scss';import basicBlock from './components/basic-block/main';import basicContainer from './components/basic-container/main';import thirdRegister from './components/third-register/main';import avueUeditor from 'avue-plugin-ueditor';import website from '@/config/website';import crudCommon from '@/mixins/crud';import format from 'vue-text-format'; //v-formatimport {  getWorkDicts} from '@/api/system/dictbiz'import { checkLock, onLock, unLock } from "@/api/lock/lock"import './util/directives.js'//客户选择组件import selectComponent from '@/components/selectComponent/customerSelect';// 仓库选择组件import warehouseSelect from '@/components/warehouseSelect/index';// 商品选择组件import goodsSelect from '@/components/goodsSelect/index';//费用选择组件import breakdownSelect from '@/components/costBreakdown/costBreakdown';//用户选择组件import userSelect from '@/components/selectComponent/userSelect';//用户选择组件重新封装import userCom from '@/components/selectComponent/userCom';//重新封装了客户选择组件import cropSelect from "@/components/crop-select/main";// 发送消息㢟import messagePost from "@/components/messageSend/main"// 更改审批人import changeApprove from "@/components/change-approve/main"//枚举列设置名称管理import {  getColumnName} from "@/enums/column-name"import {  getColumnData,  saveColumnData,  delColumnData} from "@/util/columnSetting"//查看是否有锁import {  checkLocks} from "@/util/lock"import {  inDetailsKey,  leaveDetailsKey} from "@/util/keyData"// 导入弹窗放大样式import '@/assets/css/form.css'// 客户调出收发货地址import {corpAddr} from "@/components/function/corpAddrSelect"//获取浏览器指纹并生成IDimport Fingerprint2 from 'fingerprintjs2'Vue.component('selectComponent', selectComponent);Vue.component('warehouseSelect', warehouseSelect);Vue.component('goodsSelect', goodsSelect);Vue.component('breakdownSelect', breakdownSelect);Vue.component('userCom', userCom);Vue.component('userSelect', userSelect);Vue.component('cropSelect', cropSelect);Vue.component('messagePost', messagePost);Vue.component('changeApprove', changeApprove)import portInfo from "@/components/port-info/index";Vue.component('portInfo', portInfo);// 注册全局crud驱动window.$crudCommon = crudCommon;// 加载Vue拓展Vue.use(router);Vue.use(VueAxios, axios);Vue.use(Element, {  i18n: (key, value) => i18n.t(key, value)});Vue.use(window.AVUE, {  size: 'small',  tableSize: 'small',  calcHeight: 65,  i18n: (key, value) => i18n.t(key, value)});Vue.use(format); //v-format// 注册全局容器Vue.component('basicContainer', basicContainer);Vue.component('basicBlock', basicBlock);Vue.component('thirdRegister', thirdRegister);//此处有个问题,下面这句不能使用// Vue.component('avueUeditor', avueUeditor);Vue.use(avueUeditor);//自定义标题import containerTitle from './components/titleComponent/main.vue';Vue.component('containerTitle', containerTitle);//注册echarts图表import * as echarts from 'echarts';Vue.prototype.$echarts = echarts//上传组件uploadimport cUpload from './components/upload'Vue.component('cUpload', cUpload)// 加载相关url地址Object.keys(urls).forEach(key => {  Vue.prototype[key] = urls[key];});// 加载websiteVue.prototype.website = website;// 业务字典Vue.prototype.getWorkDicts = getWorkDicts// 动态加载阿里云字体库iconfontVersion.forEach(ele => {  loadStyle(iconfontUrl.replace('$key', ele));});//枚举列设置名称管理Vue.prototype.getColumnName = getColumnNameVue.prototype.getColumnData = getColumnDataVue.prototype.saveColumnData = saveColumnDataVue.prototype.delColumnData=delColumnData//进入详情页时,保存id和其他参数Vue.prototype.inDetailsKey=inDetailsKey//离开详情页时,清除对应key的id和其他参数Vue.prototype.leaveDetailsKey=leaveDetailsKeyVue.config.productionTip = false;Vue.prototype.corpAddr = corpAddr;// 业务锁Vue.prototype.checkLock = checkLock;Vue.prototype.onLock = onLock;Vue.prototype.unLock = unLock;Vue.prototype.checkLocks = checkLocks;new Vue({  router,  store,  i18n,  render: h => h(App)}).$mount('#app');Vue.directive("input-limit", {  bind(el, binding) {    var wins_0 = /[^\d]/g //整数判断    var wins_1 = /[^\d^\.]/g //小数判断    var flag = true;    var points = 0;    var lengths = 0    var remainder = 0    var no_int = 0    const target = el instanceof HTMLInputElement ? el : el.querySelector("input");    target.addEventListener("compositionstart", e => {      flag = false;    });    target.addEventListener("compositionend", e => {      flag = true;    });    target.addEventListener("input", e => {      setTimeout(function() {        if (flag) {          if (binding.value == 0) {            if (wins_0.test(e.target.value)) {              e.target.value = e.target.value.replace(wins_0, "");              e.target.dispatchEvent(new Event("input")) //手动更新v-model值            }          }          if (binding.value == 1) {            if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {              remainder = true            }            if ((e.target.value.split('.')).length - 1 > 1) {              points = true            }            if (e.target.value.toString().split(".")[1] != undefined) {              if (e.target.value.toString().split(".")[1].length > 1) {                lengths = true              }            }            if (e.target.value.toString().indexOf(".") != -1) {              no_int = false            } else {              no_int = true            }            if (wins_1.test(e.target.value) || lengths || points || remainder) {              if (!no_int) {                e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(                  '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(                  ".") + 2)              } else {                e.target.value = e.target.value.replace(wins_0, "")              }              e.target.dispatchEvent(new Event("input"))            }          }          if (binding.value == 2) {            if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {              remainder = true            }            if ((e.target.value.split('.')).length - 1 > 1) {              points = true            }            if (e.target.value.toString().split(".")[1] != undefined) {              if (e.target.value.toString().split(".")[1].length > 2) {                lengths = true              }            }            if (e.target.value.toString().indexOf(".") != -1) {              no_int = false            } else {              no_int = true            }            if (wins_1.test(e.target.value) || lengths || points || remainder) {              if (!no_int) {                e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(                  '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(                  ".") + 3)              } else {                e.target.value = e.target.value.replace(wins_0, "")              }              e.target.dispatchEvent(new Event("input"))            }          }          if (binding.value == 4) {            if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {              remainder = true            }            if ((e.target.value.split('.')).length - 1 > 1) {              points = true            }            if (e.target.value.toString().split(".")[1] != undefined) {              if (e.target.value.toString().split(".")[1].length > 4) {                lengths = true              }            }            if (e.target.value.toString().indexOf(".") != -1) {              no_int = false            } else {              no_int = true            }            if (wins_1.test(e.target.value) || lengths || points || remainder) {              if (!no_int) {                e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(                  '$#$', '.').substring(0, e.target.value.indexOf(                  ".") + 5)              } else {                e.target.value = e.target.value.replace(wins_0, "")              }              e.target.dispatchEvent(new Event("input"))            }          }        }      }, 0)    })  }})Fingerprint2.get(function(components) {  const values = components.map(function(component,index) {    if (index === 0) {      return component.value.replace(/\bNetType\/\w+\b/, '')    }    return component.value  })  // 生成最终id murmur  const murmur = Fingerprint2.x64hash128(values.join(''), 31)  if(localStorage.getItem('browserID')!=murmur){    localStorage.setItem('browserID',murmur)  }})
 |