From 20737501a4a7a2d828324cf07329f928131c6355 Mon Sep 17 00:00:00 2001 From: ShineKOT <1917095344@qq.com> Date: Fri, 26 Sep 2025 18:45:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=A1=86=E7=BC=96=E8=BE=91=E5=99=A8=E5=8F=82=E6=95=B0autoquest?= =?UTF-8?q?ion=E5=92=8Cautofill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/editor/text-box/input/input.tsx | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa9e286a..a03adf715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Added - 表单分页计数器添加data-value属性,可通过data-value属性设置0值隐藏 +- 新增文本框编辑器参数autoquestion(AI历史数据最后一个项是用户消息时是否自动提问,默认开启)和autofill(AI回答完成之后是否触发回填,默认关闭) ### Fixed diff --git a/src/editor/text-box/input/input.tsx b/src/editor/text-box/input/input.tsx index 390a3dc52..3b54608db 100644 --- a/src/editor/text-box/input/input.tsx +++ b/src/editor/text-box/input/input.tsx @@ -46,6 +46,8 @@ import './input.scss'; * @editorparams {name:maxlength,parameterType:number,description:指定编辑器输入内容的最大字数} * @editorparams {name:readonly,parameterType:boolean,defaultvalue:false,description:设置编辑器是否为只读态} * @editorparams {name:emptyhiddenunit,parameterType:boolean,defaultvalue:true,description:编辑器无值时,其对应的值单位(如'天'、'%'等)是否隐藏} + * @editorparams {name:autoquestion,parameterType:boolean,defaultvalue:true,description: 用于AI聊天,AI历史数据最后一个项是用户消息(USER)时是否自动提问,默认开启} + * @editorparams {name:autofill,parameterType:boolean,defaultvalue:false,description: 用于AI聊天,AI回答完成之后是否触发回填,默认关闭} * @ignoreprops overflowMode * @ignoreemits infoTextChange */ @@ -281,6 +283,10 @@ export const IBizInput = defineComponent({ c.editorParams.srfaiappendcurdata === 'true' ? props.data : undefined, + // 自动提问 + autoQuestion: c.editorParams.autoquestion !== 'false', + // 自动填充 + autoFill: c.editorParams.autofill === 'true', // 编辑器参数srfaiappendcurcontent,传入编辑内容作为用户消息,获取历史数据后附加 appendCurContent: c.editorParams.srfaiappendcurcontent ? StringUtil.fill( @@ -382,9 +388,7 @@ export const IBizInput = defineComponent({ await aiChat.completeMessage(id, true); }, action: ((action: string, message: IChatMessage) => { - if (action === 'backfill') { - handleChange(message.realcontent || ''); - } + if (action === 'backfill') emit('change', message.realcontent); // eslint-disable-next-line @typescript-eslint/no-explicit-any }) as any, history: async (ctx: IContext, param: IParams, other: IParams) => { -- Gitee