无人机管理后台前端(已迁走)
chenyao
2025-11-22 623ecd9f73869dd67c166ac7d4b05b8e27c1203f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!-- 任务统计表格 -->
<template>
  <div class="order-log-update">
    <el-tabs v-model="activeTab" @tab-click="handleTabChange">
      <el-tab-pane v-for="tab in tabsList" :key="tab.name" :label="`${tab.label} (${tab.count})`" :name="tab.name">
        <SearchBox @search="searchClick"></SearchBox>
        <div class="task-table">
          <el-table border :data="orderListTable" class="custom-header">
            <el-table-column label="序号" type="index" width="60">
              <template #default="{ $index }">
                {{ ($index + 1 + (orderListParams.current - 1) * orderListParams.size).toString().padStart(2,
                '0') }}
              </template>
            </el-table-column>
            <el-table-column prop="job_info_num" label="工单编号" width="160">
              <template #default="scope">
                <el-tooltip-copy :content="scope.row.job_info_num" :showCopyText="true">
                  {{scope.row.job_info_num}}
                </el-tooltip-copy>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="工单名称" width="160">
              <template #default="scope">
                <el-tooltip-copy :content="scope.row.name" :showCopyText="true">
                  {{scope.row.name}}
                </el-tooltip-copy>
              </template>
            </el-table-column>
            <el-table-column prop="dept_name" label="所属单位" show-overflow-tooltip/>
            <el-table-column prop="create_time" label="创建时间" show-overflow-tooltip/>
            <el-table-column prop="job_num" label="已执行次数" show-overflow-tooltip align="center" />
            <el-table-column prop="content" label="工单内容" show-overflow-tooltip align="center" />
            <el-table-column prop="wayline_name" label="关联航线" show-overflow-tooltip />
            <el-table-column prop="ai_type_str" label="关联算法" width="200" align="center" />
            <el-table-column prop="device_names" label="关联机巢" width="200" align="center" />
            <el-table-column prop="creator_name" label="创建人" align="center" show-overflow-tooltip />
            <el-table-column prop="cycle_time_value" label="工单周期频次" align="center" show-overflow-tooltip />
            <el-table-column label="操作" width="200" align="center">
              <template #default="scope">
                <el-button icon="el-icon-back" v-if="scope.row.status === 2" type="text"@click="turnBack(scope.row)">返航</el-button>
                <el-button icon="el-icon-close" v-if="scope.row.status === 1" type="text" @click="cancelTask(scope.row)">取消任务</el-button>
                <el-button icon="el-icon-view" type="text" @click="handleDetail(scope.row)">查看</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="orderListParams.current"
                         v-model:page-size="orderListParams.size" layout="total, sizes, prev, pager, next, jumper" :total="total"
                         @size-change="handleSizeChange" @current-change="handleCurrentChange" />
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
 
<script setup>
import SearchBox from './component/SearchBox.vue'
import {
  getList,
  saveUpdateOrderLog,
  orderLogDetails,
  orderLogRecall,
  orderLogReject,
  orderLogPass,
  orderLogExport,
  jobStatusNum,
  userPublish,
  deleteOrderLog,
  getWaylineMaxTerrainHeight
} from '@/api/tickets/orderLog'
import { cloneDeep } from 'lodash';
 
let tabsList = ref([
  { label: '全部工单', name: 'all', value: null, count: 0 },
  { label: '待审核', name: 'WAIT_AUDIT', value: 1, count: 0 },
  { label: '已驳回', name: 'REJECTED', value: 2, count: 0 },
  { label: '已通过', name: 'PASS', value: 3, count: 0 },
  { label: '草稿', name: 'DRAFT', value: 0, count: 0 }
])
 
const orderListParams = reactive({
  current: 1,
  size: 10,
  searchParams: {},
})
 
const orderListTable = ref([])
function getTableList() {
  const apiParams = {
    ...cloneDeep(orderListParams),
    searchParams: {
      ...cloneDeep(orderListParams.searchParams)
    },
  }
  getList(apiParams).then(res => {
    orderListTable.value = res.data.data
  })
}
 
// 分页大小改变
const handleSizeChange = val => {
  orderListParams.size = val
  getTableList()
}
 
// 页码改变
const handleCurrentChange = val => {
  orderListParams.current = val
  getTableList()
}
 
// 传参查询条件
const searchClick = params => {
  orderListParams.current = 1
  orderListParams.size = 10
  orderListParams.searchParams = params
  getTableList()
}
 
const refreshGetJobList = () => {
  orderListParams.current = 1
  orderListParams.size = 10
  getTableList()
}
</script>
 
<style lang="scss" scoped>
.order-log-update {
  height: 0;
  flex: 1;
  margin: 0 10px 10px 10px;
  background-color: #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
 
  // 表格
  .task-table {
    height: 0;
    flex: 1;
    margin-top: 18px;
    overflow: auto;
  }
 
  .btnItem {
    height: 27px;
    line-height: 27px;
    border-radius: 0px 0px 0px 0px;
    border: 1px solid #51a8ff;
    font-family: Segoe UI, Segoe UI;
    font-weight: 400;
    font-size: 14px;
    color: #1C5CFF;
    padding: 0 10px;
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
 
    &.turnBack {
      border: 1px solid #ffa500;
      color: #ffa500;
    }
 
    &.cancelTask {
      border: 1px solid #00AA2D;
      color: #00AA2D;
    }
  }
  // 分页
  :deep(.custom-header th.el-table__cell) {
    color: rgba(0, 0, 0, 0.85);
  }
 
  :deep(.el-table td.el-table__cell) {
    color: #606266;
  }
 
  :deep(.el-pagination) {
    display: flex;
    justify-content: right;
  }
 
  :deep(.el-pagination button) {
    background: center center no-repeat none !important;
    color: #8eb8ea !important;
  }
}
</style>