Default Changelist
This commit is contained in:
@@ -1,52 +1,114 @@
|
||||
<template>
|
||||
<div class="design-create">
|
||||
<draggable v-if="questionInfo.questions.length > 0" v-model:data="questionInfo.questions" item-key="id"
|
||||
handle=".moveQuestion" chosenClass="chosen" animation="300" :scroll="true">
|
||||
<draggable
|
||||
v-if="questionInfo.questions.length > 0"
|
||||
v-model:data="questionInfo.questions"
|
||||
item-key="id"
|
||||
handle=".moveQuestion"
|
||||
chosenClass="chosen"
|
||||
animation="300"
|
||||
:scroll="true"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<choose-question :element="element" :questions="questionInfo.questions" :index="index"
|
||||
:chooseQuestionId="chooseQuestionId" :questionsInfo="questionInfo"
|
||||
@get-choose-question-id="getChooseQuestionId" @move="emitFun.move" @copy="emitFun.copy"
|
||||
@delete="emitFun.delete" @setting="emitFun.setting" @logics="emitFun.logics">
|
||||
<choose-question
|
||||
:element="element"
|
||||
:questions="questionInfo.questions"
|
||||
:index="index"
|
||||
:chooseQuestionId="chooseQuestionId"
|
||||
:questionsInfo="questionInfo"
|
||||
@get-choose-question-id="getChooseQuestionId"
|
||||
@move="emitFun.move"
|
||||
@copy="emitFun.copy"
|
||||
@delete="emitFun.delete"
|
||||
@setting="emitFun.setting"
|
||||
@logics="emitFun.logics"
|
||||
>
|
||||
<!-- 打分题 -->
|
||||
<Rate v-if="element.question_type === 5" :element="computedElement(element)" :index="index"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement" />
|
||||
<Rate
|
||||
v-if="element.question_type === 5"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
<!-- 选择题 -->
|
||||
<Choice v-if="element.question_type === 1 || element.question_type === 2" :index="index"
|
||||
:active="chooseQuestionId === element.id" :element="computedElement(element)"
|
||||
@update:element="updateElement"></Choice>
|
||||
<Choice
|
||||
v-if="element.question_type === 1 || element.question_type === 2"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
:element="computedElement(element)"
|
||||
@update:element="updateElement"
|
||||
></Choice>
|
||||
<!-- 填空题 -->
|
||||
<Completion v-if="element.question_type === 4" :index="index" :element="computedElement(element)"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement"></Completion>
|
||||
<Completion
|
||||
v-if="element.question_type === 4"
|
||||
:index="index"
|
||||
:element="computedElement(element)"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
></Completion>
|
||||
|
||||
<!-- 矩阵题 -->
|
||||
<martrix-question v-if="
|
||||
element.question_type === 8 ||
|
||||
element.question_type === 9 ||
|
||||
element.question_type === 10
|
||||
" :element="computedElement(element)" :index="index" :active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement" />
|
||||
<martrix-question
|
||||
v-if="
|
||||
element.question_type === 8 ||
|
||||
element.question_type === 9 ||
|
||||
element.question_type === 10
|
||||
"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
|
||||
<!-- 签名题 -->
|
||||
<sign-question v-if="[22].includes(element.question_type)" :element="computedElement(element)" :index="index"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement" />
|
||||
<sign-question
|
||||
v-if="[22].includes(element.question_type)"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
|
||||
<!-- 文件上传题 -->
|
||||
<file-upload v-if="element.question_type === 18" :element="computedElement(element)" :index="index"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement" />
|
||||
<file-upload
|
||||
v-if="element.question_type === 18"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
|
||||
<!--图文-->
|
||||
<TextWithImages v-if="element.question_type === 6" :element="computedElement(element)" :index="index"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement" />
|
||||
<TextWithImages
|
||||
v-if="element.question_type === 6"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
<!--NPS-->
|
||||
<NPS v-if="element.question_type === 106" :element="computedElement(element)" :index="index"
|
||||
:active="chooseQuestionId === element.id" @update:element="updateElement" />
|
||||
<NPS
|
||||
v-if="element.question_type === 106"
|
||||
:element="computedElement(element)"
|
||||
:index="index"
|
||||
:active="chooseQuestionId === element.id"
|
||||
@update:element="updateElement"
|
||||
/>
|
||||
<!--组件底部左侧操作-->
|
||||
<template #action="{ element: el }">
|
||||
<div v-if="el.id === chooseQuestionId" class="flex slot-actions">
|
||||
<template v-for="(item, optionIndex) in actionOptions">
|
||||
<div v-if="item.question_type.includes(el.question_type)" :key="optionIndex" class="flex">
|
||||
<div
|
||||
v-if="item.question_type.includes(el.question_type)"
|
||||
:key="optionIndex"
|
||||
class="flex"
|
||||
>
|
||||
<template v-for="(act, actIndex) in item.actions" :key="actIndex">
|
||||
<div class="flex align-center action-item theme-color" @click="actionEvent(act, el)">
|
||||
<div
|
||||
class="flex align-center action-item theme-color"
|
||||
@click="actionEvent(act, el)"
|
||||
>
|
||||
<van-icon :name="act.icon" class="icons"></van-icon>
|
||||
<span class="ml10">{{ act.label }}</span>
|
||||
</div>
|
||||
@@ -59,8 +121,13 @@
|
||||
<!-- 增加控制按钮-->
|
||||
<slot name="button" :item="element"></slot>
|
||||
<div v-if="!filterGap">
|
||||
<paging v-if="!element.question_type && questionInfo.survey.pages.length > 1" :info="element" :index="index"
|
||||
:active="pageIsActive(activeIndex, questionInfo.questions, element.page)" @click.stop="" />
|
||||
<paging
|
||||
v-if="!element.question_type && questionInfo.survey.pages.length > 1"
|
||||
:info="element"
|
||||
:index="index"
|
||||
:active="pageIsActive(activeIndex, questionInfo.questions, element.page)"
|
||||
@click.stop=""
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
@@ -128,7 +195,7 @@ watch(
|
||||
/**
|
||||
* 工具函数
|
||||
*/
|
||||
function util () {
|
||||
function util() {
|
||||
/** 通过id找到数组中对应的下标 */
|
||||
const getIndexById = (arr, id) => arr.findIndex((i) => i.id === id);
|
||||
/** 通过分页找到数组中对应的下标 */
|
||||
@@ -265,7 +332,7 @@ const actionFun = {
|
||||
},
|
||||
option_index: element.last_option_index + 1,
|
||||
parent_id: 0,
|
||||
type: 0,
|
||||
type: 1,
|
||||
cascade: [],
|
||||
config: []
|
||||
});
|
||||
@@ -293,6 +360,7 @@ const actionFun = {
|
||||
title: '',
|
||||
instructions: [],
|
||||
option_type: 0,
|
||||
type: 1,
|
||||
limit_right_content: '<p>右极文字1</p>'
|
||||
},
|
||||
parent_id: 0,
|
||||
@@ -323,6 +391,7 @@ const actionFun = {
|
||||
title: '',
|
||||
instructions: [],
|
||||
option_type: 0,
|
||||
type: 2,
|
||||
limit_right_content: '<p>右极文字1</p>'
|
||||
},
|
||||
parent_id: 0,
|
||||
@@ -404,7 +473,7 @@ const updateElement = (newElement) => {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
& .action-item+.action-item {
|
||||
& .action-item + .action-item {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ const pastTemplate = () => {
|
||||
if (res.data) {
|
||||
snQuestions({ sn: res.data.data.sn }).then((ques) => {
|
||||
if (ques.data) {
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</p>`;
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!</p>`;
|
||||
store.questionsInfo.value = ques.data.data;
|
||||
saveQuestions({
|
||||
sn: res.data.data.sn,
|
||||
|
||||
@@ -63,7 +63,7 @@ const createdQuestion = (item) => {
|
||||
const createdApx = (res) => {
|
||||
snQuestions({ sn: res.data.data.sn }).then((ques) => {
|
||||
if (ques.data) {
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</p>`;
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!</p>`;
|
||||
store.questionsInfo.value = ques.data.data;
|
||||
saveQuestions({
|
||||
sn: res.data.data.sn,
|
||||
|
||||
@@ -64,7 +64,7 @@ const createdQuestion = (item) => {
|
||||
const createdApx = (res) => {
|
||||
snQuestions({ sn: res.data.data.sn }).then((ques) => {
|
||||
if (ques.data) {
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</p>`;
|
||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!</p>`;
|
||||
store.questionsInfo.value = ques.data.data;
|
||||
saveQuestions({
|
||||
sn: res.data.data.sn,
|
||||
|
||||
@@ -610,13 +610,19 @@ onMounted(async () => {
|
||||
height: 30px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 18px;
|
||||
|
||||
div {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.introduction) {
|
||||
overflow: auto;
|
||||
width: 230px;
|
||||
height: 45px;
|
||||
& div {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,16 +14,14 @@
|
||||
<!-- LOGO -->
|
||||
|
||||
<div v-if="page !== 0 && page !== pages.length + 1" class="preview-info">
|
||||
<van-field label-align="top">
|
||||
<template #label>
|
||||
<div class="preview-info-header" v-html="questionsData?.survey?.title"></div>
|
||||
</template>
|
||||
<template #input>
|
||||
<div class="preview-info-header-intro" v-html="questionsData?.survey?.introduction"></div>
|
||||
</template>
|
||||
</van-field>
|
||||
<div>
|
||||
<div class="preview-info-header" v-html="questionsData?.survey?.title"></div>
|
||||
<div class="preview-info-header-intro" v-html="questionsData?.survey?.introduction"></div>
|
||||
</div>
|
||||
|
||||
<div class="preview-icon">
|
||||
<img :src="icon" alt="icon" />
|
||||
<div class="right-icon"></div>
|
||||
<!-- <img :src="icon" alt="icon" />-->
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@@ -1465,17 +1463,23 @@ function toUrl(url) {
|
||||
|
||||
.preview-icon {
|
||||
position: relative;
|
||||
grid-row: 1/3;
|
||||
grid-column: 2/3;
|
||||
flex: 1;
|
||||
width: 65px; /* 根据实际图片大小调整 */
|
||||
height: 50px;
|
||||
margin-right: 40px;
|
||||
margin-left: 30px;
|
||||
padding-top: 30px;
|
||||
|
||||
//width: 40%; /* 根据实际图片大小调整 */
|
||||
//height: 85px; /* 根据实际图片大小调整 */
|
||||
img {
|
||||
& .right-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 64px;
|
||||
height: 139px;
|
||||
bottom: -70px;
|
||||
left: -10px;
|
||||
width: 65px; /* 根据实际图片大小调整 */
|
||||
height: 140px; /* 根据实际图片大小调整 */
|
||||
background: url('@/assets/img/create-right-back.png') no-repeat center center;
|
||||
background-size: cover;
|
||||
|
||||
//transform: translate(-50% -50%);
|
||||
}
|
||||
@@ -1485,18 +1489,18 @@ function toUrl(url) {
|
||||
overflow: hidden;
|
||||
|
||||
//min-height: calc(100vh - 100px);
|
||||
padding: 10px;
|
||||
//padding: 0px 10px 10px 10px;
|
||||
|
||||
//background: linear-gradient(to bottom, #71b73c 200px, #f2f2f2 300px);
|
||||
|
||||
.questions {
|
||||
overflow: hidden;
|
||||
padding-bottom: 50px;
|
||||
padding: 10px 10px 50px 10px;
|
||||
|
||||
.question {
|
||||
overflow: hidden;
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
//margin-top: 10px;
|
||||
//padding: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
@@ -1505,10 +1509,11 @@ function toUrl(url) {
|
||||
}
|
||||
|
||||
.preview-info {
|
||||
display: grid;
|
||||
display: flex;
|
||||
grid-template-columns: 1fr 80px;
|
||||
max-height: 75px;
|
||||
margin-bottom: 10px;
|
||||
padding: 0 20px;
|
||||
|
||||
//margin: 0;
|
||||
background-color: transparent;
|
||||
@@ -1526,24 +1531,25 @@ function toUrl(url) {
|
||||
}
|
||||
|
||||
.preview-info-header {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
|
||||
//@include preview-info-header;
|
||||
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
|
||||
& > :first-child {
|
||||
max-width: 70%;
|
||||
}
|
||||
font-size: 18px;
|
||||
width: 230px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.preview-info-header-intro {
|
||||
overflow: scroll;
|
||||
max-height: 45px;
|
||||
width: 210px;
|
||||
height: 45px;
|
||||
color: white;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
font-size: 13px;
|
||||
|
||||
@include preview-info-header;
|
||||
//@include preview-info-header;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user