Browse Source

云盘:优化联网查询编辑组件

lwx_v28^2
han2015 2 weeks ago
parent
commit
2b5c056801
  1. 4
      src/api/doc/space.ts
  2. 42
      src/views/doc/manage.vue
  3. 2
      src/views/doc/movepanel.vue
  4. 68
      src/views/doc/spacesimpletable.vue

4
src/api/doc/space.ts

@ -175,9 +175,9 @@ export function doAiWorkflow(_url:string,data: aiChatData){
/**
* queryURLS
*/
export function setAgentQueryURL(_url:string,data: {urls:string}){
export function setAgentQueryURL(uuid:string,data: {urls:string}){
return request({
url: _url,
url: `/aibot/agents/${uuid}/query/url`,
method: 'post',
headers: {
'Content-Type': 'application/json'

42
src/views/doc/manage.vue

@ -29,6 +29,7 @@ import {doDelSpace,doAccessManage,doCreateAiagent,setAgentQueryURL,getAgentQuery
import Space from "./space.vue";
import Logpanel from "./logpanel.vue";
import Movepanel from "./movepanel.vue";
import Spacesimpletable from "./spacesimpletable.vue";
//TODO: add file icons done!
//TODO: click on table-item 1preview on file .....................
@ -898,31 +899,24 @@ const onSpaceShareRequest=(spaceid:string,name:string)=>{
//
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,
dynamicVNode.value = h(Spacesimpletable, {
title: "请配置智能体联网列表",
urlstr:resp.data,
confirmFunc: (urlstr:string) => {
setAgentQueryURL(row.uuid,{
urls:urlstr
}).then(()=>{
ElMessage({
message: '已成功更新URL',
type: 'success',
plain: true,
})
})
})
dynamicVNode.value=null
},
closeFunc: () => {
dynamicVNode.value=null
}
})
})
}

2
src/views/doc/movepanel.vue

@ -1,7 +1,7 @@
<!--
@ 作者: han2015
@ 时间: 2025-05-12 15:39:13
@ 备注: 档管理组件
@ 备注: 件移动弹窗组件
-->
<script lang="ts" setup>
import { useUserStore } from "@/store/modules/user";

68
src/views/doc/spacesimpletable.vue

@ -0,0 +1,68 @@
<!--
@ 时间: 2026-01-12
@ 备注: spacesimpletable 是用于设置智能体的联网查询网址而拓展的组件
-->
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import {Delete} from '@element-plus/icons-vue'
const props = withDefaults(defineProps<{
title:string;
urlstr:string;
confirmFunc:(urlstr:string)=>void, // dataid
closeFunc:()=>void, //
}>(),{})
const weburls=ref<string[]>([])
const addUrl = () => {
weburls.value.push('')
}
const removeUrl = (index: number) => {
weburls.value.splice(index, 1)
}
const onSaveChange = () => {
props.confirmFunc(weburls.value.join(','))
}
onMounted(() => {
weburls.value = props.urlstr ? props.urlstr.split(",") : []
})
</script>
<template>
<el-dialog :model-value="true" :style="{'max-height': '880px','--el-dialog-width': '33%'}" @close="props.closeFunc">
<template #header>
<span style="font-weight: bold;">{{props.title}}</span>
</template>
<div class="tablelist">
<div v-for="(url, index) in weburls" :key="index" style="display:flex;align-items:center;margin:8px 0;">
<el-input v-model="weburls[index]" placeholder="输入网址" style="flex:1;margin-right:8px;"></el-input>
<el-button circle size="small" type="danger" :icon="Delete" @click="removeUrl(index)"></el-button>
</div>
<el-button type="primary" plain @click="addUrl" style="margin-top:8px;">添加网址</el-button>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="props.closeFunc()">取消</el-button>
<el-button type="primary" @click="onSaveChange">保存</el-button>
</div>
</template>
</el-dialog>
</template>
<style lang="scss" scoped>
.tablelist{
margin-bottom:20px;
display:flex;
flex-direction:column;
width: 90%;
}
</style>
Loading…
Cancel
Save