Blame view

src/App.vue 3.3 KB
a0ea7efe   梁保满   init
1
  <template>
f45b3c05   LH_PC   云平台新UI界面
2
3
4
5
6
  	<div id="app" ref="app">
  		<transition name="fade" mode="out-in">
  			<router-view></router-view>
  		</transition>
  	</div>
a0ea7efe   梁保满   init
7
8
9
  </template>
  
  <script>
f45b3c05   LH_PC   云平台新UI界面
10
  import _ from "lodash";
a0ea7efe   梁保满   init
11
  export default {
f45b3c05   LH_PC   云平台新UI界面
12
13
14
15
  	name: "app",
  	mounted() {
  
  	},
ef16e57e   LH_PC   fix:前端版本迭代
16
17
18
  	methods: {
  		_reSize() {
  
f45b3c05   LH_PC   云平台新UI界面
19
  			const $app = this.$refs.app;
6bca489d   LH_PC   云平台二期UI
20
  
ef16e57e   LH_PC   fix:前端版本迭代
21
  			const standardScale = "100%" / "100%";
6bca489d   LH_PC   云平台二期UI
22
  
ef16e57e   LH_PC   fix:前端版本迭代
23
  			const docHeight = document.body.clientHeight;
6bca489d   LH_PC   云平台二期UI
24
  
ead476dd   LH_PC   fix:最终定版
25
26
27
28
  			const docWidth = document.body.clientWidth;
  
  			if (docWidth < 1700) {
  
ef16e57e   LH_PC   fix:前端版本迭代
29
  				const currentScale = docHeight / docWidth;
6bca489d   LH_PC   云平台二期UI
30
  
ef16e57e   LH_PC   fix:前端版本迭代
31
32
33
34
  				let [scale, translate] = [0, 0];
  				if (currentScale < standardScale) {
  					// 以高度计算
  					scale = docHeight / 1080;
6bca489d   LH_PC   云平台二期UI
35
  
ef16e57e   LH_PC   fix:前端版本迭代
36
  					const shouleWidth = 1920 * scale;
6bca489d   LH_PC   云平台二期UI
37
  
ef16e57e   LH_PC   fix:前端版本迭代
38
  					const offsetWidth = docWidth - shouleWidth;
6bca489d   LH_PC   云平台二期UI
39
  
ef16e57e   LH_PC   fix:前端版本迭代
40
41
  					translate =
  						offsetWidth > 0 ? `translate(${offsetWidth / 2}px, 0)` : "";
f45b3c05   LH_PC   云平台新UI界面
42
  
ef16e57e   LH_PC   fix:前端版本迭代
43
44
45
  				} else {
  					// 以宽度计算
  					scale = docWidth / 1920;
6bca489d   LH_PC   云平台二期UI
46
  
ef16e57e   LH_PC   fix:前端版本迭代
47
  					const shouleHeight = 1080 * scale;
6bca489d   LH_PC   云平台二期UI
48
  
ef16e57e   LH_PC   fix:前端版本迭代
49
  					const offsetHeight = docHeight - shouleHeight;
6bca489d   LH_PC   云平台二期UI
50
  
ef16e57e   LH_PC   fix:前端版本迭代
51
52
53
  					translate =
  						offsetHeight > 0 ? `translate(0, ${offsetHeight / 2}px)` : "";
  				}
6bca489d   LH_PC   云平台二期UI
54
  
ead476dd   LH_PC   fix:最终定版
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
  				if (docHeight <= 600) {
  
  					$app.style.cssText = `
  							transform: scale(${scale}) ${translate};
  							transform-origin: top left;
  							min-width: 1920px;
  							min-height:830px;
            				`;
  				}
  				else if (docHeight == 610) {
  					$app.style.cssText = `
  							transform: scale(${scale}) ${translate};
  							transform-origin: top left;
  							min-width: 1920px;
  							min-height:885px;
            				`; 
  				}
  				else if (docHeight <= 606) { 
  					$app.style.cssText = `
  							transform: scale(${scale}) ${translate};
  							transform-origin: top left;
  							min-width: 1920px;
  							min-height:850px;
            				`;
  				}
  				else if (docHeight <= 650) {
  
  					$app.style.cssText = `
  							transform: scale(${scale}) ${translate};
  							transform-origin: top left;
  							min-width: 1920px;
  							min-height:850px;
            				`;
  				}
  				else if (docHeight <= 700) {
6bca489d   LH_PC   云平台二期UI
90
  
ef16e57e   LH_PC   fix:前端版本迭代
91
  					$app.style.cssText = `
6bca489d   LH_PC   云平台二期UI
92
93
94
  								transform: scale(${scale}) ${translate};
  								transform-origin: top left;
  								min-width: 1920px;
ead476dd   LH_PC   fix:最终定版
95
  								min-height: 890px; 
ef16e57e   LH_PC   fix:前端版本迭代
96
97
            					`;
  				}
ead476dd   LH_PC   fix:最终定版
98
  				else if (docHeight <= 750) {
ef16e57e   LH_PC   fix:前端版本迭代
99
100
  
  					$app.style.cssText = `
6bca489d   LH_PC   云平台二期UI
101
102
103
  								transform: scale(${scale}) ${translate};
  								transform-origin: top left;
  								min-width: 1920px;
ead476dd   LH_PC   fix:最终定版
104
  								min-height: 910px; 
ef16e57e   LH_PC   fix:前端版本迭代
105
106
107
108
            					`;
  				}
  				else {
  					$app.style.cssText = `
6bca489d   LH_PC   云平台二期UI
109
110
111
  								transform: scale(${scale}) ${translate};
  								transform-origin: top left;
  								min-width: 1920px;
ef16e57e   LH_PC   fix:前端版本迭代
112
113
114
  								min-height:1045px; 
            					`;
  				}
f45b3c05   LH_PC   云平台新UI界面
115
  
ef16e57e   LH_PC   fix:前端版本迭代
116
117
118
119
120
121
122
  			} else {
  				$app.style.cssText = '';
  			}
  		},
  	},
  	created() {
  		let that = this;
f45b3c05   LH_PC   云平台新UI界面
123
  
ef16e57e   LH_PC   fix:前端版本迭代
124
  		this.$nextTick(() => {
f45b3c05   LH_PC   云平台新UI界面
125
  			if (document.createEvent) {
ef16e57e   LH_PC   fix:前端版本迭代
126
  				that._reSize();
f45b3c05   LH_PC   云平台新UI界面
127
  			} else if (document.createEventObject) {
ef16e57e   LH_PC   fix:前端版本迭代
128
  				that._reSize();
f45b3c05   LH_PC   云平台新UI界面
129
130
131
  			}
  		});
  	}
a0ea7efe   梁保满   init
132
133
134
135
136
137
138
139
  }
  
  </script>
  
  <style lang="scss">
  body {
  	margin: 0px;
  	padding: 0px;
ef16e57e   LH_PC   fix:前端版本迭代
140
  	font-family: Microsoft YaHei, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, SimSun, sans-serif;
a0ea7efe   梁保满   init
141
142
143
144
145
146
147
148
149
  	-webkit-font-smoothing: antialiased;
  }
  
  #app {
  	position: absolute;
  	top: 0px;
  	bottom: 0px;
  	width: 100%;
  }
f45b3c05   LH_PC   云平台新UI界面
150
151
152
  
  a {
  	color: #56a9ff;
a0ea7efe   梁保满   init
153
  }
f45b3c05   LH_PC   云平台新UI界面
154
  
a0ea7efe   梁保满   init
155
156
157
158
159
160
161
162
163
  .fade-enter-active,
  .fade-leave-active {
  	transition: all .2s ease;
  }
  
  .fade-enter,
  .fade-leave-active {
  	opacity: 0;
  }
f45b3c05   LH_PC   云平台新UI界面
164
  
a0ea7efe   梁保满   init
165
  #nprogress .bar {
f45b3c05   LH_PC   云平台新UI界面
166
167
  	height: 3px !important;
  	background: #56a9ff !important; //自定义颜色
a0ea7efe   梁保满   init
168
169
  }
  </style>