人脸识别与大模型问答

This commit is contained in:
jiang 2024-10-16 09:21:58 +08:00
parent 6172b62e93
commit 6b78e995bb
13 changed files with 303 additions and 180 deletions

View File

@ -10,6 +10,13 @@ export function getCategories(data) {
})
}
export function getCategoriesById(categoryId) {
return request({
url: '/ai/dataSet/getCategories/'+categoryId,
method: 'post'
})
}
// 查询菜单详细
export function getCategoryById(categoryId) {
return request({
@ -51,6 +58,7 @@ export function uploadImgFiles(formData) {
url: '/ai/dataSet/uploadImgFiles',
method: 'post',
data: formData,
timeout: 600000,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
@ -63,6 +71,7 @@ export function uploadZipFiles(formData) {
url: '/ai/dataSet/uploadZipFiles',
method: 'post',
data: formData,
timeout: 600000, // 设置超时时间为 10 秒10000 毫秒)
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}

View File

@ -88,15 +88,73 @@
padding: 10px 20px 0;
}
.el-table::before { //去除底部白线
height: 0;
}
.el-table {
background-color: transparent; //背景色设为透明
border-radius: 10px;//圆角边框
th.el-table__cell.is-leaf {//设置表头底部边框为绿色
border-bottom: 1px solid Rgb(128,255,255,60%);
}
th { //表头背景为蓝色渐变色文字颜色为白色不加粗
background: linear-gradient(180deg,rgba(1,84,120,1.00), #040b37 100%);
color: #ffffff;
font-weight: normal;
}
tr{//每一行背景色设为透明
background-color: transparent;
&:hover {//鼠标悬浮变色
td {
background-color:#1B4584 !important;
}
}
td {//每一行的每一列文字为白色底部边框为绿色
color: #fff;
border-bottom: 1px solid Rgb(128,255,255,60%);
}
td:first-child{//第一列的文字颜色为绿色
color: #ffffff;
}
}
.el-button--text{//按钮颜色为绿色
color:#0C70FA;
}
}
.el-table th.el-table__cell.is-leaf, .el-table td.el-table__cell {
border-bottom: 1px solid #1A3676;
}
.el-table td.el-table__cell.is-leaf:hover{
background-color: #0D1F4B !important;
}
.el-table {
tr {
background-color: #0D1F4B;
color: #ffffff;
}
td{
border-bottom: 1px solid #1A3676;
}
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #f8f8f9;
color: #515a6e;
background: linear-gradient(to bottom, #1A3676, #0D1F4B);
color: #ffffff;
height: 40px;
font-size: 13px;
}
}
.el-table__body-wrapper {

View File

@ -0,0 +1,18 @@
export default {
bind(el, binding) {
const debounce = (func, delay) => {
let timer;
return function (...args) {
clearTimeout(timer);
timer = setTimeout(() => func.apply(this, args), delay);
};
};
el.addEventListener('click', debounce(() => {
binding.value();
}, binding.arg || 300)); // 默认延迟300ms
},
unbind(el) {
el.removeEventListener('click', el._debounceClick);
},
};

View File

@ -15,6 +15,8 @@ import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download } from '@/utils/request'
import debounce from './directives/debounce';
import './assets/icons' // icon
import './permission' // permission control
@ -44,6 +46,7 @@ import LargeScreen from '@/components/LargeScreen'
//大屏头部
// 全局方法挂载
Vue.directive('debounce', debounce);
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime

View File

@ -20,7 +20,7 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list">
<el-table-column label="编号" prop="algorithmId" min-width="120" align="center"/>
<el-table-column label="编号" type="index" min-width="120" align="center"/>
<el-table-column label="算法名称" prop="modelName" min-width="120" align="center"/>
<el-table-column label="验证样本数" prop="validationSampleCount" min-width="120" align="center"/>
<el-table-column label="准确率" prop="correctCount" min-width="120" align="center">
@ -72,18 +72,19 @@
</el-select>
</el-form-item>
<el-form-item label="验证样本数" prop="validationSampleCount">
<el-input-number v-model="form.validationSampleCount" :min="1" label="验证样本数"></el-input-number>
<el-input-number :precision="0" @keydown.native="onKeydown" v-model="form.validationSampleCount" :min="1"
label="验证样本数"></el-input-number>
</el-form-item>
<el-form-item label="准确数" prop="correctCount" maxlength="20">
<el-input-number v-model="form.correctCount" :min="1"
<el-input-number v-model="form.correctCount" @keydown.native="onKeydown" :min="0" :precision="0"
:max="form.validationSampleCount-form.missedDetectionCount" label="准确数"></el-input-number>
</el-form-item>
<el-form-item label="漏检数" prop="missedDetectionCount" maxlength="20">
<el-input-number v-model="form.missedDetectionCount" :min="0"
<el-input-number :precision="0" @keydown.native="onKeydown" v-model="form.missedDetectionCount" :min="0"
:max="form.validationSampleCount-form.correctCount" label="漏检数"></el-input-number>
</el-form-item>
<el-form-item label="识别速度" prop="recognitionSpeed">
<el-select style="width: 100%" v-model="form.recognitionSpeed" placeholder="请选择模型类型">
<el-select style="width: 100%" v-model="form.recognitionSpeed" placeholder="请选择识别速度">
<el-option
v-for="dict in dict.type.recognition_speed"
:key="dict.value"
@ -94,7 +95,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" v-debounce:500="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -125,7 +126,11 @@ export default {
//
open: false,
//
form: {},
form: {
validationSampleCount:1,
correctCount:0,
missedDetectionCount:0,
},
queryParams: {
pageNum: 1,
pageSize: 10,
@ -133,7 +138,7 @@ export default {
},
rules: {
modelId: [
{required: true, message: "请选择模型不能为空", trigger: "blur"}
{required: true, message: "请选择模型", trigger: "blur"}
],
validationSampleCount: [
{required: true, message: "验证样本数不能为空", trigger: "blur"}
@ -155,6 +160,16 @@ export default {
this.getModelsList();
},
methods: {
onKeydown(event) {
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") {
event.preventDefault();
}
},
handleInput(e) {
e.replace(/^(0+)|[^\d]+/g, ''); //
console.log(e)
return e
},
parseTime,
getList() {
this.loading = true;
@ -195,6 +210,9 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
validationSampleCount:1,
correctCount:0,
missedDetectionCount:0,
status: "0"
};
this.resetForm("form");

View File

@ -59,7 +59,7 @@
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="categoryName" label="样本类别" align="center" :show-overflow-tooltip="true"
<el-table-column prop="categoryName" label="样本类别" :show-overflow-tooltip="true"
min-width="160"></el-table-column>
<el-table-column prop="enabled" align="center" label="是否启用" min-width="60">
<template slot-scope="scope">
@ -113,14 +113,13 @@
:normalizer="normalizer"
:show-count="true"
:searchable="false"
:disable-branch-nodes="true"
placeholder="选择上级菜单"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="样本类别" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入样本类别"/>
<el-input v-model="form.categoryName" placeholder="请输入样本类别" maxlength="20"/>
</el-form-item>
</el-col>
</el-row>
@ -157,7 +156,7 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" v-debounce:500="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -167,7 +166,14 @@
</template>
<script>
import {getCategories, updateCategory, insertCategory, deleteCategory, getCategoryById} from "@/api/dataSet/dataSet"
import {
getCategories,
updateCategory,
insertCategory,
deleteCategory,
getCategoryById,
getCategoriesById
} from "@/api/dataSet/dataSet"
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -288,13 +294,35 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
getCategoryById(row.categoryId).then(response => {
this.form = response.data;
});
getCategoriesById(row.categoryId).then(response => {
this.menuOptions = [];
const menu = {categoryId: 0, categoryName: '主类目', children: []};
menu.children = this.handleTree(response.data, "categoryId");
this.menuOptions.push(menu);
this.open = true;
this.title = "修改菜单";
});
},
removeNodeById(tree, id) {
console.log(tree)
return tree
.map(node => {
// null
if (node.id === id) {
return null;
}
//
if (node.children) {
node.children = this.removeNodeById(node.children, id);
}
return node; //
})
.filter(node => node !== null); // null
},
/** 提交按钮 */
submitForm: function () {
this.$refs["form"].validate(valid => {

View File

@ -1,137 +1,58 @@
<template>
<div class="body-container">
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-row>
<el-col :span="2" style="display: flex;align-items: center;flex-direction: row;justify-content: space-evenly;">
<div class="form-inline" style="width: 100px;height: 100px">
</div>
</el-col>
<el-col :span="12">
<el-row type="flex" style="height: 50px" align="middle">
<el-button type="primary" size="mini" @click="handleQuery">上传照片</el-button>
</el-row>
<el-row type="flex" style="height: 50px" align="middle">
<el-button size="mini" @click="resetQuery">全部</el-button>
<el-button type="primary" size="mini" @click="handleAdd">正样本</el-button>
<el-button type="primary" size="mini" @click="handleAdd">负样本</el-button>
</el-row>
</el-col>
<el-col :span="10">
<el-row type="flex" style="height: 50px" align="middle">
</el-row>
<el-row type="flex" style="height: 50px;font-weight: bold;" justify="end">
<span
style="color: #fff;font-size: 18px;display: flex;align-items: center;justify-content: center">正样本数</span>
<span
style="color: #fff;font-size: 20px;margin-right: 50px;display: flex;align-items: center;justify-content: center">1000</span>
<span
style="color: #fff;font-size: 18px;display: flex;align-items: center;justify-content: center">负样本数</span>
<span
style="color: #fff;font-size: 20px;margin-right: 50px;display: flex;align-items: center;justify-content: center">500</span>
</el-row>
</el-col>
</el-row>
</el-form>-->
<el-row type="flex" style="height: 50px;padding-top: 2%;padding-left: 2%" align="middle">
<el-col :span="5" style="text-align: left">
<el-checkbox v-model="checked" style="margin-right: 5%;color: #FFFFFF" @change="changItem">全选</el-checkbox>
<el-button size="mini" @click="handleUpdate()">移动文件</el-button>
<el-button type="primary" size="mini" @click="handleDelete()">删除文件</el-button>
<el-button type="primary" size="mini" @click="back()">返回</el-button>
</el-col>
<el-col :span="14" style="text-align: center">
<h2 style="color: #fff">{{ datasetName }}</h2>
</el-col>
<!-- <el-col :span="5" style="text-align: right">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">负样本</el-button>
</el-col>-->
</el-row>
<div class="body-container" style="overflow-y: auto;height: 85%;margin-top: 10px">
<grid-layout
:layout.sync="backLayout"
:col-num="5"
:row-height="200"
:is-draggable="false"
:is-resizable="false"
:is-mirrored="false"
:vertical-compact="true"
:use-css-transforms="true">
<grid-item v-for="item in backLayout"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i">
<div class="body-container" @mouseenter="item.showClose=true;"
@mouseleave="item.showClose=false"
:title="item.fileName">
<div style="width: 100%;height: 100%;border:2px solid #597DFC;border-radius: 5% 5% 0 0;">
<div class="top" style="height:80%">
<img :src="'https://largesrevice.oss-cn-beijing.aliyuncs.com/'+item.fileAddress"
style="width: 100%;height: 100%;position: absolute;left: 0; border-radius: 5% 5% 0 0;" alt=""/>
<el-checkbox v-model="item.checked"
style="margin-right: 5%;color: #FFFFFF;position: absolute;left: 1%;opacity: 1;padding: 2%;z-index: 99999"></el-checkbox>
<div v-show="item.showClose"
style="position: absolute;width: 100%;height: 100%;background-color: black;border-radius: 5% 5% 0 0;opacity: 0.6">
</div>
<div class="top-button" v-show="item.showClose"
style="position: absolute;left: 80%;opacity: 1;padding: 2%;z-index: 99999">
<el-button type="primary" icon="el-icon-share" circle title="移动"
@click="handleUpdate(item)"></el-button>
<el-button type="danger" icon="el-icon-delete" circle title="删除"
@click="handleDelete(item)"></el-button>
</div>
</div>
<div class="bottom" style="height: 20%">
<div class="top-span">
<div class="name">
<span class="value" style="width: 70%">{{ item.fileName }}</span>
</div>
</div>
</div>
</div>
</div>
</grid-item>
</grid-layout>
</div>
<pagination
:total="total"
:page-sizes="pageSizes"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
<div class="body-container" style="overflow-y: auto;height: 600px">
<div class="body-container">
<el-row type="flex" style="height: 50px;padding-top: 2%;padding-left: 2%" align="middle">
<el-col :span="5" style="text-align: left">
<el-checkbox v-model="checked" style="margin-right: 5%;color: #FFFFFF" @change="changItem">全选</el-checkbox>
<el-button size="mini" @click="handleUpdate()">移动文件</el-button>
<el-button type="primary" size="mini" @click="handleDelete">删除文件</el-button>
<el-button type="primary" size="mini" @click="back()">返回</el-button>
</el-col>
<el-col :span="14" style="text-align: center">
<h2 style="color: #fff">{{ datasetName }}</h2>
</el-col>
</el-row>
<div class="body-container" style="overflow-y: auto;height: 85%;margin-top: 10px">
<grid-layout
:layout.sync="dataSetLayout"
:col-num="6"
:row-height="300"
:layout.sync="backLayout"
:col-num="5"
:row-height="200"
:is-draggable="false"
:is-resizable="false"
:is-mirrored="false"
:vertical-compact="true"
:use-css-transforms="true">
<grid-item v-for="item in dataSetLayout"
<grid-item v-for="item in backLayout"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i">
<div class="body-container" :title="item.datasetName" @click="dataSetChecked(item)">
<div class="body-container" @mouseenter="item.showClose=true;"
@mouseleave="item.showClose=false"
:title="item.fileName">
<div style="width: 100%;height: 100%;border:2px solid #597DFC;border-radius: 5% 5% 0 0;">
<div class="top" style="height: 90%">
<el-checkbox v-model="item.datasetId === datasetId"
<div class="top" style="height:80%">
<img :src="'https://largesrevice.oss-cn-beijing.aliyuncs.com/'+item.fileAddress"
style="width: 100%;height: 100%;position: absolute;left: 0; border-radius: 5% 5% 0 0;" alt=""/>
<el-checkbox v-model="item.checked"
style="margin-right: 5%;color: #FFFFFF;position: absolute;left: 1%;opacity: 1;padding: 2%;z-index: 99999"></el-checkbox>
<div v-show="item.showClose"
style="position: absolute;width: 100%;height: 100%;background-color: black;border-radius: 5% 5% 0 0;opacity: 0.6">
</div>
<div class="top-button" v-show="item.showClose"
style="position: absolute;left: 80%;opacity: 1;padding: 2%;z-index: 99999">
<el-button type="primary" icon="el-icon-share" circle title="移动"
@click="handleUpdate(item)"></el-button>
<el-button type="danger" icon="el-icon-delete" circle title="删除"
@click="handleDelete(item)"></el-button>
</div>
</div>
<div class="bottom" style="height: 10%;padding: 2%">
<div class="bottom" style="height: 20%">
<div class="top-span">
<span class="value" style="width:100%;font-size: 10px">{{ item.datasetName }}</span>
<div class="name">
<span class="value" style="width: 70%">{{ item.fileName }}</span>
</div>
</div>
</div>
</div>
@ -140,18 +61,62 @@
</grid-layout>
</div>
<pagination
:total="totalDataSet"
:page-sizes="pageDataSetSizes"
:page.sync="queryDataSetParams.pageNum"
:limit.sync="queryDataSetParams.pageSize"
@pagination="getAllDatasets"
:total="total"
:page-sizes="pageSizes"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
<div class="body-container" style="overflow-y: auto;height: 600px">
<grid-layout
:layout.sync="dataSetLayout"
:col-num="6"
:row-height="300"
:is-draggable="false"
:is-resizable="false"
:is-mirrored="false"
:vertical-compact="true"
:use-css-transforms="true">
<grid-item v-for="item in dataSetLayout"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
:key="item.i">
<div class="body-container" :title="item.datasetName" @click="dataSetChecked(item)">
<div style="width: 100%;height: 100%;border:2px solid #597DFC;border-radius: 5% 5% 0 0;">
<div class="top" style="height: 90%">
<el-checkbox v-model="item.datasetId === datasetId"
style="margin-right: 5%;color: #FFFFFF;position: absolute;left: 1%;opacity: 1;padding: 2%;z-index: 99999"></el-checkbox>
</div>
<div class="bottom" style="height: 10%;padding: 2%">
<div class="top-span">
<span class="value" style="width:100%;font-size: 10px">{{ item.datasetName }}</span>
</div>
</div>
</div>
</div>
</grid-item>
</grid-layout>
</div>
<pagination
:total="totalDataSet"
:page-sizes="pageDataSetSizes"
:page.sync="queryDataSetParams.pageNum"
:limit.sync="queryDataSetParams.pageSize"
@pagination="getAllDatasets"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-debounce:500="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
@ -368,7 +333,9 @@ export default {
this.$modal.msgWarning("请选择数据");
return;
}
console.log(this.fileIds)
const fileIds = row.fileId || this.fileIds
this.$modal.confirm('是否确认删除数据项?').then(function () {
return deleteFile(fileIds);
}).then(() => {

View File

@ -1,10 +1,10 @@
<template>
<div class="body-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="true" @submit.native.prevent>
<el-form-item label="数据集名称" prop="datasetName">
<el-input
v-model="queryParams.datasetName"
placeholder="请输入类别名称"
placeholder="请输入数据集名称"
clearable
@keyup.enter.native="handleQuery"
/>
@ -12,7 +12,6 @@
<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-item style="float: right">
<el-button icon="el-icon-upload2" size="mini" @click="updateFile">上传文件</el-button>
@ -99,7 +98,7 @@
<!-- 添加或修改菜单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="680px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px" @submit.native.prevent>
<el-row>
<el-col :span="24">
<el-form-item label="数据集名称" prop="datasetName">
@ -136,7 +135,7 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" v-debounce:500="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -280,7 +279,7 @@
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFile"> </el-button>
<el-button type="primary" v-debounce:500="submitFile"> </el-button>
<el-button @click="cancelFile"> </el-button>
</div>
</el-dialog>
@ -506,8 +505,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.getList();
}
,
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
@ -582,7 +580,7 @@ export default {
this.$modal.msgWarning("请选择数据集");
return;
}
this.$modal.loading("数据上传中,请稍后。。。");
if (this.activeName === 'first') {
let formData = new FormData();
formData.append('datasetId', this.selectedDataset);
@ -590,6 +588,7 @@ export default {
this.$modal.msgWarning("请选择文件");
return;
}
this.$modal.loading("数据上传中,请稍后。。。");
Object.values(this.fileImgList).forEach((file) => {
formData.append('files', file.raw);
});
@ -597,7 +596,10 @@ export default {
this.$modal.closeLoading();
this.$modal.msgSuccess("上传成功");
this.openFile = false;
this.fileImgList = [];
this.getList();
}).catch(error =>{
this.$modal.closeLoading();
})
} else {
let formData = new FormData();
@ -606,6 +608,7 @@ export default {
this.$modal.msgWarning("请选择文件");
return;
}
this.$modal.loading("数据上传中,请稍后。。。");
Object.values(this.fileZipList).forEach((file) => {
formData.append('files', file.raw);
});
@ -613,7 +616,10 @@ export default {
this.$modal.closeLoading();
this.$modal.msgSuccess("上传成功");
this.openFile = false;
this.fileZipList = [];
this.getList();
}).catch(error =>{
this.$modal.closeLoading();
})
@ -621,7 +627,7 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.categoryName + '"的数据项?').then(function () {
this.$modal.confirm('是否确认删除名称为"' + row.datasetName + '"的数据项?').then(function () {
return deleteDataset(row.datasetId);
}).then(() => {
this.getList();
@ -633,7 +639,7 @@ export default {
}
;
</script>
<style lang="scss">
<style lang="scss" scoped>
/* 针对不支持 scrollbar-width 的浏览器 */
.body-container::-webkit-scrollbar {

View File

@ -28,14 +28,14 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list">
<el-table-column label="模型编号" prop="modelId" min-width="120" align="center"/>
<el-table-column label="编号" type="index" min-width="100" align="center"/>
<el-table-column label="模型名称" prop="modelName" min-width="120" align="center"/>
<el-table-column label="版本号" prop="modelVersion" min-width="120" align="center">
<template slot-scope="scope">
<span>v{{ scope.row.modelVersion }}</span>
</template>
</el-table-column>
<el-table-column label="模型类型" prop="modelType" min-width="120" align="center">
<el-table-column label="模型类型" prop="modelType" min-width="100" align="center">
<template slot-scope="scope">
<dict-tag :options="dict.type.model_type" :value="scope.row.modelType"/>
</template>
@ -44,24 +44,24 @@
<el-table-column label="推理语言" prop="inferLanguage" min-width="120" align="center"/>
<el-table-column label="算法选择" prop="algorithm" min-width="120" align="center"/>
<el-table-column label="模型格式" prop="modelFormat" min-width="120" align="center"/>
<el-table-column label="部署要求" prop="deployRequirement" min-width="120" align="center"/>
<el-table-column label="创建人" prop="createBy" min-width="120" align="center"/>
<el-table-column label="部署要求" prop="deployRequirement" min-width="100" align="center"/>
<el-table-column label="创建人" prop="createBy" min-width="100" align="center"/>
<el-table-column label="创建时间" prop="createTime" min-width="120" align="center">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="模型文件" min-width="120" align="center">
<el-table-column label="模型文件" min-width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text"
<el-button v-show="scope.row.modelAddress" size="mini" type="text"
@click="downloadFile('https://largesrevice.oss-cn-beijing.aliyuncs.com/'+scope.row.modelAddress,'')">
下载
</el-button>
</template>
</el-table-column>
<el-table-column label="使用手册" min-width="120" align="center">
<el-table-column label="使用手册" min-width="100" align="center">
<template slot-scope="scope">
<el-button size="mini" type="text"
<el-button v-show="scope.row.userGuide" size="mini" type="text"
@click="downloadFile('https://largesrevice.oss-cn-beijing.aliyuncs.com/'+scope.row.userGuide,'')">
下载
</el-button>
@ -123,7 +123,7 @@
<el-form-item label="部署要求" prop="deployRequirement">
<el-input v-model="form.deployRequirement" placeholder="请输入部署要求" maxlength="100"/>
</el-form-item>
<el-form-item label="模型文件" prop="deployRequirement">
<el-form-item label="模型文件" prop="fileModelList">
<el-col :span="22">
<el-upload v-show="fileModelList.length===0" style="width: 70%"
action="#"
@ -149,7 +149,7 @@
</span>
</el-col>
</el-form-item>
<el-form-item label="使用手册" prop="deployRequirement">
<el-form-item label="使用手册" prop="fileUserManualList">
<el-col :span="20">
<el-upload v-show="fileUserManualList.length===0"
action="#"
@ -175,7 +175,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" v-debounce:500="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -185,7 +185,7 @@
<script>
import {parseTime} from "@/utils/bonus";
import {getAllModels, getModelsById, insertModel, updateModel, deleteModel} from "@/api/dataSet/dataSetModel";
import {getAllDatasets} from "@/api/dataSet/dataSetFile";
import {getAllDatasets, getDatasets} from "@/api/dataSet/dataSetFile";
export default {
dicts: ['model_type'],
@ -202,8 +202,8 @@ export default {
open: false,
//
form: {},
fileModelList: [],
fileUserManualList: [],
fileUserManualList:[],
fileModelList:[],
queryParams: {
pageNum: 1,
pageSize: 10,
@ -239,7 +239,7 @@ export default {
{required: true, message: "模型类型不能为空", trigger: "blur"}
],
dataSetId: [
{required: true, message: "数据集不能为空", trigger: "blur"}
{required: true, message: "训练集不能为空", trigger: "blur"}
],
inferLanguage: [
{required: true, message: "推理语言不能为空", trigger: "blur"}
@ -250,9 +250,15 @@ export default {
modelFormat: [
{required: true, message: "模型格式不能为空", trigger: "blur"}
],
deployRequirement: [
{required: true, message: "部署要求不能为空", trigger: "blur"}
]
deployRequirement:[
{required: true, message: "请输入部署要求", trigger: "blur"}
]/*,
fileUserManual: [
{required: true, message: "请选择使用手册", trigger: "blur"}
],
fileModel: [
{required: true, message: "请选择使用手册", trigger: "blur"}
]*/
}
};
},
@ -299,9 +305,9 @@ export default {
});
},
getAllDatasets() {
getAllDatasets({}).then(response => {
getDatasets().then(response => {
this.options = []
response.rows.forEach(item => {
response.data.forEach(item => {
this.options.push({
label: item.datasetName,
value: item.datasetId
@ -333,6 +339,8 @@ export default {
noticeContent: undefined,
status: "0"
};
this.fileModelList=[];
this.fileUserManualList=[];
this.resetForm("form");
},
/** 新增按钮操作 */
@ -354,7 +362,6 @@ export default {
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
console.log(this.form)
let formData = new FormData();
for (let key in this.form) {
if (this.form.hasOwnProperty(key)) {
@ -367,17 +374,26 @@ export default {
Object.values(this.fileUserManualList).forEach((item) => {
formData.append("userGuideFile", item.raw)
})
this.$modal.loading("数据上传中,请稍后。。。");
if (this.form.modelId != undefined) {
updateModel(formData).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess("修改成功");
this.open = false;
this.reset();
this.getList();
}).catch(error =>{
this.$modal.closeLoading();
});
} else {
insertModel(formData).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
this.reset();
}).catch(error =>{
this.$modal.closeLoading();
});
}
}

View File

@ -195,7 +195,7 @@ export default {
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.modal-overlay {
z-index: 1000;
position: fixed;

View File

@ -36,7 +36,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
/* 隐藏滚动条 */
.content::-webkit-scrollbar {
display: none;

View File

@ -158,7 +158,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
@keyframes moveandflash {
0%, 100% {

View File

@ -207,7 +207,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" scoped>
#main {
width: 100%;
height: 100%;