|
@@ -84,8 +84,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, reactive, computed, onUnmounted } from 'vue';
|
|
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
+import { ref, reactive, computed, onMounted, onUnmounted } from 'vue';
|
|
|
|
|
+import { useRouter, useRoute } from 'vue-router';
|
|
|
// import { Message } from '@arco-design/web-vue';
|
|
// import { Message } from '@arco-design/web-vue';
|
|
|
import { Message } from '../../3rd-libs/arco-vue-libs';
|
|
import { Message } from '../../3rd-libs/arco-vue-libs';
|
|
|
import ModalAddIntel from './ModalAddIntel.vue';
|
|
import ModalAddIntel from './ModalAddIntel.vue';
|
|
@@ -106,6 +106,13 @@ import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
|
+const route = useRoute();
|
|
|
|
|
+const cache_searching = ref({
|
|
|
|
|
+ searchText: route.query.searchText,
|
|
|
|
|
+ target_label_list: route.query.target_label_list,
|
|
|
|
|
+ target_status: route.query.target_status,
|
|
|
|
|
+ target_app: route.query.target_app
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
const searchText = ref('');
|
|
const searchText = ref('');
|
|
|
const target_app = ref(''); // 当前选择的应用
|
|
const target_app = ref(''); // 当前选择的应用
|
|
@@ -231,44 +238,63 @@ const getDifyProfileFun = async () => {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * 监听编辑智能体事件
|
|
|
|
|
- * @param {Object} item 编辑智能体对象
|
|
|
|
|
- * case 1: 编辑ragflow智能体
|
|
|
|
|
- * case 2: 编辑bs智能体
|
|
|
|
|
- * case 3: 编辑basic智能体
|
|
|
|
|
- * case 4: 编辑Dify智能体
|
|
|
|
|
- * */
|
|
|
|
|
-bus_intelligentEdit.on(async (item) => {
|
|
|
|
|
- switch (item.agentType) {
|
|
|
|
|
- case '1':
|
|
|
|
|
- // TODO: 编辑rgflow智能体
|
|
|
|
|
- // itemObj = item;
|
|
|
|
|
- show_rg_config.value = true;
|
|
|
|
|
- add_type.value = 'edit';
|
|
|
|
|
- getRagFlowDataFunc(item);
|
|
|
|
|
-
|
|
|
|
|
- break;
|
|
|
|
|
- case '4':
|
|
|
|
|
- // TODO: 进入Dify智能体配置
|
|
|
|
|
- const res = await getDifyProfile();
|
|
|
|
|
- if (res.id && res.id.length) {
|
|
|
|
|
- router.push({ path: '/intelligent/detail', query: { id: item.id, name: item.name, mode: item.mode } });
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- console.log('暂不支持该智能体类型');
|
|
|
|
|
|
|
+onMounted(async () => {
|
|
|
|
|
+ if (Object.keys(cache_searching.value)) {
|
|
|
|
|
+ searchText.value = cache_searching.value.searchText || '';
|
|
|
|
|
+ target_app.value = cache_searching.value.target_app || '';
|
|
|
|
|
+ target_status.value = cache_searching.value.target_status || '1';
|
|
|
|
|
+ target_label_list.value = cache_searching.value.target_label_list?.map((item) => Number(item)) || [];
|
|
|
|
|
+ handleSearch();
|
|
|
}
|
|
}
|
|
|
-});
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 监听编辑智能体事件
|
|
|
|
|
+ * @param {Object} item 编辑智能体对象
|
|
|
|
|
+ * case 1: 编辑ragflow智能体
|
|
|
|
|
+ * case 2: 编辑bs智能体
|
|
|
|
|
+ * case 3: 编辑basic智能体
|
|
|
|
|
+ * case 4: 编辑Dify智能体
|
|
|
|
|
+ * */
|
|
|
|
|
+ bus_intelligentEdit.on(async (item) => {
|
|
|
|
|
+ switch (item.agentType) {
|
|
|
|
|
+ case '1':
|
|
|
|
|
+ // TODO: 编辑rgflow智能体
|
|
|
|
|
+ // itemObj = item;
|
|
|
|
|
+ show_rg_config.value = true;
|
|
|
|
|
+ add_type.value = 'edit';
|
|
|
|
|
+ getRagFlowDataFunc(item);
|
|
|
|
|
|
|
|
-bus_intelligentIconEdit.on((item) => {
|
|
|
|
|
- show_select_icon.value = true;
|
|
|
|
|
- edit_icon_data.value = item;
|
|
|
|
|
- target_icon.value = item.icon;
|
|
|
|
|
-});
|
|
|
|
|
-bus_intelligentLabelSync.on((item) => {
|
|
|
|
|
- label_list.value = item;
|
|
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '4':
|
|
|
|
|
+ // TODO: 进入Dify智能体配置
|
|
|
|
|
+ const res = await getDifyProfile();
|
|
|
|
|
+ if (res.id && res.id.length) {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/intelligent/detail',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id: item.id,
|
|
|
|
|
+ name: item.name,
|
|
|
|
|
+ mode: item.mode,
|
|
|
|
|
+ searchText: searchText.value,
|
|
|
|
|
+ target_app: target_app.value,
|
|
|
|
|
+ target_label_list: target_label_list.value,
|
|
|
|
|
+ target_status: target_status.value
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ console.log('暂不支持该智能体类型');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ bus_intelligentIconEdit.on((item) => {
|
|
|
|
|
+ show_select_icon.value = true;
|
|
|
|
|
+ edit_icon_data.value = item;
|
|
|
|
|
+ target_icon.value = item.icon;
|
|
|
|
|
+ });
|
|
|
|
|
+ bus_intelligentLabelSync.on((item) => {
|
|
|
|
|
+ label_list.value = item;
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
|
bus_intelligentEdit.off();
|
|
bus_intelligentEdit.off();
|