From a7b5e177db655a98c299d3342538e23bd4e647da Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期三, 14 八月 2024 14:35:12 +0800
Subject: [PATCH] fix: 模型管理修改

---
 src/views/dmx/model/components/addTableName.vue |   41 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/src/views/dmx/model/components/addTableName.vue b/src/views/dmx/model/components/addTableName.vue
index 9b6c8c9..c86be66 100644
--- a/src/views/dmx/model/components/addTableName.vue
+++ b/src/views/dmx/model/components/addTableName.vue
@@ -17,8 +17,20 @@
       :style="{ width: '90%', margin: '0 auto' }"
       layout="vertical"
     >
-      <a-form-item field="name" label="妯″瀷鍚嶇О">
-        <a-input v-model="form.name" placeholder="璇疯緭鍏ユā鍨嬪悕绉�" />
+      <a-form-item field="name" label="妯″瀷妗嗘灦">
+        <!-- <a-input v-model="form.name" placeholder="璇疯緭鍏ユā鍨嬪悕绉�" /> -->
+        <a-select
+          v-model="form.name"
+          placeholder="璇烽�夋嫨妯″瀷妗嗘灦"
+          allow-create
+          allow-search
+        >
+          <a-option
+            v-for="(item, index) in modalList"
+            :value="index"
+            :label="index"
+          ></a-option>
+        </a-select>
       </a-form-item>
       <!-- <a-form-item field="apiKey" label="API-Key">
         <a-input v-model="form.apiKey" placeholder="API-Key" />
@@ -66,12 +78,21 @@
     ref,
     computed,
   } from 'vue';
-  import { addLlmFactory, getLlmDetail, editLlmFactory } from '@/api/model';
+  import {
+    modelmyLlms,
+    addLlmFactory,
+    getLlmDetail,
+    editLlmFactory,
+  } from '@/api/model';
+
   import { Message } from '@arco-design/web-vue';
+  import { userModelState } from '@/store';
+
+  const modelStore = userModelState();
 
   const addTabVisible = defineModel('tabShow');
 
-  const httpUrl = localStorage.getItem('httpUrl');
+  const httpUrl = modelStore.hrefUrl;
   const loading = ref(false);
   const props = defineProps({
     task_id: {
@@ -98,13 +119,13 @@
     logo: '',
     urlS: '',
   });
-  const formRef = ref(null);
+  const formRef = ref();
 
   const rules = {
     name: [
       {
         required: true,
-        message: '鍚嶇О涓嶅厑璁镐负绌�',
+        message: '妯″瀷妗嗘灦涓嶅厑璁镐负绌�',
       },
     ],
     describe: [
@@ -125,7 +146,7 @@
             tags: form.tags,
             api_base: form.api_base,
             // all_params: all_params,
-            logo: uploadUrl.value[0],
+            logo: uploadUrl.value[0] || '',
           })
             .then((resData) => {
               if ((resData as any).code === 200) {
@@ -191,6 +212,12 @@
     });
     formRef.value?.resetFields();
   };
+  const modalList = ref([]);
+  const queryModel = async () => {
+    const res = await modelmyLlms();
+    modalList.value = res.data;
+  };
+  queryModel();
 
   watchEffect(() => {
     if (props.nameList && props.title == '缂栬緫妯″瀷') {

--
Gitblit v1.8.0