| | |
| | | import * as echarts from "echarts"; |
| | | import "./transparent"; |
| | | import { onMounted, onBeforeUnmount, ref, nextTick } from "vue"; |
| | | import eventBus from "@/utils/eventBus"; |
| | | |
| | | let chart_instance = null; |
| | | let exportChart_instance = null; |
| | | |
| | | const chart = ref(null); |
| | | const exportChart = ref(null); |
| | | const fullScreenFlag = ref(false); |
| | | const emit = defineEmits(["click"]); |
| | | const emit = defineEmits(["click", "update:fullFlag"]); |
| | | |
| | | const props = defineProps({ |
| | | fullFlag: { |
| | | type: Boolean, |
| | | default: false, |
| | | } |
| | | }); |
| | | |
| | | const fullScreenFlag = ref(props.fullFlag); |
| | | |
| | | |
| | | |
| | | onMounted(() => { |
| | |
| | | }); |
| | | window.addEventListener("resize", resize); |
| | | |
| | | eventBus.on("toggleSiteList", () => { |
| | | console.log('toggleSiteList', '============='); |
| | | setTimeout(() => { |
| | | resize(); |
| | | // 因为过渡设置了0.5s,所以需要等待0.5s后再resize |
| | | }, 500); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | |
| | | onBeforeUnmount(() => { |
| | | window.removeEventListener("resize", resize); |
| | | eventBus.off("toggleSiteList"); |
| | | dispose(); |
| | | }); |
| | | |
| | |
| | | |
| | | function fullScreen() { |
| | | fullScreenFlag.value = !fullScreenFlag.value; |
| | | emit("update:fullFlag", fullScreenFlag.value); |
| | | nextTick(() => { |
| | | resize(); |
| | | }); |
| | |
| | | option.xAxis[0].axisLine.lineStyle = { |
| | | color: "#000", |
| | | }; |
| | | option.xAxis[0].axisLabel.textStyle = option.xAxis[0].axisLabel.textStyle || {}; |
| | | option.xAxis[0].axisLabel.textStyle.color = "#000"; |
| | | |
| | | option.yAxis[0].axisLine.lineStyle = { |
| | | color: "#000", |
| | | }; |
| | | option.yAxis[0].axisLabel.textStyle = option.yAxis[0].axisLabel.textStyle || {}; |
| | | option.yAxis[0].axisLabel.textStyle.color = "#000"; |
| | | |
| | | option.animation = false; |
| | | |
| | | exportChart_instance.setOption(option); |
| | | base64 = exportChart_instance.getDataURL({ |
| | | pixelRatio: 1, |