diff --git a/components.d.ts b/components.d.ts index 2162b4d..20a78a3 100644 --- a/components.d.ts +++ b/components.d.ts @@ -17,19 +17,14 @@ declare module 'vue' { VanCellGroup: typeof import('vant/es')['CellGroup'] VanCheckbox: typeof import('vant/es')['Checkbox'] VanCheckboxGroup: typeof import('vant/es')['CheckboxGroup'] - VanCol: typeof import('vant/es')['Col'] VanDivider: typeof import('vant/es')['Divider'] - VanFeild: typeof import('vant/es')['Feild'] VanField: typeof import('vant/es')['Field'] - VanGrid: typeof import('vant/es')['Grid'] - VanGridItem: typeof import('vant/es')['GridItem'] VanIcon: typeof import('vant/es')['Icon'] VanNavBar: typeof import('vant/es')['NavBar'] VanPicker: typeof import('vant/es')['Picker'] VanPopup: typeof import('vant/es')['Popup'] 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'] diff --git a/src/components/YLPicker.vue b/src/components/YLPicker.vue index 7e5cf8f..c5108d0 100644 --- a/src/components/YLPicker.vue +++ b/src/components/YLPicker.vue @@ -170,8 +170,8 @@ const getMaxDateLimit = computed(() => { props.format ); const tempStr = '0000-12-31 23:59:59'; - const result = - props.maxDate.length !== 0 && thisMax.length > props.maxDate.length + const result + = props.maxDate.length !== 0 && thisMax.length > props.maxDate.length ? thisMax.slice(0, props.maxDate.length) + tempStr.slice(props.maxDate.length) : thisMax; return result.slice(0, props.format.length); @@ -194,8 +194,8 @@ function onChange({ selectedValues, columnIndex }) { renderMinuteColumns, renderSecondColumns ]; - updateColumns[columnIndex] && - updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false); + updateColumns[columnIndex] + && updateColumns[columnIndex](changeValue, getMinDateLimit.value, getMaxDateLimit.value, false); } // 渲染全部列 diff --git a/src/layouts/index.vue b/src/layouts/index.vue index 84ba231..c99bac8 100644 --- a/src/layouts/index.vue +++ b/src/layouts/index.vue @@ -9,7 +9,12 @@ - + {{ tab.title }} @@ -25,9 +30,9 @@ diff --git a/src/views/Design/components/Questions/types/martrix.d.ts b/src/views/Design/components/Questions/types/martrix.d.ts index a9d981f..c824f8b 100644 --- a/src/views/Design/components/Questions/types/martrix.d.ts +++ b/src/views/Design/components/Questions/types/martrix.d.ts @@ -180,30 +180,7 @@ type LogicConfig = { * @property {string} planet_id - 行星 ID(通常为空字符串) * @property {any | null} permissions - 权限信息(通常为 null) */ -type MatrixSurveyQuestion = { - id: string; - title: string; - stem: string; - other?: string; - question_index?: number; - question_type?: number; - config?: Config; - created_at?: string; - created_user_id?: number; - updated_user_id?: number | null; - survey_id?: number; - logic_config?: LogicConfig; - options: [Option[], Option[]]; - associate?: any[]; - logics_has?: string | null; - last_option_index?: number; - question_code?: string; - question_value?: string; - question_tag?: string; - planet_id?: string; - permissions?: any | null; -}; - +type MatrixSurveyQuestion = question; /** * 矩阵调查类型 * @property {MatrixSurveyQuestion} question - 矩阵调查问题 diff --git a/src/views/Design/components/Questions/types/question.d.ts b/src/views/Design/components/Questions/types/question.d.ts new file mode 100644 index 0000000..becba6b --- /dev/null +++ b/src/views/Design/components/Questions/types/question.d.ts @@ -0,0 +1,62 @@ +interface OptionConfigType { + type?: number; + price?: number; + title?: string; + gradient?: string; + image_url?: string[]; + child_area?: null; + option_type?: number; + instructions?: string[]; + binding_goods_id?: string; + limit_right_content?: string; +} + +interface OptionType { + option?: string; // 包含 HTML 标签的字符串,例如 "

选项1

" + is_other?: number; + is_fixed?: number; + is_remove_other?: number; + level?: number; + option_key?: string; + option_index?: string; + option_code?: string; + option_config?: OptionConfigType; + parent_option_index?: number; + children?: null; +} + +type questionsList = { + type: number; + cite_type: number; + relation_type: number; + relation_out_scope: number[]; + relation_last_scope: number; + relation_first_scope: number; + relation_question_index: number; + options?: OptionType[]; +}; + +type question = { + id?: string; + title?: string; + stem?: string; + other?: string; + list: questionsList[][]; + question_index?: number; + question_type?: number; + config?: Config; + created_at?: string; + created_user_id?: number; + updated_user_id?: number | null; + survey_id?: number; + logic_config?: LogicConfig; + options: questionsList[]; + associate?: any[]; + logics_has?: string | null; + last_option_index?: number; + question_code?: string; + question_value?: string; + question_tag?: string; + planet_id?: string; + permissions?: any | null; +}; diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index d2906f9..37dbd11 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -3,9 +3,9 @@ import LastSurvey from './components/LastSurvey/Index.vue'; import Market from './components/Market/Index.vue'; import CreateSurvey from './components/CreateSurvey/Index.vue'; import { onMounted, ref } from 'vue'; -import utils from '@/assets/js/common'; -import { getUserInfo } from '@/api/common/index.js'; -import { showFailToast } from 'vant'; +// import utils from '@/assets/js/common'; +// import { getUserInfo } from '@/api/common/index.js'; +// import { showFailToast } from 'vant'; const contentShow = ref(false); onMounted(async() => { contentShow.value = true; diff --git a/src/views/Survey/views/Preview/Index.vue b/src/views/Survey/views/Preview/Index.vue index 83cb9b3..0fbf3b7 100644 --- a/src/views/Survey/views/Preview/Index.vue +++ b/src/views/Survey/views/Preview/Index.vue @@ -1,8 +1,9 @@