AIManage/src/views/simulationEvaluation/addStep3.vue

134 lines
4.2 KiB
Vue
Raw Normal View History

2024-06-26 00:20:39 +08:00
<template>
<el-card style="margin-top:12px" class="simulation-add-add-step31">
2024-06-26 23:58:18 +08:00
<template #header>已选择模型</template>
2024-06-26 00:20:39 +08:00
<el-row class="model-info">
<el-col :span="8">
<span>模型名称:</span>
2024-07-17 00:30:15 +08:00
<span>{{ modelInfo.model_name }}</span>
2024-06-26 00:20:39 +08:00
</el-col>
<el-col :span="8">
<span>模型类型:</span>
2024-07-17 00:30:15 +08:00
<span>{{ modelInfo.modl_main_type_name+"/"+modelInfo.modl_sub_type_name }}</span>
2024-06-26 00:20:39 +08:00
</el-col>
<el-col :span="8">
<span>互联名称:</span>
2024-07-17 00:30:15 +08:00
<span>{{ modelInfo.connection_name }}</span>
2024-06-26 00:20:39 +08:00
</el-col>
</el-row>
</el-card>
<el-card style="margin-top:12px;position: relative;" class="simulation-add-add-step32">
2024-06-26 23:58:18 +08:00
<template #header>
2024-06-26 00:20:39 +08:00
<span>设备选择</span>
2024-07-17 00:30:15 +08:00
<el-form ref="queryFormRef" :inline="true"
style="flex-grow: 1;text-align: right;position: absolute;top:4px;right:0px;">
2024-06-26 23:58:18 +08:00
<el-form-item>
2024-07-17 00:30:15 +08:00
<el-button type="primary" @click="handleQuery"><i-ep-refresh />刷新</el-button>
2024-06-26 23:58:18 +08:00
</el-form-item>
</el-form>
</template>
2024-07-17 00:30:15 +08:00
<el-table v-loading="loading" ref="dataTb" :data="info.tableData" stripe @row-click="doRowClick">
2024-06-26 23:58:18 +08:00
<el-table-column type="selection" width="55" />
2024-07-17 00:30:15 +08:00
<el-table-column label="设备名称" align="left" prop="device_name" />
<el-table-column label="AI芯片信息" align="left" prop="hardware_chip" />
<el-table-column label="已部署模型名称" align="left" prop="deployed_model_name" width="120" />
2024-06-26 00:20:39 +08:00
2024-07-17 00:30:15 +08:00
<el-table-column label="已部署模型网络类型" align="left" prop="deployed_model_net_type" />
<el-table-column label="互联名称" align="left" prop="connection_name" width="120" />
<el-table-column label="部署时间" align="left" prop="deployed_time" width="160" />
<el-table-column label="量化和编译参数" align="left" prop="tool_params_name" width="160">
2024-06-26 23:58:18 +08:00
<template #default="scope">
2024-07-17 00:30:15 +08:00
<span class="args-state state-2">{{ scope.row.tool_params_name ? scope.row.tool_params_name : '请选择'
2024-06-26 23:58:18 +08:00
}}</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" width="100">
<template #default="scope">
2024-07-17 00:30:15 +08:00
<span :class="'device-state state-'">{{
scope.row.available? '可用' : '不可用' }}</span>
2024-06-26 00:20:39 +08:00
</template>
</el-table-column>
</el-table>
</el-card>
<div style="margin-top:12px;font-size:12px;font-weight: bold;margin-left:8px;">编译结果</div>
<el-card style="" class="simulation-add-add-step33">
2024-07-17 00:30:15 +08:00
2024-06-26 00:20:39 +08:00
</el-card>
</template>
<script setup>
2024-07-17 00:30:15 +08:00
import taskApi from '@/api/task'
2024-06-26 23:58:18 +08:00
let dataTb = ref()
2024-07-17 00:30:15 +08:00
const loading = ref(false); // 加载状态
2024-06-26 23:58:18 +08:00
const doRowClick = (row) => {
dataTb.value.toggleRowSelection(row)
2024-06-26 00:20:39 +08:00
}
2024-07-17 00:30:15 +08:00
const info=reactive({
tableData:[]
})
2024-06-26 00:20:39 +08:00
const props = defineProps({
modelInfo: {
type: Object,
require: true,
default: null
2024-06-26 23:58:18 +08:00
}
2024-06-26 00:20:39 +08:00
})
/** 查询 */
2024-07-17 00:30:15 +08:00
function handleQuery() {
loading.value = true;
let m=props.modelInfo;
taskApi.availableDevices({
connection_id:m.connection_id,
model_id:m.model_id
}).then(d=>{
loading.value=false;
info.tableData=(d.data.data.available_device_list||[]).map(it=>{
it.id=it.device_id;
return it;
});
});
2024-06-26 00:20:39 +08:00
}
2024-06-26 23:58:18 +08:00
const checkForm = () => {
2024-07-17 00:30:15 +08:00
let rows = info.dataTb.getSelectionRows();
2024-06-26 23:58:18 +08:00
return rows.length == 0 ? null : rows;
};
2024-07-17 00:30:15 +08:00
onMounted(()=>{
handleQuery();
});
2024-06-26 23:58:18 +08:00
defineExpose({
checkForm
})
2024-06-26 00:20:39 +08:00
</script>
2024-06-26 23:58:18 +08:00
<style lang="scss" scoped>
.model-info {
2024-06-26 00:20:39 +08:00
font-size: 12px;
2024-06-26 23:58:18 +08:00
color: #666;
}
</style>
<style lang='scss'>
.simulation-add-add-step32 {
.device-state {
&.state-1 {
color: var(--el-color-primary);
}
&.state-2 {
color:var(--el-color-success);
}
}
.args-state{
&.state-2{
color: var(--el-color-primary);
}
}
.result-state{
color:var(--el-color-danger);
}
2024-06-26 00:20:39 +08:00
}
</style>