From 859fc143be39c33a53fe8e4311c01e96a1fd1db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Tue, 4 Mar 2025 14:14:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=AE=BE=E8=AE=A1=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 OptionAction 组件用于选项操作 - 更新 BaseSelect 组件,集成 OptionAction 功能 - 优化 Paging 组件样式 - 调整 Design 页面布局和样式 --- components.d.ts | 8 +- src/assets/css/vant.scss | 8 ++ src/layouts/index.vue | 7 +- src/main.ts | 2 + src/stores/modules/common.ts | 93 +++++++++++- src/views/Design/Index.vue | 1 + .../ActionCompoents/OptionAction.vue | 94 ++++++++++-- .../ActionCompoents/QuestionAction.vue | 134 +++++++++++++++++- .../Design/components/ChooseQuestion.vue | 10 +- .../components/Questions/BaseSelect.vue | 19 ++- 10 files changed, 347 insertions(+), 29 deletions(-) diff --git a/components.d.ts b/components.d.ts index d313a6c..3547e0a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -2,15 +2,11 @@ // @ts-nocheck // Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 -export {} +export {}; /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - ElButton: typeof import('element-plus/es')['ElButton'] - ElContainer: typeof import('element-plus/es')['ElContainer'] - ElHeader: typeof import('element-plus/es')['ElHeader'] - ElMain: typeof import('element-plus/es')['ElMain'] Index: typeof import('./src/components/VanCellModel/Index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -24,5 +20,7 @@ declare module 'vue' { VanDivider: typeof import('vant/es')['Divider'] VanField: typeof import('vant/es')['Field'] VanIcon: typeof import('vant/es')['Icon'] + VanSearch: typeof import('vant/es')['Search'] + VanSwitch: typeof import('vant/es')['Switch'] } } diff --git a/src/assets/css/vant.scss b/src/assets/css/vant.scss index 1eb55ab..75b5c47 100644 --- a/src/assets/css/vant.scss +++ b/src/assets/css/vant.scss @@ -1,3 +1,11 @@ .van-cell { padding: 8px !important; } + +.van-divider { + margin: 5px 0 !important; +} + +.van-popup--bottom.van-popup--round { + border-radius: 10px 10px 0 0 !important; +} diff --git a/src/layouts/index.vue b/src/layouts/index.vue index 8113e41..3a40cc7 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -9,12 +9,11 @@ import { RouterView } from 'vue-router'; diff --git a/src/main.ts b/src/main.ts index 9877254..676ac4d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,6 +4,8 @@ import { createApp } from 'vue'; import { createPinia } from 'pinia'; import App from './App.vue'; import router from './router'; +// 2. 引入组件样式 +import 'vant/lib/index.css'; const app = createApp(App); app.use(createPinia()); app.use(router); diff --git a/src/stores/modules/common.ts b/src/stores/modules/common.ts index f235850..9ca2a78 100644 --- a/src/stores/modules/common.ts +++ b/src/stores/modules/common.ts @@ -93,7 +93,96 @@ export const useCommonStore = defineStore('common', { } ] }, - logics: [], + logics: [ + { + id: 472148, + question_index: 24, + sample_number: 0, + skip_question_index: 27, + skip_type: 0, + question_id: '17852294', + 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: 24, + 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: 472149, + question_index: 24, + sample_number: 0, + skip_question_index: 0, + skip_type: 0, + question_id: '17852294', + 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: 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: [] + } + ], questions: [ { id: '17852294', @@ -274,7 +363,7 @@ export const useCommonStore = defineStore('common', { id: '1048968', type: 0, is_other: 0, - is_fixed: 0, + is_fixed: 1, is_remove_other: 0, created_at: null, created_user_id: null, diff --git a/src/views/Design/Index.vue b/src/views/Design/Index.vue index b11dd74..43d82bd 100644 --- a/src/views/Design/Index.vue +++ b/src/views/Design/Index.vue @@ -11,6 +11,7 @@