Browse Source

Merge branch 'space2'

lwx_v27
han2015 3 weeks ago
parent
commit
c12b69409d
  1. 29
      src/api/doc/space.ts
  2. 24
      src/api/doc/type.ts
  3. 2
      src/components/DesignForm/public/form/aiassist.vue
  4. 4
      src/components/DesignForm/public/form/form.vue
  5. 20
      src/views/doc/agent.vue
  6. 64
      src/views/doc/logpanel.vue
  7. 50
      src/views/doc/manage.vue
  8. 5
      src/views/doc/showtext.vue
  9. 2
      src/views/doc/uploadlog.vue
  10. 15
      src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue
  11. 16
      src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue

29
src/api/doc/space.ts

@ -160,6 +160,34 @@ export function doAiWorkflow(_url:string,data: aiChatData){
}
)
}
/**
* queryURLS
*/
export function setAgentQueryURL(_url:string,data: {urls:string}){
return request({
url: _url,
method: 'post',
headers: {
'Content-Type': 'application/json'
},
data: JSON.stringify(data)
}
)
}
/**
* queryURLS
*/
export function getAgentQueryURL(uuid:string){
return request(
{
url: `/aibot/agents/${uuid}/query/urls`,
method: 'get',
}
)
}
/**
* userid获取记录列表
* @requires userid
@ -211,6 +239,7 @@ export function setAiChat(data: any){
});
}
/**
*
*/

24
src/api/doc/type.ts

