Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
</template>

<script lang="ts" setup>
import { onMounted, watch, inject } from 'vue';
import { onMounted, watch, inject, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import useLocale from '@/hooks/locale';

const { t } = useI18n();
const { currentLocale } = useLocale();
let echarts = inject<any>('echarts');
const echartsDom = ref();

let option = {
tooltip: {
Expand Down Expand Up @@ -185,7 +186,7 @@
};

onMounted(() => {
const chartDom = document.getElementById('line');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
option && myChart.setOption(option);
window.addEventListener('resize', () => {
Expand All @@ -194,7 +195,7 @@
});

watch(currentLocale, (newValue, oldValue) => {
const chartDom = document.getElementById('line');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
if (newValue === 'zhCN') {
option.legend.data = ['采样PV', '首屏可见', '页面Onload'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
</template>

<script lang="ts" setup>
import { onMounted, watch, inject } from 'vue';
import { onMounted, watch, inject, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import useLocale from '@/hooks/locale';

const { t } = useI18n();
const { currentLocale } = useLocale();
let echarts = inject<any>('echarts');
const echartsDom = ref();

const list = [
{
Expand Down Expand Up @@ -167,7 +168,7 @@
};

onMounted(() => {
const chartDom = document.getElementById('flow');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
option && myChart.setOption(option);
window.addEventListener('resize', () => {
Expand All @@ -176,7 +177,7 @@
});

watch(currentLocale, (newValue, oldValue) => {
const chartDom = document.getElementById('flow');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
myChart.setOption(option);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>

<script lang="ts" setup>
import { onMounted, inject } from 'vue';
import { onMounted, inject, ref } from 'vue';
import RegionTable from './regiontable.vue';

const data = [
Expand Down Expand Up @@ -55,6 +55,7 @@
];

let echarts = inject<any>('echarts');
const echartsDom = ref();
let options = {
tooltip: {
trigger: 'item',
Expand Down Expand Up @@ -108,7 +109,7 @@
};

onMounted(() => {
const chartDom = document.getElementById('earth');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
window.addEventListener('resize', () => {
myChart.resize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
</template>

<script lang="ts" setup>
import { onMounted, watch, inject } from 'vue';
import { onMounted, watch, inject, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import useLocale from '@/hooks/locale';
import RoundTable from './roundtable.vue';

const { t } = useI18n();
const { currentLocale } = useLocale();
let echarts = inject<any>('echarts');
const echartsDom = ref();

let option = {
tooltip: {
Expand Down Expand Up @@ -67,7 +68,7 @@
};

onMounted(() => {
const chartDom = document.getElementById('circled');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
option && myChart.setOption(option);
window.addEventListener('resize', () => {
Expand All @@ -76,7 +77,7 @@
});

watch(currentLocale, (newValue, oldValue) => {
const chartDom = document.getElementById('circled');
const chartDom = echartsDom.value;
const myChart = echarts.init(chartDom as any);
myChart.setOption(option);
});
Expand Down