diff --git a/src/views/ai/model/chatModel/index.vue b/src/views/ai/model/chatModel/index.vue
index aac7055..ef149ec 100644
--- a/src/views/ai/model/chatModel/index.vue
+++ b/src/views/ai/model/chatModel/index.vue
@@ -95,7 +95,7 @@ async function handleDel(record: any) {
{{ item.name }}
-
+
新增模型
-
+
diff --git a/src/views/ai/model/embedStore/composables/index.ts b/src/views/ai/model/embedStore/composables/index.ts
index ed689b8..a4947da 100644
--- a/src/views/ai/model/embedStore/composables/index.ts
+++ b/src/views/ai/model/embedStore/composables/index.ts
@@ -130,8 +130,6 @@ export default function () {
delListApi: EmbedStoreApi.deleteEmbedStore
});
-
-
// 打开编辑对话框
const open = (data?: any) => {
editRef.value.show(data);
@@ -141,6 +139,7 @@ export default function () {
const handleSearch = (values: any) => {
methods.setSearchParams(values)
}
+
const pagination = computed(() => {
return {
total: tableObject.total,
@@ -148,9 +147,15 @@ export default function () {
currentPage: tableObject.currentPage
}
})
- const handleDel = () => {
+ const handleDel = async (id: string | number) => {
+ try {
+ await methods.delList(id, false);
+ } catch (error) {
+ console.error('Failed to delete embed store:', error);
+ }
}
+
return {
shema,
columns,
diff --git a/src/views/ai/model/embedStore/index.vue b/src/views/ai/model/embedStore/index.vue
index ab7a19c..0354929 100644
--- a/src/views/ai/model/embedStore/index.vue
+++ b/src/views/ai/model/embedStore/index.vue
@@ -29,7 +29,7 @@ onMounted(() => {
diff --git a/src/views/ai/model/embedding/composables/index.ts b/src/views/ai/model/embedding/composables/index.ts
index a6b14dd..97cc98d 100644
--- a/src/views/ai/model/embedding/composables/index.ts
+++ b/src/views/ai/model/embedding/composables/index.ts
@@ -12,7 +12,7 @@ export default function () {
type: ModelTypeEnum.EMBEDDING
});
const tableData = ref([])
-
+ const loading = ref(false)
const baseColumns = [
{
label: '模型别名',
@@ -53,7 +53,7 @@ export default function () {
// 加载数据
const loadData = async () => {
try {
- const res = await ModelApi.getModelList({ provider: formData.value.provider, type: ModelTypeEnum.EMBEDDING });
+ const res = await ModelApi.getModelList({ provider: formData.value.provider, type: ModelTypeEnum.EMBEDDING }).finally(() => loading.value = false);
tableData.value = res;
} catch (error) {
console.error('Failed to load embedding models:', error);
@@ -101,6 +101,7 @@ export default function () {
open,
loadData,
handleDel,
- handleEdit
+ handleEdit,
+ loading
}
}
diff --git a/src/views/ai/model/embedding/index.vue b/src/views/ai/model/embedding/index.vue
index aaed469..12eb8be 100644
--- a/src/views/ai/model/embedding/index.vue
+++ b/src/views/ai/model/embedding/index.vue
@@ -5,7 +5,7 @@ import EditCom from "@/views/ai/model/embedding/edit.vue";
import {LLMProviders} from "@/views/ai/model/embedding/composables/consts";
import {Table} from "@/components/Table";
-const { baseColumns: columns, tableData, formData, editRef, open, loadData, handleEdit, handleDel} = usePage()
+const { baseColumns: columns, tableData, formData, editRef, open, loadData, loading,handleEdit, handleDel} = usePage()
const handleReload = () => {
loadData()
@@ -31,7 +31,7 @@ const handleReload = () => {
show-icon
/>
新增向量模型
-
+
diff --git a/src/views/ai/model/image/composables/index.ts b/src/views/ai/model/image/composables/index.ts
index d7550e1..44d42c9 100644
--- a/src/views/ai/model/image/composables/index.ts
+++ b/src/views/ai/model/image/composables/index.ts
@@ -1,4 +1,4 @@
-import {computed, nextTick, ref, watch} from "vue";
+import {computed, nextTick, onMounted, ref, watch} from "vue";
import {ProviderEnum} from "@/views/ai/model/image/composables/consts";
import {ModelApi} from "@/api/new-ai/model";
import { ModelTypeEnum } from "../../chatModel/composables/consts";
@@ -11,7 +11,7 @@ export default function () {
type: ModelTypeEnum.TEXT_IMAGE
});
const tableData = ref([])
-
+ const loading = ref(false)
const baseColumns = [
{
label: '模型别名',
@@ -74,7 +74,7 @@ export default function () {
// 加载数据
const loadData = async () => {
try {
- const res = await ModelApi.getModelList({ provider: formData.value.provider, type: ModelTypeEnum.TEXT_IMAGE });
+ const res = await ModelApi.getModelList({ provider: formData.value.provider, type: ModelTypeEnum.TEXT_IMAGE }).finally(() => loading.value = false);
tableData.value = res;
} catch (error) {
console.error('Failed to load image models:', error);
@@ -122,6 +122,7 @@ export default function () {
open,
loadData,
handleDel,
- handleEdit
+ handleEdit,
+ loading,
}
}
diff --git a/src/views/ai/model/image/index.vue b/src/views/ai/model/image/index.vue
index c55649e..c8f4c46 100644
--- a/src/views/ai/model/image/index.vue
+++ b/src/views/ai/model/image/index.vue
@@ -6,7 +6,7 @@ import {LLMProviders} from "@/views/ai/model/image/composables/consts";
import EditCom from './edit.vue'
import {Table} from "@/components/Table";
-const {columns, tableData, formData, editRef, open, loadData, handleEdit, handleDel} = usePage()
+const {columns, tableData, formData, editRef, open, loadData, handleEdit, handleDel, loading} = usePage()
const handleReload = () => {
loadData()
@@ -34,7 +34,7 @@ const handleReload = () => {
新增图像模型