feat(survey): 问卷列表页面添加搜索功能

- 在问卷列表页面添加搜索框
- 优化页面布局,调整搜索框位置- 更新样式,确保搜索框与页面其他元素协调
This commit is contained in:
陈昱达
2025-03-18 11:34:42 +08:00
parent b91850c508
commit 1f0ffa679b
34 changed files with 371 additions and 355 deletions

3
components.d.ts vendored
View File

@@ -2,7 +2,7 @@
// @ts-nocheck // @ts-nocheck
// Generated by unplugin-vue-components // Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
export {}; export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
@@ -39,6 +39,7 @@ declare module 'vue' {
VanRadio: typeof import('vant/es')['Radio'] VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup'] VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanRow: typeof import('vant/es')['Row'] VanRow: typeof import('vant/es')['Row']
VanSearch: typeof import('vant/es')['Search']
VanStepper: typeof import('vant/es')['Stepper'] VanStepper: typeof import('vant/es')['Stepper']
VanSwitch: typeof import('vant/es')['Switch'] VanSwitch: typeof import('vant/es')['Switch']
VanTab: typeof import('vant/es')['Tab'] VanTab: typeof import('vant/es')['Tab']

View File

@@ -85,9 +85,9 @@ export default class CommonApi {
}; };
/* eslint-disable no-useless-escape */ /* eslint-disable no-useless-escape */
const reg = /\\|\/|\?|\|\*|"|“|”|'|||<|>|{|}|\[|\]|\【|\】||:|、|\^|\$|!|~|`|\s|\+/g; const reg = /\\|\/|\?|\|\*|"|“|”|'|||<|>|{|}|\[|\]|\【|\】||:|、|\^|\$|!|~|`|\s|\+/g;
name = name
name || = name
getRandomFileName(file?.name?.replace(reg, '') ?? '' ?? `${new Date().getTime()}.png`); || getRandomFileName(file?.name?.replace(reg, '') ?? '' ?? `${new Date().getTime()}.png`);
const res = await CommonApi.getOssInfo(); const res = await CommonApi.getOssInfo();
/* eslint-enable no-useless-escape */ /* eslint-enable no-useless-escape */

View File

@@ -20,6 +20,7 @@
--van-calendar-range-edge-background: var(--primary-color); --van-calendar-range-edge-background: var(--primary-color);
--van-cascader-active-color: var(--primary-color); --van-cascader-active-color: var(--primary-color);
--status-bar-height: 20px; --status-bar-height: 20px;
--sticky-top-height: calc(var(--status-bar-height) + calc(var(--van-nav-bar-height) + 13px));
} }
/* semantic color variables for this project */ /* semantic color variables for this project */

View File

@@ -170,8 +170,8 @@ const getMaxDateLimit = computed(() => {
props.format props.format
); );
const tempStr = '0000-12-31 23:59:59'; const tempStr = '0000-12-31 23:59:59';
const result = const result
props.maxDate.length !== 0 && thisMax.length > props.maxDate.length = props.maxDate.length !== 0 && thisMax.length > props.maxDate.length
? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length) ? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length)
: thisMax; : thisMax;
return result.slice(0, props.format.length); return result.slice(0, props.format.length);
@@ -194,8 +194,8 @@ function onChange({ selectedValues, columnIndex }) {
renderMinuteColumns, renderMinuteColumns,
renderSecondColumns renderSecondColumns
]; ];
updateColumns[columnIndex] && updateColumns[columnIndex]
updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false); && updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false);
} }
// 渲染全部列 // 渲染全部列

View File

