|
@@ -83,6 +83,7 @@
|
|
|
<div class="chart">
|
|
|
<!-- 图表组件 -->
|
|
|
<LineChart
|
|
|
+ ref="lineChartRef"
|
|
|
:xAxisData="xAxisData"
|
|
|
:seriesData="seriesData"
|
|
|
:showLegend="showLegend"
|
|
@@ -149,13 +150,16 @@ const { proxy } = getCurrentInstance()!;
|
|
|
const router = useRouter();
|
|
|
const route = useRoute(); // 获取当前路由对象
|
|
|
// 可靠性预测导出
|
|
|
-const getAllDomElements = () => {
|
|
|
+const lineChartRef = ref(null);
|
|
|
+let serviceDataRef=ref(null)
|
|
|
+const getAllDomElements = async () => {
|
|
|
// this.$nextTick(() => {
|
|
|
- const htmlContent = document.documentElement.outerHTML;
|
|
|
- const cleanedHtmlContent = htmlContent.replace(/[\r\n]+/g, "");
|
|
|
- console.log(cleanedHtmlContent);
|
|
|
- downloadFile(downloadStrategy(), "预测结果", { content: cleanedHtmlContent });
|
|
|
- // });
|
|
|
+ let imgBase64=lineChartRef.value.saveChartAndSend();
|
|
|
+ serviceDataRef.value={
|
|
|
+ ...serviceDataRef.value,
|
|
|
+ imgBase64:imgBase64
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
const goAdvice = (name: string) => {
|
|
|
router.push({
|
|
@@ -223,6 +227,7 @@ onMounted(() => {
|
|
|
proxy.$loading.stop();
|
|
|
|
|
|
const result: any = res.data;
|
|
|
+ serviceDataRef.value=result;
|
|
|
xAxisData.value = result.chart.x;
|
|
|
forecast_result.value = result.forecast_result;
|
|
|
devicesArr.value = result.devices;
|