From 7146320abb82567b4670fe50725b1c01dea515b3 Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Thu, 14 Aug 2025 16:17:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 3 ++- .env.production | 3 ++- src/views/doc/space.vue | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 97d26e7..c8ab71a 100644 --- a/.env.development +++ b/.env.development @@ -10,4 +10,5 @@ VITE_APP_BASE_URL = 'http://myvuetest.net' VITE_APP_TOKEN_KEY = 'offlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://172.20.5.86/prod-api' VITE_OFFICE_HOST='http://myvuetest.net/kkapi' -VITE_ONLYOFFICE_HOST = 'http://myvuetest.net/onlyoffice' \ No newline at end of file +VITE_ONLYOFFICE_HOST = 'http://myvuetest.net/onlyoffice' +VITE_DEFAULT_AI_AGENT = '5bd9b0e9-d3f4-4089-670a-880009e925a8' \ No newline at end of file diff --git a/.env.production b/.env.production index 1acc738..d3ed364 100644 --- a/.env.production +++ b/.env.production @@ -6,4 +6,5 @@ VITE_APP_BASE_API = '' VITE_APP_TOKEN_KEY = 'onlineAccessSystemAppToken' VITE_APP_SJZT_URL = 'http://120.224.6.6:29911/prod-api' VITE_OFFICE_HOST='https://gyhlw.hxgk.group/kkapi' -VITE_ONLYOFFICE_HOST = 'https://gyhlw.hxgk.group/onlyoffice' \ No newline at end of file +VITE_ONLYOFFICE_HOST = 'https://gyhlw.hxgk.group/onlyoffice' +VITE_DEFAULT_AI_AGENT = '23a3c2c5-2de1-40df-59fa-a9206b11861d' \ No newline at end of file diff --git a/src/views/doc/space.vue b/src/views/doc/space.vue index 7492d42..f3462eb 100644 --- a/src/views/doc/space.vue +++ b/src/views/doc/space.vue @@ -22,6 +22,7 @@ import {ElMessage,UploadFile,UploadFiles,ElPagination} from "element-plus"; import aiagent from './agent.vue'; import router from "@/router"; +const defaultAiAgent=import.meta.env.VITE_DEFAULT_AI_AGENT const matterList = ref([]) const newdir=ref("") //创建新目录时的目录名 const currentHoverRow=ref("") //table 行的按钮控制 @@ -434,7 +435,7 @@ async function onlyOfficeEdit(row:matterInfo){ onMounted(() => { currentNode.value.uuid="root" //设置默认的AI智能体 - currentAgent.value={name:"通用AI",model:false,uuid:"5bd9b0e9-d3f4-4089-670a-880009e925a8"} + currentAgent.value={name:"通用AI",model:false,uuid:defaultAiAgent} onLoadMatterList() }); From a4752d24a2bbd338ef46e08a18fa14cdea1319bf Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Wed, 20 Aug 2025 16:02:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=9B=86=E6=88=90=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E5=AE=A1=E6=9F=A5=E6=99=BA=E8=83=BD=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/DesignForm/fieldUnit.ts | 3 +- src/api/DesignForm/filterUnit.ts | 22 +++++++- src/api/doc/space.ts | 17 +++++- .../DesignForm/public/expand/digitpage.vue | 3 +- .../DesignForm/public/form/aiassist.vue | 56 ++++++++----------- .../DesignForm/public/form/form.vue | 44 ++++++++++----- .../DesignForm/public/form/formItem.vue | 44 +++++++++++++-- 7 files changed, 132 insertions(+), 57 deletions(-) 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 @@