main.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import './public-path'
  2. import Vue from 'vue';
  3. import axios from "axios";
  4. // import "sv-print/dist/style.css";
  5. import ElementUI from 'element-ui';
  6. import App from './App.vue';
  7. import router from './router';
  8. import store from './store';
  9. import api from './api/api'
  10. import tool from './utils/tool'
  11. import basicData from './utils/basic-data'
  12. import FileType from './utils/matchingFeilType'
  13. import upload from './api/upload'
  14. import './style/style.css'
  15. import './style/theme/index.css'
  16. import tableLayout from './components/dynamic-table'
  17. import basicLayout from './components/normal-basic-layout'
  18. import normalLayout from './components/normal-basic-layout/normal.vue'
  19. import basicDetails from './components/normal-basic-layout/details'
  20. import deleteBtn from './components/delete_btn/index'
  21. import customBtn from './components/customBtn/index'
  22. import tagPanl from '@/components/tagPanl/tagPanl'
  23. import sort from './components/sort'
  24. import '@/style/theme/font-icon/iconfont.css'
  25. // import {hiPrintPlugin} from './index'
  26. // Vue.use(hiPrintPlugin)
  27. Vue.prototype.$api = api
  28. console.log(process.env)
  29. Vue.prototype.$upload = upload
  30. Vue.prototype.tool = tool
  31. Vue.prototype.basicData = basicData
  32. Vue.prototype.fileType = FileType
  33. axios.defaults.timeout = 60 * 1000
  34. axios.defaults.baseURL = tool.getBaseUrl()
  35. Vue.prototype.$axios = axios
  36. Vue.prototype.tableHieght = 'calc(100vh - 302px)'
  37. Vue.config.productionTip = false;
  38. Vue.component('tableLayout', tableLayout)
  39. Vue.component('basicLayout', basicLayout)
  40. Vue.component('basicDetails', basicDetails)
  41. Vue.component('normalLayout', normalLayout)
  42. Vue.component('deleteBtn',deleteBtn)
  43. Vue.component('customBtn',customBtn)
  44. Vue.component('sort', sort)
  45. /* 标签组件 */
  46. Vue.component('tagPanl',tagPanl)
  47. Vue.use(ElementUI);
  48. ElementUI.TableColumn.props.showOverflowTooltip ={type:Boolean, default: true}
  49. ElementUI.Dialog.props.closeOnClickModal.default = false;
  50. ElementUI.Drawer.props.showClose.default = false;
  51. /* table懒加载 */
  52. Vue.directive('tableLoad',{
  53. bind (el,binding) {
  54. let tableWarp = el.querySelector('.el-table__body-wrapper')
  55. function handleFun (e) {
  56. if (tableWarp.scrollTop + tableWarp.clientHeight >= tableWarp.scrollHeight) {
  57. binding.value()
  58. }
  59. }
  60. tableWarp.addEventListener('scroll',handleFun)
  61. el.tableWarp = tableWarp
  62. el.handleFun = handleFun
  63. },
  64. unbind (el,binding) {
  65. /* 解绑 */
  66. el.tableWarp.removeEventListener('scroll',el.handleFun)
  67. }
  68. })
  69. new Vue({
  70. router,
  71. store,
  72. render: (h) => h(App),
  73. }).$mount('#app');