diff --git a/server/src/interfaces/survey.ts b/server/src/interfaces/survey.ts index 34f1659f..dfb35131 100644 --- a/server/src/interfaces/survey.ts +++ b/server/src/interfaces/survey.ts @@ -88,10 +88,17 @@ export interface MsgContent { msg_9004: string; } +export interface JumpConfig { + type: string; + link: string; + buttonText?: string; +} + export interface SubmitConf { submitTitle: string; confirmAgain: ConfirmAgain; msgContent: MsgContent; + jumpConfig?: JumpConfig; } // 白名单类型 diff --git a/server/src/modules/survey/__test/dataStatistic.controller.spec.ts b/server/src/modules/survey/__test/dataStatistic.controller.spec.ts index e6c3bd8f..8a0b3673 100644 --- a/server/src/modules/survey/__test/dataStatistic.controller.spec.ts +++ b/server/src/modules/survey/__test/dataStatistic.controller.spec.ts @@ -275,6 +275,11 @@ describe('DataStatisticController', () => { again_text: '确认要提交吗?', }, link: '', + jumpConfig: { + type: 'link', + link: '', + buttonText: '', + }, }, logicConf: { showLogicConf: [], diff --git a/server/src/modules/survey/__test/mockResponseSchema.ts b/server/src/modules/survey/__test/mockResponseSchema.ts index 7adb3e0c..3d0275c2 100644 --- a/server/src/modules/survey/__test/mockResponseSchema.ts +++ b/server/src/modules/survey/__test/mockResponseSchema.ts @@ -71,6 +71,11 @@ export const mockSensitiveResponseSchema: ResponseSchema = { is_again: true, again_text: '确认要提交吗?', }, + jumpConfig: { + type: 'link', + link: '', + buttonText: '', + }, }, dataConf: { dataList: [ @@ -365,6 +370,11 @@ export const mockResponseSchema: ResponseSchema = { is_again: true, again_text: '确认要提交吗?', }, + jumpConfig: { + type: 'link', + link: '', + buttonText: '', + }, }, dataConf: { dataList: [ diff --git a/server/src/modules/survey/template/surveyTemplate/templateBase.json b/server/src/modules/survey/template/surveyTemplate/templateBase.json index 0a2bc4c4..ecd4f419 100644 --- a/server/src/modules/survey/template/surveyTemplate/templateBase.json +++ b/server/src/modules/survey/template/surveyTemplate/templateBase.json @@ -25,6 +25,11 @@ "msg_9003": "您来晚了,已经满额!", "msg_9004": "提交失败!" }, + "jumpConfig": { + "type": "link", + "link": "", + "buttonText": "" + }, "link": "" }, "bottomConf": { diff --git a/server/src/modules/surveyResponse/__test/mockResponseSchema.ts b/server/src/modules/surveyResponse/__test/mockResponseSchema.ts index 607de2a2..a76a48df 100644 --- a/server/src/modules/surveyResponse/__test/mockResponseSchema.ts +++ b/server/src/modules/surveyResponse/__test/mockResponseSchema.ts @@ -71,6 +71,11 @@ export const mockResponseSchema: ResponseSchema = { is_again: true, again_text: '确认要提交吗?', }, + jumpConfig: { + type: 'link', + link: '', + buttonText: '', + }, }, dataConf: { dataList: [ diff --git a/web/src/management/pages/edit/components/SetterField.vue b/web/src/management/pages/edit/components/SetterField.vue index 76b5d64b..3422182f 100644 --- a/web/src/management/pages/edit/components/SetterField.vue +++ b/web/src/management/pages/edit/components/SetterField.vue @@ -14,6 +14,7 @@ v-for="(content, contentIndex) in item.content" :key="`${item.key}${contentIndex}`" :form-config="content" + v-show="isShowFormItem(content)" > >([]) const init = ref(true) const components = shallowRef(props.customComponents || {}) +const isShowFormItem = (content: any) => { + if (_isFunction(content.toggleShowFn)) { + return content.toggleShowFn(props.moduleConfig) + } else { + return true + } +} + const handleFormChange = (data: any, formConfig: any) => { // 处理用户操作的设置器的值 if (_isFunction(formConfig?.valueSetter)) { diff --git a/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue b/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue index 9dffc90a..46233246 100644 --- a/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue +++ b/web/src/management/pages/edit/modules/resultModule/SetterPanel.vue @@ -5,7 +5,7 @@ { .question-config-form { padding: 30px 20px 50px 20px; } + +:deep(.group-wrap) { + margin-bottom: 0; + &:not(:last-child) { + margin-bottom: 32px; + } + + .group-title { + margin-bottom: 12px; + } + + .el-form-item { + margin-bottom: 16px; + + .el-radio { + height: initial; + line-height: initial; + margin-bottom: initial; + } + } +} diff --git a/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue b/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue index 284b5e74..78e61b72 100644 --- a/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue +++ b/web/src/management/pages/edit/modules/resultModule/components/SuccessContent.vue @@ -5,7 +5,9 @@
-
+
+ {{ jumpConfig.buttonText }} +
@@ -17,6 +19,7 @@ interface Props { } const props = defineProps() const successText = computed(() => props.moduleConfig?.msgContent?.msg_200 || '') +const jumpConfig = computed(() => props.moduleConfig?.jumpConfig || {}) diff --git a/web/src/management/pages/edit/setterConfig/statusConfig.js b/web/src/management/pages/edit/setterConfig/statusConfig.js index 520732a0..b453b877 100644 --- a/web/src/management/pages/edit/setterConfig/statusConfig.js +++ b/web/src/management/pages/edit/setterConfig/statusConfig.js @@ -1,7 +1,7 @@ export default { Success: [ { - label: '提示文案', + title: '提示文案', type: 'RichText', key: 'msgContent.msg_200', placeholder: '提交成功', @@ -9,6 +9,46 @@ export default { labelStyle: { 'font-weight': 'bold' } + }, + { + title: '交卷跳转', + type: 'Customed', + key: 'jumpConfig', + content: [ + { + key: 'jumpConfig.type', + type: 'RadioGroup', + value: 'link', + options: [ + { + label: '跳转网页', + value: 'link' + }, + { + label: '跳转按钮', + value: 'button' + }, + ], + }, + { + key: 'jumpConfig.buttonText', + label: '按钮文案', + type: 'InputSetter', + placeholder: '请输入按钮文案', + value: '', + toggleShowFn: (data) => { + return data?.jumpConfig?.type === 'button' + }, + }, + { + key: 'jumpConfig.link', + label: '跳转链接', + type: 'InputSetter', + placeholder: '请输入网址', + value: '', + }, + + ] } ], OverTime: [ diff --git a/web/src/render/pages/SuccessPage.vue b/web/src/render/pages/SuccessPage.vue index 8ea66acd..5ee3335c 100644 --- a/web/src/render/pages/SuccessPage.vue +++ b/web/src/render/pages/SuccessPage.vue @@ -16,13 +16,17 @@ > 重新填写 + + + {{ jumpConfig.buttonText }} +