标题样式修改

main
jn517618 2 years ago
parent 7a6de5f54b
commit 3ae0444941
  1. 37
      src/views/energySources/component/header.vue

@ -21,13 +21,12 @@
</div> </div>
<div class="htitle"> <div class="htitle">
<div class="htitle-t"> <div class="htitle-t" :style="{ fontSize: divFontSize }">
{{ deptName }}实业公司能耗监测系统 {{ deptName }}能耗监测系统
</div> </div>
<div class="htitle-b"> <div class="htitle-b" :style="{ fontSize: divFontSize }">
{{ deptName }}能耗监测系统
{{deptName }}实业公司能耗监测系统
</div> </div>
</div> </div>
</div> </div>
@ -37,7 +36,7 @@
import { getWeather } from "@/api/energySourcesProvince/energySourcesProvince" import { getWeather } from "@/api/energySourcesProvince/energySourcesProvince"
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
props: { props: {
deptName: { deptName: {
type: String, type: String,
default: "", default: "",
@ -49,12 +48,27 @@ export default {
timeFun: null, timeFun: null,
temp: '', temp: '',
text: '', text: '',
divFontSize: "0.32rem",
}; };
}, },
computed: { computed: {
...mapGetters(["userInfo", "permission"]), ...mapGetters(["userInfo", "permission"])
}, },
created() { created() {
if (this.deptName.length <= 12) {
this.divFontSize = "0.32rem"
}
if (this.deptName.length == 13) {
this.divFontSize = "0.3rem"
}
if (this.deptName.length == 14) {
this.divFontSize = "0.29rem"
}
if (this.deptName.length == 15) {
this.divFontSize = "0.28rem"
}
getWeather().then(res => { getWeather().then(res => {
this.temp = res.data.now.temp this.temp = res.data.now.temp
this.text = res.data.now.text this.text = res.data.now.text
@ -122,9 +136,10 @@ export default {
.htitle { .htitle {
position: absolute; position: absolute;
top: 0.18rem; top: 0.18rem;
left: 7.2rem; left: 6.64rem;
width: 4.82rem; width: 5.9rem;
height: 0.46rem; height: 0.46rem;
line-height: 0.46rem;
.htitle-t { .htitle-t {
position: absolute; position: absolute;
@ -133,7 +148,6 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: center;
font-size: 0.3rem;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
@ -145,9 +159,8 @@ export default {
.htitle-b { .htitle-b {
position: absolute; position: absolute;
text-align: center; text-align: center;
font-size: 0.3rem;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: bold; font-weight: bold;
color: rgba(0, 0, 0, 0); color: rgba(0, 0, 0, 0);

Loading…
Cancel
Save