feat:首页更新
This commit is contained in:
4
auto-imports.d.ts
vendored
4
auto-imports.d.ts
vendored
@@ -5,6 +5,4 @@
|
|||||||
// Generated by unplugin-auto-import
|
// Generated by unplugin-auto-import
|
||||||
// biome-ignore lint: disable
|
// biome-ignore lint: disable
|
||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
2
components.d.ts
vendored
2
components.d.ts
vendored
@@ -23,8 +23,6 @@ declare module 'vue' {
|
|||||||
VanCol: typeof import('vant/es')['Col']
|
VanCol: typeof import('vant/es')['Col']
|
||||||
VanDivider: typeof import('vant/es')['Divider']
|
VanDivider: typeof import('vant/es')['Divider']
|
||||||
VanField: typeof import('vant/es')['Field']
|
VanField: typeof import('vant/es')['Field']
|
||||||
VanGrid: typeof import('vant/es')['Grid']
|
|
||||||
VanGridItem: typeof import('vant/es')['GridItem']
|
|
||||||
VanIcon: typeof import('vant/es')['Icon']
|
VanIcon: typeof import('vant/es')['Icon']
|
||||||
VanNavBar: typeof import('vant/es')['NavBar']
|
VanNavBar: typeof import('vant/es')['NavBar']
|
||||||
VanPicker: typeof import('vant/es')['Picker']
|
VanPicker: typeof import('vant/es')['Picker']
|
||||||
|
|||||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -21,6 +21,7 @@
|
|||||||
"vconsole": "^3.15.1",
|
"vconsole": "^3.15.1",
|
||||||
"vite-plugin-vue": "^0.0.1",
|
"vite-plugin-vue": "^0.0.1",
|
||||||
"vue": "^3.4.29",
|
"vue": "^3.4.29",
|
||||||
|
"vue-icons-plus": "^0.1.8",
|
||||||
"vue-router": "^4.3.3",
|
"vue-router": "^4.3.3",
|
||||||
"vuex": "^4.1.0"
|
"vuex": "^4.1.0"
|
||||||
},
|
},
|
||||||
@@ -10955,6 +10956,14 @@
|
|||||||
"url": "https://opencollective.com/eslint"
|
"url": "https://opencollective.com/eslint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vue-icons-plus": {
|
||||||
|
"version": "0.1.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/vue-icons-plus/-/vue-icons-plus-0.1.8.tgz",
|
||||||
|
"integrity": "sha512-Xc4hDsD/oP9waSUf44nSaFBhUPo+QkpKclx0S7//5BRACpXymctbit02epek0VRW6nb81pR486XmxPP/ofm2yQ==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": ">=2.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vue-router": {
|
"node_modules/vue-router": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { onMounted } from 'vue';
|
|||||||
import appBridge from '@/assets/js/appBridge';
|
import appBridge from '@/assets/js/appBridge';
|
||||||
import utils from '@/assets/js/common';
|
import utils from '@/assets/js/common';
|
||||||
|
|
||||||
onMounted(async() => {
|
onMounted(async () => {
|
||||||
if (utils.getParameter('digitalYiliToken')) {
|
if (utils.getParameter('digitalYiliToken')) {
|
||||||
// 隐藏/显示 header
|
// 隐藏/显示 header
|
||||||
appBridge.setHeaderShown(false);
|
appBridge.setHeaderShown(false);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* color palette from <https://github.com/vuejs/theme> */
|
/* color palette from <https://github.com/vuejs/theme> */
|
||||||
:root {
|
:root {
|
||||||
--primary-color : rgb(111,185, 55);
|
--primary-color: rgb(111, 185, 55);
|
||||||
--vt-c-white: #fff;
|
--vt-c-white: #fff;
|
||||||
--vt-c-white-soft: #f8f8f8;
|
--vt-c-white-soft: #f8f8f8;
|
||||||
--vt-c-white-mute: #f2f2f2;
|
--vt-c-white-mute: #f2f2f2;
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background: var(--color-background);
|
background: #f2f2f2;
|
||||||
color: var(--color-text);
|
color: var(--color-text);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-family:
|
font-family:
|
||||||
|
|||||||
@@ -53,12 +53,14 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
window.ReactNativeWebView.postMessage(JSON.stringify({
|
window.ReactNativeWebView.postMessage(
|
||||||
type: 'back',
|
JSON.stringify({
|
||||||
data: {
|
type: 'back',
|
||||||
force: false // 不强制返回,让原生端判断是否可以返回
|
data: {
|
||||||
}
|
force: false // 不强制返回,让原生端判断是否可以返回
|
||||||
}));
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return false;
|
return false;
|
||||||
@@ -142,12 +144,14 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
window.ReactNativeWebView.postMessage(JSON.stringify({
|
window.ReactNativeWebView.postMessage(
|
||||||
type: 'takeOverAndroidBack',
|
JSON.stringify({
|
||||||
data: {
|
type: 'takeOverAndroidBack',
|
||||||
enabled: true
|
data: {
|
||||||
}
|
enabled: true
|
||||||
}));
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 渲染全部列
|
// 渲染全部列
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||||
src:
|
src:
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
|
||||||
format('embedded-opentype'),
|
format('embedded-opentype'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
|
||||||
format('svg');
|
format('svg');
|
||||||
src:
|
src:
|
||||||
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff2?t=1741575060989') format('woff2'),
|
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff2?t=1741575060989') format('woff2'),
|
||||||
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff?t=1741575060989') format('woff'),
|
url('//at.alicdn.com/t/c/font_4841764_vat2jbvw3q.woff?t=1741575060989') format('woff'),
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||||
src:
|
src:
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix')
|
||||||
format('embedded-opentype'),
|
format('embedded-opentype'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
|
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont')
|
||||||
format('svg');
|
format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
|||||||
@@ -8,32 +8,9 @@
|
|||||||
left-arrow
|
left-arrow
|
||||||
@click-left="$router.go(-1)"
|
@click-left="$router.go(-1)"
|
||||||
/>
|
/>
|
||||||
<van-search
|
|
||||||
shape="round"
|
|
||||||
class="header-search"
|
|
||||||
placeholder="请输入搜索关键词"
|
|
||||||
background="#6fb937"
|
|
||||||
/>
|
|
||||||
</header>
|
</header>
|
||||||
<!-- content -->
|
<!-- content -->
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<!-- tabbar -->
|
|
||||||
<van-tabbar v-model="active">
|
|
||||||
<van-tabbar-item
|
|
||||||
v-for="tab in table"
|
|
||||||
:key="tab.title"
|
|
||||||
:name="tab.title"
|
|
||||||
@click="tabPath(tab.path)"
|
|
||||||
>
|
|
||||||
<!-- <van-tabbar-item v-for="tab in table" :key="tab.title" :name="tab.title" :to="tab.path"> -->
|
|
||||||
<span>{{ tab.title }}</span>
|
|
||||||
<!-- <template #icon="props"> -->
|
|
||||||
<template #icon>
|
|
||||||
<!-- <img :src="props.active ? icon.active : icon.inactive" /> -->
|
|
||||||
<img :src="tab.icon" />
|
|
||||||
</template>
|
|
||||||
</van-tabbar-item>
|
|
||||||
</van-tabbar>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -100,7 +77,7 @@ function tabPath(path) {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.common-layout {
|
.common-layout {
|
||||||
min-height: calc(100vh);
|
//min-height: calc(100vh);
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ function showModal(options) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishPSM = function(data) {
|
const canPlanetPublishPSM = function (data) {
|
||||||
let isFb = true;
|
let isFb = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
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;
|
||||||
content = 'psm题目未完成设置,请设置价格区间后投放';
|
content = 'psm题目未完成设置,请设置价格区间后投放';
|
||||||
@@ -77,15 +77,15 @@ const canPlanetPublishPSM = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishMxdAndHotArea = function(data) {
|
const canPlanetPublishMxdAndHotArea = function (data) {
|
||||||
let isFb = true;
|
let isFb = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
const qSteams = [];
|
const qSteams = [];
|
||||||
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;
|
||||||
content = 'maxdiff题目未完成设置,请生成设计后投放';
|
content = 'maxdiff题目未完成设置,请生成设计后投放';
|
||||||
@@ -124,14 +124,14 @@ const canPlanetPublishMxdAndHotArea = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublish3D = function(data) {
|
const canPlanetPublish3D = function (data) {
|
||||||
{
|
{
|
||||||
let canFB = true;
|
let canFB = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
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) {
|
||||||
@@ -161,15 +161,15 @@ const canPlanetPublish3D = function(data) {
|
|||||||
let content = '';
|
let content = '';
|
||||||
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) => {
|
||||||
@@ -221,14 +221,14 @@ const canPlanetPublish3D = function(data) {
|
|||||||
* @param {*} data
|
* @param {*} data
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const canPlanetPublishImage = function(data) {
|
const canPlanetPublishImage = function (data) {
|
||||||
{
|
{
|
||||||
let canFB = true;
|
let canFB = true;
|
||||||
let content = '';
|
let content = '';
|
||||||
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)) {
|
||||||
@@ -323,8 +323,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}”`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -378,7 +378,7 @@ function canPublishRandom(data, publishType) {
|
|||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export const canPlanetPublish = async function(sn, publishType) {
|
export const canPlanetPublish = async function (sn, publishType) {
|
||||||
const parsedPublishType = !publishType ? 2 : publishType;
|
const parsedPublishType = !publishType ? 2 : publishType;
|
||||||
|
|
||||||
const num = window.location.href.indexOf('code=');
|
const num = window.location.href.indexOf('code=');
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ router.beforeEach((to, from, next) => {
|
|||||||
});
|
});
|
||||||
app.use(createPinia());
|
app.use(createPinia());
|
||||||
app.use(router);
|
app.use(router);
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
@@ -38,10 +38,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('保存中...');
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ const router = createRouter({
|
|||||||
component: layout,
|
component: layout,
|
||||||
redirect: '/home',
|
redirect: '/home',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页'
|
title: '伊调研'
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/home',
|
path: '/home',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页'
|
title: '伊调研'
|
||||||
},
|
},
|
||||||
component: () => import('../views/Home/Index.vue')
|
component: () => import('../views/Home/Index.vue')
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -44,10 +44,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('保存中...');
|
||||||
|
|||||||
@@ -51,8 +51,8 @@
|
|||||||
<martrix-question
|
<martrix-question
|
||||||
v-if="
|
v-if="
|
||||||
element.question_type === 8 ||
|
element.question_type === 8 ||
|
||||||
element.question_type === 9 ||
|
element.question_type === 9 ||
|
||||||
element.question_type === 10
|
element.question_type === 10
|
||||||
"
|
"
|
||||||
:element="computedElement(element)"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
|
|||||||
@@ -117,23 +117,23 @@ const openMoveModel = (item, index) => {
|
|||||||
// 上下移动
|
// 上下移动
|
||||||
const optionMove = (action) => {
|
const optionMove = (action) => {
|
||||||
switch (action.action) {
|
switch (action.action) {
|
||||||
case 'up':
|
case 'up':
|
||||||
if (activeIndex.value === 0) {
|
if (activeIndex.value === 0) {
|
||||||
moveShow.value = false;
|
moveShow.value = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 向上移动
|
// 向上移动
|
||||||
element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]);
|
element.value.splice(activeIndex.value - 1, 0, element.value.splice(activeIndex.value, 1)[0]);
|
||||||
activeIndex.value -= 1;
|
activeIndex.value -= 1;
|
||||||
break;
|
break;
|
||||||
case 'down':
|
case 'down':
|
||||||
if (activeIndex.value === element.value.length - 1) {
|
if (activeIndex.value === element.value.length - 1) {
|
||||||
moveShow.value = false;
|
moveShow.value = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]);
|
element.value.splice(activeIndex.value + 1, 0, element.value.splice(activeIndex.value, 1)[0]);
|
||||||
activeIndex.value += 1;
|
activeIndex.value += 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -259,8 +259,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);
|
||||||
}
|
}
|
||||||
@@ -276,13 +276,13 @@ const getSkipTypeText = (skipType) => {
|
|||||||
|
|
||||||
const questionSetting = (type) => {
|
const questionSetting = (type) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'before':
|
case 'before':
|
||||||
questionBeforeShow.value = true;
|
questionBeforeShow.value = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'after':
|
case 'after':
|
||||||
questionBeforeShow.value = true;
|
questionBeforeShow.value = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
skipType.value = type === 'before' ? 1 : 0;
|
skipType.value = type === 'before' ? 1 : 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ const { element } = toRefs(props);
|
|||||||
*/
|
*/
|
||||||
const tableInputTypeMapping = (/** regx?: any */) => {
|
const tableInputTypeMapping = (/** regx?: any */) => {
|
||||||
switch (element.value.question_type) {
|
switch (element.value.question_type) {
|
||||||
case 8:
|
case 8:
|
||||||
return 'text';
|
return 'text';
|
||||||
case 9:
|
case 9:
|
||||||
return 'radio';
|
return 'radio';
|
||||||
case 10:
|
case 10:
|
||||||
return 'checkbox';
|
return 'checkbox';
|
||||||
default:
|
default:
|
||||||
return 'radio';
|
return 'radio';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const props = defineProps<{
|
|||||||
columns: { option: string; editor?: boolean }[];
|
columns: { option: string; editor?: boolean }[];
|
||||||
questionType: number;
|
questionType: number;
|
||||||
matrixAnswer: { [key: string]: any };
|
matrixAnswer: { [key: string]: any };
|
||||||
rowRecord:(number | string)[];
|
rowRecord: (number | string)[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);
|
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);
|
||||||
|
|||||||
@@ -23,14 +23,14 @@ const matrixAnswer = ref({
|
|||||||
*/
|
*/
|
||||||
const tableInputTypeMapping = (/** regx?: any */) => {
|
const tableInputTypeMapping = (/** regx?: any */) => {
|
||||||
switch (element.question_type) {
|
switch (element.question_type) {
|
||||||
case 8:
|
case 8:
|
||||||
return 'text';
|
return 'text';
|
||||||
case 9:
|
case 9:
|
||||||
return 'radio';
|
return 'radio';
|
||||||
case 10:
|
case 10:
|
||||||
return 'checkbox';
|
return 'checkbox';
|
||||||
default:
|
default:
|
||||||
return 'radio';
|
return 'radio';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,55 +67,55 @@ function handleColNameChange(rowOption: string, colOption: string, e: any) {
|
|||||||
|
|
||||||
// 不同的 question_type 的 matrix 问卷处理不同的结果
|
// 不同的 question_type 的 matrix 问卷处理不同的结果
|
||||||
switch (element.question_type) {
|
switch (element.question_type) {
|
||||||
case 8: {
|
case 8: {
|
||||||
// 获取输入框元素
|
// 获取输入框元素
|
||||||
const inputElement = e.target as HTMLInputElement;
|
const inputElement = e.target as HTMLInputElement;
|
||||||
// 如果没有获取到输入框元素,则直接返回
|
// 如果没有获取到输入框元素,则直接返回
|
||||||
if (!inputElement) return;
|
if (!inputElement) return;
|
||||||
// 将输入框的值保存到 rowRecord 对应位置
|
// 将输入框的值保存到 rowRecord 对应位置
|
||||||
rowRecord[col] = e!.target!.value;
|
rowRecord[col] = e!.target!.value;
|
||||||
// 清空 matrixAnswer 的 answer 属性
|
// 清空 matrixAnswer 的 answer 属性
|
||||||
matrixAnswer.value.answer = {};
|
matrixAnswer.value.answer = {};
|
||||||
// 遍历所有行选项
|
// 遍历所有行选项
|
||||||
element.options[0].forEach((_, rowIndex) => {
|
element.options[0].forEach((_, rowIndex) => {
|
||||||
// 获取当前行记录
|
// 获取当前行记录
|
||||||
const colOptions = rowRecord[rowIndex];
|
const colOptions = rowRecord[rowIndex];
|
||||||
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
|
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
|
||||||
if (colOptions) {
|
if (colOptions) {
|
||||||
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col + 1}`] = colOptions;
|
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col + 1}`] = colOptions;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
// 将选择的行索引加1后保存到 rowRecord 对应位置
|
// 将选择的行索引加1后保存到 rowRecord 对应位置
|
||||||
rowRecord[col] = row + 1;
|
rowRecord[col] = row + 1;
|
||||||
// 清空 matrixAnswer 的 answer 属性
|
// 清空 matrixAnswer 的 answer 属性
|
||||||
matrixAnswer.value.answer = {};
|
matrixAnswer.value.answer = {};
|
||||||
// 遍历 rowRecord,更新 matrixAnswer 的 answer 属性
|
// 遍历 rowRecord,更新 matrixAnswer 的 answer 属性
|
||||||
rowRecord.forEach((row, index) => {
|
rowRecord.forEach((row, index) => {
|
||||||
matrixAnswer.value.answer[`${index + 1}_${row}`] = 1;
|
matrixAnswer.value.answer[`${index + 1}_${row}`] = 1;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
// 将选择的行索引加1后添加到 rowRecord 对应位置的数组中
|
// 将选择的行索引加1后添加到 rowRecord 对应位置的数组中
|
||||||
rowRecord[col] = (rowRecord[col] || []).concat(row + 1);
|
rowRecord[col] = (rowRecord[col] || []).concat(row + 1);
|
||||||
// 清空 matrixAnswer 的 answer 属性
|
// 清空 matrixAnswer 的 answer 属性
|
||||||
matrixAnswer.value.answer = {};
|
matrixAnswer.value.answer = {};
|
||||||
// 遍历所有行选项
|
// 遍历所有行选项
|
||||||
element.options[0].forEach((rowOption, rowIndex) => {
|
element.options[0].forEach((rowOption, rowIndex) => {
|
||||||
// 获取当前行记录
|
// 获取当前行记录
|
||||||
const colOptions = rowRecord[rowIndex];
|
const colOptions = rowRecord[rowIndex];
|
||||||
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
|
// 如果当前行有记录,则更新 matrixAnswer 的 answer 属性
|
||||||
if (colOptions) {
|
if (colOptions) {
|
||||||
colOptions.forEach((col: any) => {
|
colOptions.forEach((col: any) => {
|
||||||
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col}`] = true;
|
matrixAnswer.value.answer[`R${rowIndex + 1}_C${col}`] = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const props = defineProps<{
|
|||||||
columns: { option: string; editor?: boolean }[];
|
columns: { option: string; editor?: boolean }[];
|
||||||
questionType: number;
|
questionType: number;
|
||||||
matrixAnswer: { [key: string]: any };
|
matrixAnswer: { [key: string]: any };
|
||||||
rowRecord:(number | string)[];
|
rowRecord: (number | string)[];
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);
|
/* const emits = */ defineEmits(['update:matrixAnswer', 'update:rowRecord']);
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
class="iconfont active-icon"
|
class="iconfont active-icon"
|
||||||
:style="{ marginRight: isLastPage ? '0' : '16px' }"
|
:style="{ marginRight: isLastPage ? '0' : '16px' }"
|
||||||
@click="activePage"
|
@click="activePage"
|
||||||
></i>
|
></i
|
||||||
|
>
|
||||||
<template v-if="!isLastPage">
|
<template v-if="!isLastPage">
|
||||||
<i class="iconfont moverQues" style="margin-right: 16px"></i>
|
<i class="iconfont moverQues" style="margin-right: 16px"></i>
|
||||||
<i class="iconfont" @click="deleteHandle"></i>
|
<i class="iconfont" @click="deleteHandle"></i>
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ import { onMounted, ref } from 'vue';
|
|||||||
// import { getUserInfo } from '@/api/common/index.js';
|
// import { getUserInfo } from '@/api/common/index.js';
|
||||||
// import { showFailToast } from 'vant';
|
// import { showFailToast } from 'vant';
|
||||||
const contentShow = ref(false);
|
const contentShow = ref(false);
|
||||||
onMounted(async() => {
|
const show = ref(false);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
contentShow.value = true;
|
contentShow.value = true;
|
||||||
// if (utils.getSessionStorage('xToken')) {
|
// if (utils.getSessionStorage('xToken')) {
|
||||||
// const appToken = utils.getParameter('digitalYiliToken');
|
// const appToken = utils.getParameter('digitalYiliToken');
|
||||||
@@ -27,32 +29,41 @@ onMounted(async() => {
|
|||||||
// contentShow.value = true;
|
// contentShow.value = true;
|
||||||
// }
|
// }
|
||||||
});
|
});
|
||||||
|
function create() {
|
||||||
|
show.value = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="contentShow" class="container">
|
<div v-if="contentShow" class="container">
|
||||||
<create-survey />
|
<create-survey />
|
||||||
|
|
||||||
<!-- 最新问卷 -->
|
<!-- 最新问卷 -->
|
||||||
<last-survey />
|
<last-survey />
|
||||||
|
|
||||||
<!-- 模板市场 -->
|
<!-- 模板市场 -->
|
||||||
<Market />
|
<Market />
|
||||||
|
<div class="new_survey">
|
||||||
|
<van-button type="primary" block color="#70B937" @click="create">
|
||||||
|
<span class="fw-bold">+</span> 新建问卷</van-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<van-popup v-model:show="show" round closeable position="bottom">
|
||||||
|
<CreateSurvey></CreateSurvey>
|
||||||
|
</van-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.container {
|
.container {
|
||||||
padding: 0 10px 60px;
|
padding: 30px 10px 80px 10px;
|
||||||
background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%);
|
background: linear-gradient(0deg, #f5f5f5 0%, #f5f5f5 84%, #a5d380 100%);
|
||||||
|
|
||||||
&> :first-child {
|
& > :first-child {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
&>div {
|
& > div {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
@@ -64,5 +75,15 @@ onMounted(async() => {
|
|||||||
padding: 20px 10px;
|
padding: 20px 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.new_survey {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100vw;
|
||||||
|
background: #fff;
|
||||||
|
padding: 12px 11px 28px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<van-cell class="create_survey">
|
<van-cell class="create_survey">
|
||||||
<div style="color: #000; text-align: left">新建问卷</div>
|
<div class="create_survey_title" style="color: #000; text-align: left">请选择新建类型</div>
|
||||||
<van-row>
|
<van-row>
|
||||||
<van-col
|
<van-col
|
||||||
v-for="survey in surveys"
|
v-for="survey in surveys"
|
||||||
@@ -90,6 +90,15 @@ onMounted(() => {
|
|||||||
.create_survey {
|
.create_survey {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
.create_survey_title {
|
||||||
|
font-family:
|
||||||
|
PingFangSC,
|
||||||
|
PingFang SC;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #000000;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.survey {
|
.survey {
|
||||||
@@ -98,13 +107,13 @@ onMounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
img {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
color: black;
|
font-family: PingFangHK, PingFangHK;
|
||||||
font-size: 10px;
|
font-weight: 400;
|
||||||
|
font-size: 0.34667rem;
|
||||||
|
color: #000000;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<p class="fw-bold">最新问卷</p>
|
<p class="fw-bold">最新问卷</p>
|
||||||
<p class="survey_header_tag">NEW</p>
|
<p class="survey_header_tag">NEW</p>
|
||||||
</div>
|
</div>
|
||||||
<p>全部问卷 ></p>
|
<p @click="$router.push('/survey')">全部问卷 ></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="survey_con">
|
<div class="survey_con">
|
||||||
@@ -46,7 +46,7 @@ import { consoleSurveys } from '@/api/home/index.js';
|
|||||||
const survey = ref({
|
const survey = ref({
|
||||||
project_name: ''
|
project_name: ''
|
||||||
});
|
});
|
||||||
const fetchSurveys = async() => {
|
const fetchSurveys = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
page: 1,
|
page: 1,
|
||||||
per_page: 10,
|
per_page: 10,
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.more {
|
.more {
|
||||||
margin: 20px auto;
|
margin: 20px;
|
||||||
color: #000;
|
color: #919191;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<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">
|
||||||
<component :is="contentSvg"></component>
|
<img src="./svgs/contentSvg.svg" alt="Content Icon" style="width: 14px" />
|
||||||
<p class="title_con">{{ item.title }}</p>
|
<p class="title_con">{{ item.title }}</p>
|
||||||
</div>
|
</div>
|
||||||
<component :is="MarketItemSvg"></component>
|
<img src="./svgs/MarketItemSvg.svg" alt="Content Icon" style="width: 14px" />
|
||||||
</div>
|
</div>
|
||||||
<div class="desc flex space-between">
|
<div class="desc flex space-between">
|
||||||
<div>
|
<div>
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import contentSvg from './svgs/contentSvg.svg?componet';
|
import contentSvg from './svgs/contentSvg.svg';
|
||||||
import MarketItemSvg from './svgs/MarketItemSvg.svg?componet';
|
import MarketItemSvg from './svgs/MarketItemSvg.svg';
|
||||||
const { info } = defineProps({
|
const { info } = defineProps({
|
||||||
info: {
|
info: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
version="1.1"
|
version="1.1"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
p-id="2494"
|
p-id="2494"
|
||||||
width="14"
|
width="8"
|
||||||
height="14"
|
height="8"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
d="M1024 354c0-1.8-0.2-3.6-0.5-5.4V158c0-51.8-42.2-94-94-94H798V30c0-16.5-13.5-30-30-30s-30 13.5-30 30v34H286V30c0-16.5-13.5-30-30-30s-30 13.5-30 30v34H94.5c-51.8 0-94 42.2-94 94v190.6c-0.3 1.8-0.5 3.6-0.5 5.4 0 1.8 0.2 3.6 0.5 5.4V930c0 51.8 42.2 94 94 94h835c51.8 0 94-42.2 94-94V359.4c0.3-1.8 0.5-3.6 0.5-5.4zM94.5 124H226v38c0 16.5 13.5 30 30 30s30-13.5 30-30v-38h452v38c0 16.5 13.5 30 30 30s30-13.5 30-30v-38h131.5c18.7 0 34 15.3 34 34v166h-903V158c0-18.7 15.3-34 34-34z m835 840h-835c-18.7 0-34-15.3-34-34V384h903v546c0 18.7-15.3 34-34 34z"
|
d="M1024 354c0-1.8-0.2-3.6-0.5-5.4V158c0-51.8-42.2-94-94-94H798V30c0-16.5-13.5-30-30-30s-30 13.5-30 30v34H286V30c0-16.5-13.5-30-30-30s-30 13.5-30 30v34H94.5c-51.8 0-94 42.2-94 94v190.6c-0.3 1.8-0.5 3.6-0.5 5.4 0 1.8 0.2 3.6 0.5 5.4V930c0 51.8 42.2 94 94 94h835c51.8 0 94-42.2 94-94V359.4c0.3-1.8 0.5-3.6 0.5-5.4zM94.5 124H226v38c0 16.5 13.5 30 30 30s30-13.5 30-30v-38h452v38c0 16.5 13.5 30 30 30s30-13.5 30-30v-38h131.5c18.7 0 34 15.3 34 34v166h-903V158c0-18.7 15.3-34 34-34z m835 840h-835c-18.7 0-34-15.3-34-34V384h903v546c0 18.7-15.3 34-34 34z"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -3,7 +3,9 @@
|
|||||||
<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)">报名签到 | 引用 {{ item }} 次 | 创建人: {{ '张三' }}</span>
|
<span style="color: rgb(127, 127, 127)"
|
||||||
|
>报名签到 | 引用 {{ item }} 次 | 创建人: {{ '张三' }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -374,14 +374,14 @@ const questionEvent = (item) => {
|
|||||||
options:
|
options:
|
||||||
item.json.options.length > 0
|
item.json.options.length > 0
|
||||||
? item.json.options.map((item) => {
|
? item.json.options.map((item) => {
|
||||||
return item.map((it) => {
|
return item.map((it) => {
|
||||||
return {
|
return {
|
||||||
...it,
|
...it,
|
||||||
// 主键生成
|
// 主键生成
|
||||||
id: uuidv4()
|
id: uuidv4()
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
: []
|
: []
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -514,7 +514,7 @@ const previewQuestion = () => {
|
|||||||
router.push({ name: 'preview', query: { ...route.query } });
|
router.push({ name: 'preview', query: { ...route.query } });
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async() => {
|
onMounted(async () => {
|
||||||
await getQuestionDetail();
|
await getQuestionDetail();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -692,9 +692,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;
|
||||||
@@ -869,47 +869,47 @@ async function answer(callback, callbackBeforePage) {
|
|||||||
const { value } = answer;
|
const { value } = answer;
|
||||||
const newValue = value.replace(/\n|\r|\r\n/g, '');
|
const newValue = value.replace(/\n|\r|\r\n/g, '');
|
||||||
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
|
||||||
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
||||||
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
|
||||||
: !/^(?:[\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;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
case 6: // 手机号
|
case 6: // 手机号
|
||||||
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
||||||
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
||||||
isError = true;
|
isError = true;
|
||||||
@@ -921,46 +921,46 @@ async function answer(callback, callbackBeforePage) {
|
|||||||
Object.keys(answer).forEach((key) => {
|
Object.keys(answer).forEach((key) => {
|
||||||
const value = answer[key];
|
const value = answer[key];
|
||||||
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
|
||||||
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
||||||
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
|
||||||
: !/^(?:[\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;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
case 6: // 手机号
|
case 6: // 手机号
|
||||||
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
||||||
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
||||||
isError = true;
|
isError = true;
|
||||||
@@ -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
|
||||||
);
|
);
|
||||||
@@ -1234,8 +1234,8 @@ function updateAnswer(auto) {
|
|||||||
const evt1 = {};
|
const evt1 = {};
|
||||||
|
|
||||||
if ([1].includes(question.question_type)) {
|
if ([1].includes(question.question_type)) {
|
||||||
evt1.value
|
evt1.value =
|
||||||
= Object.keys(question.answer)
|
Object.keys(question.answer)
|
||||||
.map((key) => (question.answer[key] ? key : undefined))
|
.map((key) => (question.answer[key] ? key : undefined))
|
||||||
.filter((i) => !!i)?.[0] || undefined;
|
.filter((i) => !!i)?.[0] || undefined;
|
||||||
evt1.options = question.list.flatMap((i) => i.options);
|
evt1.options = question.list.flatMap((i) => i.options);
|
||||||
|
|||||||
@@ -227,8 +227,8 @@ export default defineComponent({
|
|||||||
.map((option) => {
|
.map((option) => {
|
||||||
return this.wares.find(
|
return this.wares.find(
|
||||||
(ware) =>
|
(ware) =>
|
||||||
ware.question_index === option.question_index
|
ware.question_index === option.question_index &&
|
||||||
&& ware.option_index === option.option_index
|
ware.option_index === option.option_index
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
wares = wares.filter((x) => x);
|
wares = wares.filter((x) => x);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
debounce(func, wait) {
|
debounce(func, wait) {
|
||||||
let timeout;
|
let timeout;
|
||||||
return function(...args) {
|
return function (...args) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
timeout = setTimeout(() => func.apply(this, args), wait);
|
timeout = setTimeout(() => func.apply(this, args), wait);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -102,37 +102,37 @@ export default defineComponent({
|
|||||||
const isEndUrl = computed(() => {
|
const isEndUrl = computed(() => {
|
||||||
const code = props.action ? props.action.code : props.code;
|
const code = props.action ? props.action.code : props.code;
|
||||||
return (
|
return (
|
||||||
(code === 20004
|
(code === 20004 &&
|
||||||
&& props.survey.screening_end_url_select
|
props.survey.screening_end_url_select &&
|
||||||
&& props.survey.screening_end_url)
|
props.survey.screening_end_url) ||
|
||||||
|| (code === 20011 && props.survey.success_end_url_select && props.survey.success_end_url)
|
(code === 20011 && props.survey.success_end_url_select && props.survey.success_end_url) ||
|
||||||
|| (code === 20016 && props.survey.quota_end_url_select && props.survey.quota_end_url)
|
(code === 20016 && props.survey.quota_end_url_select && props.survey.quota_end_url)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 跳转
|
// 跳转
|
||||||
function toEndUrl() {
|
function toEndUrl() {
|
||||||
switch (props.action.code) {
|
switch (props.action.code) {
|
||||||
case 20004: // 被甄别
|
case 20004: // 被甄别
|
||||||
if (props.survey.screening_end_url_select && props.survey.screening_end_url) {
|
if (props.survey.screening_end_url_select && props.survey.screening_end_url) {
|
||||||
const url = props.survey.screening_end_url;
|
const url = props.survey.screening_end_url;
|
||||||
toUrl(url);
|
toUrl(url);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 20011: // 成功
|
case 20011: // 成功
|
||||||
if (props.survey.success_end_url_select && props.survey.success_end_url) {
|
if (props.survey.success_end_url_select && props.survey.success_end_url) {
|
||||||
const url = props.survey.success_end_url;
|
const url = props.survey.success_end_url;
|
||||||
toUrl(url);
|
toUrl(url);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 20016: // 配额超限
|
case 20016: // 配额超限
|
||||||
if (props.survey.quota_end_url_select && props.survey.quota_end_url) {
|
if (props.survey.quota_end_url_select && props.survey.quota_end_url) {
|
||||||
const url = props.survey.quota_end_url;
|
const url = props.survey.quota_end_url;
|
||||||
toUrl(url);
|
toUrl(url);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -264,16 +264,16 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!compareArrayByField(options.value, newOptions, 'option_key')
|
!compareArrayByField(options.value, newOptions, 'option_key') ||
|
||||||
|| !compareArrayByField(options.value, newOptions, 'option')
|
!compareArrayByField(options.value, newOptions, 'option')
|
||||||
) {
|
) {
|
||||||
options.value = newOptions;
|
options.value = newOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空值和答案
|
// 清空值和答案
|
||||||
if (
|
if (
|
||||||
value.value
|
value.value &&
|
||||||
&& options.value.findIndex((option) => option.option_key === value.value) === -1
|
options.value.findIndex((option) => option.option_key === value.value) === -1
|
||||||
) {
|
) {
|
||||||
// 清空值
|
// 清空值
|
||||||
value.value = '';
|
value.value = '';
|
||||||
@@ -291,8 +291,8 @@ export default defineComponent({
|
|||||||
() => options.value,
|
() => options.value,
|
||||||
(val, oldVal) => {
|
(val, oldVal) => {
|
||||||
if (
|
if (
|
||||||
compareArrayByField(val, oldVal || [], 'option_key')
|
compareArrayByField(val, oldVal || [], 'option_key') &&
|
||||||
&& compareArrayByField(val, oldVal || [], 'option')
|
compareArrayByField(val, oldVal || [], 'option')
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,8 +132,8 @@ export default defineComponent({
|
|||||||
const value = matchValue.replace('[%cite(', '').replace(')%]', '');
|
const value = matchValue.replace('[%cite(', '').replace(')%]', '');
|
||||||
let replacement = ''; // 替换文本
|
let replacement = ''; // 替换文本
|
||||||
// 查找引用问题
|
// 查找引用问题
|
||||||
const question
|
const question =
|
||||||
= props.questions.find((question) => {
|
props.questions.find((question) => {
|
||||||
// 矩阵题
|
// 矩阵题
|
||||||
if (question.question_type >= 8 && question.question_type <= 11) {
|
if (question.question_type >= 8 && question.question_type <= 11) {
|
||||||
return question.title === value.split('_R')[0].split('_C')[0];
|
return question.title === value.split('_R')[0].split('_C')[0];
|
||||||
@@ -143,8 +143,8 @@ export default defineComponent({
|
|||||||
return question.title === value.split('_A')[0];
|
return question.title === value.split('_A')[0];
|
||||||
}
|
}
|
||||||
return question.title === value;
|
return question.title === value;
|
||||||
})
|
}) ||
|
||||||
|| props.questions.find((question) => {
|
props.questions.find((question) => {
|
||||||
// 矩阵题
|
// 矩阵题
|
||||||
if (question.question_type >= 8 && question.question_type <= 11) {
|
if (question.question_type >= 8 && question.question_type <= 11) {
|
||||||
return question.title === (value + cycleIndexStr).split('_R')[0].split('_C')[0];
|
return question.title === (value + cycleIndexStr).split('_R')[0].split('_C')[0];
|
||||||
@@ -171,8 +171,8 @@ export default defineComponent({
|
|||||||
replacement = answer[option.option_key];
|
replacement = answer[option.option_key];
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
question.question_type === 2
|
question.question_type === 2 &&
|
||||||
&& Object.keys(answer).length >= question.config.min_select
|
Object.keys(answer).length >= question.config.min_select
|
||||||
) {
|
) {
|
||||||
// 查找引用选项(多选)
|
// 查找引用选项(多选)
|
||||||
options.forEach((option) => {
|
options.forEach((option) => {
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ export const language = {
|
|||||||
zh: '请点击查看图片'
|
zh: '请点击查看图片'
|
||||||
},
|
},
|
||||||
NoteCantViewAfterTimeLimit: {
|
NoteCantViewAfterTimeLimit: {
|
||||||
en: 'Note: Can\'t view after time limit',
|
en: "Note: Can't view after time limit",
|
||||||
zh: '注意:超过显示时间限制后将无法再次查看'
|
zh: '注意:超过显示时间限制后将无法再次查看'
|
||||||
},
|
},
|
||||||
DisplayTimeLimitExceeded: {
|
DisplayTimeLimitExceeded: {
|
||||||
|
|||||||
@@ -250,10 +250,10 @@ function quesHandle(answer, logChild) {
|
|||||||
const matrixRateHandle = () => {
|
const matrixRateHandle = () => {
|
||||||
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
|
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
|
||||||
if (
|
if (
|
||||||
logChild.cell_index === 0
|
logChild.cell_index === 0 ||
|
||||||
|| logChild.row_index === 0
|
logChild.row_index === 0 ||
|
||||||
|| !logChild.operator
|
!logChild.operator ||
|
||||||
|| !logChild.value
|
!logChild.value
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -265,10 +265,10 @@ function quesHandle(answer, logChild) {
|
|||||||
const matrixInputHandle = () => {
|
const matrixInputHandle = () => {
|
||||||
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
|
// 如果配置的逻辑中参数为空,则代表没有配置逻辑匹配值,此时不做校验
|
||||||
if (
|
if (
|
||||||
logChild.cell_index === 0
|
logChild.cell_index === 0 ||
|
||||||
|| logChild.row_index === 0
|
logChild.row_index === 0 ||
|
||||||
|| !logChild.operator
|
!logChild.operator ||
|
||||||
|| !logChild.value
|
!logChild.value
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -428,59 +428,59 @@ function getConditionStatus(logChild) {
|
|||||||
if (answer) {
|
if (answer) {
|
||||||
try {
|
try {
|
||||||
switch (logChild.question_type) {
|
switch (logChild.question_type) {
|
||||||
case 1:
|
case 1:
|
||||||
quesStatus = quesHandles.choiceHandle(config);
|
quesStatus = quesHandles.choiceHandle(config);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
quesStatus = quesHandles.choiceCheckBoxHandle(config);
|
quesStatus = quesHandles.choiceCheckBoxHandle(config);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
quesStatus = quesHandles.cascaderHandle();
|
quesStatus = quesHandles.cascaderHandle();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
quesStatus = quesHandles.inputHandle();
|
quesStatus = quesHandles.inputHandle();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
quesStatus = quesHandles.rateHandle();
|
quesStatus = quesHandles.rateHandle();
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
quesStatus = quesHandles.dateTimeHandle();
|
quesStatus = quesHandles.dateTimeHandle();
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
quesStatus = quesHandles.matrixInputHandle();
|
quesStatus = quesHandles.matrixInputHandle();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
quesStatus = quesHandles.matrixRadioHandle(config);
|
quesStatus = quesHandles.matrixRadioHandle(config);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
quesStatus = quesHandles.matrixCheckboxHandle(config);
|
quesStatus = quesHandles.matrixCheckboxHandle(config);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
quesStatus = quesHandles.matrixRateHandle();
|
quesStatus = quesHandles.matrixRateHandle();
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
quesStatus = quesHandles.imgRadioHandle();
|
quesStatus = quesHandles.imgRadioHandle();
|
||||||
break;
|
break;
|
||||||
case 14:
|
case 14:
|
||||||
quesStatus = quesHandles.imgCheckBoxHandle();
|
quesStatus = quesHandles.imgCheckBoxHandle();
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
quesStatus = quesHandles.classifyHandle();
|
quesStatus = quesHandles.classifyHandle();
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
quesStatus = quesHandles.sortHandle();
|
quesStatus = quesHandles.sortHandle();
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
quesStatus = quesHandles.constantSumHandle();
|
quesStatus = quesHandles.constantSumHandle();
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
quesStatus = quesHandles.agreementHandle();
|
quesStatus = quesHandles.agreementHandle();
|
||||||
break;
|
break;
|
||||||
case 101:
|
case 101:
|
||||||
quesStatus = quesHandles.psmHandle(config);
|
quesStatus = quesHandles.psmHandle(config);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
@@ -519,10 +519,10 @@ function getlogicStatus(questionData) {
|
|||||||
// } else {
|
// } else {
|
||||||
// statusStr = statusStr + conditionStatus;
|
// statusStr = statusStr + conditionStatus;
|
||||||
// }
|
// }
|
||||||
statusStr
|
statusStr =
|
||||||
= statusStr
|
statusStr +
|
||||||
+ (logChild.logic === 'and' ? '&&' : logChild.logic === 'or' ? '||' : '')
|
(logChild.logic === 'and' ? '&&' : logChild.logic === 'or' ? '||' : '') +
|
||||||
+ conditionStatus;
|
conditionStatus;
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line no-eval
|
// eslint-disable-next-line no-eval
|
||||||
logs.logicStatus = eval(statusStr);
|
logs.logicStatus = eval(statusStr);
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ export default function answerMock(questionsData, page) {
|
|||||||
} else if (logic.skip_type === 4) {
|
} else if (logic.skip_type === 4) {
|
||||||
// 只计算跳转后所在页面的隐藏逻辑,否则会出现只返回最后一道隐藏选项题目的情况,导致失效
|
// 只计算跳转后所在页面的隐藏逻辑,否则会出现只返回最后一道隐藏选项题目的情况,导致失效
|
||||||
const toPage = page + 1;
|
const toPage = page + 1;
|
||||||
const hasHiddenLogicQuizPage
|
const hasHiddenLogicQuizPage =
|
||||||
= data.pages.findIndex((page) => page.includes(logic.question_index)) + 1;
|
data.pages.findIndex((page) => page.includes(logic.question_index)) + 1;
|
||||||
if (hasHiddenLogicQuizPage === toPage) {
|
if (hasHiddenLogicQuizPage === toPage) {
|
||||||
// 选项隐藏逻辑
|
// 选项隐藏逻辑
|
||||||
updateOptionHidden(data.hide_options, logic);
|
updateOptionHidden(data.hide_options, logic);
|
||||||
|
|||||||
@@ -154,9 +154,9 @@ export default defineComponent({
|
|||||||
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;
|
||||||
@@ -302,9 +302,9 @@ export default defineComponent({
|
|||||||
} else if (answer && questionType === 12) {
|
} else if (answer && questionType === 12) {
|
||||||
question.error = '';
|
question.error = '';
|
||||||
} else if (
|
} else if (
|
||||||
answer
|
answer &&
|
||||||
&& questionType === 14
|
questionType === 14 &&
|
||||||
&& Object.keys(answer).length < config.min_select
|
Object.keys(answer).length < config.min_select
|
||||||
) {
|
) {
|
||||||
// 图片多选题
|
// 图片多选题
|
||||||
isError = true;
|
isError = true;
|
||||||
@@ -340,46 +340,46 @@ export default defineComponent({
|
|||||||
const { value } = answer;
|
const { value } = answer;
|
||||||
const newValue = value.replace(/\n|\r|\r\n/g, '');
|
const newValue = value.replace(/\n|\r|\r\n/g, '');
|
||||||
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
|
||||||
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
: !/^[a-zA-Z]+$/.test(newValue) || !newValue.length;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
question.error = isError ? translatedText.value.PleaseEnterEnglishLetters : '';
|
||||||
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
|
||||||
: !/^(?:[\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;
|
||||||
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
question.error = isError ? translatedText.value.PleaseEnterChineseWords : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
case 6: // 手机号
|
case 6: // 手机号
|
||||||
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
isError = !/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value);
|
||||||
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
question.error = isError ? translatedText.value.PleaseEnterACorrectPhone : '';
|
||||||
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 : '';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
if (!isError && value.length < config.min && ![1, 2].includes(config.text_type)) {
|
||||||
isError = true;
|
isError = true;
|
||||||
@@ -391,54 +391,54 @@ export default defineComponent({
|
|||||||
Object.keys(answer).forEach((key) => {
|
Object.keys(answer).forEach((key) => {
|
||||||
const value = answer[key];
|
const value = answer[key];
|
||||||
switch (config.text_type) {
|
switch (config.text_type) {
|
||||||
case 3: // 字母
|
case 3: // 字母
|
||||||
if (
|
if (
|
||||||
!/^[a-zA-Z·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
|
!/^[a-zA-Z·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]]+$/.test(
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
question.error = translatedText.value.PleaseEnterEnglishLetters;
|
question.error = translatedText.value.PleaseEnterEnglishLetters;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // 中文
|
case 4: // 中文
|
||||||
if (
|
if (
|
||||||
!/^(?:[\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(
|
||||||
value
|
value
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
question.error = translatedText.value.PleaseEnterChineseWords;
|
question.error = translatedText.value.PleaseEnterChineseWords;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5: // 邮箱
|
case 5: // 邮箱
|
||||||
if (
|
if (
|
||||||
!/^(([^<>()[\]\\.,;:\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 = translatedText.value.PleaseEnterACorrectEmail;
|
question.error = translatedText.value.PleaseEnterACorrectEmail;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6: // 手机号
|
case 6: // 手机号
|
||||||
if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value)) {
|
if (!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(value)) {
|
||||||
question.error = translatedText.value.PleaseEnterACorrectPhone;
|
question.error = translatedText.value.PleaseEnterACorrectPhone;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7: // 身份证号
|
case 7: // 身份证号
|
||||||
if (
|
if (
|
||||||
!/^[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 = translatedText.value.PleaseEnterACorrectID;
|
question.error = translatedText.value.PleaseEnterACorrectID;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!question.error
|
!question.error &&
|
||||||
&& value.length < config.min
|
value.length < config.min &&
|
||||||
&& ![1, 2].includes(config.text_type)
|
![1, 2].includes(config.text_type)
|
||||||
) {
|
) {
|
||||||
question.error = translatedText.value.PleaseEnterMoreThanOneCharacters(config.min);
|
question.error = translatedText.value.PleaseEnterMoreThanOneCharacters(config.min);
|
||||||
}
|
}
|
||||||
@@ -814,8 +814,8 @@ export default defineComponent({
|
|||||||
const evt1 = {};
|
const evt1 = {};
|
||||||
|
|
||||||
if ([1].includes(question.question_type)) {
|
if ([1].includes(question.question_type)) {
|
||||||
evt1.value
|
evt1.value =
|
||||||
= Object.keys(question.answer)
|
Object.keys(question.answer)
|
||||||
.map((key) => (question.answer[key] ? key : undefined))
|
.map((key) => (question.answer[key] ? key : undefined))
|
||||||
.filter((i) => !!i)?.[0] || undefined;
|
.filter((i) => !!i)?.[0] || undefined;
|
||||||
evt1.options = question.list.flatMap((i) => i.options);
|
evt1.options = question.list.flatMap((i) => i.options);
|
||||||
|
|||||||
@@ -5,11 +5,9 @@
|
|||||||
<!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> -->
|
<!-- <van-cell-group v-if="status === 1" inset style="padding-top: 15px"> -->
|
||||||
<van-cell-group inset style="padding-top: 15px">
|
<van-cell-group inset style="padding-top: 15px">
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img width="100%"
|
||||||
width="100%"
|
|
||||||
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
|
src="https://files.axshare.com/gsc/DR6075/44/1a/03/441a03a8b1004755a7a392b311acf97f/images/%E6%8A%95%E6%94%BE/u14.jpg?pageId=2f9ba10c-92b8-4c9b-b40b-04e65a0b4333"
|
||||||
alt=""
|
alt="" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="qrcode">
|
<div class="qrcode">
|
||||||
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
|
<img :src="publishInfo.img_url" alt="" width="100px" height="100px" />
|
||||||
@@ -110,7 +108,7 @@ type OperateItem = (typeof operateList)[0];
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
function getCode() {
|
function getCode () {
|
||||||
publishInfo.value.img_url =
|
publishInfo.value.img_url =
|
||||||
'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
'https://test-cxp-pubcos.yili.com/uat-yls//survey-api/publish/202503130938138261340.png';
|
||||||
publishInfo.value.url = `${configUrl.proxyDomain}/publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
publishInfo.value.url = `${configUrl.proxyDomain}/publish?sn=${sn && sn !== undefined ? sn : ''}`;
|
||||||
@@ -162,7 +160,7 @@ const operateBtn = (item: OperateItem) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 复制链接
|
// 复制链接
|
||||||
function copyLink() {
|
function copyLink () {
|
||||||
const input = document.createElement('input');
|
const input = document.createElement('input');
|
||||||
input.value = publishInfo.value.url;
|
input.value = publishInfo.value.url;
|
||||||
document.body.appendChild(input);
|
document.body.appendChild(input);
|
||||||
@@ -172,7 +170,7 @@ function copyLink() {
|
|||||||
showToast('复制成功');
|
showToast('复制成功');
|
||||||
}
|
}
|
||||||
// 分享链接
|
// 分享链接
|
||||||
function shareLink() {
|
function shareLink () {
|
||||||
const params = {
|
const params = {
|
||||||
type: 'shareToWx',
|
type: 'shareToWx',
|
||||||
title: publishInfo.value.download_url.title,
|
title: publishInfo.value.download_url.title,
|
||||||
@@ -182,13 +180,11 @@ function shareLink() {
|
|||||||
scene: 0 // 朋友圈1 微信好友0
|
scene: 0 // 朋友圈1 微信好友0
|
||||||
};
|
};
|
||||||
console.log('shareUrl', publishInfo.value.url);
|
console.log('shareUrl', publishInfo.value.url);
|
||||||
appBridge.shareToWeChat(params, () => {
|
appBridge.shareToWeChat(params, () => { });
|
||||||
// 后续扩展
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载二维码
|
// 下载二维码
|
||||||
function downLoadImg() {
|
function downLoadImg () {
|
||||||
const { title, url } = publishInfo.value.download_url;
|
const { title, url } = publishInfo.value.download_url;
|
||||||
if (utils.getSessionStorage('xToken')) {
|
if (utils.getSessionStorage('xToken')) {
|
||||||
appBridge.save2Album(url, () => {
|
appBridge.save2Album(url, () => {
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user