From 6ed8a24745c8320a6a98cf8dd8e748782a25f65e Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Mon, 18 Aug 2025 17:22:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=A2=84=E8=A7=88=E9=97=AE=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../questionnaire/question/model.d.ts | 27 +- .../questionnaire/questionnaire/model.d.ts | 10 +- .../customerService/questionnaire/data.ts | 178 ++++------ .../customerService/questionnaire/index.vue | 192 ++++------ .../questionnaire/questionnaire-detail.vue | 206 +++++++---- .../questionnaire/questionnaire-modal.vue | 333 ++++++++++-------- 6 files changed, 504 insertions(+), 442 deletions(-) diff --git a/apps/web-antd/src/api/property/customerService/questionnaire/question/model.d.ts b/apps/web-antd/src/api/property/customerService/questionnaire/question/model.d.ts index 11d169dd..3fc2d1b4 100644 --- a/apps/web-antd/src/api/property/customerService/questionnaire/question/model.d.ts +++ b/apps/web-antd/src/api/property/customerService/questionnaire/question/model.d.ts @@ -1,6 +1,6 @@ -import type { PageQuery, BaseEntity } from '#/api/common'; +import type {PageQuery, BaseEntity} from '#/api/common'; import type { - QuestionItemForm + QuestionItemForm, QuestionItemVO } from "#/api/property/customerService/questionnaire/questionItem/model"; export interface QuestionVO { @@ -39,6 +39,19 @@ export interface QuestionVO { */ sort: number; + /** + * 问题选项 + */ + questionnaireQuestionItemVos: QuestionItemVO[]; + + options: string[]; + + answer: string; + + rate:number; + + checked:string[]; + } export interface QuestionForm extends BaseEntity { @@ -80,17 +93,17 @@ export interface QuestionForm extends BaseEntity { /** * 选项 */ - questionnaireQuestionItems:QuestionItemForm[] + questionnaireQuestionItems: QuestionItemForm[] /** * 评分预览 */ - rate?:number; + rate?: number; /** * 时间预览 */ - dateTime?:string; + dateTime?: string; } @@ -126,7 +139,7 @@ export interface QuestionQuery extends PageQuery { sort?: number; /** - * 日期范围参数 - */ + * 日期范围参数 + */ params?: any; } diff --git a/apps/web-antd/src/api/property/customerService/questionnaire/questionnaire/model.d.ts b/apps/web-antd/src/api/property/customerService/questionnaire/questionnaire/model.d.ts index 97390bf9..73a564e0 100644 --- a/apps/web-antd/src/api/property/customerService/questionnaire/questionnaire/model.d.ts +++ b/apps/web-antd/src/api/property/customerService/questionnaire/questionnaire/model.d.ts @@ -1,5 +1,8 @@ import type { PageQuery, BaseEntity } from '#/api/common'; -import type {QuestionForm} from "#/api/property/customerService/questionnaire/question/model"; +import type { + QuestionForm, + QuestionVO +} from "#/api/property/customerService/questionnaire/question/model"; export interface QuestionnaireVO { /** @@ -36,7 +39,10 @@ export interface QuestionnaireVO { * 状态(1草稿2已发布3未发布) */ status: string; - + /** + * 问题 + */ + questionnaireQuestionVos:QuestionVO[]; } export interface QuestionnaireForm extends BaseEntity { diff --git a/apps/web-antd/src/views/property/customerService/questionnaire/data.ts b/apps/web-antd/src/views/property/customerService/questionnaire/data.ts index 933e55ec..2e77cf25 100644 --- a/apps/web-antd/src/views/property/customerService/questionnaire/data.ts +++ b/apps/web-antd/src/views/property/customerService/questionnaire/data.ts @@ -1,104 +1,84 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; -import { getDictOptions } from '#/utils/dict'; -import { renderDict } from '#/utils/render'; -import {h} from "vue"; -import {Rate} from "ant-design-vue"; +import {renderDict} from "#/utils/render"; +import {getDictOptions} from "#/utils/dict"; + export const querySchema: FormSchemaGetter = () => [ { - component: 'Select', - componentProps: { - options: getDictOptions('type_contingency_plan'), - }, - fieldName: 'contingenPlanType', - label: '预案类型', - }, - { - component: 'ApiSelect', - fieldName: 'dutyPersion', - label: '责任人', + component: 'Input', + fieldName: 'head', + label: '问卷标题', }, + { component: 'Select', componentProps: { - options: getDictOptions('pro_exercise_status'), + options:getDictOptions('wy_dcwjzt') }, fieldName: 'status', - label: '演练状态', + label: '问卷状态',//(1草稿2已发布3未发布) }, ]; +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ export const columns: VxeGridProps['columns'] = [ { type: 'checkbox', width: 60 }, { - title: '序号', - field: 'id', - slots: { - default: ({rowIndex}) => { - return (rowIndex + 1).toString(); - } - } + title: '问卷标题', + field: 'head', + width:200, }, { - title: '预案名称', - field: 'contingenPlanName', + title: '问卷描述', + field: 'depict', + minWidth:180, }, { - title: '预案类型', - field: 'contingenPlanType', - slots: { - default: ({ row }) => { - return renderDict(row.contingenPlanType, 'type_contingency_plan'); - }, - }, + title: '匿名收集', + field: 'isAnonyCollec', + slots:{ + default: ({row})=>{ + return row.isAnonyCollec=='1'?'是':'否' + }}, + width:100, }, { - title: '风险等级', - field: 'grade', - slots: { - default: ({ row }) => { - return h(Rate, { - value: row.grade || 0, - disabled: true, - }); - }, - }, - minWidth: '150' + title: '多次提交', + field: 'isCommit', + slots:{ + default: ({row})=>{ + return row.isCommit=='1'?'是':'否' + }}, + width:100, }, { - title: '发起人', - field: 'initiatName', + title: '截止日期', + field: 'deadline', + width:150, }, { - title: '演练状态', + title: '问卷状态',//(1草稿2已发布3未发布) field: 'status', - slots: { - default: ({ row }) => { - return renderDict(row.status, 'pro_exercise_status'); - }, - }, - }, - { - title: '责任人', - field: 'dutyPersionName', - }, - { - title: '完成时间', - field: 'compleTimes', + slots:{ + default: ({row})=>{ + return renderDict(row.status,'wy_dcwjzt') + }}, + width:100, }, { field: 'action', fixed: 'right', slots: { default: 'action' }, title: '操作', - width: 240, + width: 280, }, ]; export const modalSchema: FormSchemaGetter = () => [ { - label: '主键', + label: 'id', fieldName: 'id', component: 'Input', dependencies: { @@ -107,52 +87,46 @@ export const modalSchema: FormSchemaGetter = () => [ }, }, { - label: '预案名称', - fieldName: 'contingenPlanName', + label: '问卷标题', + fieldName: 'head', + component: 'Textarea', + rules: 'required', + }, + { + label: '问卷描述', + fieldName: 'depict', + component: 'Textarea', + }, + { + label: '是否匿名收集', + fieldName: 'isAnonyCollec', component: 'Input', rules: 'required', }, { - label: '预案类型', - fieldName: 'contingenPlanType', - component: 'Select', + label: '是否多次提交', + fieldName: 'isCommit', + component: 'Input', + rules: 'required', + }, + { + label: '截止日期', + fieldName: 'deadline', + component: 'DatePicker', componentProps: { - options: getDictOptions('type_contingency_plan'), - }, - rules: 'selectRequired', - }, - { - label: '发起人', - fieldName: 'initiat', - component: 'ApiSelect', - rules: 'selectRequired', - }, - { - label: '责任人', - fieldName: 'dutyPersion', - component: 'ApiSelect', - rules: 'selectRequired', - }, - { - label: '预案内容', - fieldName: 'contingenPlanContent', - component: 'RichTextarea', - componentProps: { - // disabled: false, // 是否只读 - // height: 400 // 高度 默认400 - }, - formItemClass: 'col-span-2' - }, - { - label: '风险等级', - fieldName: 'grade', - component: 'Rate', - componentProps: { - allowHalf: false, - count: 5, - tooltips: ['1星', '2星', '3星', '4星', '5星'], - defaultValue: 0 + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', }, rules: 'required', }, + { + label: '状态(1草稿2已发布3未发布)', + fieldName: 'status', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + }, + }, ]; diff --git a/apps/web-antd/src/views/property/customerService/questionnaire/index.vue b/apps/web-antd/src/views/property/customerService/questionnaire/index.vue index 149a5bd4..14ff6195 100644 --- a/apps/web-antd/src/views/property/customerService/questionnaire/index.vue +++ b/apps/web-antd/src/views/property/customerService/questionnaire/index.vue @@ -1,28 +1,26 @@ diff --git a/apps/web-antd/src/views/property/customerService/questionnaire/questionnaire-detail.vue b/apps/web-antd/src/views/property/customerService/questionnaire/questionnaire-detail.vue index bf8fb9a2..ee62df03 100644 --- a/apps/web-antd/src/views/property/customerService/questionnaire/questionnaire-detail.vue +++ b/apps/web-antd/src/views/property/customerService/questionnaire/questionnaire-detail.vue @@ -1,96 +1,158 @@