Commit 6ac3369f5b0c560675369ab979678648cfc05d1a
1 parent
d43a3e49
库位监控样式修正
Signed-off-by: TanYibin <5491541@qq.com>
Showing
1 changed file
with
10 additions
and
13 deletions
ant-design-vue-jeecg/src/views/system/monitor/locationStatus.vue
... | ... | @@ -171,15 +171,13 @@ export default { |
171 | 171 | }, |
172 | 172 | |
173 | 173 | mounted() { |
174 | - //监听浏览器宽度的改变 | |
175 | - // window.onresize = function(){ | |
176 | - // _this.changeMargin(); | |
177 | - // _this.border() | |
178 | - // }; | |
179 | - // | |
180 | - // this.changeMargin(); | |
181 | - // | |
182 | - // this.border() | |
174 | + // 监听浏览器宽度的改变 | |
175 | + const resizeObserver = new ResizeObserver(entries => { | |
176 | + for (let entry of entries) { | |
177 | + this.changeMargin(); | |
178 | + } | |
179 | + }); | |
180 | + resizeObserver.observe(document.querySelector('.location')); | |
183 | 181 | }, |
184 | 182 | methods: { |
185 | 183 | loadFrom() { |
... | ... | @@ -574,7 +572,6 @@ export default { |
574 | 572 | $("#editable-num").append("<option value='" + i + "'>" + i + "</option>") |
575 | 573 | } |
576 | 574 | } |
577 | - _this.changeMargin(); | |
578 | 575 | _this.Search(); |
579 | 576 | } |
580 | 577 | }); |
... | ... | @@ -603,7 +600,7 @@ export default { |
603 | 600 | $(".location").append("<img data-i=" + num + " data-j=" + j + " data-k=" + i + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); |
604 | 601 | } |
605 | 602 | } |
606 | - this.changeMargin(); | |
603 | + // this.changeMargin(); | |
607 | 604 | this.ajaxGrid(index, data); |
608 | 605 | } else if (index === "line") { |
609 | 606 | data = {zoneCode: this.zoneCode, line: num}; |
... | ... | @@ -614,7 +611,7 @@ export default { |
614 | 611 | $(".location").append("<img data-i=" + l + " data-j=" + num + " data-k=" + k + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); |
615 | 612 | } |
616 | 613 | } |
617 | - this.changeMargin(); | |
614 | + // this.changeMargin(); | |
618 | 615 | this.ajaxGrid(index, data); |
619 | 616 | } else if (index === "layer") { |
620 | 617 | data = {zoneCode: this.zoneCode, layer: num}; |
... | ... | @@ -625,7 +622,7 @@ export default { |
625 | 622 | $(".location").append("<img data-i=" + m + " data-j=" + n + " data-k=" + num + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>"); |
626 | 623 | } |
627 | 624 | } |
628 | - this.changeMargin(); | |
625 | + // this.changeMargin(); | |
629 | 626 | this.ajaxGrid(index, data); |
630 | 627 | } |
631 | 628 | }, |
... | ... |