|
|
@@ -26,11 +26,13 @@
|
|
|
<ModelAddItem
|
|
|
v-model:show_model_item="show_model_item"
|
|
|
:target_icon="target_icon"
|
|
|
+ :target_intell_type="target_intell_type"
|
|
|
@select_icon="selectIcon"
|
|
|
+ @updateIntelligentList="updateIntelligentList"
|
|
|
></ModelAddItem>
|
|
|
<ModelSelectIcon v-model:show_select_icon="show_select_icon" @sendIcon="sendIcon"></ModelSelectIcon>
|
|
|
<AgentConfig
|
|
|
- v-model:show_dify_config="show_dify_config"
|
|
|
+ v-model:show_rg_config="show_rg_config"
|
|
|
ref="editAgentKuai"
|
|
|
:typeAngint="add_type"
|
|
|
:formData="itemObj"
|
|
|
@@ -40,6 +42,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, reactive } from 'vue';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
import ModalAddIntel from './ModalAddIntel.vue';
|
|
|
import ModelAddItem from './ModelAddItem.vue';
|
|
|
import ModelSelectIcon from './ModalSelectIcon.vue';
|
|
|
@@ -47,15 +50,17 @@ import AgentConfig from './rgflow/agentConfig.vue';
|
|
|
import { funcDebounce } from '../../utils/utils';
|
|
|
import { bus_intelligentSearch, bus_intelligentEdit } from '../../base/event-bus';
|
|
|
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
const searchText = ref('');
|
|
|
const visible = ref(false);
|
|
|
const show_model_item = ref(false);
|
|
|
const show_select_icon = ref(false);
|
|
|
-const target_icon = ref('../../assets/image/management/intelligent-frame1.png');
|
|
|
+const target_icon = ref('');
|
|
|
// 当前新建智能体类型
|
|
|
const target_intell_type = ref('');
|
|
|
// ragflow配置
|
|
|
-const show_dify_config = ref(false);
|
|
|
+const show_rg_config = ref(false);
|
|
|
const editAgentKuai = ref(null);
|
|
|
let add_type = ref('add');
|
|
|
let itemObj = reactive({});
|
|
|
@@ -92,28 +97,15 @@ const handleCreate = () => {
|
|
|
// 创建Dify智能体
|
|
|
const createRAGFLOWIntelligent = () => {
|
|
|
console.log('createRAGFLOWIntelligent');
|
|
|
- show_dify_config.value = true;
|
|
|
+ show_rg_config.value = true;
|
|
|
};
|
|
|
const closeAgentConfig = () => {
|
|
|
- show_dify_config.value = false;
|
|
|
+ show_rg_config.value = false;
|
|
|
};
|
|
|
const addIntelligent = (data) => {
|
|
|
//根据智能体类型,打开不同的配置面板data.type
|
|
|
- switch (data.type) {
|
|
|
- case 'DIFY_1':
|
|
|
- // TODO: 工作流助手
|
|
|
- show_model_item.value = true;
|
|
|
- target_intell_type.value = data.type;
|
|
|
- break;
|
|
|
- case 'DIFY_2':
|
|
|
- // TODO: 智能Agent
|
|
|
- break;
|
|
|
- case 'DIFY_3':
|
|
|
- // TODO: 工作流应用
|
|
|
- break;
|
|
|
- default:
|
|
|
- console.log('暂不支持该智能体类型');
|
|
|
- }
|
|
|
+ show_model_item.value = true;
|
|
|
+ target_intell_type.value = data.type;
|
|
|
};
|
|
|
const selectIcon = () => {
|
|
|
show_select_icon.value = true;
|
|
|
@@ -122,6 +114,11 @@ const sendIcon = (icon) => {
|
|
|
console.log('sendIcon', icon);
|
|
|
target_icon.value = icon;
|
|
|
};
|
|
|
+
|
|
|
+const updateIntelligentList = () => {
|
|
|
+ bus_intelligentSearch.emit('');
|
|
|
+ target_icon.value = '';
|
|
|
+};
|
|
|
/**
|
|
|
* 监听编辑智能体事件
|
|
|
* @param {Object} item 编辑智能体对象
|
|
|
@@ -131,15 +128,15 @@ const sendIcon = (icon) => {
|
|
|
* case 4: 编辑Dify智能体
|
|
|
* */
|
|
|
bus_intelligentEdit.on((item) => {
|
|
|
- console.log('bus_intelligentEdit', item);
|
|
|
switch (item.agentType) {
|
|
|
case '1':
|
|
|
// TODO: 编辑rgflow智能体
|
|
|
// itemObj = item;
|
|
|
- show_dify_config.value = true;
|
|
|
+ show_rg_config.value = true;
|
|
|
break;
|
|
|
case '4':
|
|
|
- add_type.value = 'edit';
|
|
|
+ // TODO: 进入Dify智能体配置
|
|
|
+ router.push({ path: '/difydetail', query: { id: item.id } });
|
|
|
console.log('item1', item);
|
|
|
break;
|
|
|
default:
|