mixins.js
1.33 KB
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
import {
getToken
} from '@/utils/auth'
import { BASE_URL } from '@/common/config'
import { formatTime } from '@/utils/util'
export default {
data() {
return {
Authorization: '',
BASE_ROOT_DOMAIN: BASE_URL,
BASE_URL: BASE_URL
};
},
created() {
this.Authorization = getToken();
},
filters: {
dateTimeFilter(val, formatter) {
return formatTime(val, formatter)
},
},
methods: {
initRem() {
var html = document.documentElement;
var w = html.getBoundingClientRect().width;
var fontSize = w / 1000;
html.style.fontSize = fontSize + "px";
if (this.echartOption1) {
this.echartOption1.textStyle = {
fontSize: fontSize * 9
};
}
if (this.echartOption2) {
this.echartOption2.textStyle = {
fontSize: fontSize * 9
};
}
if (this.echartOption3) {
this.echartOption3.textStyle = {
fontSize: fontSize * 9
};
}
if (this.resetChart) {
setTimeout(() => {
this.resetChart()
}, 2000)
}
},
}
}