fix:移动端问卷复制,标题显示、投放数量处理

This commit is contained in:
du.meimei
2025-03-22 18:56:05 +08:00
parent 40b1d7f267
commit 24ba61f034
5 changed files with 27 additions and 10 deletions

9
components.d.ts vendored
View File

@@ -8,9 +8,14 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
Contenteditable: typeof import('./src/components/contenteditable.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElText: typeof import('element-plus/es')['ElText']
@@ -29,6 +34,7 @@ declare module 'vue' {
VanGrid: typeof import('vant/es')['Grid']
VanGridItem: typeof import('vant/es')['GridItem']
VanIcon: typeof import('vant/es')['Icon']
VanList: typeof import('vant/es')['List']
VanNavBar: typeof import('vant/es')['NavBar']
VanPicker: typeof import('vant/es')['Picker']
VanPopover: typeof import('vant/es')['Popover']
@@ -36,8 +42,11 @@ declare module 'vue' {
VanRadio: typeof import('vant/es')['Radio']
VanRadioGroup: typeof import('vant/es')['RadioGroup']
VanRow: typeof import('vant/es')['Row']
VanSearch: typeof import('vant/es')['Search']
VanStepper: typeof import('vant/es')['Stepper']
VanSwitch: typeof import('vant/es')['Switch']
VanTab: typeof import('vant/es')['Tab']
VanTabs: typeof import('vant/es')['Tabs']
YLCascader: typeof import('./src/components/YLCascader.vue')['default']
YLInput: typeof import('./src/components/YLInput.vue')['default']
YLPicker: typeof import('./src/components/YLPicker.vue')['default']

View File

@@ -24,8 +24,9 @@ export function getSurveysPage(params) {
}
// 复制问卷
export function copySurveys(sn) {
// source=1 表明是移动端问卷
return request({
url: `/console/surveys/${sn}`,
url: `/console/surveys/${sn}?source=1`,
method: 'post'
});
}

View File

@@ -29,11 +29,13 @@ const route = useRoute();
const router = useRouter();
function goBack() {
if (window.history.length > 1 && route.name !== 'home') {
router.go(-1);
} else {
appBridge.navigateBack();
}
setTimeout(() => {
if (window.history.length > 1 && route.name !== 'home') {
router.go(-1);
} else {
appBridge.navigateBack();
}
}, 500);
}
</script>
<style scoped lang="scss">

View File

@@ -23,7 +23,7 @@
<div style="position: relative">
<div class="survey_item_info_title">
<el-text>
<b>{{ item.project_name }}</b>
<b v-html="item.project_name"></b>
</el-text>
<el-text>{{ item.answer_num }}</el-text>
</div>

View File

@@ -238,7 +238,8 @@
</van-cell>
<van-cell
title="企微身份获取(开启后仅支持私有化企业环境作答)"
title="企微身份获取"
label="开启后仅支持私有化企业环境作答"
class="border-bottom"
label-align="left"
>
@@ -356,7 +357,7 @@ import { basicQuesTypeList } from '@/utils/common';
import { useRoute, useRouter } from 'vue-router';
import YLPicker from '@/components/YLPicker.vue';
import { getPages } from '@/utils/public';
import { showConfirmDialog } from 'vant';
import { showConfirmDialog, showFailToast } from 'vant';
// 获取 Store 实例
const counterStore = useCounterStore();
@@ -496,7 +497,6 @@ const saveQuestionItem = (questionJson) => {
// 保存设置
const saveSetting = (parentKey, childKeys, type) => {
const query = {};
function changeValueType(type, value) {
if (type) {
switch (type) {
@@ -530,6 +530,11 @@ const saveSetting = (parentKey, childKeys, type) => {
}
});
}
let publish_number = Number(questionInfo.value.survey['publish_number']);
if (publish_number == '' || publish_number === 0) {
showFailToast('投放数量需要大于1');
return false;
}
saveSettings({
sn: route.query.sn,
...query