fix: 修复图标显示异常
- 数据源修改, 从组件自动通过 sn 获取问卷变成从上级接受数据
This commit is contained in:
@@ -27,7 +27,7 @@ const { currentSurvey } = fetchSingleSurvey(sn.value);
|
||||
// 重置 message 信息
|
||||
aiInsightsConfig.value.message = '';
|
||||
|
||||
useFetchAnalysis(sn.value);
|
||||
const { questionAnalysis } = useFetchAnalysis(sn.value);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -77,7 +77,7 @@ useFetchAnalysis(sn.value);
|
||||
<!-- 图表分析部分 -->
|
||||
<van-cell class="analysis">
|
||||
<template #extra>
|
||||
<analysis-info :sn="sn" />
|
||||
<analysis-info :sn="sn" :questionAnalysis="questionAnalysis" />
|
||||
</template>
|
||||
</van-cell>
|
||||
</section>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div style="width: 100%">
|
||||
<!-- 优先去上级传递的数值 -->
|
||||
<section v-for="analysis in analysis" :key="analysis.stem" class="mt10">
|
||||
<section v-for="analysis in questionAnalysis" :key="analysis.stem" class="mt10">
|
||||
<!-- {{ analysis }} -->
|
||||
<!-- 问题标题 -->
|
||||
<el-tag type="success" size="small">{{
|
||||
@@ -33,7 +33,6 @@
|
||||
<script setup lang="ts">
|
||||
// 空白容器
|
||||
import EmptyContainer from '@/views/Survey/components/EmptyContainer.vue';
|
||||
import { useFetchAnalysis } from '../../hooks/useAnalysis';
|
||||
import { questionTypeMap } from '@/utils/question/typeMapping';
|
||||
import ChartMsg from '@/components/Analysis/Index.vue';
|
||||
import { getTableData } from './hooks/pieSeries';
|
||||
@@ -41,17 +40,9 @@ import YlTable from '@/components/YlTable/Index.vue';
|
||||
import { ref } from 'vue';
|
||||
// questionTypeMap 自己去对应
|
||||
const showChart = ref([1, 2, 5, 106, 9, 10]);
|
||||
const sn = defineModel('sn', { required: true });
|
||||
|
||||
// 接受上级传递的 questionAnalysis 数据
|
||||
const analysis = defineModel<any[]>('questionAnalysis');
|
||||
|
||||
// 如果没有接收到数据,那么就去请求
|
||||
if (!analysis.value) {
|
||||
console.log('repeat fetch analysis');
|
||||
const { questionAnalysis } = useFetchAnalysis(sn.value as string);
|
||||
analysis.value = questionAnalysis.value;
|
||||
}
|
||||
const questionAnalysis = defineModel<any[]>('questionAnalysis');
|
||||
|
||||
// 构建表头
|
||||
const getTableHeadProps = (values: any[], option: any[]) => {
|
||||
|
||||
Reference in New Issue
Block a user