<!-- 飞行日志 -->
|
<template>
|
<div class="flight">
|
<div class="search-box">
|
<el-form :model="params" inline>
|
<el-form-item label="日期:">
|
<!-- <el-picker v-model="params.start_time" type="date" placeholder="开始日期" value-format="yyyy-MM-dd"></el-picker> -->
|
<el-date-picker
|
v-model="params.start_time"
|
type="daterange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="getList">搜索</el-button>
|
<el-button @click="cancelSearch">取消</el-button>
|
</el-form-item>
|
</el-form>
|
<div>
|
<el-button :type="tabType === '全部'?'primary':'default'" @click="handleAll"><el-icon><Folder /></el-icon>全部</el-button>
|
<el-button :type="tabType === '收藏'?'primary':'default'" @click="handleStartList"><el-icon><Star /></el-icon>我的收藏</el-button>
|
</div>
|
</div>
|
<div class="mange-table">
|
<el-table border :data="tableList" class="custom-header">
|
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
<el-table-column prop="title" label="飞行类型" align="center" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="device_name" label="无人机" align="center"></el-table-column>
|
<el-table-column prop="start_time" label="开始时间" align="center">
|
<template #default="scope">
|
{{ timeFormatConvert(scope.row.start_time) }}
|
</template>
|
</el-table-column>
|
<el-table-column prop="end_time" label="结束时间" align="center">
|
<template #default="scope">
|
{{ timeFormatConvert(scope.row.end_time) }}
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="200" align="center">
|
<template #default="scope">
|
<!-- <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</el-button> -->
|
<!-- <el-button icon="el-icon-delete" type="text" @click="handleDelete">删除</el-button> -->
|
<el-button type="text" @click="handleStart"><el-icon><Star /></el-icon>收藏</el-button>
|
<el-button type="text" @click="handleExport"><el-icon><Download /></el-icon>导出</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div class="pagination">
|
<el-pagination class="ztzf-pagination" popper-class="custom-pagination-dropdown" background
|
:page-sizes="[10, 20, 30, 40, 50, 100]" :size="size" v-model:current-page="params.page"
|
v-model:page-size="params.page_size" layout="total, sizes, prev, pager, next, jumper" :total="total"
|
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
</div>
|
</div>
|
<!-- <el-dialog class="ztzf-dialog" append-to-body v-model="isShowView" title="查看"
|
:width="pxToRem(600)" :close-on-click-modal="false" :destroy-on-close="true">
|
<div class="content">
|
<table class="view-table" border>
|
<tr>
|
<td class="label">空域类型</td>
|
<td class="value">{{ rowView.model_name }}</td>
|
<td class="label">创建时间</td>
|
<td class="value">{{ rowView.alg_type }}</td>
|
</tr>
|
</table>
|
</div>
|
</el-dialog>
|
<el-dialog class="ztzf-dialog" append-to-body v-model="isShowEditView" title="新增"
|
:width="pxToRem(800)" :close-on-click-modal="false" :destroy-on-close="true">
|
<div class="content-edit">
|
<el-form ref="ruleFormRef" :model="editParams" :rules="rules" inline>
|
<el-form-item label="空域名称">
|
<el-input v-model="editParams.model_name" />
|
</el-form-item>
|
<div class="btns">
|
<el-button type="primary" @click="submit(ruleFormRef)">确认</el-button>
|
<el-button @click="isShowEditView = false">取消</el-button>
|
</div>
|
</el-form>
|
</div>
|
</el-dialog> -->
|
</template>
|
<script setup>
|
import { getHistoryTrack } from '@/api/logs';
|
|
const total = ref(0)
|
const params = ref({
|
workspaceId: '6566662f-17c5-44f1-89d2-f09b37b81794',
|
page: '1',
|
page_size: '10',
|
});
|
|
let tableList = ref([])
|
|
let isShowView = ref(false)
|
|
let rowView = ref({})
|
|
let isShowEditView = ref(false)
|
|
let tabType = ref('全部')
|
const ruleFormRef = ref()
|
let editParams = ref({
|
model_name: '',
|
alg_type: '',
|
qua_rate: '',
|
pass_rate: '',
|
event_type: '',
|
remark: ''
|
})
|
const rules = reactive({
|
qua_rate: [
|
{ required: true, message: '请输入最低准确率', trigger: 'blur' },
|
{
|
validator: (rule, value, callback) => {
|
if (!/^\d+(\.\d+)?$/.test(value)) {
|
callback(new Error('请输入有效的数字(整数或小数)'));
|
} else if (parseFloat(value) < 0.4) {
|
callback(new Error('最低准确率不能小于0.4'));
|
} else if (parseFloat(value) >= parseFloat(editParams.value.pass_rate)) {
|
callback(new Error('最低准确率必须小于最高准确率'));
|
} else {
|
callback();
|
}
|
},
|
trigger: 'blur'
|
}
|
],
|
pass_rate: [
|
{ required: true, message: '请输入最低准确率', trigger: 'blur' },
|
{
|
validator: (rule, value, callback) => {
|
if (!/^\d+(\.\d+)?$/.test(value)) {
|
callback(new Error('请输入有效的数字(整数或小数)'));
|
} else if (parseFloat(value) > 0.8) {
|
callback(new Error('最高准确率不能大于0.8'));
|
} else {
|
callback();
|
}
|
},
|
trigger: 'blur'
|
}
|
],
|
event_type: [
|
{
|
required: true,
|
message: '请选择事件生成类型',
|
trigger: 'change',
|
},
|
],
|
})
|
|
function timeFormatConvert(time) {
|
const date = new Date(time);
|
return date.toLocaleString();
|
}
|
|
function cancelSearch() {
|
params.value = {
|
workspaceId: '',
|
page: '1',
|
page_size: '10',
|
}
|
getList()
|
}
|
|
function getList() {
|
getHistoryTrack(params.value).then(res => {
|
tableList.value = res.data.data.list || []
|
total.value = res.data.data.pagination.total || 0
|
})
|
}
|
function handleDetail(row) {
|
isShowView.value = true
|
rowView.value = row
|
}
|
function handleDelete(row) {
|
console.log(row)
|
}
|
function handleAdd(row) {
|
isShowEditView.value = true
|
// editParams.value = { ...row }
|
}
|
|
function handleAll() {
|
tabType.value = '全部'
|
}
|
|
function handleStartList() {
|
tabType.value = '收藏'
|
}
|
|
async function submit(formValidate) {
|
if (!formValidate) return
|
await formValidate.validate((valid, fields) => {
|
if (valid) {
|
algorithmManageEdit(editParams.value).then(res => {
|
isShowEditView.value = false
|
getList()
|
})
|
}
|
})
|
}
|
|
function handleSizeChange(val) {
|
params.value.page_size = val
|
getList()
|
}
|
function handleCurrentChange(val) {
|
params.value.page = val
|
getList()
|
}
|
|
onMounted(() => {
|
getList()
|
})
|
</script>
|
|
<style lang="scss" scoped>
|
.flight {
|
height: 0;
|
flex: 1;
|
margin: 0 10px 10px 10px;
|
background-color: #ffffff;
|
padding: 10px 20px;
|
border-radius: 5px;
|
display: flex;
|
flex-direction: column;
|
.search-box {
|
height: 80px;
|
}
|
|
:deep(.el-input) {
|
.el-input__wrapper {
|
width: 200px;
|
}
|
}
|
|
// 表格
|
.mange-table {
|
height: 0;
|
flex: 1;
|
margin-top: 18px;
|
overflow: auto;
|
}
|
:deep(.el-pagination) {
|
display: flex;
|
justify-content: right;
|
}
|
|
:deep(.el-pagination button) {
|
background: center center no-repeat none !important;
|
color: #8eb8ea !important;
|
}
|
:deep(.ztzf-select){
|
.el-select__selection {
|
width: 200px;
|
}
|
}
|
}
|
|
.content {
|
padding: 20px;
|
|
.view-table {
|
width: 100%;
|
border-collapse: collapse;
|
border: 1px solid #EBEEF5;
|
|
tr {
|
&:not(:last-child) {
|
border-bottom: 1px solid #EBEEF5;
|
}
|
|
td {
|
padding: 12px 10px;
|
|
&.label {
|
width: 140px;
|
text-align: right;
|
// color: #909399;
|
// background-color: #F5F7FA;
|
border-right: 1px solid #EBEEF5;
|
}
|
|
&.value {
|
width: 180px;
|
// color: #303133;
|
}
|
}
|
}
|
}
|
}
|
.content-edit {
|
.el-form {
|
.el-form-item {
|
width: 300px;
|
:deep(.el-form-item__label) {
|
width: 120px;
|
}
|
|
}
|
.btns {
|
display: flex;
|
justify-content: center
|
}
|
}
|
}
|
</style>
|