@ -103,9 +103,9 @@ export function doFileUpload(params:FormData,_url:string): AxiosPromise<matterIn
/**
*
*/
export function logUploadError(params:{content:string},_url:string): AxiosPromise<matterInfo> {
export function logUploadError(params:{content:string}): AxiosPromise<matterInfo> {
return request({
url: _url,
url: '/hxpan/api/matter/uploadlog',
method: 'post',
data: params,
headers: {
@ -113,3 +113,23 @@ export function logUploadError(params:{content:string},_url:string): AxiosPromis
}
});
}
export interface ErrUploadLog{
ID:number;
CreatedAt :string;
content:string;
}
/**
*
*/
export function getUploadErrList( uid:string): AxiosPromise<ErrUploadLog[]> {
return request({
url: '/hxpan/api/matter/logs',
method: 'post',
headers: {
'Identifier':uid,
'Content-Type': 'multipart/form-data'
},
});
}

2
src/components/DesignForm/public/form/aiassist.vue

@ -39,7 +39,7 @@ defineExpose({onSendParamToAI})
async function onSendParamToAI(arr:Array<{ uuids: string[]; params: { [key: string]: any } }>){
interact_msg.value=[]
for (let ele of arr){
interact_msg.value.unshift({ask:true,think:"", content:"AI正在分析。。。"})
//interact_msg.value.unshift({ask:true,think:"", content:"AI"})
for (let uid of ele.uuids){
await doRequest(userid,uid,ele.params)
}

4
src/components/DesignForm/public/form/form.vue

@ -2445,6 +2445,7 @@ const webPage = computed({
return newVal;
},
});
//
</script>
<template>
<div v-if="webPage" class="webBox">
@ -2471,6 +2472,7 @@ const webPage = computed({
<slot></slot>
</el-form>
</div>
<div
v-else
v-loading="loading"
@ -2493,6 +2495,7 @@ const webPage = computed({
'detail-form': type === 3 || type === 4 || type === 1,
}"
>
<FormGroup
:tableinfo="formData.form"
:numrun="numrun"
@ -2506,6 +2509,7 @@ const webPage = computed({
<slot></slot>
</el-form>
</div>
</template>
<style lang="scss" scoped>

20
src/views/doc/agent.vue

@ -27,7 +27,6 @@ const inputState=ref(true)
const conversations=ref<chatRecord[]>([])
const centHoverItem=ref("")
const currentAgent=ref<{name:string,uuid:string}>({})
const queryUrl=ref("")
const interact_msg=ref<{ask:boolean,think:string,content:string,docinfo?:any[]}[]>([])
const props = withDefaults(defineProps<{
@ -67,21 +66,16 @@ function abortFetch() {
async function onSendTextToAI(){
if(myquestion.value==="")return;
inputState.value=false
let apiURL =`${baseURL}/aibot/agents/${currentAgent.value!.uuid}/chat`
const params={
"onlineSearch":"否",
"useDataset":"",
"useDataset":"",
"queryUrl":""
}
for (let item of checkedModel.value){
if(item==="onlineSearch"){
params.onlineSearch="是"
if(queryUrl.value!="") {
params.queryUrl=queryUrl.value
//queryUrl.value="" //
}
apiURL=`${baseURL}/aibot/agents/${currentAgent.value!.uuid}/2chat`
}
if(item==="useDataset") params.useDataset="是"
}
if (conversation.value==""){
@ -93,7 +87,7 @@ async function onSendTextToAI(){
let docinfo:any=[]
controller.value = new AbortController();
try{
const res= await doAiChat(`${baseURL}/aibot/agents/${currentAgent.value!.uuid}/chat`,{
const res= await doAiChat(apiURL,{
inputs: params,
query:myquestion.value,
response_mode:"streaming",
@ -334,9 +328,6 @@ onMounted(() => {
{{ mod.name }}
</el-checkbox-button>
</el-checkbox-group>
<div v-if="agent.name.startsWith('法')&&checkedModel.length>0 && checkedModel[0]=='onlineSearch' " style="width: 98%;margin-bottom: 5px;">
<el-input placeholder="是否指定网站, 多个地址以逗号分隔。" v-model="queryUrl" input-style="border-radius: 2px;"/>
</div>
<el-input placeholder="问灵犀..." v-model="myquestion" input-style="border-radius: 20px;"
resize="none" :autosize="{minRows: 4}" type="textarea" />
@ -391,6 +382,7 @@ onMounted(() => {
margin: 20px 33px;
font-size: 16px;
color: black;
width: 92%;
}
.actions{
display: flex;
@ -491,9 +483,11 @@ onMounted(() => {
}
}
table{
display: block;
border: 0px solid;
border-spacing: 1px;
border-collapse: collapse;
overflow: scroll;
th{
background-color: #e5e5e5;
border: 1px solid;

64
src/views/doc/logpanel.vue

@ -4,11 +4,73 @@
@ 备注: 文档管理组件
-->
<script lang="ts" setup>
import { getUploadErrList,ErrUploadLog} from "@/api/doc/type"
const tableList=ref<ErrUploadLog[]>([])
const curLogContent=ref<string>("")
const moduleDrawer =ref(false)
const props = withDefaults(defineProps<{
uid:string, //uuid,base64,Identifierbase64
}>(),{})
function loadLogList(){
moduleDrawer.value=false
getUploadErrList(props.uid).then(resp=>{
tableList.value=resp.data
})
}
function showLogDetail(row: any, column: any, event: Event){
curLogContent.value=row.content
moduleDrawer.value=true
}
defineExpose({loadLogList})
</script>
<template>
<div class="app_container">
<el-row><span style="margin: 12px 0px;font-weight: bold;font-size: 20px;"> 上传日志 </span> </el-row>
<el-table :data="tableList"
stripe
row-key="uuid"
@row-click="showLogDetail"
>
<el-table-column property="ID" label="序号">
</el-table-column>
<el-table-column property="CreatedAt" label="创建时间">
<template #default="scope">
<span>{{ scope.row.CreatedAt.slice(0,16) }}</span>
</template>
</el-table-column>
<el-table-column property="content" label="日志">
<template #default="scope">
<span v-if="scope.row.content.length>100">{{ scope.row.content.slice(0,100) }}</span>
<span v-else>{{ scope.row.content }}</span>
</template>
</el-table-column>
</el-table>
</div>
<el-table></el-table>
<el-drawer
v-model="moduleDrawer"
title="上传错误记录:"
direction="rtl"
size="30%"
:style="{padding:'17px',backgroundColor:'#f3f3f3'}">
<div v-html="curLogContent"></div>
</el-drawer>
</template>
<style lang="scss" scoped>
.app_container {
padding: 10px 30px 0px 30px;
height: 100%;
width: 100%;
}
</style>

50
src/views/doc/manage.vue

@ -25,8 +25,9 @@ import uploadlog from './uploadlog.vue';
import space from './space.vue';
import spacePermission from './spacePermission.vue';
import SvgIcon from "@/components/SvgIcon/index.vue";
import {doDelSpace,doAccessManage,doCreateAiagent} from "@/api/doc/space"
import {doDelSpace,doAccessManage,doCreateAiagent,setAgentQueryURL,getAgentQueryURL} from "@/api/doc/space"
import Space from "./space.vue";
import Logpanel from "./logpanel.vue";
//TODO: add file icons done!
//TODO: click on table-item 1preview on file .....................
@ -77,6 +78,8 @@ const modRecycling=ref(false)
const percentage=ref(0)
const onprogress=ref(false)
const tabName = ref('main')
const logTableRef = ref() //
const Departs = computed(() => {
return `${'p0'+userStore.userInfoCont.userId},${userStore.userInfoCont.company},${userStore.userInfoCont.department},${userStore.userInfoCont.organization}`
@ -312,16 +315,12 @@ function showRecycling(){
//
function showlogs(){
modRecycling.value=true
currentNode.value={} //
if(!PRIVATESPACE.value) { //
PRIVATESPACE.value=true
}
getRecyclingList(uid,{}).then((resp)=>{
paginInfo.value={total:1,page:0}
matterList.value=resp.data
})
logTableRef.value.loadLogList()
}
//
@ -858,6 +857,38 @@ function onAiAgent(row:matterInfo){
})
}
//
async function onAgentQueryURL(row:matterInfo){
await getAgentQueryURL(row.uuid).then(resp=>{
const newurls=ref(resp.data)
ElMessageBox({
title:"填入网址(多个网址必须逗号分隔)",
customStyle: { '--el-messagebox-width':'630px',padding:'13px'},
confirmButtonText: "确定",
cancelButtonText: "取消",
message: () => h(ElInput, {
type:"textarea",
rows:3,
style: { width:'600px' },
modelValue: newurls.value,
'onUpdate:modelValue': (val) => {
newurls.value = val
},
}),
}).then(() => {
setAgentQueryURL(row.uuid,{
urls:newurls.value
}).then(()=>{
ElMessage({
message: '已成功更新URL',
type: 'success',
plain: true,
})
})
})
})
}
//------------------------------------------------------
//http://172.20.2.87:6010/api/alien/preview/5a10aaf6-396e-4d9a-7e87-3c5c8029d4db/123.png?ir=fill_100_100
//
@ -929,7 +960,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
</el-tree>
<div class="area_header">
<el-icon :size="20"><Collection /></el-icon> <span class="area_name" > </span>
<el-button size="small" style="margin: 0 5px 0 auto;" :icon="Plus" @click="onNewSpace"> </el-button>
<el-button v-if="userStore.userInfoCont.department==102" size="small" style="margin: 0 5px 0 auto;" :icon="Plus" @click="onNewSpace"> </el-button>
</div>
<el-tree
ref="spaceTreeRef"
@ -951,6 +982,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
<el-dropdown-item v-if="!data.puuid" @click="(e)=>{ e.stopPropagation(); onAccessManage()}">成员管理</el-dropdown-item>
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onSpacePManage(data)}">权限管理</el-dropdown-item>
<el-dropdown-item v-if="data.puuid" @click="(e)=>{ e.stopPropagation(); onAiAgent(data)}">创建智能体</el-dropdown-item>
<el-dropdown-item v-if="data.agent" @click="(e)=>{ e.stopPropagation(); onAgentQueryURL(data)}">联网查询</el-dropdown-item>
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); onDelSpaceMatter(data)}">删除</el-dropdown-item>
<el-dropdown-item @click="(e)=>{ e.stopPropagation(); spaceEleRef.onSpaceMatterRename(data)}">重命名</el-dropdown-item>
</el-dropdown-menu>
@ -959,7 +991,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
</div>
</template>
</el-tree>
<div class="area_header" @click="tabName='logs'">
<div class="area_header" @click="tabName='logs';showlogs()">
<el-icon :size="20"><Bell /></el-icon><span class="area_name" > </span>
</div>
<div class="area_header" @click="showRecycling">
@ -1105,7 +1137,7 @@ const handleSelectionChange = (val:matterInfo[]) => {
</div>
</el-tab-pane>
<el-tab-pane name="logs">
Comming soon....
<Logpanel ref="logTableRef" :uid="uid" />
</el-tab-pane>
</el-tabs>

5
src/views/doc/showtext.vue

@ -1,7 +1,7 @@
<!--
@ 作者: han2015
@ 时间: 2025-05-12 15:39:13
@ 备注: aibot组件
@ 备注: aibot会话分享页面
-->
<script lang="ts" setup>
import { getShareChat} from "@/api/doc/space"
@ -108,6 +108,7 @@ onMounted(() => {
line-height: 23px;
font-size: 13px;
color: black;
width: 92%;
}
.actions{
display: flex;
@ -165,9 +166,11 @@ onMounted(() => {
}
}
table{
display: block;
border: 0px solid;
border-spacing: 1px;
border-collapse: collapse;
overflow: scroll;
th{
background-color: #e5e5e5;
border: 1px solid;

2
src/views/doc/uploadlog.vue

@ -30,7 +30,7 @@ const onClosePopup=(done: (cancel?: boolean) => void) => {
async function handleUploadErrors(result:string){
await logUploadError({content:result},'/hxpan/api/matter/uploadlog').then(data=>{
await logUploadError({content:result}).then(data=>{
logState.value=true;
ElMessage({
message: '保存成功!',

15
src/views/sysworkflow/lowcodepage/pageFlow/appTableFlow.vue

@ -58,6 +58,7 @@ const props = defineProps({
});
const formLoading = ref(false); //loading
const flowLoading = ref(false); //loading
const aiConfigArea =ref(false)
const flowFactor = reactive<conditionInfo[]>([]); //
const flowMap = ref<any[]>(); //
@ -99,11 +100,15 @@ const drawerOpenOrClose = computed({
const drawbox = computed({
get: () => {
// console.log("isFlowTable",isFlowTable.value)
let extraW=0;
if (aiConfigArea.value){
extraW=256 //ai
}
if (isFlowTable.value) {
return 1300;
return 1300+extraW;
}
return props.drawerwith;
return props.drawerwith+extraW;
},
set: (val: number) => {
return val;
@ -143,6 +148,10 @@ const getTaskFormData = () => {
}
}
);
if(state.formData.aiConfig.length>0)
aiConfigArea.value=true
})
.finally(() => {
formLoading.value = false;

16
src/views/sysworkflow/lowcodepage/pageFlow/tableFlow.vue

@ -50,6 +50,7 @@ const props = defineProps({
});
const formLoading = ref(false); //loading
const flowLoading = ref(false); //loading
const aiConfigArea =ref(false)
const flowFactor = reactive<conditionInfo[]>([]); //
const flowMap = ref<any[]>(); //
@ -92,11 +93,15 @@ const drawerOpenOrClose = computed({
const drawbox = computed({
get: () => {
// console.log("isFlowTable",isFlowTable.value)
let extraW=0;
if (aiConfigArea.value){
extraW=256 //ai
}
if (isFlowTable.value) {
return 1300;
return 1300+extraW;
}
return props.drawerwith;
return props.drawerwith+extraW;
},
set: (val: number) => {
return val;
@ -109,7 +114,7 @@ const getTaskFormData = () => {
flowLoading.value = true;
echoTableFormPage({ id: props.versionid.toString() })
.then(({ data }) => {
// console.log("",data)
//console.log("",data)
if (data.tableFormPage.flowIsOpen == 1 && data.tableFormPage.flowkeystr != "0") {
isFlowTable.value = true;
} else {
@ -138,6 +143,9 @@ const getTaskFormData = () => {
}
}
);
if(state.formData.aiConfig.length>0)
aiConfigArea.value=true
})
.finally(() => {
formLoading.value = false;

Loading…
Cancel
Save