提交代码

This commit is contained in:
jiang 2024-12-10 16:12:25 +08:00
parent 67543e4059
commit 9777059eee
7 changed files with 404 additions and 36 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询模型管理列表
export function listManager(query) {
return request({
url: '/ai/manager/list',
method: 'get',
params: query
})
}
// 查询模型管理详细
export function getManager(id) {
return request({
url: '/ai/manager/' + id,
method: 'get'
})
}
// 新增模型管理
export function addManager(data) {
return request({
url: '/ai/manager/add',
method: 'post',
data: data
})
}
// 修改模型管理
export function updateManager(data) {
return request({
url: '/ai/manager/edit',
method: 'post',
data: data
})
}
// 删除模型管理
export function delManager(id) {
return request({
url: '/ai/manager/delete/' + id,
method: 'post'
})
}

View File

@ -125,7 +125,7 @@
<script>
import { list, del, setPublic } from '@/api/dataCenter/annotationTask'
import { list, setPublic } from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
@ -242,16 +242,6 @@ export default {
}
return 0 // 0%
},
handleDelete(row) {
const ids = row.datasetId || this.ids
this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId)

View File

@ -120,7 +120,7 @@
import { creation,del,setPublic} from '@/api/dataCenter/annotationTask'
import { creation,setPublic} from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
@ -235,15 +235,6 @@ export default {
}
return 0; // 0%
},
handleDelete(row){
const ids = row.datasetId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId)

View File

@ -120,7 +120,7 @@
import { participant,del,setPublic} from '@/api/dataCenter/annotationTask'
import { participant,setPublic} from '@/api/dataCenter/annotationTask'
import addTaskDialog from '../dialog/addTaskDialog'
import releaseVersionDialog from '../dialog/releaseVersionDialog.vue'
import { parseTime } from '@/utils/bonus'
@ -235,16 +235,6 @@ export default {
}
return 0; // 0%
},
handleDelete(row) {
const ids = row.datasetId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
return del(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.datasetId)

View File

@ -197,10 +197,7 @@ export default {
this.$message.error('文件大小不能超过 2GB');
return false; //
}
if ( file.size < 0) {
this.$message.error('文件大小错误');
return false; //
}
return true; //
},
//

View File

@ -0,0 +1,117 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="isOpen" width="500px" append-to-body @close="cancel"
:close-on-click-modal="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="groupName">
<el-input v-model="form.groupName" maxlength="20" placeholder="请输入名称"/>
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input v-model="form.description" type="textarea" maxlength="200"
show-word-limit placeholder="请输入内容"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getManager, addManager, updateManager } from '@/api/dataCenter/model'
export default {
props: {
open: {
type: Boolean,
default: false,
required: true
},
getList: {
type: Function,
required: true
},
title: {
type: String,
required: true
},
groupId: {
type: [Number, null],
default: 0 // 0
}
},
computed: {
isOpen: {
get() {
return this.open
},
set(value) {
this.$emit('dialog-cancel') //
}
}
},
data() {
return {
//
form: {},
//
rules: {
groupName: [
{ required: true, message: '名称不能为空', trigger: 'blur' }
]
}
}
},
watch: {
isOpen(newVal, oldVal) {
if (this.groupId && newVal) {
getGroups(this.groupId).then(response => {
this.form = response.data
})
}
}
},
methods: {
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.groupId != null) {
updateGroups(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.isOpen = false
this.getList()
})
} else {
addGroups(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.isOpen = false
this.getList()
})
}
}
})
},
//
cancel() {
this.isOpen = false
this.reset()
},
//
reset() {
this.form = {
groupName: null,
description: null
}
this.resetForm('form')
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -0,0 +1,239 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="模型名称" prop="modelName">
<el-input
v-model="queryParams.modelName"
placeholder="请输入模型名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="模型类型" prop="modelType">
<el-input
v-model="queryParams.modelType"
placeholder="请选择模型类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:manager:add']"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:manager:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:manager:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:manager:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="managerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="模型名称" align="center" prop="modelName"/>
<el-table-column label="版本号" align="center" prop="modelVersion"/>
<el-table-column label="模型类型" align="center" prop="modelType"/>
<el-table-column label="模型框架" align="center" prop="modelFrame"/>
<el-table-column label="模型上传path" align="center" prop="modelPath"/>
<el-table-column label="使用手册path" align="center" prop="modelManual"/>
<el-table-column label="备注" align="center" prop="remark"/>
<el-table-column label="是否删除" align="center" prop="isActive"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:manager:edit']"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:manager:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改模型管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="${comment}" prop="id">
<el-input v-model="form.id" placeholder="请输入${comment}"/>
</el-form-item>
<el-form-item label="模型名称" prop="modelName">
<el-input v-model="form.modelName" placeholder="请输入模型名称"/>
</el-form-item>
<el-form-item label="版本号" prop="modelVersion">
<el-input v-model="form.modelVersion" placeholder="请输入版本号"/>
</el-form-item>
<el-form-item label="模型框架" prop="modelFrame">
<el-input v-model="form.modelFrame" placeholder="请输入模型框架"/>
</el-form-item>
<el-form-item label="模型上传path" prop="modelPath">
<el-input v-model="form.modelPath" placeholder="请输入模型上传path"/>
</el-form-item>
<el-form-item label="使用手册path" prop="modelManual">
<el-input v-model="form.modelManual" placeholder="请输入使用手册path"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="是否删除" prop="isActive">
<el-input v-model="form.isActive" placeholder="请输入是否删除"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listManager, delManager } from '@/api/dataCenter/model'
export default {
name: 'Manager',
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
managerList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
modelName: null,
modelType: null
}
}
},
created() {
this.getList()
},
methods: {
/** 查询模型管理列表 */
getList() {
this.loading = true
listManager(this.queryParams).then(response => {
this.managerList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = '添加模型管理'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除模型管理编号为"' + ids + '"的数据项?').then(function() {
return delManager(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
}
}
}
</script>