fix:修改
This commit is contained in:
parent
c4e688a944
commit
a0799da57f
@ -25,4 +25,14 @@ export function modelConfigUpdate(data) {
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function modelConfigHistory(data) {
|
||||
return request({
|
||||
url: '/model/config/history',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -25,6 +25,7 @@
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="openDialogHistory(scope.row)">模型历史</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -41,7 +42,7 @@
|
||||
<!-- 修改对话框 -->
|
||||
<el-dialog :title="dialogTitle" v-model="dialogOpen" width="980px" append-to-body :close-on-click-modal="false"
|
||||
@close="cancel">
|
||||
<el-form :model="dialogForm" :rules="dialogRules" ref="configModelsRef" label-width="110px" class="config-form">
|
||||
<el-form :model="dialogForm" :rules="dialogRules" ref="configModelsRef" label-width="110px" class="config-form" :disabled="dialogIsView">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="模型名称" prop="useCase">
|
||||
@ -107,16 +108,44 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="!dialogIsView">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!--模型历史列表-->
|
||||
<el-dialog :title="dialogHistoryTitle" v-model="dialogHistoryOpen" width="980px" append-to-body :close-on-click-modal="false"
|
||||
@close="cancel">
|
||||
<el-table v-loading="dialogLoading" :data="dialogPageList">
|
||||
<el-table-column label="模型名称" prop="useCase" />
|
||||
<el-table-column label="模型类型" prop="modelType" />
|
||||
<el-table-column label="更新时间" prop="updateTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="view" @click="openDialog('view', scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页区域 -->
|
||||
<pagination
|
||||
:show="dialogTotal > 0"
|
||||
:total="dialogTotal"
|
||||
v-model:page="dialogQueryParams.pageNum"
|
||||
v-model:limit="dialogQueryParams.pageSize"
|
||||
@pagination="getDialogList"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelHistory">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="configModels">
|
||||
import { modelConfigList, modelConfigUpdate } from "@/api/tc/model"
|
||||
import { modelConfigList, modelConfigUpdate, modelConfigHistory } from "@/api/tc/model"
|
||||
import { getDicts } from "@/api/system/dict/data"
|
||||
import MdEditorPreview from "@/components/Markdown/MdEditorPreview"
|
||||
import { ref } from "vue"
|
||||
@ -129,11 +158,23 @@ const loading = ref(false)
|
||||
const showSearch = ref(true)
|
||||
const total = ref(0)
|
||||
const modelsOptions = ref([])
|
||||
/** 对话框列表数据 */
|
||||
const dialogHistoryTitle = ref('模型历史列表')
|
||||
const dialogHistoryOpen = ref(false)
|
||||
const dialogPageList = ref([])
|
||||
const dialogTotal = ref(0)
|
||||
const dialogLoading = ref(false)
|
||||
const dialogQueryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
|
||||
|
||||
/** 配置模型表单引用 */
|
||||
const configModelsRef = ref(null)
|
||||
const dialogOpen = ref(false)
|
||||
const dialogTitle = ref('新增')
|
||||
const dialogIsView = ref(false)
|
||||
const dialogForm = ref({
|
||||
useCase: '',
|
||||
modelId: '',
|
||||
@ -235,6 +276,7 @@ function reset() {
|
||||
|
||||
/** 打开新增/编辑弹窗 */
|
||||
function openDialog(type = 'add', row = {}) {
|
||||
dialogIsView.value = false
|
||||
if (modelsOptions.value.length === 0) {
|
||||
getModelList()
|
||||
}
|
||||
@ -243,9 +285,35 @@ function openDialog(type = 'add', row = {}) {
|
||||
} else if (type === 'edit') {
|
||||
dialogTitle.value = '编辑'
|
||||
dialogForm.value = JSON.parse(JSON.stringify(row))
|
||||
} else if (type === 'view') {
|
||||
dialogTitle.value = '查看'
|
||||
dialogForm.value = JSON.parse(JSON.stringify(row))
|
||||
dialogIsView.value = true
|
||||
}
|
||||
dialogOpen.value = true
|
||||
}
|
||||
|
||||
/** 打开模型历史弹窗 */
|
||||
function openDialogHistory(row = {}) {
|
||||
dialogHistoryOpen.value = true
|
||||
getDialogList(row.modelType)
|
||||
}
|
||||
|
||||
/** 模型历史列表 */
|
||||
function cancelHistory() {
|
||||
dialogHistoryOpen.value = false
|
||||
}
|
||||
/** 分页查询模型历史列表 */
|
||||
function getDialogList(modelType) {
|
||||
const data = { modelType }
|
||||
modelConfigHistory(data).then(response => {
|
||||
const res = response.rows;
|
||||
dialogPageList.value = res
|
||||
dialogTotal.value = response.total
|
||||
}).finally(() => {
|
||||
dialogLoading.value = false
|
||||
})
|
||||
}
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user