feat: 新增选项操作功能并优化问卷设计页面
- 新增 OptionAction 组件用于选项操作 - 更新 BaseSelect 组件,集成 OptionAction 功能 - 优化 Paging 组件样式 - 调整 Design 页面布局和样式
This commit is contained in:
@@ -35,19 +35,21 @@
|
||||
<van-divider></van-divider>
|
||||
<van-cell title="题前隐藏" :border="false">
|
||||
<template #right-icon>
|
||||
<span> {{ getSkipTypeText() }} <van-icon name="arrow"></van-icon></span>
|
||||
<span> {{ getSkipTypeText(0) }} <van-icon name="arrow"></van-icon></span>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-cell title="题后跳转" :border="false">
|
||||
<template #right-icon>
|
||||
<span> 设置 <van-icon name="arrow"></van-icon></span>
|
||||
<span> {{ getSkipTypeText(1) }} <van-icon name="arrow"></van-icon></span>
|
||||
</template>
|
||||
</van-cell>
|
||||
<van-divider></van-divider>
|
||||
<van-cell title="下移选项" :border="false" @click="questionMove('down')"></van-cell>
|
||||
<van-cell title="上移选项" :border="false" @click="questionMove('up')"></van-cell>
|
||||
<van-cell title="下移题目" :border="false" @click="questionMove('down')"></van-cell>
|
||||
<van-cell title="上移题目" :border="false" @click="questionMove('up')"></van-cell>
|
||||
</van-cell-group>
|
||||
</van-action-sheet>
|
||||
|
||||
<!-- 题目操作 题前 题后-->
|
||||
</template>
|
||||
<script setup>
|
||||
import { showConfirmDialog } from 'vant';
|
||||
@@ -80,6 +82,7 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
const questions = ref(props.questions);
|
||||
|
||||
// 当前题目
|
||||
const activeQuestion = ref(props.data);
|
||||
|
||||
@@ -122,11 +125,21 @@ const questionMove = (action) => {
|
||||
};
|
||||
|
||||
// 获取题前隐藏 和题后 跳转 文字
|
||||
const getSkipTypeText = () => {
|
||||
setTimeout(() => {
|
||||
logics[0].id = 123;
|
||||
}, 2000);
|
||||
return logics[0].id;
|
||||
const getSkipTypeText = (skipType) => {
|
||||
const ls = [];
|
||||
logics.map((item) => {
|
||||
if (
|
||||
item.skip_type === skipType &&
|
||||
item.question_index === activeQuestion.value.question_index
|
||||
) {
|
||||
ls.push(item);
|
||||
}
|
||||
});
|
||||
let text = '未设置';
|
||||
if (ls.length > 0) {
|
||||
text = `已配置 (${ls.length})`;
|
||||
}
|
||||
return text;
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user