@@ -83,14 +83,14 @@ export default defineComponent({
<style scoped lang="scss"> <style scoped lang="scss">
.yl-select-wrapper { .yl-select-wrapper {
position: relative; position: relative;
outline-color: transparent;
border-color: transparent;
display: inline-block; display: inline-block;
padding: 2px 0;
border-color: transparent;
border-radius: 12px;
background: #fafbfc;
outline-color: transparent;
font-size: 16px; /* 增加字体大小 */ font-size: 16px; /* 增加字体大小 */
line-height: 1.5; /* 增加行高 */ line-height: 1.5; /* 增加行高 */
padding: 2px 0;
background: #fafbfc;
border-radius: 12px;
} }
.yl-select-label { .yl-select-label {

View File

@@ -376,39 +376,39 @@ export function isCross(range1, range2) {
const isSibling = isLeft || isRight; const isSibling = isLeft || isRight;
// 逻辑包含循环 // 逻辑包含循环
const contain = const contain
(isPlainSequence && = (isPlainSequence
(((isNullish(start2) || isSequence(judge, start2, start1)) && && (((isNullish(start2) || isSequence(judge, start2, start1))
(isNullish(end2) || isSequence(judge, end2, start1))) || && (isNullish(end2) || isSequence(judge, end2, start1)))
((isNullish(start2) || isSequence(start1, start2, end1)) && || ((isNullish(start2) || isSequence(start1, start2, end1))
(isNullish(end2) || isSequence(start1, end2, end1))))) || && (isNullish(end2) || isSequence(start1, end2, end1)))))
(!isPlainSequence && || (!isPlainSequence
(judge < start1 && (judge < start1
? ((isNullish(start2) || isSequence(judge, start2, start1)) && ? ((isNullish(start2) || isSequence(judge, start2, start1))
(isNullish(end2) || isSequence(judge, end2, start1))) || && (isNullish(end2) || isSequence(judge, end2, start1)))
((isNullish(start2) || isSequence(start1, start2, end1)) && || ((isNullish(start2) || isSequence(start1, start2, end1))
(isNullish(end2) || isSequence(start1, end2, end1))) && (isNullish(end2) || isSequence(start1, end2, end1)))
: ((isNullish(start2) || isSequence(start1, start2, judge)) && : ((isNullish(start2) || isSequence(start1, start2, judge))
(isNullish(end2) || isSequence(start1, end2, judge))) || && (isNullish(end2) || isSequence(start1, end2, judge)))
((isNullish(start2) || isSequence(judge, start2, end1)) && || ((isNullish(start2) || isSequence(judge, start2, end1))
(isNullish(end2) || isSequence(judge, end2, end1))))); && (isNullish(end2) || isSequence(judge, end2, end1)))));
// 循环存在封闭区间,并且循环包含逻辑 // 循环存在封闭区间,并且循环包含逻辑
const contained = const contained
!isNullish(start2) && = !isNullish(start2)
!isNullish(end2) && && !isNullish(end2)
// [judge, start1, end1]; // [judge, start1, end1];
((isPlainSequence && start2 <= judge && end1 <= end2) || && ((isPlainSequence && start2 <= judge && end1 <= end2)
// [judge, start1, end1]; // [judge, start1, end1];
// [start1, judge, end1]; // [start1, judge, end1];
(!isPlainSequence && start2 <= start1 && start2 <= judge && end1 <= end2)); || (!isPlainSequence && start2 <= start1 && start2 <= judge && end1 <= end2));
// 循环不存在封闭区间 // 循环不存在封闭区间
const unCircled = const unCircled
(!isNullish(start2) && = (!isNullish(start2)
isNullish(end2) && && isNullish(end2)
((isPlainSequence && start2 === judge) || (!isPlainSequence && judge < start1) && ((isPlainSequence && start2 === judge) || (!isPlainSequence && judge < start1)
? start2 === judge ? start2 === judge
: start2 === start1)) || : start2 === start1))
(isNullish(start2) && !isNullish(end2) && end2 === end1); || (isNullish(start2) && !isNullish(end2) && end2 === end1);
return !(isSibling || contain || contained || unCircled); return !(isSibling || contain || contained || unCircled);
} }
@@ -428,8 +428,8 @@ function isSequence(s1, s2, s3, equal) {
* @param store * @param store
*/ */
export function updateNewQuestionsByLoopingEffect(quesSaveParam, store) { export function updateNewQuestionsByLoopingEffect(quesSaveParam, store) {
const { questionInfoBeforeModified = {}, questionInfo = {} } = const { questionInfoBeforeModified = {}, questionInfo = {} }
JSON.parse(JSON.stringify(store.state.common)) || {}; = JSON.parse(JSON.stringify(store.state.common)) || {};
const oldPages = questionInfoBeforeModified.survey.pages; const oldPages = questionInfoBeforeModified.survey.pages;
const newQuestions = questionInfo.questions; const newQuestions = questionInfo.questions;

View File

@@ -1,6 +1,5 @@
import { showConfirmDialog } from 'vant'; import { showConfirmDialog } from 'vant';
import { getQuestionList, getCheckSurvey } from '@/api/survey'; import { getQuestionList, getCheckSurvey } from '@/api/survey';
import appBridge from '@/assets/js/appBridge';
import { QUESTION_TYPE } from '@/layouts/config3d.constant.js'; import { QUESTION_TYPE } from '@/layouts/config3d.constant.js';
import { loopingAvailable } from '@/layouts/logic.js'; import { loopingAvailable } from '@/layouts/logic.js';
import { getDomText } from '@/utils/utils'; import { getDomText } from '@/utils/utils';
@@ -19,8 +18,12 @@ function showModal(options) {
icon: null, icon: null,
...options ...options
}) })
.then(() => {}) .then(() => {
.catch(() => {}); // then back
})
.catch(() => {
// error back
});
} }
/** /**
@@ -33,8 +36,8 @@ const canPlanetPublishPSM = function (data) {
let message = ''; let message = '';
let title = '题目设置未完成'; let title = '题目设置未完成';
const incompleteQuestionList = []; const incompleteQuestionList = [];
data.questions && data.questions
data.questions.forEach((s) => { && data.questions.forEach((s) => {
if (s.question_type === 101 && s.config.price_gradient.length <= 0) { if (s.question_type === 101 && s.config.price_gradient.length <= 0) {
isFb = false; isFb = false;
message = 'psm题目未完成设置请设置价格区间后投放'; message = 'psm题目未完成设置请设置价格区间后投放';
@@ -65,8 +68,8 @@ const canPlanetPublishMxdAndHotArea = function (data) {
const incompleteQuestionList = []; const incompleteQuestionList = [];
let type = 0; let type = 0;
let title = '题目设置未完成'; let title = '题目设置未完成';
data.questions && data.questions
data.questions.forEach((s) => { && data.questions.forEach((s) => {
if (s.question_type === 105 && s.config.design_version <= 0) { if (s.question_type === 105 && s.config.design_version <= 0) {
isFb = false; isFb = false;
message = 'maxdiff题目未完成设置请生成设计后投放'; message = 'maxdiff题目未完成设置请生成设计后投放';
@@ -111,8 +114,8 @@ const canPlanetPublish3D = function (data) {
let message = ''; let message = '';
const qSteams = []; const qSteams = [];
let title = ''; let title = '';
data.questions && data.questions
data.questions.forEach((s) => { && data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) { if (QUESTION_TYPE.contains(s.question_type)) {
try { try {
if (s.config.is_three_dimensions && !s.config.scene) { if (s.config.is_three_dimensions && !s.config.scene) {
@@ -142,15 +145,15 @@ const canPlanetPublish3D = function (data) {
let message = ''; let message = '';
const qSteams = []; const qSteams = [];
let title = ''; let title = '';
data.questions && data.questions
data.questions.forEach((s) => { && data.questions.forEach((s) => {
if (QUESTION_TYPE.contains(s.question_type)) { if (QUESTION_TYPE.contains(s.question_type)) {
try { try {
if (s.config.is_three_dimensions && s.config.is_binding_goods) { if (s.config.is_three_dimensions && s.config.is_binding_goods) {
const wares = []; const wares = [];
const _sceneInformation = s.config.scene_information; const _sceneInformation = s.config.scene_information;
const sceneInformation = const sceneInformation
typeof _sceneInformation === 'string' = typeof _sceneInformation === 'string'
? JSON.parse(_sceneInformation) ? JSON.parse(_sceneInformation)
: _sceneInformation; : _sceneInformation;
sceneInformation.shelves.forEach((shelf) => { sceneInformation.shelves.forEach((shelf) => {
@@ -206,8 +209,8 @@ const canPlanetPublishImage = function (data) {
let message = ''; let message = '';
const qSteams = []; const qSteams = [];
let title = ''; let title = '';
data.questions && data.questions
data.questions.forEach((s) => { && data.questions.forEach((s) => {
if (s.question_type === 13) { if (s.question_type === 13) {
try { try {
if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) { if (s.options.length <= 0 || s.options.some((y) => y.length <= 0)) {
@@ -302,8 +305,8 @@ function canPublishRandom(data, publishType) {
if (!isValidated) { if (!isValidated) {
errors.push({ errors.push({
message: message:
field.message || field.message
`请填写"${random.title}"中第${index + 1}组"随机题组"的"${field.name}"` || `请填写"${random.title}"中第${index + 1}组"随机题组"的"${field.name}"`
}); });
} }
}); });
@@ -382,11 +385,11 @@ function isLoopingLogicValid(data, publishType) {
if ( if (
(data?.cycle_pages || []).every((i) => { (data?.cycle_pages || []).every((i) => {
return ( return (
i.question_index && i.question_index
i.relation_type !== undefined && && i.relation_type !== undefined
i.relation_type !== null && && i.relation_type !== null
i.first_page && && i.first_page
i.last_page && i.last_page
); );
}) })
) { ) {

View File

@@ -1,2 +1,2 @@
export const surveyQuestion = export const surveyQuestion
'https://yls-api-uat.dctest.digitalyili.com/api/console/surveys/RWNK9BYp/questions'; = 'https://yls-api-uat.dctest.digitalyili.com/api/console/surveys/RWNK9BYp/questions';

View File

@@ -39,10 +39,10 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
if ( if (
response.status === 200 || response.status === 200
response.status === 201 || || response.status === 201
response.status === 202 || || response.status === 202
response.status === 204 || response.status === 204
) { ) {
if (response.config.method === 'put') { if (response.config.method === 'put') {
// message.success('保存中...'); // message.success('保存中...');

View File

@@ -45,10 +45,10 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
if ( if (
response.status === 200 || response.status === 200
response.status === 201 || || response.status === 201
response.status === 202 || || response.status === 202
response.status === 204 || response.status === 204
) { ) {
if (response.config.method === 'put') { if (response.config.method === 'put') {
// message.success('保存中...'); // message.success('保存中...');

View File

@@ -1,12 +1,13 @@
<template> <template>
<div class="option-action"> <div class="option-action">
<draggable <draggable
v-model:data="data" :data="element"
item-key="option_index" item-key="option_index"
:handle="handle" :handle="handle"
chosenClass="chosen" chosenClass="chosen"
animation="300" animation="300"
:scroll="true" :scroll="true"
@update:data="updateData"
> >
<!-- eslint-disable-next-line --> <!-- eslint-disable-next-line -->
<template #item="{ element, index }"> <template #item="{ element, index }">
@@ -83,7 +84,7 @@ import CheckboxAction from './components/OptionItemAction/CheckboxAction.vue';
import { ref } from 'vue'; import { ref } from 'vue';
import { showConfirmDialog } from 'vant'; import { showConfirmDialog } from 'vant';
import Draggable from '@/views/Design/components/Draggable.vue'; import Draggable from '@/views/Design/components/Draggable.vue';
const props = defineProps({ defineProps({
active: { active: {
type: Boolean, type: Boolean,
default: false default: false
@@ -100,7 +101,7 @@ const props = defineProps({
} }
}); });
const data = defineModel('data', { const element = defineModel('data', {
type: Array, type: Array,
default: () => [] default: () => []
}); });
@@ -113,7 +114,10 @@ const show = ref(false);
const moveShow = ref(false); const moveShow = ref(false);
const activeOption = ref({}); const activeOption = ref({});
const activeIndex = ref(-1); const activeIndex = ref(-1);
const element = ref(props.data);
const updateData = (newValue) => {
element.value = newValue;
};
// emit('update:data'); // emit('update:data');
/** /**

View File

@@ -268,8 +268,8 @@ const getSkipTypeText = (skipType) => {
const ls = []; const ls = [];
logics.map((item) => { logics.map((item) => {
if ( if (
item.skip_type === skipType && item.skip_type === skipType
item.question_index === activeQuestion.value.question_index && item.question_index === activeQuestion.value.question_index
) { ) {
ls.push(item); ls.push(item);
} }

View File

@@ -235,7 +235,7 @@ const textTypeList = [
const emit = defineEmits(['update:modelValue', 'saveOption']); const emit = defineEmits(['update:modelValue', 'saveOption']);
// //
const selectText = (textType) => { const selectText = (textType) => {
let item = textTypeList.filter((item) => item.value === textType)[0]; const item = textTypeList.filter((item) => item.value === textType)[0];
return item ? item.text : ''; return item ? item.text : '';
}; };
const confirm = ({ selectedValues }) => { const confirm = ({ selectedValues }) => {

View File

@@ -108,9 +108,9 @@ function isSurplus() {
return false; return false;
} else { } else {
return ( return (
parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10)) % parseFloat(((localConfig.value.max - localConfig.value.min) * 1000).toFixed(4, 10))
parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10)) === % parseFloat((localConfig.value.score_interval * 1000).toFixed(4, 10))
0 === 0
); );
} }
} }

View File

@@ -12,17 +12,11 @@
</div> </div>
</template> </template>
<script> <script setup>
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
import { onMounted, reactive, ref } from 'vue'; import { onMounted, ref } from 'vue';
export default { const props = defineProps({
name: 'Draggable',
props: {
data: {
type: Array,
default: () => []
},
itemKey: { itemKey: {
type: String, type: String,
default: '' default: ''
@@ -57,12 +51,19 @@ export default {
// 后续扩展 // 后续扩展
} }
} }
}, });
emits: ['update:data', 'end'],
setup(props, context) { const data = defineModel('data', {
type: Array,
default: () => []
});
const emit = defineEmits(['update:data', 'end']);
const sortable = ref(null); const sortable = ref(null);
const draggable = ref(null); const draggable = ref(null);
const copyData = reactive([]); // const copyData = reactive([]);
const options = { const options = {
handle: props.handle, handle: props.handle,
filter: props.filter, filter: props.filter,
@@ -81,24 +82,20 @@ export default {
// 拖动结束 // 拖动结束
onEnd: (evt) => { onEnd: (evt) => {
evt.stopPropagation(); evt.stopPropagation();
const tempData = JSON.parse(JSON.stringify(props.data)); const tempData = JSON.parse(JSON.stringify(data.value));
const oldEle = tempData[evt.oldIndex]; const oldEle = tempData[evt.oldIndex];
tempData.splice(evt.oldIndex, 1); data.value.splice(evt.oldIndex, 1);
tempData.splice(evt.newIndex, 0, oldEle); data.value.splice(evt.newIndex, 0, oldEle);
context.emit('update:data', tempData); // data.value = tempData;
context.emit('end', evt); // emit('update:data', tempData);
emit('end', evt);
} }
}; };
onMounted(() => { onMounted(() => {
if (sortable.value) sortable.value.destory(); if (sortable.value) sortable.value.destroy();
sortable.value = Sortable.create(draggable.value, options); sortable.value = Sortable.create(draggable.value, options);
}); });
return {
copyData,
draggable
};
}
};
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -102,7 +102,7 @@
</template> </template>
<script setup> <script setup>
import OptionAction from '@/views/Design/components/ActionCompoents/OptionAction.vue'; import OptionAction from '@/views/Design/components/ActionCompoents/OptionAction.vue';
import { defineAsyncComponent, toRefs, ref } from 'vue'; import { defineAsyncComponent, ref } from 'vue';
// 是否是预览 // 是否是预览
const isPreview = defineModel('isPreview', { default: false, type: Boolean }); const isPreview = defineModel('isPreview', { default: false, type: Boolean });
@@ -111,15 +111,7 @@ const choiceValue = defineModel('answer', { default: '1', type: String });
// console.log(`choiceValue.value`, choiceValue.value); // console.log(`choiceValue.value`, choiceValue.value);
const Contenteditable = defineAsyncComponent(() => import('@/components/contenteditable.vue')); const Contenteditable = defineAsyncComponent(() => import('@/components/contenteditable.vue'));
const props = defineProps({ defineProps({
element: {
type: Object,
default: () => {
return {
stem: ''
};
}
},
active: { active: {
type: Boolean, type: Boolean,
default: false default: false
@@ -129,7 +121,14 @@ const props = defineProps({
default: 0 default: 0
} }
}); });
const { element } = toRefs(props); const element = defineModel('element', {
type: Object,
default: () => {
return {
stem: ''
};
}
});
const value = ref([]); const value = ref([]);
const emit = defineEmits(['update:element']); const emit = defineEmits(['update:element']);
const emitValue = () => { const emitValue = () => {

View File

@@ -11,8 +11,7 @@
class="iconfont active-icon" class="iconfont active-icon"
:style="{ marginRight: isLastPage ? '0' : '16px' }" :style="{ marginRight: isLastPage ? '0' : '16px' }"
@click="activePage" @click="activePage"
>&#xe86c;</i >&#xe86c;</i>
>
<template v-if="!isLastPage"> <template v-if="!isLastPage">
<i class="iconfont moverQues" style="margin-right: 16px">&#xe71b;</i> <i class="iconfont moverQues" style="margin-right: 16px">&#xe71b;</i>
<i class="iconfont" @click="deleteHandle">&#xe6c5;</i> <i class="iconfont" @click="deleteHandle">&#xe6c5;</i>

View File

@@ -111,6 +111,7 @@ onMounted(() => {
border-radius: 10px; border-radius: 10px;
background: #fff; background: #fff;
color: #000; color: #000;
img { img {
height: 12px; height: 12px;
margin-right: 3px; margin-right: 3px;

View File

@@ -2,7 +2,7 @@
<div class=""> <div class="">
<div class="mark_container"> <div class="mark_container">
<!-- <van-row gutter="20">--> <!-- <van-row gutter="20">-->
<div v-for="(item, index) in info" @click="toDetail(item)" :key="index" class="market-item"> <div v-for="(item, index) in info" :key="index" class="market-item" @click="toDetail(item)">
<div class="content"> <div class="content">
<div class="title fw-bold fs-14"> <div class="title fw-bold fs-14">
<div class="flex align-center"> <div class="flex align-center">

View File

@@ -3,9 +3,7 @@
<div v-for="item in 10" :key="item" class="template"> <div v-for="item in 10" :key="item" class="template">
<img src="https://picsum.photos/131/128" width="110" height="100" alt="" /> <img src="https://picsum.photos/131/128" width="110" height="100" alt="" />
<span>报名/签到模板</span> <span>报名/签到模板</span>
<span style="color: rgb(127, 127, 127)" <span style="color: rgb(127, 127, 127)">报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span>
>报名签到 | 引用 {{ item }} | 创建人: {{ '张三' }}</span
>
</div> </div>
</div> </div>
</template> </template>

View File

@@ -1,4 +1,7 @@
<template> <template>
<div class="survey-search">
<van-search class="theme-background" :border="false" background="#71b73c"></van-search>
</div>
<div class="new-survey-container container"> <div class="new-survey-container container">
<van-list <van-list
v-model:loading="loading" v-model:loading="loading"
@@ -245,8 +248,17 @@ onMounted(() => {
background-color: #000; background-color: #000;
} }
.survey-search {
position: sticky;
top: var(--sticky-top-height);
z-index: 1000;
width: 100%;
padding: 0;
background-color: $theme-color;
}
.new-survey-container { .new-survey-container {
min-height: calc(100vh - 100px); //min-height: calc(100vh - 100px);
padding: 1px; padding: 1px;
//background: linear-gradient(to bottom, $theme-color 200px, #f2f2f2 300px); //background: linear-gradient(to bottom, $theme-color 200px, #f2f2f2 300px);
@@ -259,8 +271,9 @@ onMounted(() => {
.survey_item_info { .survey_item_info {
.survey_item_info_status { .survey_item_info_status {
margin-bottom: 15px;
display: flex; display: flex;
margin-bottom: 15px;
img { img {
height: 12px; height: 12px;
margin-right: 3px; margin-right: 3px;

View File

@@ -680,9 +680,9 @@ async function answer(callback, callbackBeforePage) {
question.error = translatedText.value.ThisIsARequiredQuestion; question.error = translatedText.value.ThisIsARequiredQuestion;
} }
} else if ( } else if (
answer && answer
questionType === 1 && && questionType === 1
Object.keys(answer).findIndex((value) => !answer[value]) !== -1 && Object.keys(answer).findIndex((value) => !answer[value]) !== -1
) { ) {
// 单选题 // 单选题
isError = true; isError = true;
@@ -859,8 +859,8 @@ async function answer(callback, callbackBeforePage) {
switch (config.text_type) { switch (config.text_type) {
// 字母 // 字母
case 3: case 3:
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test( ? !/^[a-zA-Z·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
@@ -869,8 +869,8 @@ async function answer(callback, callbackBeforePage) {
break; break;
// 中文 // 中文
case 4: case 4:
isError = isError
config.include_mark === 1 = config.include_mark === 1
? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test( ? !/^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|[·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]])+$/.test(
newValue newValue
) || !newValue.length ) || !newValue.length
@@ -881,8 +881,8 @@ async function answer(callback, callbackBeforePage) {
break; break;
// 邮箱 // 邮箱
case 5: case 5:
isError = isError
!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test( = !/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectEmail : '';
@@ -894,8 +894,8 @@ async function answer(callback, callbackBeforePage) {
break; break;
// 身份证号 // 身份证号
case 7: case 7:
isError = isError
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test( = !/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value value
); );
question.error = isError ? translatedText.value.PleaseEnterACorrectID : ''; question.error = isError ? translatedText.value.PleaseEnterACorrectID : '';
@@ -1037,14 +1037,14 @@ async function answer(callback, callbackBeforePage) {
currentQuestions.forEach((question, index) => { currentQuestions.forEach((question, index) => {
if (index >= warnStart && index < warnEnd) { if (index >= warnStart && index < warnEnd) {
if (repeat.repeat_type) { if (repeat.repeat_type) {
question.warning = question.warning
translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise( = translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise(
repeat.allow_repeat_num, repeat.allow_repeat_num,
repeat.repeat_type repeat.repeat_type
); );
} else { } else {
question.error = question.error
translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise( = translatedText.value.TheAnswerIsRepeatedMoreThanOneTimesPleaseRevise(
repeat.allow_repeat_num, repeat.allow_repeat_num,
repeat.repeat_type repeat.repeat_type
); );

View File

@@ -224,10 +224,10 @@ onMounted(async () => {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
margin: 0 10px; margin: 0 10px;
color: #000;
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
color: #000;
} }
} }

View File

@@ -6,8 +6,8 @@
</template> </template>
<script setup> <script setup>
const successImg = const successImg
'https://files.axshare.com/gsc/DR6075/c7/5a/53/c75a534148d349f1bb8e185629f784ac/images/%E9%A2%84%E8%A7%88/u123.png?pageId=18fb9d8a-b9b7-465f-9bd7-625b1b78f72e'; = 'https://files.axshare.com/gsc/DR6075/c7/5a/53/c75a534148d349f1bb8e185629f784ac/images/%E9%A2%84%E8%A7%88/u123.png?pageId=18fb9d8a-b9b7-465f-9bd7-625b1b78f72e';
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>