diff --git a/src/api/DesignForm/fieldUnit.ts b/src/api/DesignForm/fieldUnit.ts index ef41804..ebe4ec0 100644 --- a/src/api/DesignForm/fieldUnit.ts +++ b/src/api/DesignForm/fieldUnit.ts @@ -5,4 +5,5 @@ export const choiceUnit = ["radio"] export const switchUnit = ["switch"] export const checkboxUnit = ["checkbox"] export const orgDeptUnit = ["deptOrg"] -export const layoutUnit = ["grid","card","flex","div","tabs","divider","title","button","lowcodeImage","videoUpAndPlay","table","baidumap","lowcodeCarsusel","signaturemap","component"] +//edit by han2015: layoutUnit删掉了table字段,因为ai触发条件要支持子表字段 +export const layoutUnit = ["grid","card","flex","div","tabs","divider","title","button","lowcodeImage","videoUpAndPlay","baidumap","lowcodeCarsusel","signaturemap","component"] diff --git a/src/api/DesignForm/filterUnit.ts b/src/api/DesignForm/filterUnit.ts index f18f301..1105823 100644 --- a/src/api/DesignForm/filterUnit.ts +++ b/src/api/DesignForm/filterUnit.ts @@ -13,7 +13,27 @@ const analysisFromUnit = (unitInfo:formStruct) => { // console.log("解析出表单可作为AI变量的元素------1---1--->",item.label?1:2) if(!layoutUnit.includes(item.type)){ //by han2015: 暂时只支持普通类型字段 - if (item.type!='input' && item.type!='digitpage') return; + //if (item.type!='input' && item.type!='digitpage') return; + + //显示子表单字段 + if(item.type=="table"){ + item.list.forEach(eles => { + let labelName = "" + if(eles.label){ + labelName = eles.label + }else if(eles.item && eles.item.label){ + labelName = eles.item.label + }else{ + labelName = eles.unitName + } + optionsInfo.push({ + label:labelName, + value:eles.name + }) + }); + return;//退出该字段 + } + let labelName = "" if(item.label){ labelName = item.label diff --git a/src/api/doc/space.ts b/src/api/doc/space.ts index 2a66158..fbc3ff2 100644 --- a/src/api/doc/space.ts +++ b/src/api/doc/space.ts @@ -106,7 +106,7 @@ export function doAiTraining(_url:string,data?: any){ export interface aiChatData{ inputs:object; - query:string; + query?:string; response_mode:string; conversation_id?:string; user:string, @@ -129,6 +129,21 @@ export function doAiChat(_url:string,data: aiChatData,sig?:AbortSignal){ } ) } + +/** + * 工作流 + */ +export function doAiWorkflow(_url:string,data: aiChatData){ + return fetch( + _url,{ + method: 'post', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + } + ) +} /** * 通过userid获取记录列表 * @requires userid diff --git a/src/components/DesignForm/public/expand/digitpage.vue b/src/components/DesignForm/public/expand/digitpage.vue index 177cf7c..cc83979 100644 --- a/src/components/DesignForm/public/expand/digitpage.vue +++ b/src/components/DesignForm/public/expand/digitpage.vue @@ -23,6 +23,7 @@ const props = withDefaults( data?: Object; modelValue?: string; disabled?: boolean; + rowIndex:number; }>(), {} ); @@ -46,7 +47,7 @@ const config = computed(() => { const changeEvent = inject(constAiEffect, '') as any function onValueChange(){ changeEvent && - changeEvent({key:props.data.name,value:props.modelValue, field:props.data.item.label}) + changeEvent({key:props.data.name,value:props.modelValue, field:props.data.item.label,rowdex:props.rowIndex}) } //-------------------------------------- /** diff --git a/src/components/DesignForm/public/form/aiassist.vue b/src/components/DesignForm/public/form/aiassist.vue index 67b868e..de08fff 100644 --- a/src/components/DesignForm/public/form/aiassist.vue +++ b/src/components/DesignForm/public/form/aiassist.vue @@ -6,24 +6,17 @@