diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 26048e1..681749f 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -14,6 +14,7 @@ import 'echarts/lib/component/dataZoom' import { color, gradeColor3 } from './color' import { useConfig } from '@/stores/config' import { saveAs } from 'file-saver' +import { t } from 'vxe-table' // import { nextTick } from 'process' const config = useConfig() @@ -66,6 +67,19 @@ const initChart = () => { borderWidth: 0, ...(props.options?.tooltip || null) }, + toolbox: { + right: 20, + top: 20, + feature: { + saveAsImage: { + title: '保存图片', + }, + ...(props.options?.toolbox?.featureProps || null), + + }, + // }, + ...(props.options?.toolbox || null) + }, legend: { right: 20, top: 0, @@ -80,7 +94,7 @@ const initChart = () => { ...(props.options?.legend || null) }, grid: { - top: '50px', + top: '60px', left: '30px', right: '70px', bottom: props.options?.options?.dataZoom === null ? '10px' : '40px', @@ -218,6 +232,10 @@ const handlerXAxis = () => { } } } + + + + let throttle: ReturnType // 动态计算table高度 const resizeObserver = new ResizeObserver(entries => { diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index 6fcb43a..4022dc3 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -1,14 +1,9 @@ - + @@ -57,7 +47,7 @@ const dictData = useDictData() const areaRef = ref() const headerForm = ref() const headerFormSecond = ref() - +const num = ref(0) interface Props { datePicker?: boolean area?: boolean @@ -74,7 +64,7 @@ const props = withDefaults(defineProps(), { theCurrentTime: false }) // 动态计算table高度 -const resizeObserver = new ResizeObserver(entries => { +let resizeObserver = new ResizeObserver(entries => { for (const entry of entries) { handlerHeight() computedSearchRow() @@ -118,9 +108,11 @@ const handlerHeight = () => { ).height as string } } +// 刷新页面handler高度出下拉 const computedSearchRow = () => { if (!headerForm.value.$el) return + // 清空headerFormSecond.value.$el下的元素 while (headerFormSecond.value.$el.firstChild) { headerForm.value.$el.appendChild(headerFormSecond.value.$el.firstChild) @@ -173,13 +165,15 @@ const setInterval = (val: any) => { datePickerRef.value.setInterval(val) } -defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange }) + +defineExpose({ onComSearch, areaRef, setDatePicker, setInterval, datePickerRef, showSelectChange, computedSearchRow })