| | |
| | | <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" |
| | |
| | | </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'; |
| | |
| | | |
| | | const searchForm = reactive({ |
| | | name: '', |
| | | ai_type: [], |
| | | ai_types: [], |
| | | file_id: '', |
| | | begin_time: '', |
| | | end_time: '', |
| | |
| | | } |
| | | }; |
| | | const algorithmChange = (val) => { |
| | | searchForm.ai_type = val; |
| | | searchForm.ai_types = val; |
| | | }; |
| | | |
| | | // 获取航线文件 |
| | |
| | | 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; |
| | |
| | | isShowAddTask.value = false; |
| | | // 清除搜索数据 |
| | | searchForm.name = ''; |
| | | searchForm.ai_type = []; |
| | | searchForm.ai_types = []; |
| | | searchForm.file_id = ''; |
| | | searchForm.begin_time = ''; |
| | | searchForm.end_time = ''; |
| | |
| | | :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; // 调整日期选择器宽度 |
| | |
| | | } |
| | | .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> |