feat:app嵌套h5
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 {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
8
components.d.ts
vendored
8
components.d.ts
vendored
@@ -14,23 +14,16 @@ declare module 'vue' {
|
|||||||
VanButton: typeof import('vant/es')['Button']
|
VanButton: typeof import('vant/es')['Button']
|
||||||
VanCell: typeof import('vant/es')['Cell']
|
VanCell: typeof import('vant/es')['Cell']
|
||||||
VanCellGroup: typeof import('vant/es')['CellGroup']
|
VanCellGroup: typeof import('vant/es')['CellGroup']
|
||||||
VanCheck: typeof import('vant/es')['Check']
|
|
||||||
VanCheckbo: typeof import('vant/es')['Checkbo']
|
|
||||||
VanCheckbox: typeof import('vant/es')['Checkbox']
|
VanCheckbox: typeof import('vant/es')['Checkbox']
|
||||||
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
|
VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup']
|
||||||
VanCol: typeof import('vant/es')['Col']
|
VanCol: typeof import('vant/es')['Col']
|
||||||
VanDatePicker: typeof import('vant/es')['DatePicker']
|
|
||||||
VanDatetimePicker: typeof import('vant/es')['DatetimePicker']
|
|
||||||
VanDialog: typeof import('vant/es')['Dialog']
|
|
||||||
VanDivider: typeof import('vant/es')['Divider']
|
VanDivider: typeof import('vant/es')['Divider']
|
||||||
VanFiel: typeof import('vant/es')['Fiel']
|
|
||||||
VanField: typeof import('vant/es')['Field']
|
VanField: typeof import('vant/es')['Field']
|
||||||
VanGrid: typeof import('vant/es')['Grid']
|
VanGrid: typeof import('vant/es')['Grid']
|
||||||
VanGridItem: typeof import('vant/es')['GridItem']
|
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']
|
||||||
VanPikcer: typeof import('vant/es')['Pikcer']
|
|
||||||
VanPopup: typeof import('vant/es')['Popup']
|
VanPopup: typeof import('vant/es')['Popup']
|
||||||
VanRadio: typeof import('vant/es')['Radio']
|
VanRadio: typeof import('vant/es')['Radio']
|
||||||
VanRadioGroup: typeof import('vant/es')['RadioGroup']
|
VanRadioGroup: typeof import('vant/es')['RadioGroup']
|
||||||
@@ -40,7 +33,6 @@ declare module 'vue' {
|
|||||||
VanSwitch: typeof import('vant/es')['Switch']
|
VanSwitch: typeof import('vant/es')['Switch']
|
||||||
VanTabbar: typeof import('vant/es')['Tabbar']
|
VanTabbar: typeof import('vant/es')['Tabbar']
|
||||||
VanTabbarItem: typeof import('vant/es')['TabbarItem']
|
VanTabbarItem: typeof import('vant/es')['TabbarItem']
|
||||||
VanTimePicker: typeof import('vant/es')['TimePicker']
|
|
||||||
YLPicker: typeof import('./src/components/YLPicker.vue')['default']
|
YLPicker: typeof import('./src/components/YLPicker.vue')['default']
|
||||||
YLSelect: typeof import('./src/components/YLSelect.vue')['default']
|
YLSelect: typeof import('./src/components/YLSelect.vue')['default']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +1,10 @@
|
|||||||
import request from '@/utils/request.js';
|
import request from '@/utils/request.js';
|
||||||
|
|
||||||
// 校验token返回用户信息
|
// 校验token返回用户信息
|
||||||
export function getUserInfo(appToken) {
|
export function getUserInfo(params) {
|
||||||
return request({
|
return request({
|
||||||
url: `/open/digital_yili/${appToken}`,
|
url: '/thirdPartyInterfaceInfoEx/test',
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function sync(params) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export function questionDetails(params) {
|
export function saveQuestions(params) {
|
||||||
// let sn = params.sn;
|
// let sn = params.sn;
|
||||||
// delete params.sn;
|
// delete params.sn;
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -17,3 +17,18 @@ export function consoleSurveys(params) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
export function getListScene(params) {
|
||||||
|
return request({
|
||||||
|
url: 'console/list_scene',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//
|
||||||
|
export function getSurveyTemplates(params) {
|
||||||
|
return request({
|
||||||
|
url: '/console/survey_templates',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ export function getCheckSurvey(sn) {
|
|||||||
url: `/console/check_survey_test/${sn}`,
|
url: `/console/check_survey_test/${sn}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,9 +16,10 @@ export default {
|
|||||||
*/
|
*/
|
||||||
_string2json(value) {
|
_string2json(value) {
|
||||||
try {
|
try {
|
||||||
value = JSON.parse(value);
|
return JSON.parse(value);
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
return value;
|
// 以后再说
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -167,8 +167,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);
|
||||||
@@ -191,8 +191,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 {
|
||||||
|
|||||||
@@ -51,12 +51,14 @@ const router = createRouter({
|
|||||||
name: 'preview',
|
name: 'preview',
|
||||||
meta: {},
|
meta: {},
|
||||||
component: Preview
|
component: Preview
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: '/create',
|
path: '/create',
|
||||||
name: 'create',
|
name: 'create',
|
||||||
meta: { title: '问卷编辑' },
|
meta: { title: '问卷编辑' },
|
||||||
component: () => import('../views/Survey/views/Create/Index.vue')
|
component: () => import('../views/Survey/views/Create/Index.vue')
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: '/publish',
|
path: '/publish',
|
||||||
name: 'publish',
|
name: 'publish',
|
||||||
meta: { title: '问卷投放' },
|
meta: { title: '问卷投放' },
|
||||||
|
|||||||
@@ -9,19 +9,20 @@ export const useCommonStore = defineStore('common', {
|
|||||||
state: () => ({
|
state: () => ({
|
||||||
questionsInfo: {
|
questionsInfo: {
|
||||||
survey: {
|
survey: {
|
||||||
id: 9577,
|
id: 9616,
|
||||||
introduction: '<p>123</p>',
|
introduction:
|
||||||
pages: [[]],
|
'<p><b>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</b></p>',
|
||||||
sn: 'oxywX8W6',
|
pages: [[7], [23], [24], [25], [26], [9], [13], [12], [11], [10]],
|
||||||
|
sn: 'qxj894Ww',
|
||||||
status: 0,
|
status: 0,
|
||||||
title: '报名签到问卷 ',
|
title: '<b>报名签到问卷 </b>',
|
||||||
detail_pages: [],
|
detail_pages: [[7], [23], [24], [25], [26], [9], [13], [12], [11], [10]],
|
||||||
group_pages: [],
|
group_pages: [],
|
||||||
is_one_page_one_question: 0,
|
is_one_page_one_question: 1,
|
||||||
last_question_index: 0,
|
last_question_index: 26,
|
||||||
is_three_d_permissions: 0,
|
is_three_d_permissions: 0,
|
||||||
is_dept: 1,
|
is_dept: 1,
|
||||||
last_title: 'Q0',
|
last_title: 'Q4',
|
||||||
project_name: '报名签到问卷 ',
|
project_name: '报名签到问卷 ',
|
||||||
quota_end_content:
|
quota_end_content:
|
||||||
'<p style="text-align:center"><img style="width:220px;margin-top:30px;margin-bottom: 40px;" src="https://cxp-pubcos.yili.com/prod-yls/theme/XxgQ98WN/1693807609602_962_error.png"></p>\n<p style="text-align:center;font-size: 16px;font-weight: 500;padding-bottom: 12px;/* margin-bottom: 10px; */">很抱歉,本次调研不太适合您的情况,感谢您的参与!</p>',
|
'<p style="text-align:center"><img style="width:220px;margin-top:30px;margin-bottom: 40px;" src="https://cxp-pubcos.yili.com/prod-yls/theme/XxgQ98WN/1693807609602_962_error.png"></p>\n<p style="text-align:center;font-size: 16px;font-weight: 500;padding-bottom: 12px;/* margin-bottom: 10px; */">很抱歉,本次调研不太适合您的情况,感谢您的参与!</p>',
|
||||||
@@ -37,14 +38,369 @@ export const useCommonStore = defineStore('common', {
|
|||||||
end_jump_status: 0,
|
end_jump_status: 0,
|
||||||
end_jump_standing_time: 0,
|
end_jump_standing_time: 0,
|
||||||
success_end_content:
|
success_end_content:
|
||||||
'<p style="text-align:center"><img style="width:220px;margin-top:30px;margin-bottom: 40px;" src="https://cxp-pubcos.yili.com/prod-yls/theme/XxgQ98WN/1693807609607_514_success.png"></p>\n<p style="text-align:center;font-size: 16px;font-weight: 500;padding-bottom: 12px;/* margin-bottom: 10px; */">您已完成本次调研,感谢您的参与!</p>\n<p style="text-align:center;color: 85b43a;font-size: 16px;font-weight: 550;">【成功完成】</p>',
|
'<p style="text-align:center"><img style="width:220px;margin-top:30px;margin-bottom: 40px;" src="https://cxp-pubcos.yili.com/prod-yls/theme/XxgQ98WN/1693807609607_514_success.png"></p>\n<p style="text-align:center;font-size: 16px;font-weight: 500;padding-bottom: 12px;/* margin-bottom: 10px; */">您已完成本次调研,感谢您的参与!</p>\n<p style="text-align:center;color: #85b43a;font-size: 16px;font-weight: 550;">【成功完成】</p>',
|
||||||
success_end_url: '',
|
success_end_url: '',
|
||||||
success_end_url_select: 0,
|
success_end_url_select: 0,
|
||||||
success_standing_time: 0,
|
success_standing_time: 0,
|
||||||
template_type: 0,
|
template_type: 0,
|
||||||
local_pages: []
|
local_pages: [
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pages: [],
|
||||||
|
is_short_time: 0,
|
||||||
|
short_time: '',
|
||||||
|
is_show: 0,
|
||||||
|
use_type: 0
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
logics: [],
|
logics: [
|
||||||
|
{
|
||||||
|
id: 472233,
|
||||||
|
question_index: 10,
|
||||||
|
sample_number: 0,
|
||||||
|
skip_question_index: -1,
|
||||||
|
skip_type: 0,
|
||||||
|
question_id: '17853822',
|
||||||
|
logic: [
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
location: 0,
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
type: 0,
|
||||||
|
row_type: 0,
|
||||||
|
cell_type: 0,
|
||||||
|
logic: 'if',
|
||||||
|
operator: '=',
|
||||||
|
is_answer: 1,
|
||||||
|
is_select: 0,
|
||||||
|
row_index: 0,
|
||||||
|
cell_index: 0,
|
||||||
|
question_type: 1,
|
||||||
|
question_index: 7,
|
||||||
|
relation_question_index: 0,
|
||||||
|
relation_question_row_index: 0,
|
||||||
|
relation_question_cell_index: 0,
|
||||||
|
is_option_group: 0,
|
||||||
|
option_index: 1,
|
||||||
|
skip_type: null,
|
||||||
|
question_id: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
autofill: {
|
||||||
|
value: '',
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
question_type: 1,
|
||||||
|
option_indexs: [],
|
||||||
|
row_indexs: [],
|
||||||
|
cell_indexs: []
|
||||||
|
},
|
||||||
|
hide_option_index: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 472236,
|
||||||
|
question_index: 10,
|
||||||
|
sample_number: 0,
|
||||||
|
skip_question_index: 7,
|
||||||
|
skip_type: 0,
|
||||||
|
question_id: '17853822',
|
||||||
|
logic: [
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
location: 0,
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
type: 0,
|
||||||
|
row_type: 0,
|
||||||
|
cell_type: 0,
|
||||||
|
logic: 'if',
|
||||||
|
operator: '=',
|
||||||
|
is_answer: 1,
|
||||||
|
is_select: 1,
|
||||||
|
row_index: 0,
|
||||||
|
cell_index: 0,
|
||||||
|
question_type: 2,
|
||||||
|
question_index: 7,
|
||||||
|
relation_question_index: 0,
|
||||||
|
relation_question_row_index: 0,
|
||||||
|
relation_question_cell_index: 0,
|
||||||
|
is_option_group: 0,
|
||||||
|
option_index: 1,
|
||||||
|
skip_type: null,
|
||||||
|
question_id: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
autofill: {
|
||||||
|
value: '',
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
question_type: 1,
|
||||||
|
option_indexs: [],
|
||||||
|
row_indexs: [],
|
||||||
|
cell_indexs: []
|
||||||
|
},
|
||||||
|
hide_option_index: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 472237,
|
||||||
|
question_index: 10,
|
||||||
|
sample_number: 0,
|
||||||
|
skip_question_index: 13,
|
||||||
|
skip_type: 0,
|
||||||
|
question_id: '17853822',
|
||||||
|
logic: [
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
location: 0,
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
type: 0,
|
||||||
|
row_type: 1,
|
||||||
|
cell_type: 2,
|
||||||
|
logic: 'if',
|
||||||
|
operator: '=',
|
||||||
|
is_answer: 1,
|
||||||
|
is_select: 0,
|
||||||
|
row_index: 2,
|
||||||
|
cell_index: 3,
|
||||||
|
question_type: 9,
|
||||||
|
question_index: 24,
|
||||||
|
relation_question_index: 0,
|
||||||
|
relation_question_row_index: 0,
|
||||||
|
relation_question_cell_index: 0,
|
||||||
|
is_option_group: 0,
|
||||||
|
option_index: 0,
|
||||||
|
skip_type: null,
|
||||||
|
question_id: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
autofill: {
|
||||||
|
value: '',
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
question_type: 1,
|
||||||
|
option_indexs: [],
|
||||||
|
row_indexs: [],
|
||||||
|
cell_indexs: []
|
||||||
|
},
|
||||||
|
hide_option_index: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 472240,
|
||||||
|
question_index: 10,
|
||||||
|
sample_number: 0,
|
||||||
|
skip_question_index: 0,
|
||||||
|
skip_type: 0,
|
||||||
|
question_id: '17853822',
|
||||||
|
logic: [
|
||||||
|
{
|
||||||
|
value: '8',
|
||||||
|
location: 0,
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
type: 0,
|
||||||
|
row_type: 0,
|
||||||
|
cell_type: 0,
|
||||||
|
logic: 'if',
|
||||||
|
operator: '=',
|
||||||
|
is_answer: 1,
|
||||||
|
is_select: 0,
|
||||||
|
row_index: 0,
|
||||||
|
cell_index: 0,
|
||||||
|
question_type: 106,
|
||||||
|
question_index: 26,
|
||||||
|
relation_question_index: 0,
|
||||||
|
relation_question_row_index: 0,
|
||||||
|
relation_question_cell_index: 0,
|
||||||
|
is_option_group: 0,
|
||||||
|
option_index: 1,
|
||||||
|
skip_type: null,
|
||||||
|
question_id: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
autofill: {
|
||||||
|
value: '',
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
question_type: 1,
|
||||||
|
option_indexs: [],
|
||||||
|
row_indexs: [],
|
||||||
|
cell_indexs: []
|
||||||
|
},
|
||||||
|
hide_option_index: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 472241,
|
||||||
|
question_index: 10,
|
||||||
|
sample_number: 0,
|
||||||
|
skip_question_index: 0,
|
||||||
|
skip_type: 0,
|
||||||
|
question_id: '17853822',
|
||||||
|
logic: [
|
||||||
|
{
|
||||||
|
value: '213',
|
||||||
|
location: 0,
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
type: 0,
|
||||||
|
row_type: 0,
|
||||||
|
cell_type: 0,
|
||||||
|
logic: 'if',
|
||||||
|
operator: '=',
|
||||||
|
is_answer: 1,
|
||||||
|
is_select: 0,
|
||||||
|
row_index: 0,
|
||||||
|
cell_index: 0,
|
||||||
|
question_type: 5,
|
||||||
|
question_index: 25,
|
||||||
|
relation_question_index: 0,
|
||||||
|
relation_question_row_index: 0,
|
||||||
|
relation_question_cell_index: 0,
|
||||||
|
is_option_group: 0,
|
||||||
|
option_index: 1,
|
||||||
|
skip_type: null,
|
||||||
|
question_id: null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
autofill: {
|
||||||
|
value: '',
|
||||||
|
date: '',
|
||||||
|
time: '',
|
||||||
|
question_type: 1,
|
||||||
|
option_indexs: [],
|
||||||
|
row_indexs: [],
|
||||||
|
cell_indexs: []
|
||||||
|
},
|
||||||
|
hide_option_index: []
|
||||||
|
}
|
||||||
|
],
|
||||||
questions: [],
|
questions: [],
|
||||||
cycle_pages: null
|
cycle_pages: null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,10 +42,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('保存中...');
|
||||||
|
|||||||
@@ -15,73 +15,83 @@
|
|||||||
:index="index"
|
:index="index"
|
||||||
:chooseQuestionId="chooseQuestionId"
|
:chooseQuestionId="chooseQuestionId"
|
||||||
@get-choose-question-id="getChooseQuestionId"
|
@get-choose-question-id="getChooseQuestionId"
|
||||||
|
@move="emitFun.move"
|
||||||
|
@copy="emitFun.copy"
|
||||||
|
@delete="emitFun.delete"
|
||||||
|
@setting="emitFun.setting"
|
||||||
|
@logics="emitFun.logics"
|
||||||
>
|
>
|
||||||
|
<!-- 打分题 -->
|
||||||
|
<Rate
|
||||||
|
v-if="element.question_type === 5"
|
||||||
|
:element="computedElement(element)"
|
||||||
|
:index="index"
|
||||||
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
|
/>
|
||||||
<!-- 选择题 -->
|
<!-- 选择题 -->
|
||||||
<Choice
|
<Choice
|
||||||
v-if="element.question_type === 1 || element.question_type === 2"
|
v-if="element.question_type === 1 || element.question_type === 2"
|
||||||
:element="element"
|
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
:element="computedElement(element)"
|
||||||
|
@update:element="updateElement"
|
||||||
></Choice>
|
></Choice>
|
||||||
<!-- 填空题 -->
|
<!-- 填空题 -->
|
||||||
<Completion
|
<Completion
|
||||||
v-if="element.question_type === 4"
|
v-if="element.question_type === 4"
|
||||||
:index="index"
|
:index="index"
|
||||||
:element="element"
|
:element="computedElement(element)"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
sn="lXEBBpE2"
|
@update:element="updateElement"
|
||||||
></Completion>
|
></Completion>
|
||||||
|
|
||||||
<!-- 矩阵题 -->
|
<!-- 矩阵题 -->
|
||||||
<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="element"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 签名题 -->
|
<!-- 签名题 -->
|
||||||
<sign-question
|
<sign-question
|
||||||
v-if="[22].includes(element.question_type)"
|
v-if="[22].includes(element.question_type)"
|
||||||
:element="element"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 文件上传题 -->
|
<!-- 文件上传题 -->
|
||||||
<file-upload
|
<file-upload
|
||||||
v-if="element.question_type === 18"
|
v-if="element.question_type === 18"
|
||||||
:element="element"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
></file-upload>
|
></file-upload>
|
||||||
|
|
||||||
<!-- 打分题 -->
|
|
||||||
<Rate
|
|
||||||
v-if="element.question_type === 5"
|
|
||||||
:element="element"
|
|
||||||
:index="index"
|
|
||||||
:active="chooseQuestionId === element.id"
|
|
||||||
sn="lXEBBpE2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!--图文-->
|
<!--图文-->
|
||||||
<TextWithImages
|
<TextWithImages
|
||||||
v-if="element.question_type === 6"
|
v-if="element.question_type === 6"
|
||||||
:element="element"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
/>
|
/>
|
||||||
<!--图文-->
|
<!--图文-->
|
||||||
<NPS
|
<NPS
|
||||||
v-if="element.question_type === 106"
|
v-if="element.question_type === 106"
|
||||||
:element="element"
|
:element="computedElement(element)"
|
||||||
:index="index"
|
:index="index"
|
||||||
:active="chooseQuestionId === element.id"
|
:active="chooseQuestionId === element.id"
|
||||||
|
@update:element="updateElement"
|
||||||
/>
|
/>
|
||||||
<!--组件底部左侧操作-->
|
<!--组件底部左侧操作-->
|
||||||
<template #action="{ element: el }">
|
<template #action="{ element: el }">
|
||||||
@@ -103,6 +113,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</choose-question>
|
</choose-question>
|
||||||
|
<!-- 增加控制按钮-->
|
||||||
|
<slot name="button" :item="element"></slot>
|
||||||
|
|
||||||
<!-- {{ element.question_type }}-->
|
<!-- {{ element.question_type }}-->
|
||||||
<!-- {{questionInfo.survey.pages.length}}-->
|
<!-- {{questionInfo.survey.pages.length}}-->
|
||||||
@@ -121,9 +133,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { ref, onMounted, watch, computed } from 'vue';
|
import * as Base64 from 'js-base64';
|
||||||
|
import { ref, onMounted, watch, computed, reactive } from 'vue';
|
||||||
import { useCounterStore } from '@/stores/counter';
|
import { useCounterStore } from '@/stores/counter';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { saveQuestion, sync } from '@/api/design/index.js';
|
||||||
import Draggable from './components/Draggable.vue';
|
import Draggable from './components/Draggable.vue';
|
||||||
import Choice from './components/Questions/Choice.vue';
|
import Choice from './components/Questions/Choice.vue';
|
||||||
import ChooseQuestion from './components/ChooseQuestion.vue';
|
import ChooseQuestion from './components/ChooseQuestion.vue';
|
||||||
@@ -135,9 +150,10 @@ import TextWithImages from '@/views/Design/components/Questions/TextWithImages.v
|
|||||||
import SignQuestion from './components/Questions/SignQuestion.vue';
|
import SignQuestion from './components/Questions/SignQuestion.vue';
|
||||||
import FileUpload from './components/Questions/FileUpload.vue';
|
import FileUpload from './components/Questions/FileUpload.vue';
|
||||||
import NPS from '@/views/Design/components/Questions/NPS.vue';
|
import NPS from '@/views/Design/components/Questions/NPS.vue';
|
||||||
|
import { getPages } from '@/utils/public.js';
|
||||||
|
|
||||||
const activeIndex = ref(-1);
|
const activeIndex = ref(-1);
|
||||||
|
const route = useRoute();
|
||||||
// 获取所有的 question 列表内容
|
// 获取所有的 question 列表内容
|
||||||
const { filterGap, activeId } = defineProps({
|
const { filterGap, activeId } = defineProps({
|
||||||
filterGap: {
|
filterGap: {
|
||||||
@@ -151,6 +167,14 @@ const { filterGap, activeId } = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const computedElement = computed(() => (element) => {
|
||||||
|
return reactive({
|
||||||
|
...element,
|
||||||
|
// 添加需要响应式的属性
|
||||||
|
options: element.options.map((opt) => reactive(opt))
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => activeId,
|
() => activeId,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
@@ -210,12 +234,25 @@ const counterStore = useCounterStore();
|
|||||||
const store = storeToRefs(counterStore);
|
const store = storeToRefs(counterStore);
|
||||||
|
|
||||||
const chooseQuestionId = ref('');
|
const chooseQuestionId = ref('');
|
||||||
|
const chooseQuestionIndex = ref(-1);
|
||||||
|
|
||||||
const questionInfo = computed(() => store.questionsInfo.value);
|
const questionInfo = computed(() => store.questionsInfo.value);
|
||||||
|
// 自动更新 题型
|
||||||
|
watch(
|
||||||
|
() => questionInfo.value.questions[chooseQuestionIndex.value],
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
// saveQueItem(questionInfo.value.logics, [newVal]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
const emit = defineEmits(['getActiveQuestion']);
|
const emit = defineEmits(['getActiveQuestion']);
|
||||||
// 获取选中的题目的ID
|
// 获取选中的题目的ID
|
||||||
const getChooseQuestionId = (questionItem) => {
|
const getChooseQuestionId = (questionItem, index) => {
|
||||||
chooseQuestionId.value = questionItem.id;
|
chooseQuestionId.value = questionItem.id;
|
||||||
|
chooseQuestionIndex.value = index;
|
||||||
// 向外传出选中的题目
|
// 向外传出选中的题目
|
||||||
emit('getActiveQuestion', questionItem);
|
emit('getActiveQuestion', questionItem);
|
||||||
};
|
};
|
||||||
@@ -256,6 +293,7 @@ const actionEvent = (item, el) => {
|
|||||||
const actionFun = {
|
const actionFun = {
|
||||||
// 单选事件 添加选项
|
// 单选事件 添加选项
|
||||||
radioAddOption: (element) => {
|
radioAddOption: (element) => {
|
||||||
|
console.log(element);
|
||||||
element.options.map((item) => {
|
element.options.map((item) => {
|
||||||
item.push({
|
item.push({
|
||||||
id: uuidv4(),
|
id: uuidv4(),
|
||||||
@@ -295,6 +333,54 @@ const actionFun = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// emit 事件
|
||||||
|
const saveQueItem = (logics, questions, survey) => {
|
||||||
|
saveQuestion({
|
||||||
|
sn: route.query.sn,
|
||||||
|
data: {
|
||||||
|
logics: logics || [],
|
||||||
|
questions: questions || [],
|
||||||
|
survey: {
|
||||||
|
local_pages: [],
|
||||||
|
...survey,
|
||||||
|
pages: getPages(
|
||||||
|
questionInfo.value.questions,
|
||||||
|
questionInfo.value.survey.is_one_page_one_question
|
||||||
|
),
|
||||||
|
version: Base64.encode(`${new Date().getTime()}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
sync({ sn: route.query.sn });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const emitFun = {
|
||||||
|
move: () => {
|
||||||
|
saveQueItem();
|
||||||
|
},
|
||||||
|
copy: (item) => {
|
||||||
|
saveQueItem(null, [item]);
|
||||||
|
},
|
||||||
|
delete: () => {
|
||||||
|
saveQueItem();
|
||||||
|
},
|
||||||
|
// 右下角操作
|
||||||
|
setting: (item) => {
|
||||||
|
saveQueItem(null, [item]);
|
||||||
|
},
|
||||||
|
logics: (item) => {
|
||||||
|
saveQueItem(questionInfo.value.logics, [item]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 直接切割 变更为响应式
|
||||||
|
const updateElement = (newElement) => {
|
||||||
|
const index = questionInfo.value.questions.findIndex((q) => q.id === newElement.id);
|
||||||
|
if (index !== -1) {
|
||||||
|
questionInfo.value.questions.splice(index, 1, newElement);
|
||||||
|
}
|
||||||
|
saveQueItem(questionInfo.value.logics, [newElement]);
|
||||||
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
questionInfo.value = store.questionsInfo.value;
|
questionInfo.value = store.questionsInfo.value;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import PreviewIndex from './Index.vue';
|
import PreviewIndex from './Index.vue';
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -13,4 +12,4 @@ import PreviewIndex from './Index.vue';
|
|||||||
<preview-index :filterGap="true"></preview-index>
|
<preview-index :filterGap="true"></preview-index>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
size="0.5rem"
|
size="0.5rem"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
|
@change="saveSettings"
|
||||||
></van-switch>
|
></van-switch>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
size="0.5rem"
|
size="0.5rem"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
|
@change="saveSettings"
|
||||||
></van-switch>
|
></van-switch>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
@@ -50,15 +52,25 @@
|
|||||||
</van-cell>
|
</van-cell>
|
||||||
<van-divider></van-divider>
|
<van-divider></van-divider>
|
||||||
<!-- 根据不同题型 展示不同的操作-->
|
<!-- 根据不同题型 展示不同的操作-->
|
||||||
|
<!-- 多选-->
|
||||||
<checkbox-question-action
|
<checkbox-question-action
|
||||||
v-if="activeQuestion.question_type === 2"
|
v-if="activeQuestion.question_type === 2"
|
||||||
v-model="activeQuestion"
|
v-model="activeQuestion"
|
||||||
|
@save-option="saveSettings"
|
||||||
></checkbox-question-action>
|
></checkbox-question-action>
|
||||||
<rate-action
|
<!-- 打分-->
|
||||||
|
<rate-question-action
|
||||||
v-if="activeQuestion.question_type === 5"
|
v-if="activeQuestion.question_type === 5"
|
||||||
:config="activeQuestion.config"
|
:config="activeQuestion.config"
|
||||||
@update-config="updateConfig"
|
@update-config="updateConfig"
|
||||||
></rate-action>
|
></rate-question-action>
|
||||||
|
|
||||||
|
<!-- 填空-->
|
||||||
|
<completion-question-action
|
||||||
|
v-if="activeQuestion.question_type === 4"
|
||||||
|
v-model="activeQuestion"
|
||||||
|
@save-option="saveSettings"
|
||||||
|
></completion-question-action>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
</van-action-sheet>
|
</van-action-sheet>
|
||||||
<!-- 移动 复制-->
|
<!-- 移动 复制-->
|
||||||
@@ -86,6 +98,7 @@
|
|||||||
close-icon="close"
|
close-icon="close"
|
||||||
round
|
round
|
||||||
:style="{ minHeight: '50%', maxHeight: '75%' }"
|
:style="{ minHeight: '50%', maxHeight: '75%' }"
|
||||||
|
@close="saveLogics"
|
||||||
>
|
>
|
||||||
<div class="mv10">
|
<div class="mv10">
|
||||||
<header>
|
<header>
|
||||||
@@ -105,7 +118,8 @@ import { ref } from 'vue';
|
|||||||
import { useCounterStore } from '@/stores/counter';
|
import { useCounterStore } from '@/stores/counter';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import QuestionBefore from '@/views/Design/components/ActionCompoents/components/QuestionItemAction/QuestionBefore.vue';
|
import QuestionBefore from '@/views/Design/components/ActionCompoents/components/QuestionItemAction/QuestionBefore.vue';
|
||||||
import RateAction from './components/OptionItemAction/RateAction.vue';
|
import RateQuestionAction from './components/QuestionItemAction/RateQuestionAction.vue';
|
||||||
|
import CompletionQuestionAction from '@/views/Design/components/ActionCompoents/components/QuestionItemAction/CompletionQuestionAction.vue';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
const store = useCounterStore();
|
const store = useCounterStore();
|
||||||
const { questionsInfo } = storeToRefs(store);
|
const { questionsInfo } = storeToRefs(store);
|
||||||
@@ -132,10 +146,19 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const questions = ref(props.questions);
|
const questions = ref(props.questions);
|
||||||
|
// emit
|
||||||
|
const emit = defineEmits(['move', 'copy', 'delete', 'setting', 'logics']);
|
||||||
|
|
||||||
|
const saveSettings = () => {
|
||||||
|
emit('setting', activeQuestion.value);
|
||||||
|
};
|
||||||
|
const saveLogics = () => {
|
||||||
|
emit('logics', activeQuestion.value);
|
||||||
|
};
|
||||||
|
|
||||||
// 当前题目
|
// 当前题目
|
||||||
const activeQuestion = ref(props.data);
|
const activeQuestion = ref(props.data);
|
||||||
|
// 设置更新
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
const questionShow = ref(false);
|
const questionShow = ref(false);
|
||||||
const questionBeforeShow = ref(false);
|
const questionBeforeShow = ref(false);
|
||||||
@@ -151,7 +174,9 @@ const deleteQuestion = () => {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// on confirm
|
// on confirm
|
||||||
|
const index = props.questionIndex;
|
||||||
questions.value.splice(props.questionIndex, 1);
|
questions.value.splice(props.questionIndex, 1);
|
||||||
|
emit('delete', index);
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
// on cancel
|
// on cancel
|
||||||
@@ -175,6 +200,8 @@ const questionMove = (action) => {
|
|||||||
const temp = questions.value[props.questionIndex];
|
const temp = questions.value[props.questionIndex];
|
||||||
questions.value.splice(props.questionIndex, 1);
|
questions.value.splice(props.questionIndex, 1);
|
||||||
questions.value.splice(props.questionIndex + 1, 0, temp);
|
questions.value.splice(props.questionIndex + 1, 0, temp);
|
||||||
|
|
||||||
|
emit('move', 'down');
|
||||||
} else if (action.action === 'up') {
|
} else if (action.action === 'up') {
|
||||||
if (props.questionIndex === 0) {
|
if (props.questionIndex === 0) {
|
||||||
return;
|
return;
|
||||||
@@ -182,15 +209,21 @@ const questionMove = (action) => {
|
|||||||
const temp = questions.value[props.questionIndex];
|
const temp = questions.value[props.questionIndex];
|
||||||
questions.value.splice(props.questionIndex, 1);
|
questions.value.splice(props.questionIndex, 1);
|
||||||
questions.value.splice(props.questionIndex - 1, 0, temp);
|
questions.value.splice(props.questionIndex - 1, 0, temp);
|
||||||
|
emit('move', 'up');
|
||||||
} else {
|
} else {
|
||||||
// 复制 题目 生成新的id 更新最新的 last index
|
// 复制 题目 生成新的id 更新最新的 last index
|
||||||
const temp = questions.value[props.questionIndex];
|
const temp = questions.value[props.questionIndex];
|
||||||
questions.value.splice(props.questionIndex + 1, 0, {
|
|
||||||
|
const newQuestion = {
|
||||||
...temp,
|
...temp,
|
||||||
id: uuidv4(),
|
id: uuidv4(),
|
||||||
question_index: questionsInfo.value.survey.last_question_index + 1
|
question_index: questionsInfo.value.survey.last_question_index + 1
|
||||||
});
|
};
|
||||||
|
|
||||||
|
questions.value.splice(props.questionIndex + 1, 0, newQuestion);
|
||||||
questionsInfo.value.survey.last_question_index += 1;
|
questionsInfo.value.survey.last_question_index += 1;
|
||||||
|
emit('copy', newQuestion);
|
||||||
|
questionShow.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -200,8 +233,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);
|
||||||
}
|
}
|
||||||
@@ -217,19 +250,20 @@ 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;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateConfig = (value) => {
|
const updateConfig = (value) => {
|
||||||
activeQuestion.value.config = { ...value };
|
activeQuestion.value.config = { ...value };
|
||||||
|
saveSettings();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
input-align="right"
|
input-align="right"
|
||||||
class="action-field"
|
class="action-field"
|
||||||
placeholder="不限"
|
placeholder="不限"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(value) => {
|
(value) => {
|
||||||
actionQuestion.config.min_select = Number(value);
|
actionQuestion.config.min_select = Number(value);
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
placeholder="不限"
|
placeholder="不限"
|
||||||
input-align="right"
|
input-align="right"
|
||||||
class="action-field"
|
class="action-field"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(value) => {
|
(value) => {
|
||||||
actionQuestion.config.max_select = Number(value);
|
actionQuestion.config.max_select = Number(value);
|
||||||
@@ -49,7 +51,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue', 'saveOption']);
|
||||||
const actionQuestion = computed({
|
const actionQuestion = computed({
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue;
|
return props.modelValue;
|
||||||
|
|||||||
@@ -0,0 +1,260 @@
|
|||||||
|
<template>
|
||||||
|
<van-field
|
||||||
|
label="内容限制"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
is-link
|
||||||
|
readonly
|
||||||
|
:value="selectText(actionQuestion.config.text_type)"
|
||||||
|
@click="selectTextTypeModel = true"
|
||||||
|
>
|
||||||
|
<template #input>
|
||||||
|
<span>{{ selectText(actionQuestion.config.text_type) }}</span>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-cell-group>
|
||||||
|
<van-field
|
||||||
|
v-if="[2].includes(actionQuestion.config.text_type)"
|
||||||
|
v-model="actionQuestion.config.decimal_few"
|
||||||
|
label="保留小数位"
|
||||||
|
type="number"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
placeholder="不限"
|
||||||
|
max="4"
|
||||||
|
min="0"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.line_height = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<span>位</span>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
v-if="[3, 4].includes(actionQuestion.config.text_type)"
|
||||||
|
v-model="actionQuestion.config.decimal_few"
|
||||||
|
label="允许输入标点符号"
|
||||||
|
type="number"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
label-width="8em"
|
||||||
|
placeholder="不限"
|
||||||
|
readonly
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.line_height = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #input></template>
|
||||||
|
<template #right-icon>
|
||||||
|
<van-switch
|
||||||
|
v-model="actionQuestion.config.include_mark"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
size="0.5rem"
|
||||||
|
></van-switch>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</van-cell-group>
|
||||||
|
<van-divider></van-divider>
|
||||||
|
|
||||||
|
<van-cell
|
||||||
|
v-if="![5, 6, 7].includes(actionQuestion.config.text_type)"
|
||||||
|
title="字数限制"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
>
|
||||||
|
</van-cell>
|
||||||
|
<van-cell-group>
|
||||||
|
<van-field
|
||||||
|
v-if="![5, 6, 7].includes(actionQuestion.config.text_type)"
|
||||||
|
v-model="actionQuestion.config.min"
|
||||||
|
label="最少"
|
||||||
|
type="number"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
placeholder="不限"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.min = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<span>个</span>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
v-if="![5, 6, 7].includes(actionQuestion.config.text_type)"
|
||||||
|
v-model="actionQuestion.config.max"
|
||||||
|
label="最多"
|
||||||
|
type="number"
|
||||||
|
:border="false"
|
||||||
|
placeholder="不限"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.max = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<span>个</span>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
</van-cell-group>
|
||||||
|
<van-cell
|
||||||
|
v-if="[0].includes(actionQuestion.config.text_type)"
|
||||||
|
title="文本类型"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<van-radio-group
|
||||||
|
v-model="actionQuestion.config.line_type"
|
||||||
|
icon-size="0.4rem"
|
||||||
|
direction="horizontal"
|
||||||
|
>
|
||||||
|
<van-radio :name="0">单行</van-radio>
|
||||||
|
<van-radio :name="1">多行</van-radio>
|
||||||
|
</van-radio-group>
|
||||||
|
</template>
|
||||||
|
</van-cell>
|
||||||
|
<van-cell-group>
|
||||||
|
<van-field
|
||||||
|
v-if="[0].includes(actionQuestion.config.text_type)"
|
||||||
|
v-model="actionQuestion.config.line_height"
|
||||||
|
label="文本高度"
|
||||||
|
type="number"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
placeholder="不限"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.line_height = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<template #right-icon>
|
||||||
|
<span>行</span>
|
||||||
|
</template>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
v-model="actionQuestion.config.placeholder"
|
||||||
|
label="输入框提示"
|
||||||
|
:border="false"
|
||||||
|
label-align="left"
|
||||||
|
input-align="right"
|
||||||
|
class="action-field"
|
||||||
|
placeholder="不限"
|
||||||
|
@blur="emit('saveOption')"
|
||||||
|
@update:model-value="
|
||||||
|
(value) => {
|
||||||
|
actionQuestion.config.line_height = Number(value);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<van-popup v-model:show="selectTextTypeModel" position="bottom" round>
|
||||||
|
<van-picker
|
||||||
|
:columns="textTypeList"
|
||||||
|
@confirm="confirm"
|
||||||
|
@cancel="selectTextTypeModel = false"
|
||||||
|
></van-picker>
|
||||||
|
</van-popup>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import { computed, defineEmits, ref } from 'vue';
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const selectTextTypeModel = ref(false);
|
||||||
|
const textTypeList = [
|
||||||
|
{
|
||||||
|
text: '不限',
|
||||||
|
value: 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '整数',
|
||||||
|
value: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '小数',
|
||||||
|
value: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '字母',
|
||||||
|
value: 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '中文',
|
||||||
|
value: 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'email',
|
||||||
|
value: 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '手机号',
|
||||||
|
value: 6
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '身份证号',
|
||||||
|
value: 7
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'saveOption']);
|
||||||
|
//
|
||||||
|
const selectText = (textType) => {
|
||||||
|
return textTypeList.filter((item) => item.value === textType)[0].text;
|
||||||
|
};
|
||||||
|
const confirm = ({ selectedValues }) => {
|
||||||
|
actionQuestion.value.config.text_type = Number(selectedValues[0]);
|
||||||
|
selectTextTypeModel.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const actionQuestion = computed({
|
||||||
|
get() {
|
||||||
|
return props.modelValue;
|
||||||
|
},
|
||||||
|
set(newValue) {
|
||||||
|
emit('update:modelValue', newValue);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.action-field {
|
||||||
|
& ::v-deep .van-field__label {
|
||||||
|
color: #bfbfbf;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
class="question"
|
class="question"
|
||||||
:options="beforeQuesOptions"
|
:options="beforeQuesOptions"
|
||||||
placeholder="请选择问题"
|
placeholder="请选择问题"
|
||||||
|
@change="getQuestionType"
|
||||||
></yl-select>
|
></yl-select>
|
||||||
<!-- 为空 不为空-->
|
<!-- 为空 不为空-->
|
||||||
<yl-select
|
<yl-select
|
||||||
@@ -180,31 +181,34 @@ skipOption.push(
|
|||||||
);
|
);
|
||||||
// 题目选项
|
// 题目选项
|
||||||
let optionOptions = [];
|
let optionOptions = [];
|
||||||
|
// todo 不同题型逻辑对应不同 需要开发
|
||||||
const changeQuestionIndex = (value, logicItem) => {
|
const changeQuestionIndex = (value, logicItem) => {
|
||||||
|
console.log(logicItem);
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
beforeQuesOptions.map((item) => {
|
beforeQuesOptions.map((item) => {
|
||||||
if (item.question_index === value) {
|
if (item.question_index === value) {
|
||||||
if (logicItem.is_option_group === 0) {
|
if ([1, 2].includes(logicItem.question_type)) {
|
||||||
optionOptions = item.options[0].map((optItem) => {
|
if (logicItem.is_option_group === 0) {
|
||||||
return {
|
optionOptions = item.options[0].map((optItem) => {
|
||||||
...optItem,
|
return {
|
||||||
label: optItem.option,
|
...optItem,
|
||||||
value: optItem.option_index
|
label: optItem.option,
|
||||||
};
|
value: optItem.option_index
|
||||||
});
|
};
|
||||||
} else if (logicItem.is_option_group === 1) {
|
});
|
||||||
optionOptions = item.config.option_groups.option_group.map((groupItem) => {
|
} else if (logicItem.is_option_group === 1) {
|
||||||
return {
|
optionOptions = item.config.option_groups.option_group.map((groupItem) => {
|
||||||
...groupItem,
|
return {
|
||||||
label: groupItem.title,
|
...groupItem,
|
||||||
value: groupItem.group_index
|
label: groupItem.title,
|
||||||
};
|
value: groupItem.group_index
|
||||||
});
|
};
|
||||||
} else {
|
});
|
||||||
optionOptions = [];
|
} else {
|
||||||
|
optionOptions = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -229,7 +233,7 @@ const addLogicItem = (logIndex, item) => {
|
|||||||
item.splice(logIndex + 1, 0, {
|
item.splice(logIndex + 1, 0, {
|
||||||
logic: 'and',
|
logic: 'and',
|
||||||
question_index: '',
|
question_index: '',
|
||||||
question_type: '',
|
question_type: 0,
|
||||||
is_answer: 1,
|
is_answer: 1,
|
||||||
operator: '=',
|
operator: '=',
|
||||||
option_index: '',
|
option_index: '',
|
||||||
@@ -245,28 +249,16 @@ const addLogic = () => {
|
|||||||
logics.value.push({
|
logics.value.push({
|
||||||
logic: [
|
logic: [
|
||||||
{
|
{
|
||||||
value: '',
|
|
||||||
location: 0,
|
|
||||||
date: '',
|
|
||||||
time: '',
|
|
||||||
type: 0,
|
type: 0,
|
||||||
row_type: 0,
|
|
||||||
cell_type: 0,
|
|
||||||
logic: 'if',
|
logic: 'if',
|
||||||
operator: '=',
|
operator: '=',
|
||||||
is_answer: 1,
|
is_answer: 1,
|
||||||
is_select: 0,
|
question_type: 0,
|
||||||
row_index: 0,
|
question_index: 0,
|
||||||
cell_index: 0,
|
|
||||||
question_type: '',
|
|
||||||
question_index: '',
|
|
||||||
relation_question_index: 0,
|
relation_question_index: 0,
|
||||||
relation_question_row_index: 0,
|
relation_question_row_index: 0,
|
||||||
relation_question_cell_index: 0,
|
relation_question_cell_index: 0,
|
||||||
is_option_group: '',
|
option_index: 0
|
||||||
option_index: '',
|
|
||||||
skip_type: null,
|
|
||||||
question_id: null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
skip_type: props.skipType,
|
skip_type: props.skipType,
|
||||||
@@ -323,6 +315,12 @@ const symbolOptions = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const getQuestionType = (value) => {
|
||||||
|
console.log(beforeQuesOptions);
|
||||||
|
const type = beforeQuesOptions.filter((item) => item.question_index === value)[0];
|
||||||
|
console.log(type);
|
||||||
|
};
|
||||||
|
|
||||||
const logicIf = (value, index) => {
|
const logicIf = (value, index) => {
|
||||||
if (value === 'always') {
|
if (value === 'always') {
|
||||||
logics.value[index].logic = [logics.value[index].logic[0]];
|
logics.value[index].logic = [logics.value[index].logic[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
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,20 +17,13 @@
|
|||||||
v-model:data="element"
|
v-model:data="element"
|
||||||
:questions="questions"
|
:questions="questions"
|
||||||
:questionIndex="index"
|
:questionIndex="index"
|
||||||
|
@move="emit('move', $event)"
|
||||||
|
@copy="emit('copy', $event)"
|
||||||
|
@delete="emit('delete', $event)"
|
||||||
|
@setting="emit('setting', $event)"
|
||||||
|
@logics="emit('logics', $event)"
|
||||||
></question-action>
|
></question-action>
|
||||||
</template>
|
</template>
|
||||||
<!-- <div-->
|
|
||||||
<!-- v-for="item in questionAction"-->
|
|
||||||
<!-- :key="item.key"-->
|
|
||||||
<!-- class=""-->
|
|
||||||
<!-- :class="item.class ? item.class : ''"-->
|
|
||||||
<!-- @click="itemAction(item)"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <i class="icon iconfont choose-question-active-container-icon" v-html="item.icon"></i>-->
|
|
||||||
<!-- <div class="choose-question-active-container-name">-->
|
|
||||||
<!-- {{ item.name }}-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,68 +54,13 @@ const props = defineProps({
|
|||||||
const element = ref(props.element);
|
const element = ref(props.element);
|
||||||
|
|
||||||
// 选中题目后出现的操作
|
// 选中题目后出现的操作
|
||||||
// const questionAction = ref([
|
const emit = defineEmits(['getChooseQuestionId', 'move', 'copy']);
|
||||||
// {
|
|
||||||
// icon: '',
|
|
||||||
// name: '编辑',
|
|
||||||
// key: 'edit',
|
|
||||||
// class: ''
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// icon: '',
|
|
||||||
// name: '复制',
|
|
||||||
// key: 'copy',
|
|
||||||
// class: ''
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// icon: '',
|
|
||||||
// name: '移动',
|
|
||||||
// key: 'moveUp',
|
|
||||||
// class: 'moverQues'
|
|
||||||
// },
|
|
||||||
// // {
|
|
||||||
// // icon:'',
|
|
||||||
// // name:'下移',
|
|
||||||
// // key:'moveDown',
|
|
||||||
// // class:''
|
|
||||||
// // },
|
|
||||||
// {
|
|
||||||
// icon: '',
|
|
||||||
// name: '删除',
|
|
||||||
// key: 'delete',
|
|
||||||
// class: ''
|
|
||||||
// }
|
|
||||||
// ]);
|
|
||||||
const emit = defineEmits(['getChooseQuestionId']);
|
|
||||||
|
|
||||||
// 选中题目
|
// 选中题目
|
||||||
const chooseItem = () => {
|
const chooseItem = () => {
|
||||||
// 使用从 defineProps 接收的 element 对象
|
// 使用从 defineProps 接收的 element 对象
|
||||||
emit('getChooseQuestionId', props.element);
|
emit('getChooseQuestionId', props.element, props.index);
|
||||||
};
|
};
|
||||||
|
|
||||||
// const itemAction = (item) => {
|
|
||||||
// switch (item.key) {
|
|
||||||
// case 'edit':
|
|
||||||
// // vue router跳转到/edit
|
|
||||||
//
|
|
||||||
// router.push({
|
|
||||||
// path: '/design/edit',
|
|
||||||
// query: {
|
|
||||||
// id: props.element.id
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// break;
|
|
||||||
// case 'copy':
|
|
||||||
// break;
|
|
||||||
// case 'moveUp':
|
|
||||||
// break;
|
|
||||||
// case 'moveDown':
|
|
||||||
// break;
|
|
||||||
// case 'delete':
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.choose-question-container {
|
.choose-question-container {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
<template #label>
|
<template #label>
|
||||||
<contenteditable v-model="element.stem" :active="active"></contenteditable>
|
<contenteditable v-model="element.stem" :active="active" @blur="emitValue"></contenteditable>
|
||||||
</template>
|
</template>
|
||||||
<template #input>
|
<template #input>
|
||||||
<template v-for="(item, optionIndex) in element.options" :key="item.id">
|
<template v-for="(item, optionIndex) in element.options" :key="item.id">
|
||||||
@@ -30,12 +30,7 @@
|
|||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="flex align-center van-cell">
|
<div class="flex align-center van-cell">
|
||||||
<div
|
<contenteditable v-model="it.option" :active="active"></contenteditable>
|
||||||
class="van-cell--borderless choice-html"
|
|
||||||
:contenteditable="active"
|
|
||||||
@blur="saveOption($event, it)"
|
|
||||||
v-html="it.option"
|
|
||||||
></div>
|
|
||||||
<div v-if="it.is_other">
|
<div v-if="it.is_other">
|
||||||
<input class="other-input" type="text" />
|
<input class="other-input" type="text" />
|
||||||
</div>
|
</div>
|
||||||
@@ -61,12 +56,7 @@
|
|||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="flex align-center van-cell">
|
<div class="flex align-center van-cell">
|
||||||
<div
|
<contenteditable v-model="it.option" :active="active"></contenteditable>
|
||||||
class="van-cell--borderless choice-html"
|
|
||||||
:contenteditable="active"
|
|
||||||
@blur="saveOption($event, it)"
|
|
||||||
v-html="it.option"
|
|
||||||
></div>
|
|
||||||
<div v-if="it.is_other">
|
<div v-if="it.is_other">
|
||||||
<input class="other-input" type="text" />
|
<input class="other-input" type="text" />
|
||||||
</div>
|
</div>
|
||||||
@@ -82,7 +72,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 { ref, defineAsyncComponent } from 'vue';
|
import { defineAsyncComponent, toRefs } from 'vue';
|
||||||
const Contenteditable = defineAsyncComponent(() => import('@/components/contenteditable.vue'));
|
const Contenteditable = defineAsyncComponent(() => import('@/components/contenteditable.vue'));
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
element: {
|
element: {
|
||||||
@@ -102,10 +92,10 @@ const props = defineProps({
|
|||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const { element } = toRefs(props);
|
||||||
const element = ref(props.element);
|
const emit = defineEmits(['update:element']);
|
||||||
const saveOption = (e, ele) => {
|
const emitValue = () => {
|
||||||
ele.option = e.target.innerHTML;
|
emit('update:element', element.value);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
@@ -10,12 +10,11 @@
|
|||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div
|
<contenteditable
|
||||||
:contenteditable="active"
|
v-model="element.stem"
|
||||||
class="van-field"
|
:active="active"
|
||||||
@blur="saveStem($event, element)"
|
@blur="emitValue"
|
||||||
v-html="element.stem"
|
></contenteditable>
|
||||||
></div>
|
|
||||||
</template>
|
</template>
|
||||||
<template #input>
|
<template #input>
|
||||||
<div contenteditable="true" class="input other_input"></div>
|
<div contenteditable="true" class="input other_input"></div>
|
||||||
@@ -25,7 +24,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { toRefs } from 'vue';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
element: {
|
element: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -41,17 +40,14 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
sn: { type: String, default: '' },
|
|
||||||
questionType: { type: [String, Number], default: 4 }
|
questionType: { type: [String, Number], default: 4 }
|
||||||
});
|
});
|
||||||
const element = ref(props.element);
|
|
||||||
// 创建一个本地副本以保存更改
|
// 创建一个本地副本以保存更改
|
||||||
const localElement = ref({ ...props.element });
|
const emit = defineEmits(['update:element']);
|
||||||
|
const { element } = toRefs(props);
|
||||||
|
|
||||||
const saveStem = (e) => {
|
const emitValue = () => {
|
||||||
localElement.value.stem = e.target.innerHTML;
|
emit('update:element', element.value);
|
||||||
// 如果需要,可以在这里发出事件以通知父组件
|
|
||||||
// this.$emit('update:element', localElement.value);
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -77,4 +77,4 @@ function handleFileUpload() {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -16,14 +16,14 @@ const { element } = defineProps<{ element: MatrixSurveyQuestion }>();
|
|||||||
*/
|
*/
|
||||||
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';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,11 @@
|
|||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
<template #label>
|
<template #label>
|
||||||
<div
|
<contenteditable
|
||||||
:contenteditable="active"
|
v-model="element.stem"
|
||||||
class="van-field"
|
:active="active"
|
||||||
@blur="saveStem($event, element)"
|
@blur="emitValue"
|
||||||
v-html="element.stem"
|
></contenteditable>
|
||||||
></div>
|
|
||||||
</template>
|
</template>
|
||||||
<template #input>
|
<template #input>
|
||||||
<div v-for="(optionItem, optionItemIndex) in element.options" :key="optionItemIndex">
|
<div v-for="(optionItem, optionItemIndex) in element.options" :key="optionItemIndex">
|
||||||
@@ -24,11 +23,7 @@
|
|||||||
:key="optionIndex"
|
:key="optionIndex"
|
||||||
@click="chooseOption(item)"
|
@click="chooseOption(item)"
|
||||||
>
|
>
|
||||||
<div
|
<contenteditable v-model="item.option" :active="active"></contenteditable>
|
||||||
:contenteditable="item.id === chooseId"
|
|
||||||
class="van-field"
|
|
||||||
v-html="item.option"
|
|
||||||
></div>
|
|
||||||
<RateCharacter :config="element.config"></RateCharacter>
|
<RateCharacter :config="element.config"></RateCharacter>
|
||||||
<div class="tips">
|
<div class="tips">
|
||||||
<p>{{ element.config.prompt_left }}</p>
|
<p>{{ element.config.prompt_left }}</p>
|
||||||
@@ -43,12 +38,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, toRefs, watch } from 'vue';
|
||||||
import RateCharacter from './RateCharacter.vue';
|
import RateCharacter from './RateCharacter.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
element: {
|
element: {
|
||||||
type: Object
|
type: Object,
|
||||||
|
required: true
|
||||||
},
|
},
|
||||||
active: {
|
active: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -61,14 +57,22 @@ const props = defineProps({
|
|||||||
sn: { type: String, default: '' },
|
sn: { type: String, default: '' },
|
||||||
questionType: { type: [String, Number], default: 4 }
|
questionType: { type: [String, Number], default: 4 }
|
||||||
});
|
});
|
||||||
const element = ref(props.element);
|
|
||||||
const chooseId = ref('');
|
|
||||||
// 创建一个本地副本以保存更改
|
|
||||||
const localElement = ref({ ...props.element });
|
|
||||||
|
|
||||||
const saveStem = (e) => {
|
const emit = defineEmits(['update:element']);
|
||||||
localElement.value.stem = e.target.innerHTML;
|
|
||||||
|
const chooseId = ref('');
|
||||||
|
const { element } = toRefs(props);
|
||||||
|
|
||||||
|
const emitValue = (newVal) => {
|
||||||
|
emit('update:element', newVal || element.value);
|
||||||
};
|
};
|
||||||
|
watch(
|
||||||
|
element.value,
|
||||||
|
(newVal) => {
|
||||||
|
emitValue(newVal);
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
|
);
|
||||||
|
|
||||||
const chooseOption = (item) => {
|
const chooseOption = (item) => {
|
||||||
chooseId.value = item.id;
|
chooseId.value = item.id;
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
interface Config {
|
interface Config {
|
||||||
is_required: number;
|
is_required: number;
|
||||||
min_number: number;
|
min_number: number;
|
||||||
max_number: number;
|
max_number: number;
|
||||||
min_size: number;
|
min_size: number;
|
||||||
max_size: number;
|
max_size: number;
|
||||||
file_type: string;
|
file_type: string;
|
||||||
float_window: number;
|
float_window: number;
|
||||||
float_window_content: string;
|
float_window_content: string;
|
||||||
popup_window: number;
|
popup_window: number;
|
||||||
popup_window_content: string;
|
popup_window_content: string;
|
||||||
is_show: any[];
|
is_show: any[];
|
||||||
quick_type: number;
|
quick_type: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LogicConfig {
|
interface LogicConfig {
|
||||||
expect: string;
|
expect: string;
|
||||||
order: number;
|
order: number;
|
||||||
type: number;
|
type: number;
|
||||||
stay_time: string;
|
stay_time: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Permissions {
|
interface Permissions {
|
||||||
id: null;
|
id: null;
|
||||||
question_id: null;
|
question_id: null;
|
||||||
parent_question_id: null;
|
parent_question_id: null;
|
||||||
disable_update: null;
|
disable_update: null;
|
||||||
disable_option_update: null;
|
disable_option_update: null;
|
||||||
disable_copy: null;
|
disable_copy: null;
|
||||||
disable_delete: null;
|
disable_delete: null;
|
||||||
delete_group_keep_one: null;
|
delete_group_keep_one: null;
|
||||||
disable_copy_delete: null;
|
disable_copy_delete: null;
|
||||||
disable_copy_update: null;
|
disable_copy_update: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface FileUploadQuestion {
|
interface FileUploadQuestion {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
stem: string;
|
stem: string;
|
||||||
other: string | null;
|
other: string | null;
|
||||||
question_index: number;
|
question_index: number;
|
||||||
question_type: number;
|
question_type: number;
|
||||||
config: Config;
|
config: Config;
|
||||||
created_at: string | null;
|
created_at: string | null;
|
||||||
created_user_id: number | null;
|
created_user_id: number | null;
|
||||||
updated_user_id: number | null;
|
updated_user_id: number | null;
|
||||||
survey_id: number;
|
survey_id: number;
|
||||||
logic_config: LogicConfig;
|
logic_config: LogicConfig;
|
||||||
options: any[];
|
options: any[];
|
||||||
associate: any[];
|
associate: any[];
|
||||||
logics_has: number | null;
|
logics_has: number | null;
|
||||||
last_option_index: number;
|
last_option_index: number;
|
||||||
question_code: string;
|
question_code: string;
|
||||||
question_value: string | null;
|
question_value: string | null;
|
||||||
question_tag: string | null;
|
question_tag: string | null;
|
||||||
planet_id: string | null;
|
planet_id: string | null;
|
||||||
permissions: Permissions | null;
|
permissions: Permissions | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,19 +9,18 @@ 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() => {
|
onMounted(async() => {
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
if (utils.getParameter('digitalYiliToken')) {
|
if (utils.getParameter('digitalYiliToken')) {
|
||||||
const appToken = utils.getParameter('digitalYiliToken');
|
const query = {
|
||||||
getUserInfo(appToken).then((res) => {
|
xToken: utils.getParameter('digitalYiliToken')
|
||||||
|
};
|
||||||
|
getUserInfo(query).then((res) => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
contentShow.value = true;
|
utils.setSessionStorage('userInfo', res.data);
|
||||||
utils.setSessionStorage('userInfo', res.data.data);
|
|
||||||
} else {
|
} else {
|
||||||
contentShow.value = false;
|
showFailToast(error.data?.message || error.message || '服务器错误');
|
||||||
showFailToast(error.response.data?.message || error.data?.message || error.message || '服务器错误');
|
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
|
||||||
contentShow.value = false;
|
|
||||||
showFailToast(error.response.data?.message || error.message || '服务器错误');
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
contentShow.value = true;
|
contentShow.value = true;
|
||||||
@@ -46,13 +45,13 @@ onMounted(async() => {
|
|||||||
padding: 0 10px 60px;
|
padding: 0 10px 60px;
|
||||||
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;
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup>
|
||||||
// import { ref } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { consoleSurveys } from '@/api/home/index.js';
|
import { consoleSurveys, getQuestionList } from '@/api/home/index.js';
|
||||||
import { snQuestions, questionDetails } from '@/api/design/index.js';
|
import { snQuestions, saveQuestions } from '@/api/design/index.js';
|
||||||
import { surveys } from './Hooks/useRequestHooks';
|
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useCounterStore } from '@/stores/counter';
|
import { useCounterStore } from '@/stores/counter';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
@@ -11,14 +10,7 @@ const counterStore = useCounterStore();
|
|||||||
const store = storeToRefs(counterStore);
|
const store = storeToRefs(counterStore);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// const surveys = ref([]);
|
const surveys = ref([]);
|
||||||
//
|
|
||||||
// getQuestionList({}).then((res) => {
|
|
||||||
// console.log(res.data.data);
|
|
||||||
// surveys.value = res.data.data;
|
|
||||||
// });
|
|
||||||
|
|
||||||
console.log(surveys);
|
|
||||||
|
|
||||||
const createdQuestion = (item) => {
|
const createdQuestion = (item) => {
|
||||||
const query = {
|
const query = {
|
||||||
@@ -35,7 +27,7 @@ const createdQuestion = (item) => {
|
|||||||
if (ques.data) {
|
if (ques.data) {
|
||||||
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</p>`;
|
ques.data.data.survey.introduction = `<p>为优化活动服务品质,烦请完成问卷,感谢配合!您的反馈至关重要!(此提示语为默认提示语,您可选择自行输入本问卷的提示语)</p>`;
|
||||||
store.questionsInfo.value = ques.data.data;
|
store.questionsInfo.value = ques.data.data;
|
||||||
questionDetails({
|
saveQuestions({
|
||||||
sn: res.data.data.sn,
|
sn: res.data.data.sn,
|
||||||
introduction: ques.data.data.survey.introduction,
|
introduction: ques.data.data.survey.introduction,
|
||||||
title: ques.data.data.survey.title
|
title: ques.data.data.survey.title
|
||||||
@@ -52,6 +44,28 @@ const createdQuestion = (item) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 添加获取问卷列表的方法
|
||||||
|
const getList = () => {
|
||||||
|
getQuestionList().then((res) => {
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
if (res.data.data) {
|
||||||
|
res.data.data.forEach((item) => {
|
||||||
|
if (item.parentCode && item.parentCode === 1) {
|
||||||
|
surveys.value.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
surveys.value.push({});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 在组件挂载时调用
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -65,7 +79,7 @@ const createdQuestion = (item) => {
|
|||||||
class="survey"
|
class="survey"
|
||||||
@click="createdQuestion(survey)"
|
@click="createdQuestion(survey)"
|
||||||
>
|
>
|
||||||
<img width="45px" :src="survey.icon" alt=" " />
|
<img :src="survey.image" alt="" width="40" />
|
||||||
<span>{{ survey.title }}</span>
|
<span>{{ survey.title }}</span>
|
||||||
</van-col>
|
</van-col>
|
||||||
</van-row>
|
</van-row>
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { ref, h } from 'vue';
|
|
||||||
import { tables } from './hooks/useMarketHooks';
|
|
||||||
import TestComponent from './components/TestComponent.vue';
|
|
||||||
|
|
||||||
const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 模板 -->
|
<!-- 模板 -->
|
||||||
<div class="market">
|
<div class="market">
|
||||||
@@ -15,15 +7,63 @@ const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="market_table">
|
<div class="market_table">
|
||||||
<div v-for="item in tables" :key="item.title" @click="activeComponet = item.component">
|
<div v-for="item in tables" :key="item.title" @click="getMarketInfo(item)">
|
||||||
{{ item.title }}
|
{{ item.title }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<van-cell class="market_items">
|
<van-cell class="market_items">
|
||||||
<component :is="activeComponet" />
|
<market-item :info="marketInfo"></market-item>
|
||||||
|
<!-- <component :is="TestComponent" />-->
|
||||||
</van-cell>
|
</van-cell>
|
||||||
|
<p class="more">-更多模板期待您的探索-</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import MarketItem from './components/MarketItem.vue';
|
||||||
|
import { getListScene, getSurveyTemplates } from '@/api/home';
|
||||||
|
|
||||||
|
interface SceneItem {
|
||||||
|
parentCode: number;
|
||||||
|
title: string;
|
||||||
|
component: any;
|
||||||
|
code: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tables = ref<SceneItem[]>([]);
|
||||||
|
const marketInfo = ref([]);
|
||||||
|
|
||||||
|
const getTableList = async () => {
|
||||||
|
const res = await getListScene();
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
res.data.data.forEach((item: SceneItem) => {
|
||||||
|
if (item.parentCode && item.parentCode === 1) {
|
||||||
|
tables.value.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
getMarketInfo(tables.value[0]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getMarketInfo = async (item: SceneItem) => {
|
||||||
|
const params = {
|
||||||
|
page: 1,
|
||||||
|
per_page: 10,
|
||||||
|
group_id: 0,
|
||||||
|
is_public: 1,
|
||||||
|
scene_code_info: item.code,
|
||||||
|
sort: 'quote_nums, desc'
|
||||||
|
};
|
||||||
|
const res = await getSurveyTemplates(params);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
marketInfo.value = res.data.data;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTableList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.market {
|
.market {
|
||||||
@@ -70,5 +110,12 @@ const activeComponet = ref(h(TestComponent, { cn: '报名签到' }));
|
|||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.more {
|
||||||
|
margin: 10px 0;
|
||||||
|
color: #666;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
57
src/views/Home/components/Market/components/MarketItem.vue
Normal file
57
src/views/Home/components/Market/components/MarketItem.vue
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<template>
|
||||||
|
<van-row :gutter="12">
|
||||||
|
<van-col v-for="(item, index) in info" :key="index" :span="12" class="market-item">
|
||||||
|
<div class="content">
|
||||||
|
<div class="title">
|
||||||
|
<span>{{ item.title }}</span>
|
||||||
|
<img
|
||||||
|
src="https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u42.svg"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="desc">
|
||||||
|
<span>引用{{ item.quote_nums }}次</span> |
|
||||||
|
<span>创建人: {{ item.creator }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
const { info } = defineProps({
|
||||||
|
info: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.market-item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
color: #666;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
const { cn } = defineProps({
|
|
||||||
cn: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
deault: 'default'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<van-row :gutter="4">
|
|
||||||
<van-col
|
|
||||||
v-for="item in 2"
|
|
||||||
:key="item"
|
|
||||||
:span="10"
|
|
||||||
style="
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: start;
|
|
||||||
box-shadow: 0 3px 3px rgba(0, 0, 0, 0.1);
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<div style="display: flex; align-items: center; justify-content: space-evenly; width: 100%">
|
|
||||||
<span>{{ cn }} 模板</span>
|
|
||||||
<img
|
|
||||||
src="https://files.axshare.com/gsc/DR6075/63/4d/77/634d77293a4d41d1b3d145974a8fb6a7/images/首页_1/u42.svg?pageId=5cc10b9f-56eb-48dc-943a-bfe7afb18a64"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div><span>引用10次</span> | <span>创建人: 张三</span></div>
|
|
||||||
</van-col>
|
|
||||||
</van-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="sass" scoped></style>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import TestComponent from '../components/TestComponent.vue';
|
import TestComponent from '../components/MarketItem.vue';
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
|
||||||
export const tables = [
|
export const tables = [
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -25,17 +25,23 @@
|
|||||||
></contenteditable>
|
></contenteditable>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button v-if="questionInfo.questions.length === 0" @click="show = true">添加题目</button>
|
<van-button v-if="questionInfo.questions.length === 0" size="small" @click="show = true">
|
||||||
|
添加题目
|
||||||
|
</van-button>
|
||||||
</div>
|
</div>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<div class="ques">
|
<div class="ques">
|
||||||
<!-- 题目-->
|
<!-- 题目-->
|
||||||
<Design
|
<Design :active-id="activeId" class="design" @get-active-question="getActiveQuestion">
|
||||||
:active-id="activeId"
|
<template #button="{ item }">
|
||||||
class="desgin"
|
<div class="design-button">
|
||||||
@get-active-question="getActiveQuestion"
|
<van-button v-if="activeId === item.id" size="small" @click="show = true">
|
||||||
></Design>
|
添加题目
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Design>
|
||||||
<!-- <van-button @click="show = true">添加题目</van-button>-->
|
<!-- <van-button @click="show = true">添加题目</van-button>-->
|
||||||
<!-- 弹出的新增题目弹窗-->
|
<!-- 弹出的新增题目弹窗-->
|
||||||
<van-popup
|
<van-popup
|
||||||
@@ -74,9 +80,9 @@
|
|||||||
<span>投放设置</span>
|
<span>投放设置</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="survey-action_btn">
|
<div class="survey-action_btn">
|
||||||
<van-button size="small">预览</van-button>
|
<van-button size="small" @click="previewQuestion">预览</van-button>
|
||||||
<van-button size="small">保存</van-button>
|
<van-button size="small" @click="saveAs">保存</van-button>
|
||||||
<van-button size="small" @click="$router.push({ name: 'publish' })">投放</van-button>
|
<van-button size="small" @click="publishQuestion">投放</van-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -96,6 +102,7 @@
|
|||||||
size="0.5rem"
|
size="0.5rem"
|
||||||
:active-value="1"
|
:active-value="1"
|
||||||
:inactive-value="0"
|
:inactive-value="0"
|
||||||
|
@change="saveIsOnePage"
|
||||||
></van-switch>
|
></van-switch>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
@@ -281,7 +288,7 @@ import { ref, computed, onMounted, watch } from 'vue';
|
|||||||
import * as Base64 from 'js-base64';
|
import * as Base64 from 'js-base64';
|
||||||
import {
|
import {
|
||||||
getSetting,
|
getSetting,
|
||||||
questionDetails,
|
saveQuestions,
|
||||||
saveQuestion,
|
saveQuestion,
|
||||||
snQuestions,
|
snQuestions,
|
||||||
sync,
|
sync,
|
||||||
@@ -302,8 +309,9 @@ import {
|
|||||||
signQuestion,
|
signQuestion,
|
||||||
nps
|
nps
|
||||||
} from '@/utils/importJsons';
|
} from '@/utils/importJsons';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import YLPicker from '@/components/YLPicker.vue';
|
import YLPicker from '@/components/YLPicker.vue';
|
||||||
|
import { getPages } from '@/utils/public';
|
||||||
|
|
||||||
// 获取 Store 实例
|
// 获取 Store 实例
|
||||||
const counterStore = useCounterStore();
|
const counterStore = useCounterStore();
|
||||||
@@ -314,6 +322,7 @@ const activeQuestionIndex = ref(-1);
|
|||||||
const currentDate = ref();
|
const currentDate = ref();
|
||||||
const currentType = ref();
|
const currentType = ref();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const surveyTitle = route.meta.title as string;
|
const surveyTitle = route.meta.title as string;
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
// const textModel = ref(false);
|
// const textModel = ref(false);
|
||||||
@@ -344,6 +353,7 @@ const onConfirmDate = (e) => {
|
|||||||
// 获取选中的题目
|
// 获取选中的题目
|
||||||
const getActiveQuestion = (activeQues) => {
|
const getActiveQuestion = (activeQues) => {
|
||||||
chooseQuestionId.value = activeQues.id;
|
chooseQuestionId.value = activeQues.id;
|
||||||
|
activeId.value = activeQues.id;
|
||||||
// 在questions 里 查找index 给 activeQuestionIndex
|
// 在questions 里 查找index 给 activeQuestionIndex
|
||||||
questionInfo.value.questions.forEach((item, index) => {
|
questionInfo.value.questions.forEach((item, index) => {
|
||||||
if (item.id === activeQues.id) {
|
if (item.id === activeQues.id) {
|
||||||
@@ -353,7 +363,7 @@ const getActiveQuestion = (activeQues) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const saveTitle = () => {
|
const saveTitle = () => {
|
||||||
questionDetails({
|
saveQuestions({
|
||||||
sn: route.query.sn,
|
sn: route.query.sn,
|
||||||
title: questionInfo.value.survey.title,
|
title: questionInfo.value.survey.title,
|
||||||
introduction: questionInfo.value.survey.introduction
|
introduction: questionInfo.value.survey.introduction
|
||||||
@@ -447,14 +457,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()
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
: []
|
: []
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -482,9 +492,10 @@ const saveQuestionItem = (questionJson) => {
|
|||||||
questions: [questionJson],
|
questions: [questionJson],
|
||||||
survey: {
|
survey: {
|
||||||
local_pages: [],
|
local_pages: [],
|
||||||
pages: questionInfo.value.questions.map((item) => {
|
pages: getPages(
|
||||||
return [item.question_index];
|
questionInfo.value.questions,
|
||||||
}),
|
questionInfo.value.survey.is_one_page_one_question
|
||||||
|
),
|
||||||
version: Base64.encode(`${new Date().getTime()}`)
|
version: Base64.encode(`${new Date().getTime()}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -520,6 +531,13 @@ const saveSetting = (parentKey, childKeys) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 保存是否每页一题
|
||||||
|
const saveIsOnePage = () => {
|
||||||
|
saveQuestions({
|
||||||
|
sn: route.query.sn,
|
||||||
|
is_one_page_one_question: questionInfo.value.survey.is_one_page_one_question
|
||||||
|
});
|
||||||
|
};
|
||||||
const init = () => {
|
const init = () => {
|
||||||
// event.detail 为当前输入的值
|
// event.detail 为当前输入的值
|
||||||
show.value = true;
|
show.value = true;
|
||||||
@@ -565,8 +583,22 @@ watch(
|
|||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
onMounted(async() => {
|
|
||||||
await getQuestionDetail(); // 等待接口返回数据
|
// 保存 目前没有任何逻辑可以执行所有保存
|
||||||
|
const saveAs = () => {
|
||||||
|
// 保存所有
|
||||||
|
};
|
||||||
|
// 投放
|
||||||
|
const publishQuestion = () => {
|
||||||
|
router.push({ name: 'publish', query: { ...route.query } });
|
||||||
|
};
|
||||||
|
// 预览
|
||||||
|
const previewQuestion = () => {
|
||||||
|
router.push({ name: 'preview', query: { ...route.query } });
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getQuestionDetail();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -598,8 +630,10 @@ onMounted(async() => {
|
|||||||
|
|
||||||
& > button {
|
& > button {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
border-radius: 10px;
|
|
||||||
background-color: lightgreen;
|
//border-radius: 10px;
|
||||||
|
background-color: #70b936;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -624,8 +658,21 @@ onMounted(async() => {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
& .desgin {
|
& .design {
|
||||||
padding-bottom: 50px;
|
padding-bottom: 60px;
|
||||||
|
|
||||||
|
& .design-button {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
::v-deep .van-button {
|
||||||
|
background-color: #70b936;
|
||||||
|
|
||||||
|
//width: 140px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ques_list {
|
.ques_list {
|
||||||
|
|||||||
@@ -41,8 +41,7 @@
|
|||||||
height: 50px;
|
height: 50px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
"
|
"
|
||||||
>
|
></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -83,6 +82,7 @@ interface PublishInfo {
|
|||||||
|
|
||||||
const publishInfo = ref<PublishInfo>({} as PublishInfo);
|
const publishInfo = ref<PublishInfo>({} as PublishInfo);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
type OperateItem = typeof operateList[0];
|
type OperateItem = typeof operateList[0];
|
||||||
onMounted(async() => {
|
onMounted(async() => {
|
||||||
getQrcode('Xxgdr5EN').then((res) => {
|
getQrcode('Xxgdr5EN').then((res) => {
|
||||||
@@ -92,20 +92,34 @@ onMounted(async() => {
|
|||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
showFailToast(error.data?.message || error.message || '服务器错误');
|
showFailToast(error.data?.message || error.message || '服务器错误');
|
||||||
});
|
});
|
||||||
|
=======
|
||||||
|
type OperateItem = (typeof operateList)[0];
|
||||||
|
onMounted(async () => {
|
||||||
|
getQrcode('Xxgdr5EN')
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data) {
|
||||||
|
publishInfo.value = res.data.data || {};
|
||||||
|
console.log(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
showFailToast(error.data?.message || error.message || '服务器错误');
|
||||||
|
});
|
||||||
|
>>>>>>> e30652902e8d5cc8e390399001c3c69c5fe80ff3
|
||||||
});
|
});
|
||||||
const operateBtn = (item: OperateItem) => {
|
const operateBtn = (item: OperateItem) => {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'shareLink':
|
case 'shareLink':
|
||||||
shareLink();
|
shareLink();
|
||||||
break;
|
break;
|
||||||
case 'copyLink':
|
case 'copyLink':
|
||||||
copyLink();
|
copyLink();
|
||||||
break;
|
break;
|
||||||
case 'qrCode':
|
case 'qrCode':
|
||||||
downLoadImg();
|
downLoadImg();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// 复制链接
|
// 复制链接
|
||||||
@@ -128,7 +142,7 @@ function shareLink() {
|
|||||||
webpageUrl: publishInfo.value.url,
|
webpageUrl: publishInfo.value.url,
|
||||||
scene: 0 // 朋友圈1 微信好友0
|
scene: 0 // 朋友圈1 微信好友0
|
||||||
};
|
};
|
||||||
appBridge.shareToWeChat(params, (result: any) => {
|
appBridge.shareToWeChat(params, () => {
|
||||||
// console.log('分享结果:', result);
|
// console.log('分享结果:', result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -149,7 +163,6 @@ function downLoadImg() {
|
|||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
69
vite.config.ts.timestamp-1741757594112-f9893a9e35187.mjs
Normal file
69
vite.config.ts.timestamp-1741757594112-f9893a9e35187.mjs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
// vite.config.ts
|
||||||
|
import {
|
||||||
|
defineConfig,
|
||||||
|
loadEnv
|
||||||
|
} from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/vite/dist/node/index.js';
|
||||||
|
import vue from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/@vitejs/plugin-vue/dist/index.mjs';
|
||||||
|
import { fileURLToPath, URL } from 'node:url';
|
||||||
|
import vueJsx from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/@vitejs/plugin-vue-jsx/dist/index.mjs';
|
||||||
|
import AutoImport from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-auto-import/dist/vite.js';
|
||||||
|
import Components from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-vue-components/dist/vite.js';
|
||||||
|
import { VantResolver } from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/unplugin-vue-components/dist/resolvers.js';
|
||||||
|
import postCssPxToRem from 'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/node_modules/postcss-pxtorem/index.js';
|
||||||
|
var __vite_injected_original_import_meta_url =
|
||||||
|
'file:///E:/yijiaofu/yili/GIT/ylst-survey-h5/vite.config.ts';
|
||||||
|
var vite_config_default = defineConfig(({ mode }) => {
|
||||||
|
const env = loadEnv(mode, process.cwd());
|
||||||
|
const proxyUrl = env.VITE_APP_BASEURL;
|
||||||
|
const proxyUrlDelivery = env.VITE_APP_DELIVERY_BASEURL;
|
||||||
|
return {
|
||||||
|
// 必须 return 配置对象
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 3e3,
|
||||||
|
proxy: {
|
||||||
|
'/backend-api': {
|
||||||
|
target: proxyUrl,
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: {
|
||||||
|
'^/backend-api': ''
|
||||||
|
// 路径重写
|
||||||
|
},
|
||||||
|
// bypass: (req) => req.headers.accept?.indexOf('html') !== -1, // 跳过 HTML 请求
|
||||||
|
cookieDomainRewrite: 'localhost'
|
||||||
|
},
|
||||||
|
'/request-java': {
|
||||||
|
target: `${proxyUrlDelivery}/api`,
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: { '^/request-java': '' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
css: {
|
||||||
|
postcss: {
|
||||||
|
plugins: [
|
||||||
|
postCssPxToRem({
|
||||||
|
rootValue: 37.5,
|
||||||
|
propList: ['*']
|
||||||
|
})
|
||||||
|
]
|
||||||
|
},
|
||||||
|
preprocessorOptions: {
|
||||||
|
scss: { api: 'modern-compiler' }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
vueJsx(),
|
||||||
|
AutoImport({ resolvers: [VantResolver()] }),
|
||||||
|
Components({ resolvers: [VantResolver()] })
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', __vite_injected_original_import_meta_url))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
export { vite_config_default as default };
|
||||||
|
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJFOlxcXFx5aWppYW9mdVxcXFx5aWxpXFxcXEdJVFxcXFx5bHN0LXN1cnZleS1oNVwiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9maWxlbmFtZSA9IFwiRTpcXFxceWlqaWFvZnVcXFxceWlsaVxcXFxHSVRcXFxceWxzdC1zdXJ2ZXktaDVcXFxcdml0ZS5jb25maWcudHNcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfaW1wb3J0X21ldGFfdXJsID0gXCJmaWxlOi8vL0U6L3lpamlhb2Z1L3lpbGkvR0lUL3lsc3Qtc3VydmV5LWg1L3ZpdGUuY29uZmlnLnRzXCI7Ly8gdml0ZS5jb25maWcudHNcclxuaW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBsb2FkRW52IH0gZnJvbSAndml0ZSc7IC8vIFx1NEVDRSB2aXRlIFx1NUJGQ1x1NTE2NSBsb2FkRW52XHJcbmltcG9ydCB2dWUgZnJvbSAnQHZpdGVqcy9wbHVnaW4tdnVlJztcclxuaW1wb3J0IHsgZmlsZVVSTFRvUGF0aCwgVVJMIH0gZnJvbSAnbm9kZTp1cmwnO1xyXG5pbXBvcnQgdnVlSnN4IGZyb20gJ0B2aXRlanMvcGx1Z2luLXZ1ZS1qc3gnO1xyXG5pbXBvcnQgQXV0b0ltcG9ydCBmcm9tICd1bnBsdWdpbi1hdXRvLWltcG9ydC92aXRlJztcclxuaW1wb3J0IENvbXBvbmVudHMgZnJvbSAndW5wbHVnaW4tdnVlLWNvbXBvbmVudHMvdml0ZSc7XHJcbmltcG9ydCB7IFZhbnRSZXNvbHZlciB9IGZyb20gJ3VucGx1Z2luLXZ1ZS1jb21wb25lbnRzL3Jlc29sdmVycyc7XHJcbmltcG9ydCBwb3N0Q3NzUHhUb1JlbSBmcm9tICdwb3N0Y3NzLXB4dG9yZW0nO1xyXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoKHsgbW9kZSB9KSA9PiB7XHJcbiAgLy8gXHU2M0E1XHU2NTM2IG1vZGUgXHU1M0MyXHU2NTcwXHJcbiAgLy8gXHU2QjYzXHU3ODZFXHU1MkEwXHU4RjdEXHU3M0FGXHU1ODgzXHU1M0Q4XHU5MUNGXHJcbiAgY29uc3QgZW52ID0gbG9hZEVudihtb2RlLCBwcm9jZXNzLmN3ZCgpKTtcclxuXHJcbiAgLy8gXHU0RUNFIGVudiBcdTVCRjlcdThDNjFcdTRFMkRcdTgzQjdcdTUzRDZcdTUzRDhcdTkxQ0ZcclxuICBjb25zdCBwcm94eVVybCA9IGVudi5WSVRFX0FQUF9CQVNFVVJMO1xyXG4gIGNvbnN0IHByb3h5VXJsRGVsaXZlcnkgPSBlbnYuVklURV9BUFBfREVMSVZFUllfQkFTRVVSTDtcclxuICByZXR1cm4ge1xyXG4gICAgLy8gXHU1RkM1XHU5ODdCIHJldHVybiBcdTkxNERcdTdGNkVcdTVCRjlcdThDNjFcclxuICAgIHNlcnZlcjoge1xyXG4gICAgICBob3N0OiAnMC4wLjAuMCcsXHJcbiAgICAgIHBvcnQ6IDMwMDAsXHJcbiAgICAgIHByb3h5OiB7XHJcbiAgICAgICAgJy9iYWNrZW5kLWFwaSc6IHtcclxuICAgICAgICAgIHRhcmdldDogcHJveHlVcmwsXHJcbiAgICAgICAgICBjaGFuZ2VPcmlnaW46IHRydWUsXHJcbiAgICAgICAgICBwYXRoUmV3cml0ZToge1xyXG4gICAgICAgICAgICAnXi9iYWNrZW5kLWFwaSc6ICcnIC8vIFx1OERFRlx1NUY4NFx1OTFDRFx1NTE5OVxyXG4gICAgICAgICAgfSxcclxuICAgICAgICAgIC8vIGJ5cGFzczogKHJlcSkgPT4gcmVxLmhlYWRlcnMuYWNjZXB0Py5pbmRleE9mKCdodG1sJykgIT09IC0xLCAvLyBcdThERjNcdThGQzcgSFRNTCBcdThCRjdcdTZDNDJcclxuICAgICAgICAgIGNvb2tpZURvbWFpblJld3JpdGU6ICdsb2NhbGhvc3QnXHJcbiAgICAgICAgfSxcclxuICAgICAgICAnL3JlcXVlc3QtamF2YSc6IHtcclxuICAgICAgICAgIHRhcmdldDogYCR7cHJveHlVcmxEZWxpdmVyeX0vYXBpYCxcclxuICAgICAgICAgIGNoYW5nZU9yaWdpbjogdHJ1ZSxcclxuICAgICAgICAgIHBhdGhSZXdyaXRlOiB7ICdeL3JlcXVlc3QtamF2YSc6ICcnIH1cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgIH0sXHJcbiAgICBjc3M6IHtcclxuICAgICAgcG9zdGNzczoge1xyXG4gICAgICAgIHBsdWdpbnM6IFtcclxuICAgICAgICAgIHBvc3RDc3NQeFRvUmVtKHtcclxuICAgICAgICAgICAgcm9vdFZhbHVlOiAzNy41LFxyXG4gICAgICAgICAgICBwcm9wTGlzdDogWycqJ11cclxuICAgICAgICAgIH0pXHJcbiAgICAgICAgXVxyXG4gICAgICB9LFxyXG4gICAgICBwcmVwcm9jZXNzb3JPcHRpb25zOiB7XHJcbiAgICAgICAgc2NzczogeyBhcGk6ICdtb2Rlcm4tY29tcGlsZXInIH1cclxuICAgICAgfVxyXG4gICAgfSxcclxuICAgIHBsdWdpbnM6IFtcclxuICAgICAgdnVlKCksXHJcbiAgICAgIHZ1ZUpzeCgpLFxyXG4gICAgICBBdXRvSW1wb3J0KHsgcmVzb2x2ZXJzOiBbVmFudFJlc29sdmVyKCldIH0pLFxyXG4gICAgICBDb21wb25lbnRzKHsgcmVzb2x2ZXJzOiBbVmFudFJlc29sdmVyKCldIH0pXHJcbiAgICBdLFxyXG4gICAgcmVzb2x2ZToge1xyXG4gICAgICBhbGlhczoge1xyXG4gICAgICAgICdAJzogZmlsZVVSTFRvUGF0aChuZXcgVVJMKCcuL3NyYycsIGltcG9ydC5tZXRhLnVybCkpXHJcbiAgICAgIH1cclxuICAgIH1cclxuICB9O1xyXG59KTtcclxuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUNBLFNBQVMsY0FBYyxlQUFlO0FBQ3RDLE9BQU8sU0FBUztBQUNoQixTQUFTLGVBQWUsV0FBVztBQUNuQyxPQUFPLFlBQVk7QUFDbkIsT0FBTyxnQkFBZ0I7QUFDdkIsT0FBTyxnQkFBZ0I7QUFDdkIsU0FBUyxvQkFBb0I7QUFDN0IsT0FBTyxvQkFBb0I7QUFSNEosSUFBTSwyQ0FBMkM7QUFTeE8sSUFBTyxzQkFBUSxhQUFhLENBQUMsRUFBRSxLQUFLLE1BQU07QUFHeEMsUUFBTSxNQUFNLFFBQVEsTUFBTSxRQUFRLElBQUksQ0FBQztBQUd2QyxRQUFNLFdBQVcsSUFBSTtBQUNyQixRQUFNLG1CQUFtQixJQUFJO0FBQzdCLFNBQU87QUFBQTtBQUFBLElBRUwsUUFBUTtBQUFBLE1BQ04sTUFBTTtBQUFBLE1BQ04sTUFBTTtBQUFBLE1BQ04sT0FBTztBQUFBLFFBQ0wsZ0JBQWdCO0FBQUEsVUFDZCxRQUFRO0FBQUEsVUFDUixjQUFjO0FBQUEsVUFDZCxhQUFhO0FBQUEsWUFDWCxpQkFBaUI7QUFBQTtBQUFBLFVBQ25CO0FBQUE7QUFBQSxVQUVBLHFCQUFxQjtBQUFBLFFBQ3ZCO0FBQUEsUUFDQSxpQkFBaUI7QUFBQSxVQUNmLFFBQVEsR0FBRyxnQkFBZ0I7QUFBQSxVQUMzQixjQUFjO0FBQUEsVUFDZCxhQUFhLEVBQUUsa0JBQWtCLEdBQUc7QUFBQSxRQUN0QztBQUFBLE1BQ0Y7QUFBQSxJQUNGO0FBQUEsSUFDQSxLQUFLO0FBQUEsTUFDSCxTQUFTO0FBQUEsUUFDUCxTQUFTO0FBQUEsVUFDUCxlQUFlO0FBQUEsWUFDYixXQUFXO0FBQUEsWUFDWCxVQUFVLENBQUMsR0FBRztBQUFBLFVBQ2hCLENBQUM7QUFBQSxRQUNIO0FBQUEsTUFDRjtBQUFBLE1BQ0EscUJBQXFCO0FBQUEsUUFDbkIsTUFBTSxFQUFFLEtBQUssa0JBQWtCO0FBQUEsTUFDakM7QUFBQSxJQUNGO0FBQUEsSUFDQSxTQUFTO0FBQUEsTUFDUCxJQUFJO0FBQUEsTUFDSixPQUFPO0FBQUEsTUFDUCxXQUFXLEVBQUUsV0FBVyxDQUFDLGFBQWEsQ0FBQyxFQUFFLENBQUM7QUFBQSxNQUMxQyxXQUFXLEVBQUUsV0FBVyxDQUFDLGFBQWEsQ0FBQyxFQUFFLENBQUM7QUFBQSxJQUM1QztBQUFBLElBQ0EsU0FBUztBQUFBLE1BQ1AsT0FBTztBQUFBLFFBQ0wsS0FBSyxjQUFjLElBQUksSUFBSSxTQUFTLHdDQUFlLENBQUM7QUFBQSxNQUN0RDtBQUFBLElBQ0Y7QUFBQSxFQUNGO0FBQ0YsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0K
|
||||||
Reference in New Issue
Block a user