jinlin
2023-11-14 96905176e38f8ebfbc44da1dd9adc650357bfc4f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import '@babel/polyfill'
import Vue from 'vue'
import Element from 'element-ui'
import App from './App'
import './assets/css/custom.css'
import './assets/css/resetui.css'
import './assets/icon/iconfont.css'
import './assets/icons/iconfont.css'
import './assets/bz-icon/iconfont.css'
import '../packages/icons'
import '../packages/element-ui/theme/index.css'
import '../packages/assets/scss/aui.scss'
import './assets/css/theme-light.css'
import './assets/css/qccommon.css'
import VueRouter from 'vue-router'
import './assets/css/theme-high.css'
// import '@/assets/less/common.less'
import i18n from '../packages/i18n'
import store from '../packages/store'
import router from './router'
import cloneDeep from 'lodash/cloneDeep'
import ztAdmin from '../packages/index'
// import 'bpmn-js/dist/assets/diagram-js.css';
// import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
import ProductTree from './components/product-tree'
import ProductSelector from './components/product-selector'
import ConfigUploader from './components/config-uploader'
import SysFileManagement from './components/file-management'
import experimentUploader from './components/file-experiment'
import RepairerSelector from './components/repairer-selector'
import TingteamSelector from './components/tingteam-selector'
import TeamGroupSelector from './components/team-group-selector'
import TeamMajorSelector from './components/team-major-selector'
import LocalShipSelector from './components/local-ship-selector'
import ProductSelectorCascade from './components/product-selector-cascade'
import ProjectListSelectDialog from './components/project-list-select-dialog'
import MenuTreeSelector from './components/menu-tree-selector'
import SelectTree from './components/select-tree'
import MajorSelector from './components/major-selector'
import ZtBoatTree from './components/zt-boat-tree'
import ColumnSelect from './components/column-select'
import ZtEquipmentConfig from './components/zt-equipment-config'
import ZtEquipmentSelect from './components/zt-equipment-select'
import scroll from 'vue-seamless-scroll'
import adaptive from './directive/el-table'
import './directive/dialogDrag'
import Cookies from 'js-cookie'
import allDirective from './plugins/commonDirective'
 
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location)
}
 
Object.keys(allDirective).forEach(f => {
  Vue.directive(f, allDirective[f])
})
// Vue.use(icon)
Vue.use(adaptive)
Vue.use(VueRouter)
Vue.use(scroll)
Vue.use(ztAdmin)
Vue.use(SysFileManagement)
Vue.use(experimentUploader)
Vue.use(ProductTree)
Vue.use(ProductSelector)
Vue.use(ConfigUploader)
Vue.use(RepairerSelector)
Vue.use(TeamGroupSelector)
Vue.use(TeamMajorSelector)
Vue.use(TingteamSelector)
Vue.use(LocalShipSelector)
Vue.use(ProductSelectorCascade)
Vue.use(ProjectListSelectDialog)
Vue.use(MenuTreeSelector)
Vue.use(SelectTree)
Vue.use(MajorSelector)
Vue.use(ZtBoatTree)
Vue.use(ColumnSelect)
Vue.use(ZtEquipmentConfig)
Vue.use(ZtEquipmentSelect)
Vue.config.productionTip = false
 
Vue.directive('loadmore', {
  bind(el, binding) {
    const selectWrap = el.querySelector('.el-table__body-wrapper')
    selectWrap.addEventListener('scroll', function() {
      let sign = 0
      const scrollDistance = this.scrollHeight - this.scrollTop - this.clientHeight
      if (scrollDistance <= sign) {
        binding.value()
      }
    })
  }
})
// 默认主题  浅版light 深版hight
store.state.theme = Cookies.get('systemTheme') || 'light'
 
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
// 表格默认展示条数
store.state.config.tablePageSize = 20
store.state.config.tablePageSizes = [10, 20, 50, 100,1000]
 
Vue.use(Element, {
  size: 'mini',
  i18n: (key, value) => i18n.t(key, value)
})
 
Vue.config.warnHandler = function (msg) {
  if (!msg.includes('Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.')) {
    return
  }
}
// 拦截request.js里面重新登录
// Vue.prototype.$EventBus.$on('reLogin', () => router.replace({name: 'login'}, onComplete => {
// }, onAbort => {
// }))
 
new Vue({
  i18n,
  router,
  store,
  render: h => h(App)
}).$mount('#app')