| | |
| | | import request from '@/axios'; |
| | | import request from '@/axios' |
| | | |
| | | export const getList = (data) => { |
| | | return request({ |
| | | url: '/drone-device-core/jobEvent/eventPage', |
| | | method: 'post', |
| | | data, |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | // 修改创建工单的方法 |
| | | export const createTicket = (data, file) => { |
| | | const formData = new FormData(); |
| | | |
| | | const formData = new FormData() |
| | | |
| | | // 创建 eventDto 对象,不显式设置 file 字段 |
| | | const eventDto = { |
| | | ...data // 直接使用传入的 data,不添加 file: null |
| | | }; |
| | | } |
| | | |
| | | // 添加所有字段到 FormData |
| | | Object.entries(eventDto).forEach(([key, value]) => { |
| | | formData.append(key, value); |
| | | }); |
| | | |
| | | formData.append(key, value) |
| | | }) |
| | | |
| | | // 只有当 file 存在时才添加文件 |
| | | if (file) { |
| | | formData.append("file", file); |
| | | formData.append("file", file) |
| | | } |
| | | |
| | | return request({ |
| | |
| | | headers: { |
| | | 'Content-Type': 'multipart/form-data' |
| | | } |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | // 新增接口:获取工单详细信息 |
| | | export const getTicketInfo = (id) => { |
| | |
| | | url: '/drone-device-core/jobEvent/getTicketInfo', |
| | | method: 'get', |
| | | params: { id }, // 使用工单 ID 查询 |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | // 修改接口:处理待审核状态,动态构建 FormData 提交 |
| | | export const flowEvent = (data, file) => { |
| | | const formData = new FormData(); |
| | | const formData = new FormData() |
| | | |
| | | // 动态添加非空字段到 FormData |
| | | Object.entries(data).forEach(([key, value]) => { |
| | | if (value !== undefined && value !== null) { |
| | | formData.append(key, value); |
| | | formData.append(key, value) |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | // 如果 file 存在,则添加到 FormData |
| | | if (file) { |
| | | formData.append('file', file); |
| | | formData.append('file', file) |
| | | } |
| | | |
| | | return request({ |
| | |
| | | headers: { |
| | | 'Content-Type': 'multipart/form-data', // 设置为表单数据格式 |
| | | }, |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | // 新增接口:获取状态统计数据 |
| | | export const getstatusCount = (params) => { |
| | |
| | | url: '/drone-device-core/jobEvent/getstatusCount', |
| | | method: 'get', |
| | | params, |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | export const getStepInfo = (eventNum) => { |
| | | return request({ |
| | | url: '/drone-device-core/jobEvent/getStepInfo', |
| | | method: 'get', |
| | | params: { eventNum } |
| | | }); |
| | | }; |
| | | }) |
| | | } |
| | | |
| | | // 人工复核接口 |
| | | export const getReviewById = (id) => { |
| | | return request({ |
| | | url: `/drone-device-core/jobEvent/reviewById/${id}`, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | // 获取机器复核可执行时间 |
| | | export const getReCheckTime = (id) => { |
| | | return request({ |
| | | url: `/`, |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | // 下发任务 |
| | | export const getCreateEventJob = (id) => { |
| | | return request({ |
| | | url: `/drone-device-core/wayline/waylineJobInfo/createEventJob/${id}`, |
| | | method: 'post', |
| | | }) |
| | | } |
| | |
| | | <el-button type="text" icon="el-icon-delete" class="danger-button" |
| | | @click="handleDelete(row)">删除</el-button> |
| | | </template> |
| | | |
| | | <template v-else> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> |
| | | </template> |
| | | |
| | | <el-button v-if="row.status === 4" type="text" icon="el-icon-check" @click="reCheck(row)">复核</el-button> |
| | | </template> |
| | | <template #status="{ row }"> |
| | | <span :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 复核弹出层 --> |
| | | |
| | | <el-dialog v-model="reCheckDialog" title="工单复核" width="30%" append-to-body custom-class="re-check-dialog" |
| | | @close="reCheckDialog = false"> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="reCheckConfirm(1)">人工复核</el-button> |
| | | <el-button type="primary" @click="reCheckConfirm(2)">机器复核</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ElMessageBox } from 'element-plus' |
| | | import { calculateDefaultRange } from '@/utils/util' |
| | | import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation' |
| | | import { getList, createTicket, getTicketInfo, flowEvent, getstatusCount, getStepInfo } from '@/api/tickets/ticket' |
| | | import { |
| | | getList, |
| | | createTicket, |
| | | getTicketInfo, |
| | | flowEvent, |
| | | getstatusCount, |
| | | getStepInfo, |
| | | getReviewById, |
| | | getReCheckTime, |
| | | getCreateEventJob |
| | | } from '@/api/tickets/ticket' |
| | | import { export_json_to_excel } from '@/utils/exportExcel' |
| | | import geoJson from '@/assets/geoJson.json' |
| | | |
| | |
| | | |
| | | // 配置时间选择器默认配置 |
| | | datePickerDefaultVal: calculateDefaultRange(), |
| | | |
| | | // 复核弹窗 |
| | | reCheckDialog: false, |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | |
| | | showIsReviewText () { |
| | | return (row) => { |
| | | console.log(row, 111111) |
| | | |
| | | if (['4', '5'].includes(String(row.status))) return row.isReview === 1 ? '是' : '否' |
| | | |
| | | return '/' |
| | |
| | | } |
| | | |
| | | return [String(lng), String(lat)] |
| | | }, |
| | | |
| | | // 复核按钮 |
| | | reCheck (row) { |
| | | this.reCheckData = row |
| | | this.reCheckDialog = true |
| | | }, |
| | | |
| | | // 复核确认框按钮事件 |
| | | reCheckConfirm (key) { |
| | | const that = this |
| | | if (key == 1) { |
| | | getReviewById(this.reCheckData.id).then(res => { |
| | | this.reCheckDialog = false |
| | | this.page.currentPage = 1 |
| | | this.fetchTableData() |
| | | this.fetchTabCounts() |
| | | }) |
| | | } else { |
| | | // 获取时间的接口 |
| | | getReCheckTime(that.reCheckData.id).then(res => { |
| | | |
| | | ElMessageBox.confirm(`确认在该${res.data.data}时间进行复核?`) |
| | | .then(() => { |
| | | |
| | | // 生成任务的接口 |
| | | getCreateEventJob(that.reCheckData.id).then(() => { |
| | | that.page.currentPage = 1 |
| | | that.fetchTableData() |
| | | that.fetchTabCounts() |
| | | }) |
| | | |
| | | }) |
| | | .catch(() => { |
| | | // catch error |
| | | }) |
| | | |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | .re-check-dialog { |
| | | :deep(.el-dialog__body) { |
| | | padding: 0; |
| | | background-color: #f5f7fa; |
| | | } |
| | | } |
| | | |
| | | .review-container { |
| | | position: relative; |
| | | |