Blame view

src/main.js 3.35 KB
yuanshuhui authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import './assets/styles/element-variables.scss'

import '@/assets/styles/index.scss' // global css
import '@/assets/styles/huaheng.scss' // huaheng css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
yuanshuhui authored
16
17
18
import {
  download
} from '@/utils/request'
yuanshuhui authored
19
import i18n from './lang' // internationalization
yuanshuhui authored
20
21
import './assets/icons' // icon
import './permission' // permission control
yuanshuhui authored
22
23
24
25
26
27
import {
  getDicts
} from "@/api/system/dict/data";
import {
  getConfigKey
} from "@/api/system/config";
yuanshuhui authored
28
29
30

import Print from '@/utils/print'
yuanshuhui authored
31
32
33
34
35
import dfilters from '@/utils/dfilter';
for (let key in dfilters) {
  Vue.filter(key, dfilters[key]);
}
yuanshuhui authored
36
37
import VueBarcode from 'vue-barcode';
yuanshuhui authored
38
39
import QrcodeVue from "qrcode.vue";
yuanshuhui authored
40
41
import draggable from 'vuedraggable'
yuanshuhui authored
42
43
import printTaskDialog from "@/views/task/taskHeader/dialog/printTaskDialog.vue";
yuanshuhui authored
44
45
46
47
48
49
50
51
import {
  resetForm,
  addDateRange,
  addDateRange2,
  selectDictLabel,
  selectDictLabels,
  selectCommonLabel,
  selectRuleLabel,
yuanshuhui authored
52
  selectlocatingRuleLabel,
53
54
  handleTree,
  reduceDays,
lector authored
55
  changeDate,
yuanshuhui authored
56
57
  fitCondition,
  parseTime as formatTime
yuanshuhui authored
58
} from "@/utils/huaheng";
yuanshuhui authored
59
60
61

import {formatDate as parseTime} from "@/utils";
yuanshuhui authored
62
63
64
65
66
67
68
69
70
71
import Pagination from "@/components/Pagination";
//自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"

// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
72
Vue.prototype.addDateRange2 = addDateRange2
yuanshuhui authored
73
74
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
yuanshuhui authored
75
Vue.prototype.selectCommonLabel = selectCommonLabel
yuanshuhui authored
76
Vue.prototype.selectRuleLabel = selectRuleLabel
yuanshuhui authored
77
Vue.prototype.selectlocatingRuleLabel = selectlocatingRuleLabel
78
79
Vue.prototype.reduceDays = reduceDays
Vue.prototype.changeDate = changeDate
yuanshuhui authored
80
Vue.prototype.download = download
lector authored
81
Vue.prototype.fitCondition = fitCondition
yuanshuhui authored
82
Vue.prototype.handleTree = handleTree
yuanshuhui authored
83
Vue.prototype.formatTime = formatTime
yuanshuhui authored
84
85

Vue.prototype.msgSuccess = function (msg) {
yuanshuhui authored
86
87
88
89
90
  this.$message({
    showClose: true,
    message: msg,
    type: "success"
  });
yuanshuhui authored
91
92
93
}

Vue.prototype.msgError = function (msg) {
yuanshuhui authored
94
95
96
97
98
  this.$message({
    showClose: true,
    message: msg,
    type: "error"
  });
yuanshuhui authored
99
100
101
102
103
104
}

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}
105
106
107
//全局变量挂载
Vue.prototype.$colData
yuanshuhui authored
108
// 全局组件挂载
yuanshuhui authored
109
110
111
Vue.component('barcode', VueBarcode);
Vue.component('QrcodeVue', QrcodeVue);
Vue.component('printTaskDialog', printTaskDialog);
yuanshuhui authored
112
113
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
yuanshuhui authored
114
Vue.component('draggable', draggable)
yuanshuhui authored
115
116
117
118

Vue.use(permission)
Vue.use(Print)
119
yuanshuhui authored
120
121
122
123
124
125
126
127
128
129
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */

Vue.use(Element, {
yuanshuhui authored
130
131
  size: Cookies.get('size') || 'medium', // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
yuanshuhui authored
132
133
134
135
136
137
138
139
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
yuanshuhui authored
140
  i18n,
yuanshuhui authored
141
142
  render: h => h(App)
})