Commit 82acfe7e authored by 水玉婷's avatar 水玉婷
Browse files

feat:表格简单版总结也需要用md渲染

parent 1a6bb856
<template>
<div class="chart-container">
<div class="tips" v-if="chartData?.description">
{{ chartData?.description }}
<div class="tips" v-if="chartData?.description" v-html="renderedDescription">
</div>
<!-- 图表类型选择器 -->
<div class="chart-controls">
......@@ -73,7 +72,7 @@
:value="index"
:disabled="(selectedIndexes.length >= 2 && !selectedIndexes.includes(index))"
>
{{ index }}
{{ index }}
</a-select-option>
</a-select>
</div>
......@@ -143,7 +142,7 @@ import { ref, computed, watch, onMounted, defineAsyncComponent, type Ref } from
import { Select as ASelect, SelectOption as ASelectOption, Tooltip as ATooltip } from 'ant-design-vue';
import { QuestionCircleOutlined } from '@ant-design/icons-vue';
import TableComponent from './TableComponent.vue';
import { p } from 'vue-router/dist/router-CWoNjPRp.mjs';
import { markdownTemplate } from './utils/markdownTemplate';
// 类型定义
interface ChartData {
......@@ -186,7 +185,12 @@ const selectedDimensions = ref<string[]>([]);
const selectedIndexes = ref<string[]>([]);
const processedChartData = ref<ChartData | null>(null);
// 计算属性
// 计算属性:渲染后的description(支持markdown)
const renderedDescription = computed(() => {
if (!props.chartData?.description) return '';
return markdownTemplate(props.chartData.description);
});
const showChartControls = computed(() => {
return selectedChartType.value === CHART_TYPES.COLUMN ||
selectedChartType.value === CHART_TYPES.LINE ||
......@@ -344,7 +348,7 @@ onMounted(() => {
border: 1px solid #EBEDF0;
.tips {
margin-bottom: 8px;
font-weight: 500;
font-size:0;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment