From 949a989dcfc1f16c73665d878f7a5695830d9b3d Mon Sep 17 00:00:00 2001 From: Jiangchunfu Date: Tue, 3 Sep 2024 15:54:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=80=89=E9=A1=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=89=A9=E5=B1=95)=EF=BC=9A=E9=80=89=E6=8B=A9=E7=B1=BB?= =?UTF-8?q?=E9=A2=98=E5=9E=8B=E5=A2=9E=E5=8A=A0=E9=80=89=E9=A1=B9=E6=8E=92?= =?UTF-8?q?=E5=88=97=E9=85=8D=E7=BD=AE=20(#403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: add optimizeDeps packages * feat(选项设置扩展):选择类题型增加选项排列配置 * feat(选项设置扩展): 验收问题修复 --------- Co-authored-by: jiangchunfu --- .../questions/widgets/BaseChoice/index.jsx | 5 ++- .../questions/widgets/BaseChoice/style.scss | 32 ++++++++++++++++++- .../widgets/BinaryChoiceModule/meta.js | 30 ++++++++++++++++- .../widgets/CheckboxModule/index.jsx | 1 + .../questions/widgets/CheckboxModule/meta.js | 23 ++++++++++++- .../questions/widgets/RadioModule/meta.js | 30 ++++++++++++++++- .../questions/widgets/VoteModule/index.jsx | 2 +- .../questions/widgets/VoteModule/meta.js | 2 ++ web/vite.config.ts | 4 ++- 9 files changed, 120 insertions(+), 9 deletions(-) diff --git a/web/src/materials/questions/widgets/BaseChoice/index.jsx b/web/src/materials/questions/widgets/BaseChoice/index.jsx index 3aba05c8..fe41bbe1 100644 --- a/web/src/materials/questions/widgets/BaseChoice/index.jsx +++ b/web/src/materials/questions/widgets/BaseChoice/index.jsx @@ -97,7 +97,7 @@ export default defineComponent({ return (
-
+
{getOptions.map((item, index) => { return ( !item.hide && ( @@ -106,11 +106,10 @@ export default defineComponent({ style={this.choiceStyle} class={['choice-outer']} > -
+
{!/^\s*$/.test(item.text) && (
{{ selectMore: (scoped) => { diff --git a/web/src/materials/questions/widgets/CheckboxModule/meta.js b/web/src/materials/questions/widgets/CheckboxModule/meta.js index a6ffe433..24165e4f 100644 --- a/web/src/materials/questions/widgets/CheckboxModule/meta.js +++ b/web/src/materials/questions/widgets/CheckboxModule/meta.js @@ -1,5 +1,4 @@ import basicConfig from '@materials/questions/common/config/basicConfig' - const meta = { title: '多选', type: 'checkbox', @@ -83,6 +82,12 @@ const meta = { propType: Number, description: '最多选择数', defaultValue: 0 + }, + { + name: 'layout', + propType: String, + description: '排列方式', + defaultValue: 'vertical' } ], formConfig: [ @@ -92,6 +97,22 @@ const meta = { title: '选项配置', type: 'Customed', content: [ + { + label: '排列方式', + type: 'RadioGroup', + key: 'layout', + value: 'vertical', + options: [ + { + label: '竖排', + value: 'vertical' + }, + { + label: '横排', + value: 'horizontal' + }, + ] + }, { label: '至少选择数', type: 'InputNumber', diff --git a/web/src/materials/questions/widgets/RadioModule/meta.js b/web/src/materials/questions/widgets/RadioModule/meta.js index 1568ad14..bbdb3f42 100644 --- a/web/src/materials/questions/widgets/RadioModule/meta.js +++ b/web/src/materials/questions/widgets/RadioModule/meta.js @@ -71,9 +71,37 @@ const meta = { hash: '115020' } ] + }, + { + name: 'layout', + propType: String, + description: '排列方式', + defaultValue: 'vertical' } ], - formConfig: [basicConfig], + formConfig: [basicConfig, { + name: 'optionConfig', + title: '选项配置', + type: 'Customed', + content: [ + { + label: '排列方式', + type: 'RadioGroup', + key: 'layout', + value: 'vertical', + options: [ + { + label: '竖排', + value: 'vertical' + }, + { + label: '横排', + value: 'horizontal' + }, + ] + }, + ] + }], editConfigure: { optionEdit: { show: true diff --git a/web/src/materials/questions/widgets/VoteModule/index.jsx b/web/src/materials/questions/widgets/VoteModule/index.jsx index 8869e794..481a34c8 100644 --- a/web/src/materials/questions/widgets/VoteModule/index.jsx +++ b/web/src/materials/questions/widgets/VoteModule/index.jsx @@ -103,7 +103,7 @@ export default defineComponent({ return (