feat: 优化问卷分析页面样式和功能
1. 添加VSCode拼写检查配置,添加'vant'到字典 2. 优化问卷分析页面布局,设置100%宽度 3. 使用el-text组件优化问题标题的文本显示 4. 修复问卷项操作按钮的禁用状态逻辑
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -73,5 +73,8 @@
|
||||
"less",
|
||||
"vue"
|
||||
],
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib"
|
||||
"typescript.tsdk": "node_modules\\typescript\\lib",
|
||||
"cSpell.words": [
|
||||
"vant"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@load="onLoad"
|
||||
>
|
||||
<div v-for="item in survey" v-if="survey.length > 0" :key="item" class="new-survey_item">
|
||||
<survey-item :survey="item" :is-analysis="true" />
|
||||
<survey-item :survey="item" :is-analysis="true" :disable-action-button="false" />
|
||||
</div>
|
||||
<empty-container v-else />
|
||||
</van-list>
|
||||
|
||||
@@ -26,6 +26,9 @@ const router = useRouter();
|
||||
const emit = defineEmits(['post-analysis', 'post-surveys']);
|
||||
const survey = defineModel<SurveyItem>('survey', { required: true });
|
||||
const isAnalysis = defineModel('isAnalysis', { default: false, type: Boolean });
|
||||
// 禁用 action 功能
|
||||
const disableActionButton = defineModel('disableActionButton', { default: false, type: Boolean });
|
||||
|
||||
const postAnalysis = defineModel<Function>('post-analysis');
|
||||
function setImg(code: number) {
|
||||
const imageMap: { [key: number]: string } = {
|
||||
@@ -201,15 +204,9 @@ function copyItem(item: SurveyItem) {
|
||||
</el-space>
|
||||
</div>
|
||||
<!-- action 功能位置 -->
|
||||
<div v-if="!isAnalysis" class="survey_item_action">
|
||||
<div v-if="!disableActionButton" class="survey_item_action">
|
||||
<div>
|
||||
<el-button :disabled="survey.source === 0" @click="editItem(survey)"> 编辑 </el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- style="border: 1px solid #71b73c"-->
|
||||
<!-- @click="toPreview(survey)"-->
|
||||
<!-- >-->
|
||||
<!-- <el-text style="color: #71b73c">预览</el-text>-->
|
||||
<!-- </el-button>-->
|
||||
<el-button style="border: 1px solid #71b73c" @click="toAnalysis(survey)">
|
||||
<el-text style="color: #71b73c">统计</el-text>
|
||||
</el-button>
|
||||
|
||||
@@ -43,6 +43,7 @@ useFetchAnalysis(sn.value);
|
||||
<template #extra>
|
||||
<survey-item
|
||||
:is-analysis="disableInsight"
|
||||
:disable-action-button="true"
|
||||
:survey="currentSurvey as SurveyItem"
|
||||
@post-analysis="postAnalysis(sn as string)"
|
||||
/>
|
||||
@@ -77,7 +78,7 @@ useFetchAnalysis(sn.value);
|
||||
|
||||
.survey-container {
|
||||
padding: theme.$gap;
|
||||
width: 100%;
|
||||
// width: 100%;
|
||||
|
||||
.survey-item,
|
||||
.ai-insight,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="width: 100%">
|
||||
<section v-for="analysis in questionAnalysis" :key="analysis.stem" class="mt10">
|
||||
<!-- {{ analysis }} -->
|
||||
<!-- 问题标题 -->
|
||||
<el-tag type="success" size="small">{{
|
||||
questionTypeMap.get(analysis.question_type as number)
|
||||
}}</el-tag>
|
||||
{{ analysis.stem }}
|
||||
<el-text>{{ analysis.stem }}</el-text>
|
||||
|
||||
<!-- 问题图表部分 -->
|
||||
<chart-msg
|
||||
|
||||
Reference in New Issue
Block a user