提交 | 用户 | 时间
|
820397
|
1 |
export function resetSize(vm) { |
H |
2 |
let img_width, img_height, bar_width, bar_height //图片的宽度、高度,移动条的宽度、高度 |
|
3 |
const EmployeeWindow = window as any |
|
4 |
const parentWidth = vm.$el.parentNode.offsetWidth || EmployeeWindow.offsetWidth |
|
5 |
const parentHeight = vm.$el.parentNode.offsetHeight || EmployeeWindow.offsetHeight |
|
6 |
if (vm.imgSize.width.indexOf('%') != -1) { |
|
7 |
img_width = (parseInt(vm.imgSize.width) / 100) * parentWidth + 'px' |
|
8 |
} else { |
|
9 |
img_width = vm.imgSize.width |
|
10 |
} |
|
11 |
|
|
12 |
if (vm.imgSize.height.indexOf('%') != -1) { |
|
13 |
img_height = (parseInt(vm.imgSize.height) / 100) * parentHeight + 'px' |
|
14 |
} else { |
|
15 |
img_height = vm.imgSize.height |
|
16 |
} |
|
17 |
|
|
18 |
if (vm.barSize.width.indexOf('%') != -1) { |
|
19 |
bar_width = (parseInt(vm.barSize.width) / 100) * parentWidth + 'px' |
|
20 |
} else { |
|
21 |
bar_width = vm.barSize.width |
|
22 |
} |
|
23 |
|
|
24 |
if (vm.barSize.height.indexOf('%') != -1) { |
|
25 |
bar_height = (parseInt(vm.barSize.height) / 100) * parentHeight + 'px' |
|
26 |
} else { |
|
27 |
bar_height = vm.barSize.height |
|
28 |
} |
|
29 |
|
|
30 |
return { imgWidth: img_width, imgHeight: img_height, barWidth: bar_width, barHeight: bar_height } |
|
31 |
} |
|
32 |
|
|
33 |
export const _code_chars = [ |
|
34 |
1, |
|
35 |
2, |
|
36 |
3, |
|
37 |
4, |
|
38 |
5, |
|
39 |
6, |
|
40 |
7, |
|
41 |
8, |
|
42 |
9, |
|
43 |
'a', |
|
44 |
'b', |
|
45 |
'c', |
|
46 |
'd', |
|
47 |
'e', |
|
48 |
'f', |
|
49 |
'g', |
|
50 |
'h', |
|
51 |
'i', |
|
52 |
'j', |
|
53 |
'k', |
|
54 |
'l', |
|
55 |
'm', |
|
56 |
'n', |
|
57 |
'o', |
|
58 |
'p', |
|
59 |
'q', |
|
60 |
'r', |
|
61 |
's', |
|
62 |
't', |
|
63 |
'u', |
|
64 |
'v', |
|
65 |
'w', |
|
66 |
'x', |
|
67 |
'y', |
|
68 |
'z', |
|
69 |
'A', |
|
70 |
'B', |
|
71 |
'C', |
|
72 |
'D', |
|
73 |
'E', |
|
74 |
'F', |
|
75 |
'G', |
|
76 |
'H', |
|
77 |
'I', |
|
78 |
'J', |
|
79 |
'K', |
|
80 |
'L', |
|
81 |
'M', |
|
82 |
'N', |
|
83 |
'O', |
|
84 |
'P', |
|
85 |
'Q', |
|
86 |
'R', |
|
87 |
'S', |
|
88 |
'T', |
|
89 |
'U', |
|
90 |
'V', |
|
91 |
'W', |
|
92 |
'X', |
|
93 |
'Y', |
|
94 |
'Z' |
|
95 |
] |
|
96 |
export const _code_color1 = ['#fffff0', '#f0ffff', '#f0fff0', '#fff0f0'] |
|
97 |
export const _code_color2 = ['#FF0033', '#006699', '#993366', '#FF9900', '#66CC66', '#FF33CC'] |