import Vue from 'vue' import 'normalize.css/normalize.css' // 用于加载页面时上面的加载动画条。 import Element from 'element-ui' import 'element-ui/lib/theme-chalk/index.css'; import '@/styles/index.scss' import moment from 'moment' // 时间库 import App from './App' import router from './router' import store from './store' import {getDept,openUrl, getToken, getTyps, getTypsName, supremeAuthority, getUserData, getEmployeeMap,getEmployeeMapAll,getEmployeeMapItem,getIsIdentity,getCache,setCache,removeCache,returnDeptName,getIsAdministrator} from '@/utils/auth' import './performanceSet' // 绩效系统相关配置 import {onFilePreView } from '@/okr/utils/auth'; import { VueOkrTree } from "vue-okr-tree"; import "vue-okr-tree/dist/vue-okr-tree.css"; import 'shepherd.js/dist/css/shepherd.css'; import './icons' import './permission' import * as filters from '@/utils/filters' import axiosKq from '@/utils/axiosKq' import axiosUser from '@/utils/axiosUser' import axios from '@/utils/axios' import axiosKc from '@/utils/axiosKc' import * as socketApi from './api/websocket' import * as socketApiTow from './api/websocketTow' import ECharts from 'echarts'; // 头像 import UserImage from '@/components/UserImage' import noData from '@/components/noData' import BrawerBox from '@/performance/components/public/BrawerBox'; import TaskItem from '@/okr/components/public/TaskItem'; //任务内容 Vue.component('userImage', UserImage) Vue.component('NoData', noData) Vue.component('BrawerBox', BrawerBox) Vue.component('TaskItem', TaskItem) Vue.component('VueOkrTree', VueOkrTree) Vue.use(Element, { size: 'medium', }) Vue.prototype.$echarts = ECharts Vue.prototype.$axios = axios Vue.prototype.$axiosUser = axiosUser Vue.prototype.$axiosKq = axiosKq Vue.prototype.$axiosKc = axiosKc Vue.prototype.$moment = moment Vue.prototype.$getToken = getToken Vue.prototype.$serveAd = process.env.SERVE_AD Vue.prototype.$serverdomain= process.env.BASE_API Vue.prototype.$getIsIdentity = getIsIdentity //在积分系统里 判断是否具备某项权限 Vue.prototype.$supremeAuthority = supremeAuthority //返回积分系统的最高权限 Vue.prototype.$getIsAdministrator = getIsAdministrator //最高权限 平台管理者 Vue.prototype.$getTypsName = getTypsName Vue.prototype.$getTyps = getTyps Vue.prototype.$userInfo = getUserData Vue.prototype.$getEmployeeMap = getEmployeeMap //人员列表 Vue.prototype.$getEmployeeMapAll = getEmployeeMapAll //人员列表(包含已删除的) Vue.prototype.$getEmployeeMapItem = getEmployeeMapItem //查询人员信息(包含已删除的) Vue.prototype.$getCache = getCache Vue.prototype.$setCache = setCache Vue.prototype.$removeCache = removeCache Vue.prototype.$socketApi = socketApi //长连接 Vue.prototype.$socketApiTow = socketApiTow //长连接 Vue.prototype.$returnDeptName = returnDeptName Vue.prototype.$openUrl = openUrl Vue.prototype.$getDept = getDept // okr Vue.prototype.$onFilePreView = onFilePreView // 上传相关 Vue.prototype.$action = 'https://integralsys.oss-cn-shenzhen.aliyuncs.com' Vue.prototype.$acceptImg = 'image/jpeg,image/png' Vue.prototype.$acceptFile = 'application/pdf,application/vnd.ms-excel,application/msword,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document' Vue.prototype.$acceptImgFile='image/jpeg,image/png,application/pdf,application/vnd.ms-excel,application/msword,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.wordprocessingml.document' Vue.prototype.$xtoken={ 'X-Token': getToken() }; Vue.directive('dragscroll', function (el) { el.onmousedown = function (ev) { const disX = ev.clientX const disY = ev.clientY const originalScrollLeft = el.scrollLeft const originalScrollTop = el.scrollTop const originalScrollBehavior = el.style['scroll-behavior'] const originalPointerEvents = el.style['pointer-events'] // auto: 默认值,表示滚动框立即滚动到指定位置。 el.style['scroll-behavior'] = 'auto' el.style['cursor'] = 'grabbing' // 鼠标移动事件是监听的整个document,这样可以使鼠标能够在元素外部移动的时候也能实现拖动 document.onmousemove = function (ev) { ev.preventDefault() // 计算拖拽的偏移距离 const distanceX = ev.clientX - disX const distanceY = ev.clientY - disY el.scrollTo(originalScrollLeft - distanceX, originalScrollTop - distanceY) // 在鼠标拖动的时候将点击事件屏蔽掉 // el.style['pointer-events'] = 'none' // document.body.style['cursor'] = 'grabbing' } document.onmouseup = function () { // el.style['scroll-behavior'] = originalScrollBehavior // el.style['pointer-events'] = originalPointerEvents // el.style['cursor'] = 'grab' document.onmousemove = null document.onmouseup = null } } }) Object.keys(filters).forEach(key => { Vue.filter(key, filters[key]) }) Vue.config.productionTip = false new Vue({ el: '#app', router, store, render: h => h(App) })