From 0082fa417fb2af9add3406bf05ab3e3e45890c34 Mon Sep 17 00:00:00 2001
From: rain <1679827795@qq.com>
Date: Thu, 12 Jun 2025 14:30:02 +0800
Subject: [PATCH] Merge branch 'master' of http://139.196.74.78:10010/r/drone/drone-web-manage
---
src/views/tickets/orderLog.vue | 243 ++++++++++++++++++++++++++----------------------
1 files changed, 132 insertions(+), 111 deletions(-)
diff --git a/src/views/tickets/orderLog.vue b/src/views/tickets/orderLog.vue
index 8179c0a..782f5e5 100644
--- a/src/views/tickets/orderLog.vue
+++ b/src/views/tickets/orderLog.vue
@@ -22,8 +22,7 @@
</div>
<div class="search-bar-box-item">
- <el-select placeholder="请选择所属单位" v-model="filters.create_dept" @change="handleDepartmentChange"
- clearable>
+ <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>
<el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />
</el-select>
</div>
@@ -102,37 +101,33 @@
<template #menu="{ row }">
<div class="menu-custom-box">
- <div v-if="row.status == 1">
+ <template v-if="row.status == 1">
<el-button v-if="hasPaddingBtnPermission()" type="text" icon="el-icon-view"
@click="handleCheckDetail(row)">审核</el-button>
- </div>
-
- <div v-if="
- (userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) &&
- row.status == 1
- ">
+ </template>
+ <!-- v-if="
+ (userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) &&
+ row.status == 1
+ " -->
+ <template v-if="row.status == 1">
<!--待审核状态-->
- <el-button type="text" icon="el-icon-warning"
- @click="orderLogRecall(row.id)">撤回</el-button>
- </div>
+ <el-button type="text" icon="el-icon-warning" @click="orderLogRecall(row.id)">撤回</el-button>
+ </template>
<!--已驳回-->
- <div v-if="row.status == 2">
- <el-button type="text" icon="el-icon-warning"
- @click="rejectDetail(row.id)">驳回原因</el-button>
- </div>
+ <template v-if="row.status == 2">
+ <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)">驳回原因</el-button>
+ <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button>
+ </template>
+ <!-- 已通过 -->
+ <template v-if="row.status == 3">
+ <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button>
+ </template>
<!--草稿-->
- <div>
- <el-button type="text" icon="el-icon-edit"
- @click="handleViewDetail(row)">编辑</el-button>
- <el-button type="text" icon="el-icon-position"
- @click="userPublishPush(row.id)">发布</el-button>
- <el-button type="text" icon="el-icon-delete"
- @click="deleteOrderLog(row.id)">删除</el-button>
- </div>
- <div v-if="row.status == 3 || row.status == 1 || row.status == 2">
- <el-button type="text" icon="el-icon-view"
- @click="handleViewDetail(row)">详情</el-button>
- </div>
+ <template v-if="row.status == 0">
+ <el-button type="text" icon="el-icon-edit" @click="handleViewDetail(row)">编辑</el-button>
+ <el-button type="text" icon="el-icon-position" @click="userPublishPush(row.id)">发布</el-button>
+ <el-button type="text" icon="el-icon-delete" @click="deleteOrderLog(row.id)">删除</el-button>
+ </template>
</div>
</template>
<template #status="{ row }">
@@ -251,16 +246,7 @@
<span class="step-description" style="position: relative; display: inline-block">
{{ record.user_name }}
</span>
- <span style="
- position: absolute;
- left: 80%;
- top: 50%;
- transform: translateY(-50%);
- width: 100px;
- margin-left: 4px;
- color: #666;
- font-size: 12px;
- ">
+ <span class="step-timer ">
{{ record.interval_time_str }}
</span>
<div class="step-description">
@@ -384,16 +370,7 @@
<span class="step-description" style="position: relative; display: inline-block">
{{ record.user_name }}
</span>
- <span style="
- position: absolute;
- left: 80%;
- top: 50%;
- transform: translateY(-50%);
- width: 100px;
- margin-left: 4px;
- color: #666;
- font-size: 12px;
- ">
+ <span class="step-timer ">
{{ record.interval_time_str }}
</span>
<div class="step-description">
@@ -664,6 +641,13 @@
},
mounted () {
this.fetchTableData()
+ const id = this.$route.query.id
+ if (id) {
+ // 确保 id 存在
+ this.handleViewDetail({ id })
+ } else {
+ console.error('工单ID不存在!')
+ }
},
computed: {
...mapGetters(['userInfo', 'permission']),
@@ -686,7 +670,7 @@
methods: {
searchChange (params, done) {
- console.log('searchChange')
+ // console.log('searchChange')
this.query = params
this.parentId = ''
this.page.currentPage = 1
@@ -728,7 +712,7 @@
this.loading = true
try {
let params = this.getQueryParam()
- console.log('发送的参数:', params)
+ // console.log('发送的参数:', params)
const response = await getList(params, this.page.currentPage, this.page.pageSize)
if (!response?.data?.data?.records) {
throw new Error('接口返回数据格式不正确')
@@ -739,11 +723,11 @@
return item
})
- console.log('权限检查:', this.permission)
+ // console.log('权限检查:', this.permission)
this.page.total = total || 0
this.updateGlobalCounts()
} catch (error) {
- console.error('获取数据失败:', error)
+ // console.error('获取数据失败:', error)
this.$message.error(error.message || '获取数据失败')
this.tableData = []
this.page.total = 0
@@ -755,10 +739,10 @@
getQueryParam () {
const currentTab = this.tabs.find(tab => tab.name === this.activeTab)
if (this.filters.dateRange) {
- console.log(
- 'this.formatDate(this.filters.dateRange[0])',
- this.formatDate(this.filters.dateRange[0])
- )
+ // console.log(
+ // 'this.formatDate(this.filters.dateRange[0])',
+ // this.formatDate(this.filters.dateRange[0])
+ // )
}
const params = {
@@ -798,7 +782,7 @@
this.$refs.testform.validate(async valid => {
if (valid) {
let dateRange = this.form.date_range
- console.log('dateRange' + dateRange)
+ // console.log('dateRange' + dateRange)
this.form.begin_time = this.formatDate(dateRange[0])
this.form.end_time = this.formatDate(dateRange[1])
@@ -902,7 +886,7 @@
PASS: 0,
}
var reponse = await jobStatusNum()
- console.log('统计' + reponse.data.data)
+ // console.log('统计' + reponse.data.data)
reponse.data.data.forEach(item => {
const tab = this.tabs.find(t => t.name === item.dict_key)
if (tab) {
@@ -943,7 +927,6 @@
async handleViewDetail (row) {
const response = await orderLogDetails(row.id)
const data = response.data.data
-
this.form = {
...data,
}
@@ -958,16 +941,42 @@
this.detailVisible = true
+ // 更新航线列表,追加 wayline_file_region_vo 数据
+ if (data.wayline_file_region_vo) {
+ const newWayline = data.wayline_file_region_vo
+
+ // 检查是否已经存在于 this.wayLineList 中
+ const isDuplicate = this.wayLineList.some(
+ (item) => item.wayline_id === newWayline.wayline_id
+ )
+
+ if (!isDuplicate) {
+ this.wayLineList.push(newWayline)
+ }
+ }
+
this.initMapLine(data.device_map_infos)
},
async handleCheckDetail (row) {
const response = await orderLogDetails(row.id)
const data = response.data.data
-
this.form = {
...data,
}
+ // 更新航线列表,追加 wayline_file_region_vo 数据
+ // 更新航线列表,追加 wayline_file_region_vo 数据
+ if (data.wayline_file_region_vo) {
+ const newWayline = data.wayline_file_region_vo
+ // 检查是否已经存在于 this.wayLineList 中
+ const isDuplicate = this.wayLineList.some(
+ (item) => item.wayline_id === newWayline.wayline_id
+ )
+
+ if (!isDuplicate) {
+ this.wayLineList.push(newWayline)
+ }
+ }
// 更新机巢列表
this.device_sns = data.device_list
this.detailVisibleCopy = true
@@ -990,23 +999,24 @@
},
hasAddBtnPermission () {
// undefined 或 false 都返回 false,只有 true 返回 true
- console.log('this.permission.order_log_add :', this.permission.order_log_add)
+ // console.log('this.permission.order_log_add :', this.permission.order_log_add)
return this.permission && this.permission.order_log_add === true
},
hasPaddingBtnPermission () {
// undefined 或 false 都返回 false,只有 true 返回 true
- console.log('权限检查:', this.permission)
+ // console.log('权限检查:', this.permission)
return this.permission && this.permission.order_log_review === true
},
hasRecallPaddingBtnPermission () {
// undefined 或 false 都返回 false,只有 true 返回 true
- console.log('权限检查:', this.permission)
+ // console.log('权限检查:', this.permission)
+ // 智飞工单撤回
return this.permission && this.permission.order_log_recall === true
},
//驳回按钮权限
hasRejectionBtnPermission () {
// undefined 或 false 都返回 false,只有 true 返回 true
- console.log('权限检查:', this.permission)
+ // console.log('权限检查:', this.permission)
return this.permission && this.permission.rejection_btn === true
},
//自己点发布
@@ -1045,60 +1055,40 @@
this.initMapLine()
},
- initMapLine (infos = {}) {
+ initMapLine (cb = () => { }) {
let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id)
if (!currentLine) return
- // 异步解析kmz文件
- const analysis = async url => {
- return new Promise(async resolve => {
- const res = await analyzeKmzFile(`${url}?_t=${new Date().getTime()}`)
- const templateXML = await res.fileInfoObj['wpmz/template.kml']
- const templateXMLJSON = XMLToJSON(templateXML)?.['Document']
- const templateXMLObj = removeTextKey(templateXMLJSON.Folder)
- resolve(templateXMLObj)
- })
- }
-
- const drawLine = async () => {
- let prexUrl = ref(import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key)
- const res = await analysis(prexUrl.value)
- if (!res.Placemark.length) return
- renderingLine(res)
- }
-
- const renderingLine = lineObj => {
- const positions = lineObj.Placemark.map(item => {
- return item.Point.coordinates.split(',')
- })
-
- if (JSON.stringify(infos) != '{}') positions.unshift([
- infos[0].longitude,
- infos[0].latitude,
- ])
-
- this.$nextTick(() => {
- if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
- this.$refs.MapContainer.initAddEntity('polyline', positions)
- }
- })
- }
-
- drawLine()
+ this.$nextTick(() => {
+ if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
+ this.$refs.MapContainer.initAddEntity('polyline', {
+ url: `${import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key}?_t=${new Date().getTime()}`,
+ type: currentLine.wayline_type,
+ cb
+ })
+ }
+ })
},
//可飞行机巢列表
async getFlyingNestBy (waylineId) {
- this.initMapLine()
+ const that = this
- //按照航线来
- const params = {
- type: 0,
- waylineId: waylineId,
- }
- var wayLineListResponse = await getFlyingNestBy(params)
- this.device_sns = wayLineListResponse.data.data
+ that.device_sns = []
+
+ this.initMapLine(async (polygon) => {
+ const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId)
+
+ //按照航线来
+ const params = {
+ type: currentLine.wayline_type,
+ wayline_id: waylineId,
+ polygon
+ }
+ var wayLineListResponse = await getFlyingNestBy(params)
+ that.device_sns = wayLineListResponse.data.data
+ })
},
//撤回
@@ -1150,8 +1140,32 @@
},
}
</script>
-<style></style>
+
<style lang="scss" scoped>
+:deep() {
+ .avue-crud__body {
+ .el-form {
+ height: 625px;
+ overflow: auto;
+ }
+ }
+}
+
+:deep(.el-pagination .el-select) {
+ width: 128px !important;
+}
+
+.step-timer {
+ position: absolute;
+ left: 80%;
+ top: 50%;
+ transform: translateY(-50%);
+ width: 100px;
+ margin-left: 4px;
+ color: #666;
+ font-size: 12px;
+}
+
:deep(.el-textarea__inner) {
padding: 8px 12px;
}
@@ -1309,9 +1323,16 @@
.menu-custom-box {
display: flex;
justify-content: center;
+ flex-wrap: wrap;
- &>div {
+ &> ::v-deep(.el-button) {
flex: 1;
+ max-width: 44px;
+ margin-right: 10px;
+
+ &:nth-child(4n) {
+ margin-left: 0;
+ }
}
}
}
--
Gitblit v1.9.3