|
@@ -178,9 +178,11 @@ const openAddDialog = () => {
|
|
|
dialogVisible.value = true
|
|
|
}
|
|
|
|
|
|
+const loadingNum = ref<number>(-1)
|
|
|
// 打开编辑对话框
|
|
|
-const openEditDialog = async (row: LmConfigInfo) => {
|
|
|
+const { doLoading: openEditDialog,loading: loadingOpenEditDialog } = useLoading(async (row: LmConfigInfo) => {
|
|
|
try {
|
|
|
+ loadingNum.value = row.id ?? -1
|
|
|
const res = await api.model.detail({ id: row.id! })
|
|
|
Object.assign(formData, res)
|
|
|
dialogTitle.value = '编辑模型配置'
|
|
@@ -190,7 +192,7 @@ const openEditDialog = async (row: LmConfigInfo) => {
|
|
|
console.error('获取模型详情失败:', error)
|
|
|
ElMessage.error('获取模型详情失败')
|
|
|
}
|
|
|
-}
|
|
|
+})
|
|
|
|
|
|
// 保存表单
|
|
|
const { loading: saveLoading, doLoading: doSave } = useLoading(async () => {
|
|
@@ -302,15 +304,11 @@ onMounted(() => {
|
|
|
<el-table-column label="更新时间" prop="updatedAt" width="180" align="center" />
|
|
|
<el-table-column label="操作" width="200" align="center" fixed="right">
|
|
|
<template #default="scope">
|
|
|
- <el-button text type="primary" size="small" @click="openEditDialog(scope.row)">
|
|
|
- 编辑
|
|
|
- </el-button>
|
|
|
+ <el-button text type="primary" size="small" @click="openEditDialog(scope.row)" :loading="loadingOpenEditDialog && loadingNum === scope.row.id"> 编辑 </el-button>
|
|
|
<el-button text :type="scope.row.status ? 'warning' : 'success'" size="small" @click="toggleStatus(scope.row)">
|
|
|
{{ scope.row.status ? '禁用' : '启用' }}
|
|
|
</el-button>
|
|
|
- <el-button text type="danger" size="small" @click="delSingle(scope.row.id)">
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ <el-button text type="danger" size="small" @click="delSingle(scope.row.id)"> 删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|