From ec78562fc1d0642527683ace911bd5fb78a68f4d Mon Sep 17 00:00:00 2001 From: sunhao Date: Mon, 24 Nov 2025 11:11:25 +0800 Subject: [PATCH] * [story #79425] fix widget type not set in ai form config. --- www/js/zui3/ai.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/www/js/zui3/ai.js b/www/js/zui3/ai.js index 6ddbc3260d..9719cda7a3 100644 --- a/www/js/zui3/ai.js +++ b/www/js/zui3/ai.js @@ -46,10 +46,17 @@ window.openPageForm = function(url, data, callback) function getPromptFormConfig(fields, extraConfig) { if(!Array.isArray(fields) || !fields.length) return; - const typeMap = {text: 'string', radio: 'picker', checkbox: 'multiPicker'}; + const typeMap = {radio: 'picker', checkbox: 'multiPicker'}; const required = []; const properties = fields.reduce((properties, field, index) => { - properties[field.name] = {type: typeMap[field.type] || field.type || 'string', title: field.name, description: field.placeholder, order: index, required: field.required && field.required !== '0'}; + properties[field.name] = { + type: 'string', + widget: typeMap[field.type] || field.type, + title: field.name, + order: index, + required: field.required && field.required !== '0', + props: zui.isNotEmptyString(field.options) ? {items: field.options.split(',').map(x => ({text: x, value: x}))} : undefined + }; if(field.required) required.push(field.name); return properties; }, {});