Merge remote-tracking branch 'origin/feature/feature-20250331-h5' into feature/feature-20250331-h5
# Conflicts: # src/views/Design/Index.vue # src/views/Survey/views/Create/Index.vue
This commit is contained in:
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -32,7 +32,7 @@
|
|||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true
|
||||||
},
|
},
|
||||||
"[vue]": {
|
"[vue]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
"editor.defaultFormatter": "Vue.volar",
|
||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true
|
||||||
},
|
},
|
||||||
"css.validate": false, //用来校验CSS文件中的语法错误和潜在的问题
|
"css.validate": false, //用来校验CSS文件中的语法错误和潜在的问题
|
||||||
|
|||||||
@@ -87,11 +87,7 @@
|
|||||||
<template #action="{ element: el }">
|
<template #action="{ element: el }">
|
||||||
<div class="flex slot-actions">
|
<div class="flex slot-actions">
|
||||||
<template v-for="(item, optionIndex) in actionOptions">
|
<template v-for="(item, optionIndex) in actionOptions">
|
||||||
<div
|
<div v-if="item.question_type.includes(el.question_type)" :key="optionIndex" class="flex">
|
||||||
v-if="item.question_type.includes(el.question_type)"
|
|
||||||
:key="optionIndex"
|
|
||||||
class="flex"
|
|
||||||
>
|
|
||||||
<template v-for="(act, actIndex) in item.actions" :key="actIndex">
|
<template v-for="(act, actIndex) in item.actions" :key="actIndex">
|
||||||
<div class="flex align-center action-item" @click="actionEvent(act, el)">
|
<div class="flex align-center action-item" @click="actionEvent(act, el)">
|
||||||
<van-icon :name="act.icon"></van-icon>
|
<van-icon :name="act.icon"></van-icon>
|
||||||
@@ -106,13 +102,12 @@
|
|||||||
|
|
||||||
<!-- {{ element.question_type }}-->
|
<!-- {{ element.question_type }}-->
|
||||||
<!-- {{questionInfo.survey.pages.length}}-->
|
<!-- {{questionInfo.survey.pages.length}}-->
|
||||||
|
<div v-if="!filterGap">
|
||||||
<paging
|
<paging
|
||||||
v-if="!element.question_type && questionInfo.survey.pages.length > 1"
|
v-if="!element.question_type && questionInfo.survey.pages.length > 1" :info="element" :index="index"
|
||||||
:info="element"
|
:active="pageIsActive(activeIndex, questionInfo.questions, element.page)" @click.stop=""
|
||||||
:index="index"
|
|
||||||
:active="pageIsActive(activeIndex, questionInfo.questions, element.page)"
|
|
||||||
@click.stop=""
|
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</draggable>
|
</draggable>
|
||||||
</div>
|
</div>
|
||||||
@@ -180,6 +175,16 @@ function util() {
|
|||||||
copyStoreContent
|
copyStoreContent
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取所有的 question 列表内容
|
||||||
|
const { filterGap } = defineProps({
|
||||||
|
filterGap: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const { pageIsActive } = util();
|
const { pageIsActive } = util();
|
||||||
// 获取 Store 实例
|
// 获取 Store 实例
|
||||||
const counterStore = useCounterStore();
|
const counterStore = useCounterStore();
|
||||||
|
|||||||
@@ -1,48 +1,16 @@
|
|||||||
<template>
|
<script setup lang="ts">
|
||||||
<div class="container preview-container">
|
import PreviewIndex from './Index.vue';
|
||||||
<div v-for="(element, index) in questionsInfo.questions" :key="index" class="element-container">
|
|
||||||
<Choice v-if="element.question_type === 1" :element="element" :active="false"></Choice>
|
|
||||||
<!-- 填空题 -->
|
|
||||||
<Completion
|
|
||||||
v-if="element.question_type === 4"
|
|
||||||
:element="element"
|
|
||||||
:active="chooseQuestionId === element.id"
|
|
||||||
sn="lXEBBpE2"
|
|
||||||
></Completion>
|
|
||||||
|
|
||||||
<martrix-question
|
|
||||||
v-if="element.question_type === 9"
|
|
||||||
:element="element"
|
|
||||||
:active="chooseQuestionId === element.id"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 打分题 -->
|
|
||||||
<Rate
|
|
||||||
v-if="element.question_type === 5"
|
|
||||||
:element="element"
|
|
||||||
:active="chooseQuestionId === element.id"
|
|
||||||
sn="lXEBBpE2"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup>
|
|
||||||
import Choice from '@/views/Design/components/Questions/Choice.vue';
|
|
||||||
// store paine
|
|
||||||
import { storeToRefs } from 'pinia';
|
|
||||||
import { useCounterStore } from '@/stores/counter';
|
|
||||||
import MartrixQuestion from '@/views/Design/components/Questions/MartrixQuestion.vue';
|
|
||||||
import Rate from '@/views/Design/components/Questions/Rate.vue';
|
|
||||||
import Completion from '@/views/Design/components/Questions/Completion.vue';
|
|
||||||
const store = useCounterStore();
|
|
||||||
const { questionsInfo } = storeToRefs(store);
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
|
||||||
.preview-container {
|
|
||||||
background: #f5f5f5;
|
|
||||||
|
|
||||||
& .element-container {
|
<template>
|
||||||
padding: 8px;
|
<van-nav-bar title="预览" left-arrow>
|
||||||
}
|
<template #right>
|
||||||
}
|
<van-icon name="search" />
|
||||||
</style>
|
</template>
|
||||||
|
</van-nav-bar>
|
||||||
|
|
||||||
|
<preview-index :filterGap="true"></preview-index>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
Reference in New Issue
Block a user