AIManage/src/views/simulationEvaluation/components/addStep5.vue

99 lines
3.1 KiB
Vue
Raw Normal View History

2024-06-26 00:20:39 +08:00
<template>
2024-07-20 00:34:54 +08:00
<el-card style="margin-top:12px;position: relative;" class="simulation-add-add-step4">
<template #header>
<span>数据集列表</span>
<el-form ref="queryFormRef" :model="queryParams" :inline="true"
style="flex-grow: 1;text-align: right;position: absolute;top:4px;right:0px;">
<el-form-item label="" prop="dataset_name">
<el-input v-model="queryParams.dataset_name" placeholder="请输入数据集名称" clearable style="width: 250px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery"><i-ep-search />搜索</el-button>
</el-form-item>
</el-form>
</template>
<el-table v-loading="loading" :data="info.tableData" stripe @row-click="doRowClick">
<el-table-column align="center" width="55" label="选择">
<template #default="scope">
<el-radio v-model="datasSelection" :label="scope.row.dataset_id + ''"
@change="handleChange(scope.row)">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column label="数据集名称" align="left" prop="dataset_name" />
<el-table-column label="版本" align="left" prop="dataset_version" width="80" />
<el-table-column label="数据集说明" align="left" prop="dataset_desc" show-overflow-tooltip />
2024-06-26 23:58:18 +08:00
2024-07-20 00:34:54 +08:00
<el-table-column label="适用任务类型" align="left" prop="modl_sub_type" />
<el-table-column label="图片数量" align="left" prop="frame_count" width="120" />
<el-table-column label="数据集格式" width="120" align="left" prop="dats_dataset_format" />
<el-table-column label="创建时间" align="left" prop="createTime" />
2024-06-26 23:58:18 +08:00
2024-07-20 00:34:54 +08:00
</el-table>
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
</el-card>
2024-06-26 00:20:39 +08:00
</template>
<script setup>
2024-07-20 00:34:54 +08:00
import dataSetApi from '@/api/dataSet'
2024-06-26 23:58:18 +08:00
const datasSelection = ref("")//单选id
2024-07-20 00:34:54 +08:00
const loading = ref(false)
const queryFormRef = ref()
2024-09-27 23:35:14 +08:00
const emit = defineEmits(["change"]);
2024-06-26 23:58:18 +08:00
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
2024-07-20 00:34:54 +08:00
dataset_name: ''
2024-06-26 23:58:18 +08:00
});
2024-07-20 00:34:54 +08:00
const info = reactive({
tableData: []
})
let total = ref(100)
2024-06-26 23:58:18 +08:00
/** 查询 */
function handleQuery(a) {
2024-07-20 00:34:54 +08:00
if (a) {
queryParams.pageSize = a.limit;
queryParams.pageNum = a.page;
}
loading.value = true;
dataSetApi.list(queryParams).then(d => {
loading.value = false;
total.value = d.data?.data?.total || 0;
info.tableData = d.data?.data?.raw_dataset_list || [];
});
2024-06-26 23:58:18 +08:00
}
const handleChange = (row) => {
2024-07-20 00:34:54 +08:00
datasSelection.value = row.dataset_id + "";
2024-09-27 23:35:14 +08:00
emit("change")
2024-06-26 23:58:18 +08:00
}
2024-07-20 00:34:54 +08:00
const doRowClick = (row, col, sel) => {
datasSelection.value = row.dataset_id + "";
2024-09-27 23:35:14 +08:00
emit("change")
2024-06-26 23:58:18 +08:00
}
2024-07-20 00:34:54 +08:00
const checkForm = () => {
if (datasSelection.value) {
let tmps = info.tableData.filter(d => d.dataset_id == datasSelection.value);
return tmps.length > 0 ? tmps[0] : null;
}
return null;
2024-06-26 23:58:18 +08:00
};
2024-09-27 23:35:14 +08:00
const returnData = (d) => {
if(d){
datasSelection.value=""+d.dataset_id
}
}
2024-07-20 00:34:54 +08:00
onMounted(() => {
handleQuery();
});
2024-06-26 23:58:18 +08:00
defineExpose({
2024-09-27 23:35:14 +08:00
checkForm,
returnData
2024-06-26 23:58:18 +08:00
})
2024-06-26 00:20:39 +08:00
</script>
2024-07-20 00:34:54 +08:00
<style lang='scss'></style>