Merge branch 'feature/feature-20250430-h5' of https://e.coding.yili.com/yldc/ylst/ylst-survey-h5 into feature/feature-20250430-h5

This commit is contained in:
Huangzhe
2025-05-29 15:13:51 +08:00
4 changed files with 28 additions and 26 deletions

View File

@@ -23,14 +23,11 @@ const chartHeight = computed(() => {
// 做一些额外的检测, 如果 option 下面的title 字段超过 8 个,就把 addHeight 增加
analysis.value?.option?.forEach((item: any) => {
console.log(item);
if (item.title?.length > 8) {
addHeight += 2;
}
});
console.log(`addHeight`, addHeight);
// 每三个选项高度增加 20px 默认 300px
return dimension.value ? 280 : 280 + addHeight;
});
@@ -52,8 +49,6 @@ watch(
// console.log(`series value`, series.value);
if (!series.value.data?.length) return;
console.log(`series.value.data`, series.value.data);
// nextTick(() => {
// setTimeout(() => {
useSetPieChart(pieChart, series, { title: false, legend: false });
@@ -101,10 +96,7 @@ const chartVisible = computed(() => {
// });
} else if (analysis.value.question_type === 106 || analysis.value.question_type === 5) {
const data = series.value?.data as { name: any; value: any }[];
console.log(`series.value on nps`, series.value?.data);
const filterData = data?.filter((item) => item.value && Number(item.value) > 0);
console.log(`filterData`, filterData);
return filterData?.length;
// console.log(`series.value on nps`, series.value?.data);

View File

@@ -88,7 +88,7 @@ const props = ref<TablePropsType[]>([
<div style="width: 90vw">
<common-layout title="123">
<template #title>
<h3 class="recommend-layout-title">内容推荐</h3>
<h3 class="recommend-layout-title">创新速递</h3>
</template>
<span class="recommend-title">{{ data?.title }}</span>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import QuestionList from './components/QuestionList.vue';
import { ref, watch } from 'vue';
import { ref, watch, nextTick } from 'vue';
import { isDrag } from './hooks/useDragEvent';
const active = ref(0);
const total = ref(0);
@@ -10,27 +10,42 @@ function setActive(act: number, tol: number) {
total.value = tol;
}
const swiper = ref();
const questionComat = ref();
const questionComat = ref([]);
function handleDragStart() {
isDrag.value = true;
}
watch(
() => active.value,
(value) => {
setTimeout(() => {
// 获取高度
swiper.value.$el.style.height = questionComat.value[value]?.$el.scrollHeight + 30 + 'px';
swiper.value.resize();
}, 500);
updateSwiperHeight();
}
);
function slideChange() {
nextTick(() => {
if (questionComat.value && questionComat.value.length > 0) {
console.log('questionComat 已经加载完成');
updateSwiperHeight();
}
});
function updateSwiperHeight() {
setTimeout(() => {
// 获取高度
swiper.value.$el.style.height = questionComat.value[active.value]?.$el.scrollHeight + 30 + 'px';
swiper.value.resize();
if (swiper.value && questionComat.value[active.value]) {
console.log(questionComat.value[active.value]?.$el.scrollHeight, '123');
if (questionComat.value[active.value]?.$el.scrollHeight === 0) {
updateSwiperHeight();
return false;
}
swiper.value.$el.style.height =
questionComat.value[active.value]?.$el.scrollHeight + 30 + 'px';
swiper.value.resize();
}
}, 500);
}
function slideChange() {
updateSwiperHeight();
}
function handleDragEnd() {
isDrag.value = false;
// setTimeout(() => {

View File

@@ -52,9 +52,6 @@ export async function postAnalysis(sn: string) {
clearInterval(aiInsightsConfig.value.timer);
// 获取洞察结果
const { data } = await getAnalysis(sn);
console.log(data.other.overall_conclusion);
console.log(data);
aiAnalysisData.value = data;
aiInsightsConfig.value.message = data.other.overall_conclusion;
@@ -71,7 +68,5 @@ export async function checkAnalysis(sn: string) {
return data;
}
export {aiAnalysisData, currentSn };
export { aiAnalysisData, currentSn };
export { useFetchAnalysis } from '@/hooks/request/useSurvey';