import Vue from 'vue' import axios from './router/axios' import VueAxios from 'vue-axios' import App from './App' import router from './router/router' import Pagination from './components/Pagination' import './permission' // 权限 import './error' // 日志 import './cache' //页面缓存 import store from './store' import { loadStyle, getFormatDate, exportFile } from './util/util' import * as urls from '@/config/env' import Element from 'element-ui' import { iconfontUrl, iconfontVersion } from '@/config/env' import i18n from './lang' // Internationalization import './styles/common.scss' import './styles/index.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 { currencyGainSymbol } from '@/api/currencyType/currency' import md5 from 'js-md5' import { selectDictLabel, getDictToLabel, selectConstantLabel, resetForm, moneyFormat, sort, getFileType, handleTree, selectConstantsLabel, selectConstantsLabelRemark, selectTenantLabel, accordingToValueShowLabel, feedbackLabel, onPreview, } from '@/util/saas' // import { getDays, getNearDays, dateFormat } from '@/util/date' import { getDays, getNearDays, pickerOptions } from '@/util/date' import Prevent from '@/plugs/preventRepeatClick' import Print from '@/plugs/print.js' //打印功能 import 'echarts-gl' import './world.js' import './icons' import animate from 'animate.css' //动画 import VueLazyload from 'vue-lazyload' //图片懒加载 import Contextmenu from 'vue-contextmenujs' //右击菜单 import ViewUI from 'view-design' import VueWechatTitle from 'vue-wechat-title' import './util/table2excel' // global table2excel // import 'view-design/dist/styles/iview.css'; import VueBarcode from 'vue-barcode' import htmlToPdf from "@/util/htmlToPdf" Vue.prototype.selectConstantsLabel = selectConstantsLabel Vue.prototype.selectConstantsLabelRemark = selectConstantsLabelRemark Vue.prototype.selectTenantLabel = selectTenantLabel Vue.prototype.feedbackLabel = feedbackLabel Vue.prototype.onPreview = onPreview // 全局方法挂载,树型 Vue.prototype.handleTree = handleTree //全局方法挂载,前缀货币计算 Vue.prototype.currencyGainSymbol = currencyGainSymbol Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectConstantLabel = selectConstantLabel Vue.prototype.getDictToLabel = getDictToLabel Vue.prototype.getFormatDate = getFormatDate Vue.prototype.exportFile = exportFile Vue.prototype.website = website Vue.prototype.resetForm = resetForm Vue.prototype.moneyFormat = moneyFormat Vue.prototype.sort = sort Vue.prototype.getFileType = getFileType Vue.prototype.accordingToValueShowLabel = accordingToValueShowLabel // Vue.prototype.dateFormat = dateFormat 会与element底层处理日期的函数命名冲突 Vue.prototype.getDays = getDays Vue.prototype.getNearDays = getNearDays Vue.prototype.pickerOptions = pickerOptions //全局引入md5加密 Vue.prototype.$md5 = md5 // 注册全局crud驱动 window.$crudCommon = crudCommon // 加载Vue拓展 Vue.use(router) Vue.use(VueAxios, axios) Vue.use(Pagination) Vue.use(Print) Vue.use(Prevent) Vue.use(animate) Vue.use(Contextmenu) Vue.use(ViewUI) Vue.use(VueWechatTitle) Vue.use(htmlToPdf) const errImg = require('./assets/images/empty.png') // const loadingImg = require('./assets/images/loading-spin.svg') Vue.use(VueLazyload, { preLoad: 1.3, error: errImg, // loading: loadingImg, attempt: 1, listenEvents: ['scroll'], }) Element.Select.props.filterable = { type: Boolean, default: true, } Element.Select.props.clearable = { type: Boolean, default: true, } Element.Dialog.props.closeOnClickModal.default = false 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.component('basicContainer', basicContainer) Vue.component('basicBlock', basicBlock) Vue.component('thirdRegister', thirdRegister) Vue.component('avueUeditor', avueUeditor) Vue.component('Pagination', Pagination) Vue.component('barcode', VueBarcode) // 加载相关url地址 Object.keys(urls).forEach((key) => { Vue.prototype[key] = urls[key] }) // 动态加载阿里云字体库 iconfontVersion.forEach((ele) => { loadStyle(iconfontUrl.replace('$key', ele)) }) Vue.prototype.msgSuccess = function (msg) { this.$message({ showClose: true, message: msg, type: 'success' }) } Vue.prototype.msgError = function (msg) { this.$message({ showClose: true, message: msg, type: 'error' }) } Vue.prototype.msgWarning = function (msg) { this.$message({ showClose: true, message: msg, type: 'warning' }) } Vue.prototype.msgInfo = function (msg) { this.$message.info(msg) } Vue.config.productionTip = false new Vue({ router, store, i18n, data: function () { return { search: '', mailbox: '', mailRefresh: '', busiId: '', mailHost: '', formPath: '', } }, render: (h) => h(App), }).$mount('#app')