diff --git a/src/views/home/components/MunicipalChart.vue b/src/views/home/components/MunicipalChart.vue index d53d282b..58f9e445 100644 --- a/src/views/home/components/MunicipalChart.vue +++ b/src/views/home/components/MunicipalChart.vue @@ -100,7 +100,7 @@ export default { return { width: '1920px', height: '1080px', - transform: `translate(${this.offsetX}px, ${this.offsetY}px) scale(${this.scale})`, + transform: `scale(${this.scale})`, transformOrigin: '0 0', } }, @@ -115,23 +115,10 @@ export default { methods: { calcScale() { const baseW = 1920 - const baseH = 1080 - const vw = document.documentElement.clientWidth - const vh = document.documentElement.clientHeight - const scale = Math.min(vw / baseW, vh / baseH) - - const realW = baseW * scale - const realH = baseH * scale - - // ✅ 横向:仍然居中 - this.offsetX = (vw - realW) / 2 / scale - - // ✅ 纵向:贴顶(不再居中) - this.offsetY = 0 - - this.scale = scale + // ✅ 永远以当前可视宽度为准 + this.scale = vw / baseW }, openEquipTurnroundRate() { this.$refs.equipTurnroundRate.openDialog() @@ -163,8 +150,9 @@ export default { .viewport { position: fixed; inset: 0; - overflow: hidden; - background: #e1ebf7; /* 大屏底色 */ + overflow-x: hidden; + overflow-y: auto; + background: #e1ebf7; } /* 被缩放的 1920×1080 画布 */ diff --git a/src/views/home/components/MunicipalChart/Bottom1.vue b/src/views/home/components/MunicipalChart/Bottom1.vue index 506e85f7..7cb73670 100644 --- a/src/views/home/components/MunicipalChart/Bottom1.vue +++ b/src/views/home/components/MunicipalChart/Bottom1.vue @@ -69,7 +69,7 @@ export default { console.log(response, 'maintenanceAlarmApi') if (response.code == 200) { this.totalNum = response.data.total - this.tableList = response.data.list.slice(0, 7) + this.tableList = response.data.list.slice(0, 5) } } catch (error) { console.log('🚀 ~ error:', error) diff --git a/src/views/home/components/MunicipalChart/Center1.vue b/src/views/home/components/MunicipalChart/Center1.vue index 80edd55e..b452c625 100644 --- a/src/views/home/components/MunicipalChart/Center1.vue +++ b/src/views/home/components/MunicipalChart/Center1.vue @@ -69,7 +69,7 @@ export default { console.log(response, 'retirementAlarmApi') if (response.code == 200) { this.totalNum = response.data.total - this.tableList = response.data.list.slice(0, 7) + this.tableList = response.data.list.slice(0, 5) } } catch (error) { console.log('🚀 ~ error:', error) diff --git a/src/views/home/components/ProvincialChart.vue b/src/views/home/components/ProvincialChart.vue index bc9fea51..7e8aa5c1 100644 --- a/src/views/home/components/ProvincialChart.vue +++ b/src/views/home/components/ProvincialChart.vue @@ -67,8 +67,6 @@ export default { data() { return { scale: 1, - offsetX: 0, - offsetY: 0, } }, computed: { @@ -76,7 +74,7 @@ export default { return { width: '1920px', height: '1080px', - transform: `translate(${this.offsetX}px, ${this.offsetY}px) scale(${this.scale})`, + transform: `scale(${this.scale})`, transformOrigin: '0 0', } }, @@ -91,23 +89,10 @@ export default { methods: { calcScale() { const baseW = 1920 - const baseH = 1080 - const vw = document.documentElement.clientWidth - const vh = document.documentElement.clientHeight - const scale = Math.min(vw / baseW, vh / baseH) - - const realW = baseW * scale - const realH = baseH * scale - - // ✅ 横向:仍然居中 - this.offsetX = (vw - realW) / 2 / scale - - // ✅ 纵向:贴顶(不再居中) - this.offsetY = 0 - - this.scale = scale + // ✅ 永远以当前可视宽度为准 + this.scale = vw / baseW }, }, } @@ -118,8 +103,9 @@ export default { .viewport { position: fixed; inset: 0; - overflow: hidden; - background: #e1ebf7; /* 大屏底色 */ + overflow-x: hidden; + overflow-y: auto; + background: #e1ebf7; } /* 被缩放的 1920×1080 画布 */ diff --git a/vue.config.js b/vue.config.js index 3a67d3a7..3bae5dcb 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,9 +38,9 @@ module.exports = { // target: `http://localhost:18080`, // target: `http://192.168.0.96:28080`,//马 // target: `http://192.168.0.110:18080`,//洪 - target: `http://192.168.0.229:28080`,//蒋 - // target: `http://36.33.26.201:17788/proxyApi`, //测试 - // target: `http://36.33.26.201:21999/prod-api`, //测试 + // target: `http://192.168.0.229:28080`,//蒋 + // target: `http://112.29.103.165:21001/prod-api`, //测试-重庆 + target: `http://36.33.26.201:21999/prod-api`, //测试-安徽 // target: `http://192.168.137.1:18080`,// // target: `http://112.29.103.165:21001/prod-api`,// // target: `http://10.125.30.229:28080`,//