diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fa9e286ad5763b7c59f6c4d2682172b1f351146..a03adf7153ba90ee4171e78fcae745f87e0dbc3e 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 390a3dc522e3e6fcf40dbbc6ef22debfa9e53378..3b54608db5e97abdffc643f0c317f5a2576f627f 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) => {