update code

main
haha 2024-08-20 20:39:44 +08:00
parent 86faa6878b
commit f43647068d
5 changed files with 633 additions and 550 deletions

View File

@ -13,6 +13,13 @@ const userOperationNotice=()=>{
}); });
} }
const userRunning=()=>{
return request({
url:`/logs/user_operation/running`,
method:"get"
})
}
//获取用户操作详情 //获取用户操作详情
const userOperation=(operation_id)=>{ const userOperation=(operation_id)=>{
return request({ return request({
@ -33,6 +40,7 @@ export default {
serverState, serverState,
userOperationNotice, userOperationNotice,
userOperation, userOperation,
compileDeploy compileDeploy,
userRunning
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="model-flow"> <div class="model-flow">{{ info }}
<el-row class="row-1"> <el-row class="row-1">
<div class="card-item"> <div class="card-item">
<div class="title-text">算法上传</div> <div class="title-text">算法上传</div>
@ -11,9 +11,9 @@
</div> </div>
<div class="line line-right"> <div class="line line-right">
</div> </div>
<div class="card-item is-active" > <div class="card-item ">
<div class="title-text">算子检查</div> <div class="title-text">算子互联</div>
<el-badge :value="10" class="item"> <el-badge :value="0" class="item">
<div class="div-img"> <div class="div-img">
<img class="img-150" src="./flow/suanzijiancha.png" /> <img class="img-150" src="./flow/suanzijiancha.png" />
@ -24,20 +24,19 @@
<div class="line line-right"> <div class="line line-right">
</div> </div>
<div class="card-item" > <div class="card-item" :class="info.cnt1 > 0 ? 'is-active' : ''">
<div class="title-text">编译部署</div> <div class="title-text">编译部署</div>
<el-badge :value="0" class="item"> <el-badge :value="info.cnt1" class="item">
<div class="div-img"> <div class="div-img">
<img class="img-150" src="./flow/bybs.png" /> <img class="img-150" src="./flow/bybs.png" />
</div> </div>
</el-badge> </el-badge>
</div> </div>
<div class="line line-right"> <div class="line line-right">
</div> </div>
<div class="card-item"> <div class="card-item" :class="info.cnt2 > 0 ? 'is-active' : ''">
<div class="title-text">推理评估</div> <div class="title-text">推理评估</div>
<el-badge :value="0" class="item"> <el-badge :value="info.cnt2" class="item">
<div class="div-img"> <div class="div-img">
<img class="img-150" src="./flow/tlpg.png" /> <img class="img-150" src="./flow/tlpg.png" />
</div> </div>
@ -47,9 +46,9 @@
<div class="line line-right"> <div class="line line-right">
</div> </div>
<div class="card-item"> <div class="card-item" :class="info.cnt3 > 0 ? 'is-active' : ''">
<div class="title-text">评估报告</div> <div class="title-text">评估报告</div>
<el-badge :value="0" class="item"> <el-badge :value="info.cnt3" class="item">
<div class="div-img"> <div class="div-img">
<img class="img-150" src="./flow/pgbg.png" /> <img class="img-150" src="./flow/pgbg.png" />
</div> </div>
@ -110,6 +109,27 @@
</template> </template>
<script lang='ts' setup> <script lang='ts' setup>
import LogApi from '@/api/log'
let info = reactive({
cnt1: 0,
cnt2: 0,
cnt3: 0
})
const loadData = () => {
LogApi.userRunning().then(d => {
let tmps = d.data?.data?.running_operation_list || [];
const findCnt = t => {
let objs = tmps.filter(it => it.logs_operation_type == t);
return objs.length > 0 ? objs[0].operation_count : 0;
}
info.cnt1 = findCnt("model_compile");
info.cnt2 = findCnt("model_infer");
info.cnt3 = findCnt("model_report");
});
}
onMounted(() => {
loadData();
});
</script> </script>
<style lang='scss'> <style lang='scss'>
@media screen and (max-width:1440px) { @media screen and (max-width:1440px) {
@ -117,19 +137,23 @@
padding-left: 10px; padding-left: 10px;
} }
} }
@media screen and (min-width:1440px) { @media screen and (min-width:1440px) {
.model-flow { .model-flow {
padding-left: 60px; padding-left: 60px;
} }
} }
.model-flow { .model-flow {
.row-1 { .row-1 {
.title-text { .title-text {
margin-bottom: 10px; margin-bottom: 10px;
} }
.line { .line {
position: relative; position: relative;
width: calc(20% - 120px); width: calc(20% - 120px);
&::before { &::before {
display: inline-block; display: inline-block;
height: 1px; height: 1px;
@ -140,6 +164,7 @@
top: 40%; top: 40%;
left: 10px; left: 10px;
} }
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -155,28 +180,35 @@
.row-3 { .row-3 {
margin-top: 60px; margin-top: 60px;
.line { .line {
position: relative; position: relative;
width: calc(20% - 120px); width: calc(20% - 120px);
text-align: center; text-align: center;
img { img {
position: relative; position: relative;
top: 30px; top: 30px;
} }
} }
.title-text { .title-text {
margin-top: 10px; margin-top: 10px;
} }
.card-center { .card-center {
position: relative; position: relative;
width: 120px; width: 120px;
.card-center-item { .card-center-item {
position: absolute; position: absolute;
width: 120px; width: 120px;
top: 24px; top: 24px;
z-index: 9; z-index: 9;
&:first-child { &:first-child {
left: -90px; left: -90px;
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -187,6 +219,7 @@
top: -175px; top: -175px;
left: 60px; left: 60px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -198,8 +231,10 @@
left: 60px; left: 60px;
} }
} }
&:last-child { &:last-child {
left: 90px; left: 90px;
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -210,6 +245,7 @@
top: -175px; top: -175px;
left: -10px; left: -10px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -223,6 +259,7 @@
} }
} }
} }
.card-item { .card-item {
&.line-top { &.line-top {
&::after { &::after {
@ -234,6 +271,7 @@
top: -170px; top: -170px;
left: 60px; left: 60px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -251,43 +289,53 @@
.card-item { .card-item {
width: 120px; width: 120px;
.el-badge__content { .el-badge__content {
display: none; display: none;
} }
&.is-active { &.is-active {
.div-img { .div-img {
background: #3399ff; background: #3399ff;
box-shadow: var(--el-box-shadow-light); box-shadow: var(--el-box-shadow-light);
&:hover { &:hover {
background: #3399ff88; background: #3399ff88;
} }
} }
.el-badge__content { .el-badge__content {
display: inline-block; display: inline-block;
} }
} }
.title-text { .title-text {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;
} }
.el-badge { .el-badge {
width: auto; width: auto;
display: block; display: block;
} }
.div-img { .div-img {
background: #fff; background: #fff;
text-align: center; text-align: center;
padding: 10px 0px 0px; padding: 10px 0px 0px;
border-radius: 8px; border-radius: 8px;
&:hover { &:hover {
box-shadow: var(--el-box-shadow-light); box-shadow: var(--el-box-shadow-light);
} }
img { img {
&.img-150 { &.img-150 {
width: 80px; width: 80px;
height: 44px; height: 44px;
} }
&.img-120 { &.img-120 {
width: 80px; width: 80px;
height: 55px; height: 55px;

View File

@ -12,8 +12,8 @@
<div class="line line-right"> <div class="line line-right">
</div> </div>
<div class="card-item is-active"> <div class="card-item is-active">
<div class="title-text">算子检查</div> <div class="title-text">算子互联</div>
<el-badge :value="10" class="item"> <el-badge :value="0" class="item">
<div class="div-img"> <div class="div-img">
<img class="img-150" src="./flow/suanzijiancha.png" /> <img class="img-150" src="./flow/suanzijiancha.png" />
@ -117,19 +117,23 @@
padding-left: 10px; padding-left: 10px;
} }
} }
@media screen and (min-width:1440px) { @media screen and (min-width:1440px) {
.model-flow { .model-flow {
padding-left: 60px; padding-left: 60px;
} }
} }
.model-flow { .model-flow {
.row-1 { .row-1 {
.title-text { .title-text {
margin-bottom: 10px; margin-bottom: 10px;
} }
.line { .line {
position: relative; position: relative;
width: calc(20% - 120px); width: calc(20% - 120px);
&::before { &::before {
display: inline-block; display: inline-block;
height: 1px; height: 1px;
@ -140,6 +144,7 @@
top: 40%; top: 40%;
left: 10px; left: 10px;
} }
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -155,28 +160,35 @@
.row-3 { .row-3 {
margin-top: 60px; margin-top: 60px;
.line { .line {
position: relative; position: relative;
width: calc(20% - 120px); width: calc(20% - 120px);
text-align: center; text-align: center;
img { img {
position: relative; position: relative;
top: 30px; top: 30px;
} }
} }
.title-text { .title-text {
margin-top: 10px; margin-top: 10px;
} }
.card-center { .card-center {
position: relative; position: relative;
width: 120px; width: 120px;
.card-center-item { .card-center-item {
position: absolute; position: absolute;
width: 120px; width: 120px;
top: 24px; top: 24px;
z-index: 9; z-index: 9;
&:first-child { &:first-child {
left: -90px; left: -90px;
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -187,6 +199,7 @@
top: -175px; top: -175px;
left: 60px; left: 60px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -198,8 +211,10 @@
left: 60px; left: 60px;
} }
} }
&:last-child { &:last-child {
left: 90px; left: 90px;
&::after { &::after {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -210,6 +225,7 @@
top: -175px; top: -175px;
left: -10px; left: -10px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -223,6 +239,7 @@
} }
} }
} }
.card-item { .card-item {
&.line-top { &.line-top {
&::after { &::after {
@ -234,6 +251,7 @@
top: -170px; top: -170px;
left: 60px; left: 60px;
} }
&::before { &::before {
display: inline-block; display: inline-block;
content: " "; content: " ";
@ -251,43 +269,53 @@
.card-item { .card-item {
width: 120px; width: 120px;
.el-badge__content { .el-badge__content {
display: none; display: none;
} }
&.is-active { &.is-active {
.div-img { .div-img {
background: #3399ff; background: #3399ff;
box-shadow: var(--el-box-shadow-light); box-shadow: var(--el-box-shadow-light);
&:hover { &:hover {
background: #3399ff88; background: #3399ff88;
} }
} }
.el-badge__content { .el-badge__content {
display: inline-block; display: inline-block;
} }
} }
.title-text { .title-text {
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;
} }
.el-badge { .el-badge {
width: auto; width: auto;
display: block; display: block;
} }
.div-img { .div-img {
background: #fff; background: #fff;
text-align: center; text-align: center;
padding: 10px 0px 0px; padding: 10px 0px 0px;
border-radius: 8px; border-radius: 8px;
&:hover { &:hover {
box-shadow: var(--el-box-shadow-light); box-shadow: var(--el-box-shadow-light);
} }
img { img {
&.img-150 { &.img-150 {
width: 80px; width: 80px;
height: 44px; height: 44px;
} }
&.img-120 { &.img-120 {
width: 80px; width: 80px;
height: 55px; height: 55px;

View File

@ -278,9 +278,9 @@ function uploadFile(file) {
// //
function handleFileChange(file, b) { function handleFileChange(file, b) {
if (file.file.size > 10 * 1024 * 1024) { if (file.file.size > 500 * 1024 * 1024) {
ElMessage.warning("文件大小不能超10M"); ElMessage.warning("文件大小不能超500M");
file.onError("文件大小不能超10M") file.onError("文件大小不能超500M")
return; return;
} }
let ext = file.file.name.split(".").pop().toLowerCase(); let ext = file.file.name.split(".").pop().toLowerCase();

View File

@ -47,8 +47,7 @@
<el-table-column label="量化和编译参数" align="left" prop="tool_params_name" width="160"> <el-table-column label="量化和编译参数" align="left" prop="tool_params_name" width="160">
<template #default="scope"> <template #default="scope">
<span class="args-state state-2 command" @click.stop="doChoice(scope.row)" v-if="scope.row.available">{{ <span class="args-state state-2 command" @click.stop="doChoice(scope.row)" v-if="scope.row.available">{{
scope.row.tool_params_name ? scope.row.tool_params_name : "请选择" scope.row.tool_params_name ? scope.row.tool_params_name : "请选择" }}</span>
}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备状态" align="center" width="100"> <el-table-column label="设备状态" align="center" width="100">