|  |  | 
 |  |  |                           <div class="arco-btn-group"> | 
 |  |  |                             <a-space class="btn-group"> | 
 |  |  |                               <!-- <editModel></editModel> --> | 
 |  |  |                               <a-button @click="handleDeleteModel(item, 1)"> | 
 |  |  |                                 删除 | 
 |  |  |                               </a-button> | 
 |  |  |                               <a-button | 
 |  |  |                                 type="primary" | 
 |  |  |                                 @click="handleEditModel(item, 1)" | 
 |  |  | 
 |  |  |                               <a-button @click="handleDeleteModel(list)"> | 
 |  |  |                                 删除 | 
 |  |  |                               </a-button> | 
 |  |  |                               <a-button | 
 |  |  |                               <!-- <a-button | 
 |  |  |                                 type="primary" | 
 |  |  |                                 @click="handleEditModel(list)" | 
 |  |  |                               > | 
 |  |  |                                 编辑 | 
 |  |  |                               </a-button> | 
 |  |  |                               </a-button> --> | 
 |  |  |  | 
 |  |  |                               <!-- <editModel></editModel> --> | 
 |  |  |                             </a-space> | 
 |  |  | 
 |  |  |                 /> | 
 |  |  |               </div> --> | 
 |  |  |               <div> | 
 |  |  |                 <a-button type="primary" @click="handleAddModel"> | 
 |  |  |                 <a-button | 
 |  |  |                   type="primary" | 
 |  |  |                   @click="handleAddModel" | 
 |  |  |                   :disabled="addBtn" | 
 |  |  |                 > | 
 |  |  |                   <template #icon> | 
 |  |  |                     <icon-plus /> | 
 |  |  |                   </template> | 
 |  |  | 
 |  |  |     modelmyLlms, | 
 |  |  |     deleteLlm, | 
 |  |  |     deleteLlmFactory, | 
 |  |  |     getFactoryDetail, | 
 |  |  |   } from '@/api/model'; | 
 |  |  |   import { Modal, Message } from '@arco-design/web-vue'; | 
 |  |  |   import { userModelState } from '@/store'; | 
 |  |  | 
 |  |  |  | 
 |  |  |   const modelStore = userModelState(); | 
 |  |  |   let count = 5; | 
 |  |  |   const addBtn = ref(false); | 
 |  |  |   const activeKey = ref(1); | 
 |  |  |   const data = ref([ | 
 |  |  |     { | 
 |  |  | 
 |  |  |     key: { | 
 |  |  |       tags: '添加key', | 
 |  |  |       id: 1, | 
 |  |  |       live: 1, | 
 |  |  |     }, | 
 |  |  |   }); | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |   const modalList = ref({}); | 
 |  |  |   const tabKey = ref('key'); | 
 |  |  |   const changeTabs = (val) => { | 
 |  |  |   const changeTabs = async (val) => { | 
 |  |  |     tabKey.value = val; | 
 |  |  |     await getFactory(); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const httpUrl = modelStore.hrefUrl; | 
 |  |  | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   //删除模型 | 
 |  |  |   const handleDeleteModel = (val) => { | 
 |  |  |     Modal.confirm({ | 
 |  |  |       title: '警告', | 
 |  |  |       content: '确认删除吗', | 
 |  |  |       okText: '确定', | 
 |  |  |       cancelText: '取消', | 
 |  |  |       onOk: async () => { | 
 |  |  |         const factory = tabKey.value; | 
 |  |  |         const res = await deleteLlm({ | 
 |  |  |           llm_factory: tabKey.value, | 
 |  |  |           llm_name: val.name, | 
 |  |  |         }); | 
 |  |  |   const handleDeleteModel = (val, type) => { | 
 |  |  |     if (type == 1) { | 
 |  |  |       handleDelete(val); | 
 |  |  |     } else { | 
 |  |  |       Modal.confirm({ | 
 |  |  |         title: '警告', | 
 |  |  |         content: '确认删除吗', | 
 |  |  |         okText: '确定', | 
 |  |  |         cancelText: '取消', | 
 |  |  |         onOk: async () => { | 
 |  |  |           const factory = tabKey.value; | 
 |  |  |           const res = await deleteLlm({ | 
 |  |  |             llm_factory: tabKey.value, | 
 |  |  |             llm_name: val.name, | 
 |  |  |           }); | 
 |  |  |  | 
 |  |  |         if ((res as any).code == 0) { | 
 |  |  |           queryModel(); | 
 |  |  |           tabKey.value = factory; | 
 |  |  |         } else { | 
 |  |  |         } | 
 |  |  |       }, | 
 |  |  |       onCancel: () => {}, | 
 |  |  |     }); | 
 |  |  |           if ((res as any).code == 0) { | 
 |  |  |             queryModel(); | 
 |  |  |             tabKey.value = factory; | 
 |  |  |           } else { | 
 |  |  |           } | 
 |  |  |         }, | 
 |  |  |         onCancel: () => {}, | 
 |  |  |       }); | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   //父级模型 | 
 |  |  | 
 |  |  |     modalList.value = res.data; | 
 |  |  |     loading.value = true; | 
 |  |  |     tabData.value = Object.assign({}, tabData.value, res.data); | 
 |  |  |     tabData.value = filterObject(tabData.value, 1); | 
 |  |  |     tabKey.value = Object.keys(tabData.value)[0]; | 
 |  |  |     await getFactory(); | 
 |  |  |   }; | 
 |  |  |   queryModel(); | 
 |  |  |   //返回满足条件的对象 | 
 |  |  |   const filterObject = (obj, threshold) => { | 
 |  |  |     return Object.keys(obj) | 
 |  |  |       .filter((key) => obj[key].added == 1) | 
 |  |  |       .reduce((result, key) => { | 
 |  |  |         result[key] = obj[key]; | 
 |  |  |         return result; | 
 |  |  |       }, {}); | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const refreshParentMethod = () => { | 
 |  |  |     queryModel(); | 
 |  |  |     // 这里执行需要的操作 | 
 |  |  |   }; | 
 |  |  |  | 
 |  |  |   const getFactory = async () => { | 
 |  |  |     const { data } = await getFactoryDetail({ | 
 |  |  |       factory_name: tabKey.value, | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     if (data.set_type == 2) { | 
 |  |  |       addBtn.value = true; | 
 |  |  |     } else { | 
 |  |  |       addBtn.value = false; | 
 |  |  |     } | 
 |  |  |   }; | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <script lang="ts"> |