From 1f35eadc571d76119d84b8f5e8afe55db94b13e2 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 23 十月 2024 15:39:33 +0800 Subject: [PATCH] 民航 --- src/books/civilAviation/view/components/index.vue | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/books/civilAviation/view/components/index.vue b/src/books/civilAviation/view/components/index.vue index c140f6c..4c75882 100644 --- a/src/books/civilAviation/view/components/index.vue +++ b/src/books/civilAviation/view/components/index.vue @@ -4,8 +4,8 @@ <div id="searchContent"></div> </div> <div class="page-content" :style="{ - fontSize: fontSize ? fontSize + 'px' : '18px', - transform: `scale(${pageZoom ? pageZoom : 1})`, + fontSize: fontSize + 'px', + transform: `scale(${pageZoom})`, transformOrigin: 'center top', }"> <pageHeader v-if="showCatalogList.indexOf(1) > -1" :showPageList="loadPageList"></pageHeader> @@ -47,10 +47,10 @@ computed: { fontSize() { this.transformDom(this.$store.state.qiankun.fontSize) - return this.$store.state.qiankun.fontSize; + return this.$store.state.qiankun.fontSize ? this.$store.state.qiankun.fontSize : 18; }, pageZoom() { - return this.$store.state.qiankun.scale / 100; + return this.$store.state.qiankun.scale ? this.$store.state.qiankun.scale / 100 : 1; }, }, watch: { @@ -75,6 +75,7 @@ loadPageList: { handler(newVal, oldVal) { setTimeout(() => { + this.transformDom(this.$store.state.qiankun.fontSize) this.initSwiper(); this.initViewer(); this.closeAudio(); @@ -913,9 +914,15 @@ }, //鍏朵粬绫诲悕涓嬪瓧浣撳ぇ灏忓彉鍖� transformDom(fs) { - const blockElement = this.$refs.blockElement; - if (blockElement) { - blockElement.style.fontSize = fs; // 鎴栬�呬綘鎯宠鐨勪换浣曞ぇ灏� + console.log('瀛椾綋澶у皬',fs); + if(!fs) return + let doms = ( + this.container ? this.container : document + ).querySelectorAll('.block') + if(!doms.length) return + for (let index = 0; index < doms.length; index++) { + const dom = doms[index]; + dom.style.fontSize = fs + 'px' } } }, -- Gitblit v1.9.1