update code

main
haha 2024-06-21 00:42:29 +08:00
parent 4671858232
commit 42961c717c
6 changed files with 399 additions and 7 deletions

View File

@ -141,6 +141,18 @@ class MenuAPI {
keepAlive: true,
alwaysShow: false,
},
},{
path: "compile",
component: "simulationEvaluation/compile",
name: "simulationEvaluationCompile",
meta: {
title: "编译部署",
icon: "user",
hidden: true,
roles: ["ADMIN", "GUEST"],
keepAlive: true,
alwaysShow: false,
},
},
{
path: "reason",

View File

@ -165,7 +165,7 @@ function handleDelete(row: { [key: string]: any }) {
}
const doShowModelDetail=(row:any)=>{
router.replace({path:"/modelMgr/modelDetail",query:{id:row.id}})
router.replace({path:"/modelMgr/modelDetail",query:{id:row.id,from:'model'}})
}
/**
* 打开弹窗

View File

@ -83,11 +83,16 @@
<script setup>
const router = useRouter();
const route =useRoute()
let url=ref("")
onMounted(()=>{
url.value="./onnx/onnx.html?url=/ai/siamRPN_192.onnx"
});
const doBack=()=>{
if(route.query.from=='simulation'){
router.replace({path:"/simulationEvaluation/index"})
return;
}
router.replace({path:"/modelMgr/index"})
}
</script>

View File

@ -44,7 +44,7 @@
<template #header>算子互联</template>
<div class="edit-content">
<div class="item" style="position: relative;">
<div class="line-arrow" style="position: absolute;left: 270px;width: 80px;border-bottom: solid 1px #409eff;top: 250px;">
<div class="line-arrow" style="position: absolute;left: 100%;margin-left:10px; width: 80px;border-bottom: solid 1px #409eff;top: 250px;">
<i-ep-arrow-right style="color:#409eff;position: absolute;right: -7px;top: -9px;"/>
</div>
<div class="div-title">

View File

@ -0,0 +1,178 @@
<template>
<div class="app-container simulation-compile">
<el-card>
<template #header>互联说明</template>
<el-form ref="uploadForm" :model="upForm" label-width="120">
<el-row>
<el-col :span="12">
<el-form-item label="模型名称">
<el-input disabled v-model="upForm.name" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="模型类型">
<el-input disabled v-model="upForm.type" placeholder="VIT" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="互联名称">
<el-input disabled v-model="upForm.netName" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="互联说明">
<el-input disabled v-model="upForm.desc" type="textarea" style="width:100%;" :rows="4"
placeholder="" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card style="margin-top:12px">
<template #header>硬件设备列表</template>
<el-table v-loading="loading" :data="tableData" stripe height="300">
<el-table-column type="selection" width="55" />
<el-table-column label="设备名称" align="left" prop="name" />
<el-table-column label="已部署模型名称" align="left" prop="modelName" />
<el-table-column label="已部署模型类型" align="left" prop="modelType" />
<el-table-column label="部署时间" align="left" prop="time" />
<el-table-column label="设备状态" align="left" prop="devState">
<template #default="scope">{{ scope.row.devState == 0 ? '空闲' : '推理中' }}</template>
</el-table-column>
<el-table-column label="量化和编译参数" align="left" prop="parm" width="280">
<template #default="scope">
<el-upload v-model:file-list="fileList" class="upload-demo" :limit="1">
<el-button>
<i-ep-upload-filled />
上传文件</el-button>
<el-button text type="primary" size="small" v-if="scope.row.parm"></el-button>
<span style="color: #ccc;font-size:12px;white-space: nowrap;margin-left:8px;"
v-else>无参数,请上传参数文件</span>
</el-upload>
</template>
</el-table-column>
<el-table-column label="编译部署结果" align="left" prop="state">
<template #default="scope">
<el-button type="success" link size="small" v-if="scope.row.state == 1"></el-button>
<el-button type="danger" link size="small" v-else-if="scope.row.state == 2">部署失败</el-button>
<span v-else></span>
</template>
</el-table-column>
</el-table>
</el-card>
<div style="font-size:12px;font-weight: bold;margin-top:12px;padding-left: 8px;">编译部署日志</div>
<el-card style="margin-top:0px;margin-bottom: 60px;">
<div v-for="(it, idx) in logList" :key="idx" class="log-item">
<span>{{ it.date }}</span>
<span>{{ it.log }}</span>
</div>
</el-card>
<el-card class="card-footer">
<el-button type="primary" @click="doCompile"></el-button>
<el-button type="primary" @click="doToReason"></el-button>
<el-button @click="doCancel"></el-button>
</el-card>
</div>
</template>
<script setup>
const router = useRouter();
const uploadForm = ref(ElForm)
const upForm = reactive({
name: '目标分类模型',
type: "VIT",
netName: "互联名称",
desc: "互联说明互联说明互联说明互联说明互联说明互联说明互联说明互联说明互联说明互联说明"
})
const doCompile = () => {
}
const doToReason = () => {
}
const doCancel = () => {
router.replace({ path: "/simulationEvaluation/index" })
}
const tableData = [
{
id: "1",
name: "设备名称设备名称设备名称",
modelName: "进行人员检测的模型",
modelType: "Mobile-Vit",
time: "2024-02-02 18:00:00",
devState: 0,
parm: 'aa.json',
state: '1'
},
{
id: "2",
name: "设备名称设备名称设备名称",
modelName: "进行人员检测的模型",
modelType: "Mobile-Vit",
time: "2024-02-02 18:00:00",
devState: 0,
parm: '',
state: '0'
},
{
id: "3",
name: "设备名称设备名称设备名称",
modelName: "进行人员检测的模型",
modelType: "Mobile-Vit",
time: "2024-02-02 18:00:00",
devState: 0,
parm: 'bb.json',
state: '2'
},
{
id: "3",
name: "设备名称设备名称设备名称",
modelName: "进行人员检测的模型",
modelType: "Mobile-Vit",
time: "2024-02-02 18:00:00",
devState: 1,
parm: 'cc.json',
state: '1'
},
];
const logList = reactive([{
date: '2024-05-06 18:34:36', log: '系统已启动编译'
}, { date: '2024-05-06 18:34:36', log: '系统正在分割目标文件' },
{ date: '2024-05-06 18:34:36', log: '运行时异常,系统编译已终止' }])
</script>
<style scoped lang='scss'>
.simulation-compile {
:deep(.el-card__header) {
padding: 8px 12px;
display: flex;
align-items: center;
font-weight: bold;
}
.card-footer {
position: fixed;
width: calc(100% - 215px);
bottom: 0px;
:deep(.el-card__body) {
padding: 10px;
.el-pagination {
justify-content: end;
}
}
}
.log-item{
font-size: 12px;
color:#666;
}
}
</style>

View File

@ -1,11 +1,208 @@
<!-- 用户管理 -->
<template>
<div>
33333
<div class="app-container">
<div class="search-container">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" style="flex-grow: 1;text-align: right;">
<el-form-item label="" prop="keywords">
<el-input v-model="queryParams.keywords" placeholder="请输入模型名称" clearable style="width: 250px"
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
<el-button @click="resetQuery">
<i-ep-refresh />
重置</el-button>
</el-form-item>
</el-form>
</div>
<el-card shadow="never" class="table-container">
<el-table v-loading="loading" :data="tableData" stripe @selection-change="handleSelectionChange">
<el-table-column label="模型名称" align="left" prop="name" />
<el-table-column label="网络名称" align="left" prop="netName" width="120"/>
<el-table-column label="模型类型" align="left" prop="modelType" />
<el-table-column label="版本" align="left" prop="ver" />
<el-table-column label="互联名称" align="left" prop="netName" width="120"/>
<el-table-column label="互联说明" align="left" prop="desc" />
<el-table-column label="互联创建时间" width="120" align="left" prop="upTime" />
<el-table-column label="创建用户" width="100" align="left" prop="upUser" />
<el-table-column label="操作" fixed="right" align="center" width="270">
<template #default="scope">
<el-button text type="primary" size="small"
@click="doShowDetail(scope.row)"><i-ep-edit />查看模型</el-button>
<el-button text type="primary" size="small"
@click="doEdit('user-form', scope.row.id)"><i-ep-link/>编译部署</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="card-footer">
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
</el-card>
</div>
</template>
<script setup>
<script setup lang="ts">
import { UserQuery } from "@/api/user/model";
const queryFormRef = ref(ElForm); //
const router = useRouter();
const loading = ref(false); //
const removeIds = ref([]); // ID
const queryParams = reactive<UserQuery>({
pageNum: 1,
pageSize: 10,
});
const dateTimeRange = ref("");
const total = ref(100); //
watch(dateTimeRange, (newVal) => {
if (newVal) {
queryParams.startTime = newVal[0];
queryParams.endTime = newVal[1];
}
});
const tableData = [
{
id:"1",
name: "模型名称模型名称模型名称查看",
netName: "VIT",
modelType: "图像分类",
ver: "1.0",
netName:'我的互联名称',
desc:'进行10种类型 的目标分类模型查看',
upTime: "2024-02-02",
upUser:'USER',
state:'1'
},
{
id:"2",
name: "模型名称模型名称模型名称查看",
netName: "Mobile-VIT",
modelType: "图像分类",
ver: "1.0",
netName:'我的互联名称',
desc:'进行10种类型 的目标分类模型查看',
upTime: "2024-02-02",
upUser:'USER' ,
state:'1'
},
{
id:"3",
name: "模型名称模型名称模型名称查看",
netName: "VIT",
modelType: "图像分类",
ver: "1.0",
netName:'我的互联名称',
desc:'进行人员检测的模型',
upTime: "2024-02-02",
upUser:'USER' ,
state:'1'
},
{
id:"4",
name: "模型名称模型名称模型名称查看",
netName: "Mobile-VIT",
modelType: "图像分类",
ver: "1.0",
netName:'我的互联名称',
desc:'进行10种类型 的目标分类模型查看',
upTime: "2024-02-02",
upUser:'USER' ,
state:'0'
},
{
id:"5",
name: "模型名称模型名称模型名称查看",
netName: "VIT",
modelType: "图像分类",
ver: "1.0",
netName:'我的互联名称',
desc:'进行人员检测的模型',
upTime: "2024-02-02",
upUser:'USER' ,
state:'0'
}
];
/** 查询 */
function handleQuery() {
loading.value = true;
ElMessage.success("查询成功");
loading.value = false;
}
function doUploadModel(){
router.replace({ path: "/modelMgr/uploadModel" });
}
/** 重置查询 */
function resetQuery() {
queryFormRef.value.resetFields();
dateTimeRange.value = "";
queryParams.pageNum = 1;
queryParams.deptId = undefined;
queryParams.startTime = undefined;
queryParams.endTime = undefined;
handleQuery();
}
/** 行选中 */
function handleSelectionChange(selection: any) {
removeIds.value = selection.map((item: any) => item.id);
}
/** 删除数据 */
function handleDelete(row: { [key: string]: any }) {
ElMessageBox.confirm("确认删除算子?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(function () {
ElMessage.success("删除成功");
});
}
const doShowDetail=(row:any)=>{
router.replace({path:"/modelMgr/modelDetail",query:{id:row.id,from:'simulation'}})
}
const doEdit=(row:any)=>{
router.replace({path:"/simulationEvaluation/compile",query:{id:row.id,type:'edit'}})
}
const doAdd=(row:any)=>{
router.replace({path:"/protocol/edit",query:{id:row.id,type:'add'}})
}
onMounted(() => {
//handleQuery();
});
</script>
<style scoped lang='less'>
</style>
<style scoped lang='scss'>
.search-container{
display:flex;
}
.card-footer{
position: fixed;
width: calc(100% - 215px);
bottom: 0px;
:deep(.el-card__body){
padding:0px;
.el-pagination{
justify-content: end;
}
}
}
</style>