From 678c0cd6e2273d1e42000d48ca18dbd3929160a4 Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Sun, 23 Mar 2025 16:59:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix[create]:=20=E8=A7=A3=E5=86=B3=E7=BD=AE?= =?UTF-8?q?=E5=BA=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复属性无法访问 --- components.d.ts | 9 --------- src/views/Design/components/Questions/Choice.vue | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/components.d.ts b/components.d.ts index cc91605..fab8e77 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,14 +8,9 @@ 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'] @@ -34,7 +29,6 @@ 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'] @@ -42,11 +36,8 @@ 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'] diff --git a/src/views/Design/components/Questions/Choice.vue b/src/views/Design/components/Questions/Choice.vue index 4863cc0..d6ce715 100644 --- a/src/views/Design/components/Questions/Choice.vue +++ b/src/views/Design/components/Questions/Choice.vue @@ -157,6 +157,8 @@ function handleChange(names) { const newOption = names[names.length - 1]; // 如果names 长度小于1,直接返回,不处理 if (names.length < 1) return; + // 如果不存在 options 和 list 属性,直接返回 + if (!element.value.options || !element.value.list) return; const options = element.value.options[0] ?? element.value.list[0]; // 如果新增的结果是排它项, 对结果进行处理 From 0d8123ffda2ddea276843e8644ad2694dcc7a20d Mon Sep 17 00:00:00 2001 From: Huangzhe Date: Sun, 23 Mar 2025 17:40:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix[create]:=20=E9=A2=84=E8=A7=88=E9=A2=98?= =?UTF-8?q?=E7=9B=AE=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 预览题目跟随pc, 取 title 值 --- components.d.ts | 2 + .../Design/components/ChooseQuestion.vue | 4 +- .../Design/components/Questions/Choice.vue | 3 +- .../components/Questions/Completion.vue | 1 - .../components/Questions/FileUpload.vue | 2 +- .../components/Questions/MatrixCheckbox.vue | 10 ++--- .../components/Questions/MatrixQuestion.vue | 2 +- src/views/Design/components/Questions/NPS.vue | 3 +- .../Design/components/Questions/Rate.vue | 39 ++++------------- .../components/Questions/SignQuestion.vue | 43 +++++-------------- .../components/Questions/TextWithImages.vue | 19 ++------ .../components/questions/PreviewCheckbox.vue | 4 +- .../components/questions/PreviewChoice.vue | 4 +- .../questions/PreviewCompletion.vue | 6 ++- .../questions/PreviewFileUpload.vue | 4 +- .../questions/PreviewMatrixCheckbox.vue | 16 +++---- .../questions/PreviewMatrixRadio.vue | 18 +++----- .../questions/PreviewMatrixText.vue | 18 +++----- .../components/questions/PreviewNPS.vue | 7 ++- .../components/questions/PreviewRate.vue | 18 +++----- .../components/questions/PreviewSign.vue | 17 +++----- .../questions/PreviewTextWithImages.vue | 3 +- 22 files changed, 77 insertions(+), 166 deletions(-) diff --git a/components.d.ts b/components.d.ts index fab8e77..7b27095 100644 --- a/components.d.ts +++ b/components.d.ts @@ -38,6 +38,8 @@ declare module 'vue' { VanRow: typeof import('vant/es')['Row'] 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'] diff --git a/src/views/Design/components/ChooseQuestion.vue b/src/views/Design/components/ChooseQuestion.vue index b554564..564b46a 100644 --- a/src/views/Design/components/ChooseQuestion.vue +++ b/src/views/Design/components/ChooseQuestion.vue @@ -69,9 +69,7 @@ const element = defineModel('element', { return {}; } }); -const index = defineModel('index', { - type: Number -}); +const index = defineModel('index'); // watch( // () => index.value, diff --git a/src/views/Design/components/Questions/Choice.vue b/src/views/Design/components/Questions/Choice.vue index d6ce715..c129ecb 100644 --- a/src/views/Design/components/Questions/Choice.vue +++ b/src/views/Design/components/Questions/Choice.vue @@ -130,8 +130,7 @@ defineProps({ default: false }, index: { - type: Number, - default: 0 + default: '' } }); diff --git a/src/views/Design/components/Questions/Completion.vue b/src/views/Design/components/Questions/Completion.vue index 6f50df2..c20eabc 100644 --- a/src/views/Design/components/Questions/Completion.vue +++ b/src/views/Design/components/Questions/Completion.vue @@ -45,7 +45,6 @@ const props = defineProps({ } }, index: { - type: Number, default: 0 }, active: { diff --git a/src/views/Design/components/Questions/FileUpload.vue b/src/views/Design/components/Questions/FileUpload.vue index 8c1ca62..3e51bd6 100644 --- a/src/views/Design/components/Questions/FileUpload.vue +++ b/src/views/Design/components/Questions/FileUpload.vue @@ -7,7 +7,7 @@ import { fileLimit, answer } from './hooks/useFileUploadHooks'; const isPreview = defineModel('isPreview', { default: false, type: Boolean, required: false }); const props = defineProps<{ element: any; - index: number; + index: number | String; active: boolean; }>(); const { element } = toRefs(props); diff --git a/src/views/Design/components/Questions/MatrixCheckbox.vue b/src/views/Design/components/Questions/MatrixCheckbox.vue index 42f3040..d95e919 100644 --- a/src/views/Design/components/Questions/MatrixCheckbox.vue +++ b/src/views/Design/components/Questions/MatrixCheckbox.vue @@ -1,10 +1,6 @@