Explorar o código

fix:首页思维导图开关样式修改,智能体详情退出记录上次搜索条件

hanyang hai 1 ano
pai
achega
bcaeaa8ff4

+ 1 - 0
public/i18n/lang-en.json

@@ -66,6 +66,7 @@
     "edit": "Edit",
     "delete": "Delete",
     "online": "Online",
+    "setting": "Settings",
     "offline": "Offline",
     "delete_success": "Deletion Successful",
     "delete_fail": "Deletion Failed",

+ 1 - 0
public/i18n/lang-zh.json

@@ -65,6 +65,7 @@
     "document": "文档",
     "edit": "编辑",
     "delete": "删除",
+    "setting": "设置",
     "online": "上线",
     "offline": "下线",
     "delete_success": "删除成功",

+ 5 - 6
src/modules/conversation-chat/dialog-input/InputActions.vue

@@ -37,7 +37,7 @@
         <a-option v-for="item in knowledge_list" :key="item.id" :label="item.name" :value="item.id"></a-option>
       </a-select>
       <div class="switch-mind-map">
-        <a-switch v-model="show_mind_map" type="round" unchecked-color="var(--color-fill-3)" @change="handleChange" />
+        <a-switch v-model="show_mind_map" type="circle" unchecked-color="var(--color-fill-3)" @change="handleChange" />
         <span class="text">{{ $t('ai_search.mindmap_title') }}</span>
       </div>
     </div>
@@ -208,7 +208,6 @@ const handleInternetChange = () => {
 };
 
 const handleChange = () => {
-  console.log('show_mind_map', show_mind_map.value);
   emit('actionConfig', {
     isDeep: is_deep_think.value ? 2 : 1,
     knowledgeId: base_list.value,
@@ -386,16 +385,16 @@ onMounted(() => {
   margin-left: 10px;
   color: var(--color-text-2);
   .arco-switch-type-round {
-    width: 50px;
+    /* width: 50px;
     height: 30px;
     line-height: 30px;
-    border-radius: 8px;
+    border-radius: 8px; */
   }
 }
-:deep(.arco-switch .arco-switch-handle) {
+/* :deep(.arco-switch .arco-switch-handle) {
   top: 7px;
   border-radius: 50%;
-}
+} */
 /* :deep(.arco-switch-checked .arco-switch-handle) {
   background-color: #f00;
 } */

+ 18 - 1
src/modules/dify/TopSetting.vue

@@ -2,16 +2,33 @@
   <a-breadcrumb class="breadcrumb">
     <a-breadcrumb-item><icon-apps /></a-breadcrumb-item>
     <a-breadcrumb-item>
-      <router-link to="/intelligent">智能体</router-link>
+      <router-link
+        :to="{
+          path: '/intelligent',
+          query: search_data
+        }"
+        >智能体</router-link
+      >
     </a-breadcrumb-item>
     <a-breadcrumb-item>{{ current_label }}</a-breadcrumb-item>
   </a-breadcrumb>
 </template>
 
 <script setup>
+import { ref } from 'vue';
+import { useRoute } from 'vue-router';
+
+const route = useRoute();
+console.log(route);
 const props = defineProps({
   current_label: String
 });
+const search_data = 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
+});
 </script>
 
 <style lang="css" scoped>

+ 14 - 9
src/modules/intelligent/MessageBody.vue

@@ -53,14 +53,20 @@
             <icon-more :style="{ cursor: 'pointer' }" />
           </div> -->
           <div class="tools" v-if="!item.online">
-            <icon-settings :style="{ cursor: 'pointer' }" @click.stop="editIntelligent(item)" />
-            <icon-delete :style="{ cursor: 'pointer' }" @click.stop="deleteIntelligent(item)" />
+            <a-tooltip :content="$t('management.setting')">
+              <icon-settings :style="{ cursor: 'pointer' }" @click.stop="editIntelligent(item)" />
+            </a-tooltip>
+            <a-tooltip :content="$t('management.delete')">
+              <icon-delete :style="{ cursor: 'pointer' }" @click.stop="deleteIntelligent(item)" />
+            </a-tooltip>
             <!-- ragflow的修改不支持该接口 -->
-            <icon-edit
-              v-if="item.agentType !== '1'"
-              :style="{ cursor: 'pointer' }"
-              @click.stop="updateIntelligent(item)"
-            />
+            <a-tooltip :content="$t('management.edit')">
+              <icon-edit
+                v-if="item.agentType !== '1'"
+                :style="{ cursor: 'pointer' }"
+                @click.stop="updateIntelligent(item)"
+              />
+            </a-tooltip>
           </div>
         </div>
       </template>
@@ -246,7 +252,6 @@ const deleteModalOk = async () => {
 
 const updateIntelligent = (item) => {
   show_model_item.value = true;
-  console.log(item, 999);
   update_model_data.value = {
     name: item.name,
     mode: item.mode,
@@ -356,7 +361,7 @@ bus_intelligentSearch.on((search_data) => {
 });
 
 onMounted(() => {
-  getDialog();
+  // getDialog();
   getLabels();
   body_container.value.addEventListener('scroll', funcThrottle(scrollHandler, 500));
 });

+ 0 - 1
src/modules/intelligent/ModelUpdateItem.vue

@@ -100,7 +100,6 @@ const handleOk = async () => {
   const res = await updateDify(edit_id, data);
   if (res) {
     const response = await updateOwnIntelligentIcon(edit_id, icon_name.value, data.name, data.description);
-    console.log(response, 1111);
     if (response.code == 200) {
       Message.success(t('management.edit_success'));
       emit('updateIntelligentList');

+ 64 - 38
src/modules/intelligent/TopSetting.vue

@@ -84,8 +84,8 @@
 </template>
 
 <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 '../../3rd-libs/arco-vue-libs';
 import ModalAddIntel from './ModalAddIntel.vue';
@@ -106,6 +106,13 @@ import { useI18n } from 'vue-i18n';
 
 const { t } = useI18n();
 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 target_app = ref(''); // 当前选择的应用
@@ -231,44 +238,63 @@ const getDifyProfileFun = async () => {
     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(() => {
   bus_intelligentEdit.off();