From da5035c06495ecf01e3f399ee7203a77527202d4 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Tue, 08 Apr 2025 11:50:26 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/TaskManage/TaskTop/TaskTime.vue | 8 +-
/dev/null | 25 ------
src/views/TaskManage/TaskTop/TaskEvent.vue | 8 +-
src/views/TaskManage/SearchBox.vue | 30 +++++--
src/views/TaskManage/TaskTop/TaskTotal.vue | 11 +-
src/views/TaskManage/TaskTop/TaskIndustry.vue | 8 +-
src/views/TaskManage/TaskIntermediateContent/AddTask.vue | 33 ++++++-
src/views/TaskManage/TaskManage.vue | 6 -
src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue | 9 +-
src/views/TaskManage/TaskIntermediateContent/TaskTable.vue | 56 +++++++++----
src/views/TaskManage/TaskTop/TaskTop.vue | 9 +
src/views/TaskManage/components/TaskAlgorithmBusiness.vue | 4
12 files changed, 119 insertions(+), 88 deletions(-)
diff --git a/src/views/TaskManage/SearchBox.vue b/src/views/TaskManage/SearchBox.vue
index c96de38..a9eb886 100644
--- a/src/views/TaskManage/SearchBox.vue
+++ b/src/views/TaskManage/SearchBox.vue
@@ -53,7 +53,7 @@
/>
</el-form-item>
<el-form-item label="任务算法">
- <!-- <el-select v-model="searchForm.ai_type" placeholder="请选择算法" clearable>
+ <!-- <el-select v-model="searchForm.ai_types" placeholder="请选择算法" clearable>
<el-option v-for="item in taskAlgorithm" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
</el-select> -->
<TaskAlgorithmBusiness :showAlgorithm="true" @algorithmChange="algorithmChange"/>
@@ -92,7 +92,7 @@
const dateRange = ref([]);
const searchForm = reactive({
- ai_type: '', // 算法类型
+ ai_types: [], // 算法类型
area_code: '', // 区域code
create_dept: '', // 创建部门
date_enum: '', // 日期枚举,可用值:TODAY,CURRENT_WEEK,CURRENT_MONTH,CURRENT_YEAR
@@ -117,8 +117,8 @@
const handleSearch = () => {
emit('search', {
...searchForm,
- start_date: `${dateRange.value[0]} 00:00:00`,
- end_date: `${dateRange.value[1]} 23:59:59`
+ start_date: dateRange.value.length ? `${dateRange.value[0]} 00:00:00` : '',
+ end_date: dateRange.value.length ? `${dateRange.value[1]} 23:59:59` : ''
});
};
@@ -149,7 +149,7 @@
// });
// };
const algorithmChange = (val) => {
- searchForm.ai_type = val;
+ searchForm.ai_types = val;
};
const businessChange = (val) => {
@@ -200,10 +200,11 @@
<style lang="scss" scoped>
.search-box {
position: absolute;
- top: 120px;
- left: 450px;
- width: calc(100% - 400px - 400px - 100px);
+ top: 340px;
+ left: 40px;
+ width: calc(100% - 80px);
height: 60px;
+ line-height: 60px;
background: rgba(31, 62, 122, 0.95);
// padding: 10px 20px;
transition: all 0.3s;
@@ -212,7 +213,7 @@
}
.search-row {
display: flex;
- justify-content: space-between;
+ // justify-content: space-between;
align-items: center;
.search-items {
@@ -236,6 +237,7 @@
z-index: 10;
border-top: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
+ margin-bottom: 60px; // 为分页预留空间
}
:deep(.el-form) {
@@ -273,5 +275,15 @@
line-height: 18px;
}
}
+ :deep(.el-pagination) {
+ position: fixed;
+ bottom: 20px;
+ left: 50%;
+ transform: translateX(-50%);
+ background: rgba(31, 62, 122, 0.95);
+ padding: 15px 20px;
+ border-radius: 4px;
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
+ }
}
</style>
\ No newline at end of file
diff --git a/src/views/TaskManage/TaskIntermediateContent/AddTask.vue b/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
index a1c0060..9d23405 100644
--- a/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
@@ -12,7 +12,7 @@
<div class="left">
<div class="search">
<div class="item">任务名称:<el-input v-model="searchForm.name" placeholder="请输入任务名称"></el-input></div>
- <div class="item">任务日期:
+ <div class="item"><span style="color: red;">*</span>任务日期:
<el-date-picker
v-model="searchForm.begin_time"
format="YYYY-MM-DD"
@@ -66,6 +66,7 @@
</template>
<script setup>
+import { ElMessage } from 'element-plus';
import { pxToRem } from '@/utils/rem';
import { getWaylineList, createTask } from '@/api/home/task';
import TaskAlgorithmBusiness from '../components/TaskAlgorithmBusiness.vue';
@@ -82,7 +83,7 @@
const searchForm = reactive({
name: '',
- ai_type: [],
+ ai_types: [],
file_id: '',
begin_time: '',
end_time: '',
@@ -102,7 +103,7 @@
}
};
const algorithmChange = (val) => {
- searchForm.ai_type = val;
+ searchForm.ai_types = val;
};
// 获取航线文件
@@ -118,12 +119,18 @@
const emit = defineEmits(['refresh']);
// 提交
const submitClick = () => {
+ if (!searchForm.begin_time) {
+ ElMessage({
+ message: '请选择任务日期',
+ type: 'warning'
+ });
+ return;
+ }
searchForm.end_time = `${searchForm.begin_time} 23:59:59`;
searchForm.begin_time = `${searchForm.begin_time} 00:00:00`;
createTask(searchForm).then((res) => {
- console.log(res);
- if (res.code === 0) {
+ if (res.data.code === 0) {
ElMessage.success('任务创建成功');
// 关闭当前窗口,刷新任务管理列表
isShowAddTask.value = false;
@@ -135,7 +142,7 @@
isShowAddTask.value = false;
// 清除搜索数据
searchForm.name = '';
- searchForm.ai_type = [];
+ searchForm.ai_types = [];
searchForm.file_id = '';
searchForm.begin_time = '';
searchForm.end_time = '';
@@ -179,7 +186,7 @@
:deep(.el-date-picker),
:deep(.el-time-picker) {
width: 240px;
- margin-left: 10px;
+ // margin-left: 10px;
}
:deep(.el-date-editor.el-input__wrapper) {
width: 200px; // 调整日期选择器宽度
@@ -189,6 +196,18 @@
}
.right {
width: 30%;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+
+ .btn {
+ margin-top: 20px;
+ text-align: center;
+
+ .el-button {
+ margin: 0 10px;
+ }
+ }
}
}
</style>
diff --git a/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue b/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
index 05beb46..f6b3f34 100644
--- a/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue
@@ -66,7 +66,6 @@
};
// 状态文字
const getStatusText = (status) => {
- console.log('哒哒哒',status)
const statusMap = {
1: '待执行',
2: '执行中',
@@ -128,10 +127,10 @@
<style lang="scss" scoped>
.task-intermediate-content {
position: absolute;
- top: 200px;
- width: calc(100% - 400px - 400px - 100px);
- left: 450px;
- height: 760px;
+ top: 400px;
+ width: calc(100% - 80px);
+ left: 40px;
+ height: 500px;
display: flex;
flex-direction: column;
justify-content: space-between;
diff --git a/src/views/TaskManage/TaskIntermediateContent/TaskTable.vue b/src/views/TaskManage/TaskIntermediateContent/TaskTable.vue
index 26d834a..7b349c3 100644
--- a/src/views/TaskManage/TaskIntermediateContent/TaskTable.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/TaskTable.vue
@@ -1,21 +1,23 @@
<template>
- <el-table :data="tableData" style="width: 100%" height="400" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" />
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column prop="nickname" label="机巢名称" />
- <el-table-column prop="estimated_arrival_time" label="预计到达时间" />
- <el-table-column prop="exe_distance" label="执行里程" />
- </el-table>
- <div class="pagination">
- <el-pagination
- v-model:current-page="pageParams.page"
- v-model:page-size="pageParams.limit"
- :page-sizes="[10, 20, 30]"
- layout="total, sizes, prev, pager, next"
- :total="total"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
+ <div class="table-container">
+ <el-table :data="tableData" style="width: 100%" height="400" @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55" />
+ <el-table-column type="index" label="序号" width="60" />
+ <el-table-column prop="nickname" label="机巢名称" />
+ <el-table-column prop="estimated_arrival_time" label="预计到达时间" />
+ <el-table-column prop="exe_distance" label="执行里程" />
+ </el-table>
+ <div class="pagination">
+ <el-pagination
+ v-model:current-page="pageParams.page"
+ v-model:page-size="pageParams.limit"
+ :page-sizes="[10, 20, 30]"
+ layout="total, sizes, prev, pager, next"
+ :total="total"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ />
+ </div>
</div>
</template>
@@ -48,7 +50,9 @@
const getNestList = async () => {
tableData.value = [];
const res = await getFlyingNestBy(pageParams);
+
if (res.data.code === 0) {
+ console.log(res.data.data, '哒哒哒');
tableData.value = res.data.data;
}
};
@@ -83,4 +87,22 @@
</script>
<style lang="scss" scoped>
+.table-container {
+ height: 500px;
+ // display: flex;
+ // flex-direction: column;
+
+ .pagination {
+ margin-top: 10px;
+ }
+
+ // :deep(.el-table) {
+ // flex: 1;
+ // background-color: transparent;
+ // --el-table-border-color: rgba(255, 255, 255, 0.1);
+ // --el-table-header-bg-color: rgba(31, 62, 122, 0.5);
+ // --el-table-header-text-color: #fff;
+ // --el-table-text-color: #fff;
+ // }
+}
</style>
\ No newline at end of file
diff --git a/src/views/TaskManage/TaskManage.vue b/src/views/TaskManage/TaskManage.vue
index 1416d8d..22fb1d0 100644
--- a/src/views/TaskManage/TaskManage.vue
+++ b/src/views/TaskManage/TaskManage.vue
@@ -1,13 +1,11 @@
<script setup>
-import TaskLeft from "@/views/TaskManage/TaskLeft/TaskLeft.vue";
-import TaskRight from "@/views/TaskManage/TaskRight/TaskRight.vue";
+import TaskTop from "@/views/TaskManage/TaskTop/TaskTop.vue";
import TaskIntermediateContent from "@/views/TaskManage/TaskIntermediateContent/TaskIntermediateContent.vue";
</script>
<template>
- <TaskLeft/>
+ <TaskTop/>
<TaskIntermediateContent />
- <TaskRight/>
</template>
diff --git a/src/views/TaskManage/TaskRight/TaskRight.vue b/src/views/TaskManage/TaskRight/TaskRight.vue
deleted file mode 100644
index 7a23af9..0000000
--- a/src/views/TaskManage/TaskRight/TaskRight.vue
+++ /dev/null
@@ -1,25 +0,0 @@
-<template>
- <div class="task-right">
- <TaskTime />
- <TaskEvent />
- </div>
-</template>
-
-<script setup>
-import TaskTime from './TaskTime.vue';
-import TaskEvent from './TaskEvent.vue';
-</script>
-
-<style scoped lang="scss">
-.task-right {
- position: absolute;
- top: 122px;
- right: 31px;
- width: 404px;
-
- .titleBox {
- width: 404px;
- height: 43px;
- }
-}
-</style>
\ No newline at end of file
diff --git a/src/views/TaskManage/TaskRight/TaskEvent.vue b/src/views/TaskManage/TaskTop/TaskEvent.vue
similarity index 95%
rename from src/views/TaskManage/TaskRight/TaskEvent.vue
rename to src/views/TaskManage/TaskTop/TaskEvent.vue
index 5600ec3..349d1ab 100644
--- a/src/views/TaskManage/TaskRight/TaskEvent.vue
+++ b/src/views/TaskManage/TaskTop/TaskEvent.vue
@@ -1,6 +1,6 @@
<!-- 任务事件统计 -->
<template>
- <common-title title="任务事件统计"></common-title>
+ <!-- <common-title title="任务事件统计"></common-title> -->
<div class="task-event">
<div class="chart" ref="chartRef"></div>
</div>
@@ -130,10 +130,10 @@
<style lang="scss" scoped>
.task-event {
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
- margin-left: 29px;
- padding: 16px 16px;
+ // margin-left: 29px;
+ // padding: 16px 16px;
width: 340px;
- height: 400px;
+ height: 200px;
background: linear-gradient(
270deg,
rgba(31, 62, 122, 0) 0%,
diff --git a/src/views/TaskManage/TaskLeft/TaskIndustry.vue b/src/views/TaskManage/TaskTop/TaskIndustry.vue
similarity index 94%
rename from src/views/TaskManage/TaskLeft/TaskIndustry.vue
rename to src/views/TaskManage/TaskTop/TaskIndustry.vue
index f8f895f..47968cf 100644
--- a/src/views/TaskManage/TaskLeft/TaskIndustry.vue
+++ b/src/views/TaskManage/TaskTop/TaskIndustry.vue
@@ -1,6 +1,6 @@
<!-- 业务统计 -->
<template>
- <common-title title="行业统计" :style="{ marginLeft: pxToRem(14) }"></common-title>
+ <!-- <common-title title="行业统计" :style="{ marginLeft: pxToRem(14) }"></common-title> -->
<div class="task-industry">
<div class="chart" ref="chartRef"></div>
</div>
@@ -112,10 +112,10 @@
<style lang="scss" scoped>
.task-industry {
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
- margin-left: 29px;
- padding: 16px 16px;
+ // margin-left: 29px;
+ // padding: 16px 16px;
width: 340px;
- height: 400px;
+ height: 200px;
background: linear-gradient(
270deg,
rgba(31, 62, 122, 0) 0%,
diff --git a/src/views/TaskManage/TaskRight/TaskTime.vue b/src/views/TaskManage/TaskTop/TaskTime.vue
similarity index 94%
rename from src/views/TaskManage/TaskRight/TaskTime.vue
rename to src/views/TaskManage/TaskTop/TaskTime.vue
index 48b9495..6de6d35 100644
--- a/src/views/TaskManage/TaskRight/TaskTime.vue
+++ b/src/views/TaskManage/TaskTop/TaskTime.vue
@@ -1,6 +1,6 @@
<!-- 任务事件统计 -->
<template>
- <common-title title="任务时间统计"></common-title>
+ <!-- <common-title title="任务时间统计"></common-title> -->
<div class="task-time">
<div class="chart" ref="chartRef"></div>
</div>
@@ -105,10 +105,10 @@
<style lang="scss" scoped>
.task-time {
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
- margin-left: 29px;
- padding: 16px 16px;
+ // margin-left: 29px;
+ // padding: 16px 16px;
width: 340px;
- height: 400px;
+ height: 200px;
background: linear-gradient(
270deg,
rgba(31, 62, 122, 0) 0%,
diff --git a/src/views/TaskManage/TaskLeft/TaskLeft.vue b/src/views/TaskManage/TaskTop/TaskTop.vue
similarity index 60%
rename from src/views/TaskManage/TaskLeft/TaskLeft.vue
rename to src/views/TaskManage/TaskTop/TaskTop.vue
index f0117c5..b3c7374 100644
--- a/src/views/TaskManage/TaskLeft/TaskLeft.vue
+++ b/src/views/TaskManage/TaskTop/TaskTop.vue
@@ -2,18 +2,23 @@
<div class="task-left">
<TaskTotal />
<TaskIndustry />
+ <TaskTime />
+ <TaskEvent />
</div>
</template>
<script setup>
import TaskTotal from './TaskTotal.vue';
import TaskIndustry from './TaskIndustry.vue';
+import TaskTime from './TaskTime.vue';
+import TaskEvent from './TaskEvent.vue';
</script>
<style lang="scss" scoped>
.task-left {
- // width: 300px;
position: relative;
- top: 20px;
+ display: flex;
+ justify-content: space-between;
+ margin: 40px;
}
</style>
\ No newline at end of file
diff --git a/src/views/TaskManage/TaskLeft/TaskTotal.vue b/src/views/TaskManage/TaskTop/TaskTotal.vue
similarity index 92%
rename from src/views/TaskManage/TaskLeft/TaskTotal.vue
rename to src/views/TaskManage/TaskTop/TaskTotal.vue
index ad69663..5a5178c 100644
--- a/src/views/TaskManage/TaskLeft/TaskTotal.vue
+++ b/src/views/TaskManage/TaskTop/TaskTotal.vue
@@ -1,6 +1,6 @@
<!-- 任务统计 -->
<template>
- <common-title title="任务统计" :style="{ marginLeft: pxToRem(14) }"></common-title>
+ <!-- <common-title title="任务统计" :style="{ marginLeft: pxToRem(14) }"></common-title> -->
<div class="task-total">
<div class="card" v-for="item in list">
<div>
@@ -53,10 +53,11 @@
<style lang="scss" scoped>
.task-total {
font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
- margin-left: 29px;
- padding: 16px 16px;
+ // margin-left: 29px;
+ // padding: 16px 16px;
width: 340px;
- height: 400px;
+ height: 200px;
+ left: 40px;
background: linear-gradient(
270deg,
rgba(31, 62, 122, 0) 0%,
@@ -69,7 +70,7 @@
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(3, 1fr);
- gap: 20px;
+ gap: 10px;
padding: 20px;
.card {
/* position: absolute;
diff --git a/src/views/TaskManage/components/TaskAlgorithmBusiness.vue b/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
index 5a773ac..2dcd44a 100644
--- a/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
+++ b/src/views/TaskManage/components/TaskAlgorithmBusiness.vue
@@ -1,7 +1,7 @@
<!-- 关联算法和综合业务 -->
<template>
<div class="task-algorithm" v-if="showAlgorithm">
- <el-select v-model="ai_type" multiple collapse-tags collapse-tags-tooltip placeholder="请选择算法" clearable @change="handleAlgorithmChange">
+ <el-select v-model="ai_types" multiple collapse-tags collapse-tags-tooltip placeholder="请选择算法" clearable @change="handleAlgorithmChange">
<el-option v-for="item in taskAlgorithm" :key="item.id" :label="item.dictValue" :value="item.dictKey" />
</el-select>
</div>
@@ -28,7 +28,7 @@
});
// 算法
-let ai_type = ref('');
+let ai_types = ref('');
let taskAlgorithm = ref([]);
// 综合业务
let industry_type = ref('');
--
Gitblit v1.9.3