From 1606cbed5beef1dd04a3235d4bc3fd30ea45eb1e Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期五, 09 八月 2024 11:13:29 +0800
Subject: [PATCH] 智能体页面bug修改
---
src/views/dmx/model/components/addTableName.vue | 80 +++++++++++++++++++++++++++++----------
1 files changed, 59 insertions(+), 21 deletions(-)
diff --git a/src/views/dmx/model/components/addTableName.vue b/src/views/dmx/model/components/addTableName.vue
index a6b5631..0b5648c 100644
--- a/src/views/dmx/model/components/addTableName.vue
+++ b/src/views/dmx/model/components/addTableName.vue
@@ -2,7 +2,7 @@
<!-- 娣诲姞妯″瀷 -->
<a-modal
v-model:visible="addTabVisible"
- title="娣诲姞妯″紡"
+ :title="title"
@before-open="handleOpened"
@cancel="handleCancel"
:footer="false"
@@ -20,12 +20,12 @@
<a-form-item field="name" label="妯″瀷鍚嶇О">
<a-input v-model="form.name" placeholder="璇疯緭鍏ユā鍨嬪悕绉�" />
</a-form-item>
- <a-form-item field="apiKey" label="API-Key">
+ <!-- <a-form-item field="apiKey" label="API-Key">
<a-input v-model="form.apiKey" placeholder="API-Key" />
</a-form-item>
<a-form-item field="baseUrl" label="Base-Url">
<a-input v-model="form.baseUrl" placeholder="Base-Url" />
- </a-form-item>
+ </a-form-item> -->
<a-form-item field="tags" label="妯″瀷鎻忚堪">
<a-textarea
v-model="form.tags"
@@ -39,6 +39,7 @@
<Upload
:action="uploadAction"
:limit="1"
+ :url="form.urlS"
@update:fileList="updateFileList"
@success="handleSuccess"
></Upload>
@@ -57,8 +58,15 @@
</template>
<script lang="ts" setup>
- import { onMounted, onBeforeMount, reactive, ref, computed } from 'vue';
- import { addLlmFactory } from '@/api/model';
+ import {
+ onMounted,
+ onBeforeMount,
+ watchEffect,
+ reactive,
+ ref,
+ computed,
+ } from 'vue';
+ import { addLlmFactory, getLlmDetail, editLlmFactory } from '@/api/model';
import { Message } from '@arco-design/web-vue';
const addTabVisible = defineModel('tabShow');
@@ -72,6 +80,10 @@
type: Object,
default: {},
},
+ title: {
+ type: String,
+ default: '娣诲姞妯″瀷',
+ },
});
const editList = computed(() => props.nameList);
@@ -82,6 +94,7 @@
api_base: '',
tags: '',
logo: '',
+ urlS: '',
});
const formRef = ref(null);
@@ -104,23 +117,40 @@
console.log(editList, 9999);
formRef.value.validate().then(async (res) => {
if (!res) {
- await addLlmFactory({
- name: form.name,
- tags: form.tags,
- api_base: form.api_base,
- // all_params: all_params,
- logo: imageUrls.value[0],
- })
- .then((resData) => {
- if ((resData as any).code === 200) {
- emit('refresh-parent');
- addTabVisible.value = false;
- Message.success('娣诲姞鎴愬姛');
- }
+ if (props.title == '缂栬緫妯″瀷') {
+ await editLlmFactory({
+ name: form.name,
+ tags: form.tags,
+ api_base: form.api_base,
+ // all_params: all_params,
+ logo: imageUrls.value[0],
})
- .catch(() => {
- Message.error('娣诲姞澶辫触');
- });
+ .then((resData) => {
+ if ((resData as any).code === 200) {
+ emit('refresh-parent');
+ addTabVisible.value = false;
+ }
+ })
+ .catch(() => {});
+ } else {
+ await addLlmFactory({
+ name: form.name,
+ tags: form.tags,
+ api_base: form.api_base,
+ // all_params: all_params,
+ logo: imageUrls.value[0],
+ })
+ .then((resData) => {
+ if ((resData as any).code === 200) {
+ emit('refresh-parent');
+ addTabVisible.value = false;
+ Message.success('娣诲姞鎴愬姛');
+ }
+ })
+ .catch(() => {
+ Message.error('娣诲姞澶辫触');
+ });
+ }
}
});
};
@@ -154,6 +184,14 @@
});
formRef.value?.resetFields();
};
+
+ watchEffect(() => {
+ if (props.nameList && props.title == '缂栬緫妯″瀷') {
+ form.name = props.nameList.llm_factory;
+ form.tags = props.nameList.tags;
+ form.urlS = props.nameList.logo;
+ }
+ });
</script>
<script lang="ts">
--
Gitblit v1.8.0