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
| import request from '@/axios'
| export const getList = data => {
| return request({
| url: '/drone-device-core/jobEvent/eventPage',
| method: 'post',
| data,
| })
| }
| // 获取状态统计数据
| export const getstatusCount1 = params => {
| return request({
| url: '/drone-device-core/jobEvent/getstatusCount',
| method: 'get',
| params,
| })
| }
| export const getstatusCount = data => {
| return request({
| url: '/drone-device-core/jobEvent/getstatusCount',
| method: 'post',
| data,
| })
| }
| export const getStepInfo = eventNum => {
| return request({
| url: '/drone-device-core/jobEvent/getStepInfo',
| method: 'get',
| params: { eventNum },
| })
| }
|
| // 修改接口:处理待审核状态,动态构建 FormData 提交
| export const flowEvent = (data, file) => {
| const formData = new FormData()
|
| // 动态添加非空字段到 FormData
| Object.entries(data).forEach(([key, value]) => {
| if (value !== undefined && value !== null) {
| formData.append(key, value)
| }
| })
|
| // 如果 file 存在,则添加到 FormData
| if (file) {
| formData.append('file', file)
| }
|
| return request({
| url: '/drone-device-core/jobEvent/flowEvent',
| method: 'post',
| data: formData,
| headers: {
| 'Content-Type': 'multipart/form-data', // 设置为表单数据格式
| },
| })
| }
|
| // 新增接口:获取工单详细信息
| export const getTicketInfo = id => {
| return request({
| url: '/drone-device-core/jobEvent/getTicketInfo',
| method: 'get',
| params: { id }, // 使用工单 ID 查询
| })
| }
|
| // 获取算法
| export const getDictionaryByCode = codes => {
| return request({
| url: '/blade-system/dict-biz/listByCodes',
| method: 'get',
| params: {
| codes,
| },
| })
| }
| export const getChildList = (current, size, parentId, params) => {
| return request({
| url: '/blade-system/dict-biz/child-list',
| method: 'get',
| params: {
| ...params,
| current,
| size,
| parentId: parentId,
| },
| })
| }
|
| // 修改创建工单的方法
| export const createTicket = (data, file) => {
| const formData = new FormData()
|
| // 创建 eventDto 对象,不显式设置 file 字段
| const eventDto = {
| ...data, // 直接使用传入的 data,不添加 file: null
| }
|
| // 添加所有字段到 FormData
| Object.entries(eventDto).forEach(([key, value]) => {
| formData.append(key, value)
| })
|
| // 只有当 file 存在时才添加文件
| if (file) {
| formData.append('file', file)
| }
|
| return request({
| url: '/drone-device-core/jobEvent/saveEvent',
| method: 'post',
| data: formData,
| headers: {
| 'Content-Type': 'multipart/form-data',
| },
| })
| }
| // 获取按钮
| export const getButtons = params =>
| request({
| url: '/blade-system/menu/buttons',
| method: 'get',
| params,
| })
|
|