diff --git a/src/assets/img/market/16.png b/src/assets/img/market/16.png index 5e3c826..d5759e3 100644 Binary files a/src/assets/img/market/16.png and b/src/assets/img/market/16.png differ diff --git a/src/assets/img/publish/edit.png b/src/assets/img/publish/edit.png index 7135c4e..8a8b2db 100644 Binary files a/src/assets/img/publish/edit.png and b/src/assets/img/publish/edit.png differ diff --git a/src/assets/img/publish/end.png b/src/assets/img/publish/end.png index 4da6e51..a524818 100644 Binary files a/src/assets/img/publish/end.png and b/src/assets/img/publish/end.png differ diff --git a/src/assets/img/publish/publish.png b/src/assets/img/publish/publish.png index c9d6a54..68ea498 100644 Binary files a/src/assets/img/publish/publish.png and b/src/assets/img/publish/publish.png differ diff --git a/src/components/Analysis/Index.vue b/src/components/Analysis/Index.vue index eb21420..b622544 100644 --- a/src/components/Analysis/Index.vue +++ b/src/components/Analysis/Index.vue @@ -6,29 +6,32 @@ import { getTableData, setDimensionData } from '@/views/Survey/views/Analysis/components/AnalysisInfo/hooks/pieSeries'; +import EmptyContainer from '@/views/Survey/components/EmptyContainer.vue'; -// series 信息 const tableData = ref([]); const analysis = defineModel('analysis'); -// console.log('analysis', analysis.value); - +// series 信息 const series = ref([]); const dimension = defineModel('dimension'); // 图标高度 const chartHeight = computed(() => { // 需要增加的高度, 由于字多了他就会高度异常,所有要指定一个动态高度 let addHeight = 0; - const optionLength = analysis.value?.option?.length; + // const optionLength = analysis.value?.option?.length; + // 做一些额外的检测, 如果 option 下面的title 字段超过 8 个,就把 addHeight 增加 analysis.value?.option?.forEach((item: any) => { + console.log(item); + if (item.title?.length > 8) { - addHeight += 9; + addHeight += 2; } }); + console.log(`addHeight`, addHeight); // 每三个选项高度增加 20px, 默认 300px - return dimension.value ? 280 : 280 + (optionLength - 1) * addHeight; + return dimension.value ? 280 : 280 + addHeight; }); const index = ref(0); @@ -37,18 +40,17 @@ const index = ref(0); watch( () => analysis.value, async (value) => { - // 排除空数据渲染图标步骤 - tableData.value = { ...analysis.value, option: getTableData(analysis.value) }; - // console.log(`图标的高度是`, chartHeight.value); + // console.log(`tableData.value`, tableData.value); series.value = formatData(dimension.value ? tableData.value : analysis.value, index.value); + // console.log(`series value`, series.value); + const pieChart = useTemplateRef('pieChart'); - // console.log(`series value `, series.value); if (!series.value?.data?.length) return; useSetPieChart(pieChart, series, { title: false, legend: false }); @@ -60,12 +62,42 @@ const changeChart = (i: number) => { index.value = i; series.value = formatData(tableData.value, index.value); + // console.log(`series value. by changeChart`, series.value); + if (series.value.data.length <= 0) { series.value.data = [{ value: 0, name: 0 }]; } // const pieChart = useTemplateRef('pieChart'); // useSetPieChart(pieChart, series, { title: false, legend: false }); }; + +const chartVisible = computed(() => { + /** + * 针对特殊题型做处理, + * 首先就是矩阵的题目 question_type 为 8 9 10 + * + * */ + + if ( + analysis.value.question_type === 8 || + analysis.value.question_type === 9 || + analysis.value.question_type === 10 + ) { + // console.log(`series.value on matrix`, series.value?.data); + const data = series.value?.data as { name: any; value: any }[]; + + // 过滤后的 data 数据, + const filterData = data.filter((item) => item.value != 0 && item.name != 0); + return filterData.length; + // series.value?.data.forEach((item: any`1[]) => { + // if (item.value > 0) { + // return true; + // } + // }); + } + + return series.value?.data?.length; +}); diff --git a/src/components/Navigation/Index.vue b/src/components/Navigation/Index.vue index 20fc934..72c16c8 100644 --- a/src/components/Navigation/Index.vue +++ b/src/components/Navigation/Index.vue @@ -17,14 +17,14 @@ const navigation = ref([ icon: 'home-o', inactive: '' }, - { - title: '伊调研', - // link: { - // name: 'home', - // path: '/home' - // }, - icon: yl - }, + // { + // title: '伊调研', + // // link: { + // // name: 'home', + // // path: '/home' + // // }, + // icon: yl + // }, { title: '我的', link: { @@ -66,7 +66,7 @@ watch(activeTab, (value) => {