From d1bcde4242b59e3c102b5b61c378af1756aeadfe Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 04 Feb 2026 09:48:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/drone-command/src/page/index/top/index.vue | 6
applications/mobile-web-view/env/.env.production | 16
applications/drone-command/env/.env.production | 4
applications/drone-command/env/.env.test | 13
applications/drone-command/src/utils/stateToImageMap/drone.js | 10
applications/mobile-web-view/src/appPages/work/workDetail/index.vue | 1023 ++-----------------------------------
applications/mobile-web-view/src/permission.js | 2
applications/drone-command/src/views/resource/components/DrawPolygon.vue | 2
applications/mobile-web-view/env/.env | 2
applications/drone-command/src/store/modules/user.js | 2
applications/task-work-order/env/.env.production | 5
applications/drone-command/src/components/map-container/device-map-container.vue | 7
applications/task-work-order/env/.env.test | 25
applications/task-work-order/src/views/orderView/appConfiguration/process/index.vue | 10
applications/task-work-order/env/.env.development | 2
applications/drone-command/src/api/dataCockpit/index.js | 20
applications/drone-command/src/utils/cesium/useBoundary.js | 2
applications/mobile-web-view/env/.env.test | 11
applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue | 18
applications/mobile-web-view/index.html | 2
applications/drone-command/src/permission.js | 4
applications/drone-command/src/api/patchManagement/index.js | 11
/dev/null | 171 ------
applications/drone-command/src/axios.js | 174 ++---
applications/drone-command/src/api/job/task.js | 8
applications/mobile-web-view/env/.env.development | 20
applications/mobile-web-view/env/.env.localhost | 7
applications/task-work-order/env/.env | 6
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue | 17
applications/drone-command/env/.env.development | 7
applications/drone-command/env/.env | 10
31 files changed, 258 insertions(+), 1,359 deletions(-)
diff --git a/applications/drone-command/env/.env b/applications/drone-command/env/.env
index fc813f9..d97d213 100644
--- a/applications/drone-command/env/.env
+++ b/applications/drone-command/env/.env
@@ -1,13 +1,3 @@
-/*
- * @Author : yuan
- * @Date : 2026-01-07 14:58:30
- * @LastEditors : yuan
- * @LastEditTime : 2026-02-03 15:43:33
- * @FilePath : \applications\drone-command\env\.env
- * @Description :
- * Copyright 2026 OBKoro1, All Rights Reserved.
- * 2026-01-07 14:58:30
- */
#接口地址
VITE_APP_API=/api
diff --git a/applications/drone-command/env/.env.development b/applications/drone-command/env/.env.development
index 67d4a44..08ba807 100644
--- a/applications/drone-command/env/.env.development
+++ b/applications/drone-command/env/.env.development
@@ -2,7 +2,7 @@
# @Author : yuan
# @Date : 2026-01-31 14:34:31
# @LastEditors : yuan
- # @LastEditTime : 2026-02-03 15:52:27
+ # @LastEditTime : 2026-02-03 17:22:33
# @FilePath : \applications\drone-command\env\.env.development
# @Description :
# Copyright 2026 OBKoro1, All Rights Reserved.
@@ -16,10 +16,7 @@
#开发环境代理地址(推荐本地新建文件 .env.development.local 来进行覆盖)
# VITE_APP_URL=https://wrj.shuixiongit.com/api
-VITE_APP_URL=http://192.168.1.168
-
-#新大屏地址
-VITE_APP_DASHBOARD_URL='https://wrj.shuixiongit.com/command-center-dashboard/'
+VITE_APP_URL=http://192.168.1.33
# 域名
VITE_APP_AREA_NAME=https://wrj.shuixiongit.com
diff --git a/applications/drone-command/env/.env.production b/applications/drone-command/env/.env.production
index 6121cb1..5659bad 100644
--- a/applications/drone-command/env/.env.production
+++ b/applications/drone-command/env/.env.production
@@ -1,4 +1,3 @@
-
NODE_ENV='production'
#生产环境配置
@@ -9,9 +8,6 @@
# 域名
VITE_APP_AREA_NAME=https://aisky.org.cn
-
-#新大屏地址
-VITE_APP_DASHBOARD_URL='https://aisky.org.cn/command-center-dashboard/'
# ws地址
VITE_APP_WS_API_URL=wss://aisky.org.cn/drone-wss/api/v1/ws
diff --git a/applications/drone-command/env/.env.test b/applications/drone-command/env/.env.test
index 923fe31..79d7d21 100644
--- a/applications/drone-command/env/.env.test
+++ b/applications/drone-command/env/.env.test
@@ -1,3 +1,13 @@
+###
+ # @Author : yuan
+ # @Date : 2026-01-07 14:58:30
+ # @LastEditors : yuan
+ # @LastEditTime : 2026-02-04 09:12:33
+ # @FilePath : \applications\drone-command\env\.env.test
+ # @Description :
+ # Copyright 2026 OBKoro1, All Rights Reserved.
+ # 2026-01-07 14:58:30
+###
NODE_ENV = 'test'
#开发环境配置
@@ -5,9 +15,6 @@
# 服务地址
VITE_APP_URL = https://wrj.shuixiongit.com/api
-
-#新大屏地址
-VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
# 域名
VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
diff --git a/applications/drone-command/src/api/dataCockpit/index.js b/applications/drone-command/src/api/dataCockpit/index.js
index 21805e2..6432650 100644
--- a/applications/drone-command/src/api/dataCockpit/index.js
+++ b/applications/drone-command/src/api/dataCockpit/index.js
@@ -2,7 +2,7 @@
* @Author : yuan
* @Date : 2026-01-09 11:14:04
* @LastEditors : yuan
- * @LastEditTime : 2026-02-02 09:45:21
+ * @LastEditTime : 2026-02-03 17:21:56
* @FilePath : \applications\drone-command\src\api\dataCockpit\index.js
* @Description :
* Copyright 2026 OBKoro1, All Rights Reserved.
@@ -100,3 +100,21 @@
params
})
}
+
+// 查list --- 区域
+export const newAreaDivideList = params => {
+ return request({
+ url: `/drone-fw/cockpit/dataCockpit/areaDivideList`,
+ method: 'get',
+ params,
+ })
+}
+
+// 查list
+export const newDefenseSceneManageList = params => {
+ return request({
+ url: `/drone-fw/cockpit/dataCockpit/defenseSceneManageList`,
+ method: 'get',
+ params,
+ })
+}
\ No newline at end of file
diff --git a/applications/drone-command/src/api/home/aggregation.js b/applications/drone-command/src/api/home/aggregation.js
deleted file mode 100644
index b31f892..0000000
--- a/applications/drone-command/src/api/home/aggregation.js
+++ /dev/null
@@ -1,34 +0,0 @@
-import request from '@/axios'
-
-export const getDeviceRegionCount = params => {
- return request({
- url: '/drone-device-core/manage/api/v1/devices/getDeviceRegionCount',
- method: 'get',
- params,
- })
-}
-
-export const getDeviceRegion = data => {
- return request({
- url: '/drone-device-core/manage/api/v1/devices/getDeviceRegion',
- method: 'post',
- data:{ hidden_flag:0, ...data },
- })
-}
-
-// 事件聚合 和 事件散点
-export const getMapEvents = (data) => {
- return request({
- url: '/drone-device-core/jobEvent/mapEvents',
- method: 'post',
- data
- });
-};
-// 事件散点详情
-export const getEventDetails = (params) => {
- return request({
- url: '/drone-device-core/jobEvent/eventDetails',
- method: 'post',
- params
- });
-};
diff --git a/applications/drone-command/src/api/home/index.js b/applications/drone-command/src/api/home/index.js
deleted file mode 100644
index 76f51b1..0000000
--- a/applications/drone-command/src/api/home/index.js
+++ /dev/null
@@ -1,149 +0,0 @@
-import request from '@/axios';
-// 事件概况总数
-export const getJobEventTotal = () => {
- return request({
- url: '/drone-device-core/jobEvent/total',
- method: 'get',
- });
-};
-// 大屏首页=>事件状态数量
-export const getEventStatusNum = data => {
- return request({
- url: '/drone-device-core/jobEvent/eventStatusNum',
- method: 'post',
- data,
- })
-}
-// 事件概况分类数
-export const getJobEventByStatus = data => {
- return request({
- url: '/drone-device-core/jobEvent/eventByStatus',
- method: 'post',
- data,
- });
-};
-// 行业任务统计
-export const industryJobNumPieChart = data => {
- return request({
- url: '/drone-device-core/jobEvent/deviceEventList',
- method: 'post',
- data: data,
- });
-};
-// 事件任务统计
-export const jobEventBar = data => {
- return request({
- url: '/drone-device-core/wayline/waylineJobInfo/jobEventBar',
- method: 'post',
- data: data,
- });
-};
-// 设备统计
-export const getStatics = areaCode => {
- return request({
- url: '/drone-device-core/manage/api/v1/devices/deviceStatistics',
- method: 'post',
- params: {
- areaCode,
- },
- });
-};
-// 日历
-export const getCalen = data => {
- return request({
- url: '/drone-device-core/wayline/waylineJobInfo/jobEventBarByMouth',
- method: 'post',
- data,
- });
-};
-// 飞行统计
-export const getFly = data => {
- return request({
- url: '/drone-device-core/manage/api/v1/devices/deviceFlyTimeAndDistance',
- method: 'post',
- data,
- });
-};
-// 飞行统计111
-export const tongjiNestApi = data => {
- return request({
- url: `/drone-device-core/manage/api/v1/devices/getAllDeviceStatistics`,
- method: 'post',
- data,
- })
-}
-// 飞行时长 里程 任务数
-export const getFlyTime = data => {
- return request({
- url: '/drone-device-core/manage/api/v1/devices/deviceFlyTimeAndDistanceBar',
- method: 'post',
- data,
- });
-};
-
-// 获取事件工单和智飞工单的数量
-export const getOrderCountApi = (areaCode) => {
- return request({
- url: '/drone-device-core/jobEvent/getOrderCount',
- method: 'get',
- params: {
-
- areaCode
- },
- });
-};
-// 标记事件工单或智飞工单已读
-export const addOrderRecordApi = (type,ticketId) => {
- return request({
- url: '/drone-device-core/jobEvent/addOrderRecord',
- method: 'post',
- params: {
- type,
- ticketId
- },
- });
-};
-// 获取事件工单或者智飞工单的信息
-
-export const getOrderOrEventApi = data => {
- return request({
- url: '/drone-device-core/jobEvent/getOrderOrEvent',
- method: 'post',
- data: data,
- })
-}
-// 任务成果
-export const getdisposeApi = data => {
- return request({
- url: `/drone-device-core/jobEvent/eventStatusLine`,
- method: 'post',
- data,
- })
-}
-// 任务成果
-export const gettaskOutcomApi = data => {
- return request({
- url: `/blade-resource/attach/getManageAttachTypeStatistics`,
- method: 'post',
- data,
- })
-}
-
-// 执行机巢详情
-export const NestDetailApi = params => {
- return request({
- url: '/drone-device-core/wayline/waylineJobInfo/taskDetails',
- method: 'get',
- params,
- })
-}
-
-// 导出任务报表
-export const exportTaskReports = params => {
- return request({
- url: `/drone-device-core/wayline/waylineJobInfo/downloadJob`,
- method: 'get',
- responseType: 'blob',
- params,
- })
-}
\ No newline at end of file
diff --git a/applications/drone-command/src/api/home/territory.js b/applications/drone-command/src/api/home/territory.js
deleted file mode 100644
index b88ce8b..0000000
--- a/applications/drone-command/src/api/home/territory.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import request from '@/axios';
-// 更新图斑数据
-export const sdfwUpdate = params => {
- return request({
- url: `/drone-device-core/patches/api/v1/Patches/sdfwUpdate`,
- method: 'put',
- data: params,
- })
-}
\ No newline at end of file
diff --git a/applications/drone-command/src/api/job/task.js b/applications/drone-command/src/api/job/task.js
index 88d3dc2..c209719 100644
--- a/applications/drone-command/src/api/job/task.js
+++ b/applications/drone-command/src/api/job/task.js
@@ -198,6 +198,14 @@
})
}
+export const getDeviceRegionCount = params => {
+ return request({
+ url: '/drone-device-core/manage/api/v1/devices/getDeviceRegionCount',
+ method: 'get',
+ params,
+ })
+}
+
// 获取区域全部
export const getRegionTreeAll = params => {
return request({
diff --git a/applications/drone-command/src/api/patchManagement/index.js b/applications/drone-command/src/api/patchManagement/index.js
index 5b999f1..8de4525 100644
--- a/applications/drone-command/src/api/patchManagement/index.js
+++ b/applications/drone-command/src/api/patchManagement/index.js
@@ -111,4 +111,13 @@
method: 'get',
params,
})
-}
\ No newline at end of file
+}
+
+// 更新图斑数据
+export const sdfwUpdate = params => {
+ return request({
+ url: `/drone-device-core/patches/api/v1/Patches/sdfwUpdate`,
+ method: 'put',
+ data: params,
+ })
+}
diff --git a/applications/drone-command/src/api/tickets/orderLog.js b/applications/drone-command/src/api/tickets/orderLog.js
deleted file mode 100644
index 5e53e5f..0000000
--- a/applications/drone-command/src/api/tickets/orderLog.js
+++ /dev/null
@@ -1,108 +0,0 @@
-import request from '@/axios';
-
-export const getList = (data,current,size) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/pageList?current='+current+"&size="+size,
- method: 'post',
- data,
- });
-};
-
-export const saveUpdateOrderLog = (data) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/saveUpdateOrderLog',
- method: 'post',
- data,
- });
-};
-
-// 获取工单详细信息
-export const orderLogDetails = (id) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/details',
- method: 'get',
- params: { id }, // 使用工单 ID 查询
- });
-};
-// 撤回
-export const orderLogRecall = (id) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/recall',
- method: 'get',
- params: { id }, // 使用工单 ID 查询
- });
-};
-
-// 驳回
-export const orderLogReject = (id,remaker) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/reject',
- method: 'get',
- params: { id,remaker },
- });
-};
-// 通过
-export const orderLogPass = (id) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/pass',
- method: 'get',
- params: { id },
- });
-};
-
-
-// 导出
-export const orderLogExport = (data) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/export',
- method: 'post',
- data,
- responseType: 'blob',
- });
-};
-
-export const jobStatusNum = () => {
- return request({
- url: '/drone-device-core/wayline/orderLog/jobStatusNum',
- method: 'get'
- });
-};
-
-// 智飞工单 统计数替换上面接口
-// export const jobStatusNum = (data) => {
-// return request({
-// url: '/drone-device-core/wayline/orderLog/jobStatusNum',
-// method: 'post',
-// data
-// });
-// };
-
-// 草稿转发布
-export const userPublish = (id) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/userPublish',
- method: 'get',
- params: { id },
- });
-};
-//删除
-export const deleteOrderLog = (id) => {
- return request({
- url: '/drone-device-core/wayline/orderLog/deleteOrderLog',
- method: 'get',
- params: { id },
- });
-};
-
-// 获取返航最高 高度
-export const getWaylineMaxTerrainHeight = data => {
- return request({
- url: `/drone-odm/odmTaskInfo/odmTaskInfo/getWaylineMaxTerrainHeight`,
- method: 'post',
- data,
- })
-}
-
-
-
-
diff --git a/applications/drone-command/src/api/tickets/ticket.js b/applications/drone-command/src/api/tickets/ticket.js
deleted file mode 100644
index 139345a..0000000
--- a/applications/drone-command/src/api/tickets/ticket.js
+++ /dev/null
@@ -1,121 +0,0 @@
-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()
-
- // 创建 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 getTicketInfo = (id) => {
- return request({
- url: '/drone-device-core/jobEvent/getTicketInfo',
- method: 'get',
- params: { id }, // 使用工单 ID 查询
- })
-}
-
-// 修改接口:处理待审核状态,动态构建 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 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 }
- })
-}
-
-// 人工复核接口
-export const getReviewById = (id) => {
- return request({
- url: `/drone-device-core/jobEvent/reviewById/${id}`,
- method: 'get',
- })
-}
-
-// 下发任务
-export const getCreateEventJob = (id) => {
- return request({
- url: `/drone-device-core/wayline/waylineJobInfo/createEventJob/${id}`,
- method: 'post',
- })
-}
-// 导出工单
-export const exportTheTicket = params => {
- return request({
- url: `/drone-device-core/jobEvent/downloadEvent`,
- method: 'get',
- responseType: 'blob',
- params,
- })
-}
\ No newline at end of file
diff --git a/applications/drone-command/src/axios.js b/applications/drone-command/src/axios.js
index 2a9d292..1e7423d 100644
--- a/applications/drone-command/src/axios.js
+++ b/applications/drone-command/src/axios.js
@@ -6,63 +6,62 @@
* isToken是否需要token
*/
-import axios from 'axios';
-import store from '@/store/';
-import router from '@/router/';
-import { serialize } from '@/utils/util';
-import { getToken, removeToken, removeRefreshToken } from '@/utils/auth';
-import { isURL, validatenull } from '@/utils/validate';
-import { ElMessage } from 'element-plus';
-import website from '@/config/website';
-import { Base64 } from 'js-base64';
-import { baseUrl } from '@/config/env';
-import crypto from '@/utils/crypto';
-const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL;
+import axios from 'axios'
+import store from '@/store/'
+import router from '@/router/'
+import { serialize } from '@/utils/util'
+import { getToken, removeToken, removeRefreshToken } from '@/utils/auth'
+import { isURL, validatenull } from '@/utils/validate'
+import { ElMessage } from 'element-plus'
+import website from '@/config/website'
+import { Base64 } from 'js-base64'
+import { baseUrl } from '@/config/env'
+import crypto from '@/utils/crypto'
// 全局未授权错误提示状态,只提示一次
-let isErrorShown = false;
+let isErrorShown = false
-let _retry = false;
+let _retry = false
// 超时时间设置为10分钟,部分接口上传比较慢,如固件上传
-axios.defaults.timeout = 600000;
+axios.defaults.timeout = 600000
//返回其他状态码
axios.defaults.validateStatus = function (status) {
- return status >= 200 && status <= 500; // 默认的
-};
+ return status >= 200 && status <= 500 // 默认的
+}
//跨域请求,允许保存cookie
-axios.defaults.withCredentials = true;
+axios.defaults.withCredentials = true
//http request拦截
axios.interceptors.request.use(
config => {
// 初始化错误提示状态
- isErrorShown = false;
+ isErrorShown = false
//地址为已经配置状态则不添加前缀
if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
- config.url = baseUrl + config.url;
+ config.url = baseUrl + config.url
}
//安全请求header
- config.headers['areaCode'] = config?.params?.areaCode || store?.state?.user?.userInfo?.detail?.areaCode;
- config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
+ config.headers['areaCode'] = config?.params?.areaCode || store?.state?.user?.userInfo?.detail?.areaCode
+ config.headers['Blade-Requested-With'] = 'BladeHttpRequest'
//headers判断是否需要
- const authorization = config.authorization === false;
+ const authorization = config.authorization === false
if (!authorization) {
config.headers['Authorization'] = `Basic ${Base64.encode(
`${website.clientId}:${website.clientSecret}`
- )}`;
+ )}`
}
//headers判断请求是否携带token
- const meta = config.meta || {};
- const isToken = meta.isToken === false;
+ const meta = config.meta || {}
+ const isToken = meta.isToken === false
//headers传递token是否加密
- const cryptoToken = config.cryptoToken === true;
+ const cryptoToken = config.cryptoToken === true
//判断传递数据是否加密
- const cryptoData = config.cryptoData === true;
- const token = getToken();
+ const cryptoData = config.cryptoData === true
+ const token = getToken()
if (token && !isToken) {
config.headers[website.tokenHeader] = cryptoToken
? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
- : 'bearer ' + token;
+ : 'bearer ' + token
}
// 开启报文加密
// if (cryptoData) {
@@ -77,131 +76,118 @@
// }
//headers中配置text请求
if (config.text === true) {
- config.headers['Content-Type'] = 'text/plain';
+ config.headers['Content-Type'] = 'text/plain'
}
//headers中配置serialize为true开启序列化
if (config.method === 'post' && meta.isSerialize === true) {
- config.data = serialize(config.data);
+ config.data = serialize(config.data)
}
- return config;
+ return config
},
error => {
- return Promise.reject(error);
+ return Promise.reject(error)
}
-);
+)
//http response拦截
axios.interceptors.response.use(
res => {
- const status = res.data.error_code || res.data.code || res.status;
- const statusWhiteList = website.statusWhiteList || [];
- const message = res.data.msg || res.data.error_description || res.data.message || '系统错误';
- const config = res.config;
- const cryptoData = config.cryptoData === true;
+ const status = res.data.error_code || res.data.code || res.status
+ const statusWhiteList = website.statusWhiteList || []
+ const message = res.data.msg || res.data.error_description || res.data.message || '系统错误'
+ const config = res.config
+ const cryptoData = config.cryptoData === true
if (status === 511) {
ElMessage({
message: '请联系运维人员上传密钥证书!',
type: 'error',
- });
+ })
// 获取当前路由名称
- const currentRouteName = router.currentRoute.value.name;
+ const currentRouteName = router.currentRoute.value.name
// 如果当前路由不是登录页,则跳转到登录页
if (currentRouteName !== '登录页') {
store.dispatch('FedLogOut').then(() =>
router.push({
path: '/login',
})
- );
+ )
}
- return Promise.reject(new Error(message));
+ return Promise.reject(new Error(message))
}
//如果在白名单里则自行catch逻辑处理
- if (statusWhiteList.includes(status)) return Promise.reject(res);
+ if (statusWhiteList.includes(status)) return Promise.reject(res)
// 如果是401并且没有重试过,尝试刷新token
if (status === 401 && !_retry) {
// 标记此请求已尝试刷新token
- _retry = true;
+ _retry = true
// 调用RefreshToken action来刷新token
return store
.dispatch('RefreshToken')
.then(() => {
- const meta = config.meta || {};
- const isToken = meta.isToken === false;
- const cryptoToken = config.cryptoToken === true;
+ const meta = config.meta || {}
+ const isToken = meta.isToken === false
+ const cryptoToken = config.cryptoToken === true
// 获取刷新后的token
- const token = getToken();
+ const token = getToken()
if (token && !isToken) {
config.headers[website.tokenHeader] = cryptoToken
? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
- : 'bearer ' + token;
+ : 'bearer ' + token
}
// 重新发送原来的请求
- return axios(config);
+ return axios(config)
})
.catch(() => {
// 首次报错时提示
if (!isErrorShown) {
- isErrorShown = true;
+ isErrorShown = true
ElMessage({
message: message,
type: 'error',
- });
+ })
}
// 清除token信息
- removeToken();
- removeRefreshToken();
- const env = import.meta.env.VITE_APP_ENV;
+ removeToken()
+ removeRefreshToken()
+ const env = import.meta.env.VITE_APP_ENV
// 重定向到登录页
store.dispatch('FedLogOut').then(() => router.push({
- path: '/login'
- }));
- // env === 'development'
- // ? store.dispatch('FedLogOut').then(() =>
- // router.push({
- // path: '/login',
- // })
- // )
- // : store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
- return Promise.reject(new Error(message));
- });
+ path: '/login'
+ }))
+
+ return Promise.reject(new Error(message))
+ })
}
// 如果是401并且已经重试过,直接跳转到登录页面
if (status === 401 && _retry) {
// 首次报错时提示
if (!isErrorShown) {
- isErrorShown = true;
+ isErrorShown = true
ElMessage({
message: '用户令牌过期,请重新登录',
type: 'error',
- });
+ })
}
// 清除token信息
- removeToken();
- removeRefreshToken();
+ removeToken()
+ removeRefreshToken()
// 重定向到登录页
- // store.dispatch('FedLogOut').then(() => router.push({
- // path: '/login'
- // }));
- const env = import.meta.env.VITE_APP_ENV;
- env === 'development'
- ? store.dispatch('FedLogOut').then(() =>
- router.push({
- path: '/login',
- })
- )
- : store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
- return Promise.reject(new Error(message));
+ store.dispatch('FedLogOut').then(() => router.push({
+ path: '/login'
+ }))
+
+ return Promise.reject(new Error(message))
}
// 如果请求为oauth2错误码则首次报错时提示
if (status > 2000 && !validatenull(res.data.error_description)) {
// 首次报错时提示
if (!isErrorShown) {
- isErrorShown = true;
+ isErrorShown = true
ElMessage({
message: message,
type: 'error',
- });
+ })
}
- return Promise.reject(new Error(message));
+ return Promise.reject(new Error(message))
}
// 如果请求为非200默认统一处理
if (status !== 200 && status !== 0) {
@@ -209,19 +195,19 @@
ElMessage({
message: message,
type: 'error',
- });
+ })
}
- return Promise.reject(new Error(message));
+ return Promise.reject(new Error(message))
}
// 解析加密报文
if (cryptoData) {
- res.data = JSON.parse(crypto.decryptAES(res.data, crypto.aesKey));
+ res.data = JSON.parse(crypto.decryptAES(res.data, crypto.aesKey))
}
- return res;
+ return res
},
error => {
- return Promise.reject(new Error(error));
+ return Promise.reject(new Error(error))
}
-);
+)
window._request = axios
-export default axios;
+export default axios
diff --git a/applications/drone-command/src/components/map-container/device-map-container.vue b/applications/drone-command/src/components/map-container/device-map-container.vue
index 7819129..7d6383c 100644
--- a/applications/drone-command/src/components/map-container/device-map-container.vue
+++ b/applications/drone-command/src/components/map-container/device-map-container.vue
@@ -49,9 +49,8 @@
import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue'
import { buildEllipsePositions } from '@/utils/cesium/shapeTools'
import { AREA_TYPE_STYLE_MAP, BUFFER_LEVEL_STYLES, DEFAULT_AREA_STYLE } from '@ztzf/constants'
-import { fwAreaDivideListApi } from '@/views/areaManage/partition/partitionApi'
-import { fwDefenseSceneManageListApi } from '@/views/areaManage/sceneManage/sceneManageApi'
+import { newAreaDivideList, newDefenseSceneManageList } from '@/api/dataCockpit/index'
import { newCockpitAggregationApi } from '@/api/dataCockpit'
import layerControlIcon from '@/assets/images/dataCockpit/layerControl.png'
@@ -1142,7 +1141,7 @@
const loadPartitions = async () => {
if (!viewer) return
try {
- const res = await fwAreaDivideListApi({
+ const res = await newAreaDivideList({
isSetSceneManage: 1,
flyTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
})
@@ -1306,7 +1305,7 @@
const loadCommandPosts = async () => {
try {
- const res = await fwDefenseSceneManageListApi({
+ const res = await newDefenseSceneManageList({
time: dayjs().format('YYYY-MM-DD HH:mm:ss')
})
renderCommandPosts(res?.data?.data ?? [])
diff --git a/applications/drone-command/src/page/index/top/index.vue b/applications/drone-command/src/page/index/top/index.vue
index 1423d34..0493285 100644
--- a/applications/drone-command/src/page/index/top/index.vue
+++ b/applications/drone-command/src/page/index/top/index.vue
@@ -93,16 +93,12 @@
cancelButtonClass: 'command-message-box-cancel',
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
- const env = import.meta.env.VITE_APP_ENV
- const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
this.$router.push({ path: '/login' })
- // env === 'development' ? this.$router.push({ path: '/login' }) : window.location.replace(`${adminUrl}#/login`)
})
})
},
jumpMH () {
- // const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
- // window.location.href = `${adminUrl}#/gatewayPage`
+
},
},
}
diff --git a/applications/drone-command/src/permission.js b/applications/drone-command/src/permission.js
index 5062baa..2e3d72f 100644
--- a/applications/drone-command/src/permission.js
+++ b/applications/drone-command/src/permission.js
@@ -18,8 +18,6 @@
NProgress.configure({ showSpinner: false })
const lockPage = '/lock' //锁屏页
const urlParams = getUrlParams(window.location.href)
-const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
-const env = import.meta.env.VITE_APP_ENV
function findRouteByPath (routes, targetPath) {
// 遍历数组中的每个路由对象
@@ -96,7 +94,6 @@
store.dispatch('FedLogOut').then(() => {
next({ path: '/login' })
})
- // store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
} else {
const meta = to.meta || {}
const query = to.query || {}
@@ -122,7 +119,6 @@
next()
} else {
next('/login')
- // env === 'development' ? next('/login') : window.location.replace(`${adminUrl}#/login`)
}
}
})
diff --git a/applications/drone-command/src/store/modules/user.js b/applications/drone-command/src/store/modules/user.js
index af8714f..4dbd240 100644
--- a/applications/drone-command/src/store/modules/user.js
+++ b/applications/drone-command/src/store/modules/user.js
@@ -272,8 +272,6 @@
GetMenu({ commit, dispatch }, tenantId) {
const errLogOut = () => {
dispatch('LogOut').then(()=>{
- const env = import.meta.env.VITE_APP_ENV
- const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
window.location.href = "/drone-command/login"
// env === 'development'
// ? window.location.href = "/drone-command/login"
diff --git a/applications/drone-command/src/utils/cesium/useBoundary.js b/applications/drone-command/src/utils/cesium/useBoundary.js
index 053ddd6..abddf39 100644
--- a/applications/drone-command/src/utils/cesium/useBoundary.js
+++ b/applications/drone-command/src/utils/cesium/useBoundary.js
@@ -4,7 +4,7 @@
import * as Cesium from 'cesium'
import { PolyGradientMaterial } from '@/utils/cesium/Material'
import { useStore } from 'vuex'
-import { getDeviceRegion, getDeviceRegionCount } from '@/api/home/aggregation'
+import { getDeviceRegion, getDeviceRegionCount } from '@/api/job/task'
import userStore from '@/store/modules/user'
import { areaCodeToArr, getContourByCode, getDockPolyLine, getLnglatAltitude } from '@/utils/cesium/mapUtil'
import getBaseConfig from '@/buildConfig/config'
diff --git a/applications/drone-command/src/utils/stateToImageMap/drone.js b/applications/drone-command/src/utils/stateToImageMap/drone.js
index 0cab6d7..8fde846 100644
--- a/applications/drone-command/src/utils/stateToImageMap/drone.js
+++ b/applications/drone-command/src/utils/stateToImageMap/drone.js
@@ -1,13 +1,3 @@
-/*
- * @Author: shuishen 1109946754@qq.com
- * @Date: 2025-04-17 20:17:12
- * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2025-04-17 20:28:08
- * @FilePath: \command-center-dashboard\src\utils\stateToImageMap\drone.js
- * @Description:
- *
- * Copyright (c) 2025 by shuishen, All Rights Reserved.
- */
import endingImg from '@/assets/images/aiNowFly/ending-offline.png'
import endingHighImg from '@/assets/images/aiNowFly/ending-high.png'
diff --git a/applications/drone-command/src/views/resource/components/DrawPolygon.vue b/applications/drone-command/src/views/resource/components/DrawPolygon.vue
index 59428dd..ee8dfe1 100644
--- a/applications/drone-command/src/views/resource/components/DrawPolygon.vue
+++ b/applications/drone-command/src/views/resource/components/DrawPolygon.vue
@@ -6,7 +6,7 @@
import * as Cesium from 'cesium';
import { ElMessage } from 'element-plus';
-import { sdfwUpdate } from '@/api/home/territory';
+import { sdfwUpdate } from '@/api/patchManagement';
let curPolygonPosition = [];
let savePolygonPosition = [];
diff --git a/applications/drone-command/src/views/tickets/component/AddEditDetails.vue b/applications/drone-command/src/views/tickets/component/AddEditDetails.vue
deleted file mode 100644
index 1cf0c9d..0000000
--- a/applications/drone-command/src/views/tickets/component/AddEditDetails.vue
+++ /dev/null
@@ -1,622 +0,0 @@
-<template>
- <el-dialog class="command-dialog-mange" modal-class="add-edit-details" v-model="isShowAddEditDetails" :title="txtTitle"
- width="70%" :close-on-click-modal="false" :destroy-on-close="true" @close="closeFun"
- >
- <div class="add-edit-details">
- <div class="process" v-if="txtTitle !== '新建工单'">
- <div class="order_title">{{ formParams.name }}</div>
- <div class="custom-steps-container">
- <!-- 标题行 -->
- <div class="steps-titles">
- <div class="step-title" v-for="(record, index) in formParams.record_list"
- :class="{ active: record.user_id >= 0 }" :key="index">
- {{ record.status_str }}
- </div>
- </div>
- <!-- Element Steps 组件 -->
- <el-steps :active="formParams.active" align-center class="custom-steps">
- <el-step v-for="(record, index) in formParams.record_list" :key="index">
- <template #description>
- <span class="step-description" style="position: relative; display: inline-block">
- {{ record.user_name }}
- </span>
- <span class="step-timer">
- {{ record.interval_time_str }}
- </span>
- <div class="step-description">
- {{ record.create_time_str }}
- </div>
- </template>
- </el-step>
- </el-steps>
- </div>
- </div>
- <el-form ref="orderFormRef" :model="formParams" :rules="rules" label-width="100px">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input v-model="formParams.name" placeholder="请输入工单名称" maxlength="100" show-word-limit
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关联航线" prop="file_id">
- <el-input
- v-if="formParams?.wayline_file_region_vo?.is_deleted"
- v-model="formParams.wayline_file_region_vo.name"
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
- </el-input>
- <el-select
- v-if="!formParams?.wayline_file_region_vo?.is_deleted || txtTitle === '新建工单'"
- v-model="formParams.file_id" placeholder="请选择航线"
- filterable
- @change="getFlyingNest"
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
- <el-option v-for="item in lineList" :key="item.wayline_id" :label="item.name" :value="item.wayline_id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
- <el-input-number class="command-input" v-model="formParams.rth_altitude" :min="50" :max="500"
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input-number>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="关联机巢" prop="device_sns">
- <el-select v-model="formParams.device_sns" placeholder="请选择机巢" multiple
- :disabled="(txtTitle === '工单审核' || txtTitle === '工单详情')">
- <el-option v-for="item in drone_sns" :key="item.device_sn" :label="item.nickname"
- :value="item.device_sn" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关联算法" prop="ai_types">
- <el-select v-model="formParams.ai_types" placeholder="请选择关联算法" :multiple-limit="3" multiple
- :disabled="logCollect || (txtTitle === '工单审核' || txtTitle === '工单详情')" @change="aiTypeChange">
- <el-option v-for="item in aiTypeList" :key="item.dictKey" :label="item.dictValue"
- :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item class="safe-height" label="自定义识别区" prop="enable_custom_area">
- <el-checkbox v-model="formParams.enable_custom_area" :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-checkbox>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12" v-if="txtTitle === '新建工单'">
- <el-form-item label="工单内容" prop="content">
- <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255"
- show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
- </el-form-item>
- </el-col>
-
- <el-col :span="12" prop="statusStr" v-else>
- <el-form-item label="当前状态">
- {{ getOrderStatus(formParams.status) }}
- </el-form-item>
- </el-col>
-
- <el-col :span="7">
- <el-form-item label="周期频次" prop="date_range">
- <el-date-picker :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" v-model="formParams.date_range"
- type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
- :disabled-date="disabledDate" />
- </el-form-item>
- </el-col>
- <el-col :span="2">
- <el-select v-model="formParams.rep_fre_type" placeholder="请选择频次"
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'">
- <el-option v-for="item in weeks" :key="item" :label="item" :value="item" />
- </el-select>
- </el-col>
- <el-col :span="3">
- <el-time-picker :style="{ width: pxToRem(140) }" v-model="formParams.deal_time"
- :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'" prop="deal_time" value-format="HH:mm"
- :picker-options="{ selectableRange: '00:00 - 23:59' }" />
- </el-col>
- </el-row>
-
- <el-row :gutter="20" v-if="txtTitle === '工单审核' || txtTitle === '工单详情' || txtTitle === '工单编辑'">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input type="textarea" v-model="formParams.content" rows="4" placeholder="请输入工单内容" maxlength="255"
- show-word-limit :disabled="txtTitle === '工单审核' || txtTitle === '工单详情'"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20" style="height: 400px">
- <el-col :span="24">
- <map-container v-if="isShowAddEditDetails" ref="mapContainerRef"></map-container>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <template #footer v-if="txtTitle === '新建工单'">
- <div class="dialog-footer">
- <el-button type="danger" @click="submitForm(1)" icon="el-icon-position">发起</el-button>
- <!-- <el-button type="primary" @click="submitForm(0)" icon="el-icon-document-add">存草稿</el-button>-->
- <el-button @click="cancel" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- <template #footer v-if="txtTitle === '工单审核'">
- <div class="dialog-footer">
- <el-button type="primary" v-if="formParams.status == 1 && permission.orderLogpass"
- @click="orderPass(formParams.id)">通过
- </el-button>
- <el-button type="danger" v-if="formParams.status == 1 && permission.rejection_btn"
- @click="orderReject(formParams.id)">驳回
- </el-button>
- <el-button @click="cancel" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- <template #footer v-if="txtTitle === '工单编辑'">
- <div class="dialog-footer">
- <el-button type="danger"
- v-if="formParams.status == 0 || (formParams.status == 2 && userInfo.user_id === formParams.create_user)"
- @click="submitForm(1)" icon="el-icon-position">发布
- </el-button>
- <el-button @click="cancel" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- </el-dialog>
-</template>
-
-<script setup>
-import { pxToRem, pxToRemNum } from '@/utils/rem'
-import { ref, shallowRef, onMounted, computed } from 'vue'
-import { newGetWorkspacesPage } from '@/api/resource/wayline'
-import { getDictionaryByCode } from '@/api/system/dictbiz'
-import { getFlyingNestBy } from '@/api/device/device'
-import {
- saveUpdateOrderLog,
- orderLogDetails,
- orderLogPass,
- orderLogReject,
- orderLogRecall, getWaylineMaxTerrainHeight
-} from '@/api/tickets/orderLog'
-import dayjs from 'dayjs'
-import 'dayjs/locale/zh-cn' // 导入中文语言包
-import _ from 'lodash'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import weekday from 'dayjs/plugin/weekday'
-dayjs.extend(weekday)
-dayjs.locale('zh-cn')
-import { useStore } from 'vuex'
-import { useIdentificationArea } from '@ztzf/hooks'
-
-const emit = defineEmits(['refresh'])
-
-const store = useStore()
-const userInfo = computed(() => store.state.user.userInfo)
-const permission = computed(() => store.state.user.permission)
-
-const waylineTypes = ref('')
-const logCollect = ref(false)
-
-// safeHeight 计算属性
-const safeHeight = computed(() => {
- const height = store.state.common.safeHeight
- return Number(height) || 0 // 确保是数字类型
-})
-
-// positionsArr 计算属性
-const positionsArr = computed(() => {
- const arr = store.state.common.positionsArr
- return arr || [] // 确保是数组类型
-})
-
-const txtTitle = inject('txtTitle')
-const rowObj = inject('rowObj')
-
-const isShowAddEditDetails = defineModel('show')
-const mapContainerRef = ref(null)
-const orderFormRef = ref(null)
-const formParams = ref({})
-const rules = ref({
- name: [
- { required: true, message: '请输入工单名称', trigger: 'blur' },
- { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' }
- ],
- file_id: [{ required: true, message: '需要选择航线', trigger: 'change' }],
- device_sns: [{ required: true, message: '请选择机巢', trigger: 'change' }],
- content: [
- { required: true, message: '请输入工单内容', trigger: 'blur' },
- { max: 255, message: '工单内容不能超过255个字', trigger: 'blur' }
- ],
- date_range: [{ required: true, message: '请选择时间不能为空', trigger: 'blur' }],
- rep_fre_type: [{ required: true, message: '请选择周期', trigger: 'blur' }],
- deal_time: [{ required: true, message: '请选择执行时间', trigger: 'blur' }]
-})
-//周期
-const weeks = ref(['每天', '周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日'])
-
-let lineList = inject('lineList')
-let aiTypeList = inject('aiTypeList')
-
-// 获取航线
-// let lineList = ref([])
-// function getLines() {
-// const formData = {
-// name: '',
-// waylineType: undefined,
-// current: 1,
-// size: 99999999,
-// descs: 'update_time'
-// }
-// newGetWorkspacesPage(formData).then(res => {
-// lineList.value = res.data.data.records
-// })
-// }
-
-function getOrderStatus (status) {
- const statusTextMap = {
- 0: '草稿',
- 1: '待审核',
- 2: '已驳回',
- 3: '已通过'
- }
- return statusTextMap[status] || '未知状态'
-}
-
-function disabledDate (time) {
- return time.getTime() < Date.now() - 8.64e7 // 86400000 = 24 * 60 * 60 * 1000
-}
-
-// 关联机巢
-const drone_sns = ref([])
-function getFlyingNest (waylineId) {
- let currentLine = lineList.value.find(item => item.wayline_id === waylineId)
- if (!formParams.ai_types || formParams.ai_types.length === 0) {
- if (currentLine.wayline_type === '0' || currentLine.wayline_type === '3') {
- logCollect.value = false
- } else {
- logCollect.value = true
- }
- }
- // 选中航线对象
- initMapLine({}, polygon => {
- const params = {
- type: ['2', '4', '5', '7', '8', '9', '10'].includes(currentLine.wayline_type) ? 2 : 0,
- wayline_id: waylineId,
- polygon
- }
- // 重置
- formParams.value.device_sns = []
- drone_sns.value = []
- getFlyingNestBy(params).then(res => {
- drone_sns.value = res.data.data
- initMapLine()
- })
- })
-}
-
-// 根据算法 重新加载航线
-function aiTypeChange(val) {
- formParams.ai_types = val
- waylineTypes.value = ''
- if(val.length > 0) {
- waylineTypes.value = '3'
- }
- const formData = {
- name: '',
- waylineType: undefined,
- current: 1,
- size: 99999999,
- descs: 'update_time',
- waylineTypes: waylineTypes.value
- }
- newGetWorkspacesPage(formData).then(res => {
- lineList.value = res.data.data.records
- })
-}
-
-// 获取算法
-// let aiTypeList = ref([])
-// function aitypeList() {
-// getDictionaryByCode('SF').then(res => {
-// aiTypeList.value = res.data.data['SF']
-// })
-// }
-
-// initMapLine 方法
-const initMapLine = async (infos = {}, cb = () => { }) => {
- let currentLine = lineList.value.find(item => item.wayline_id == formParams.value.file_id)
-
- if (!currentLine) {
- currentLine = formParams.value.wayline_file_region_vo
- }
-
- await nextTick()
- if (mapContainerRef.value?.initAddEntity) {
- mapContainerRef.value.initAddEntity('polyline', {
- url: `${import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key}?_t=${new Date().getTime()}`,
- type: currentLine.wayline_type,
- cb,
- infos
- })
- }
-}
-
-function formatDate (date) {
- if (!date) return undefined
- const d = new Date(date)
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
- d.getDate()
- ).padStart(2, '0')} 00:00:00`
-}
-
-async function returnHeight () {
- let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn))
- const maxItem = checkedList.reduce((max, item) => {
- return item.drone_height > max.drone_height ? item : max
- })
- // 返航绝对高度
- let backHeight = formParams.value.rth_altitude // + maxItem.drone_height
- console.log(backHeight, 'backHeight')
- // 安全起飞高度
- let positions = positionsArr.value
- positions.unshift({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- positions.push({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- let resultHeight = 0
- await getWaylineMaxTerrainHeight(positions).then(res => {
- resultHeight = safeHeight.value > (res.data.data + 30) ? safeHeight.value : (res.data.data + 30)
- })
- let valueHeight = _.round(backHeight - resultHeight, 2)
- return _.round(backHeight - resultHeight, 2)
-}
-
-function submitForm (status) {
- orderFormRef.value?.validate(async (valid, fields) => {
- if (valid) {
- if (formParams.value?.wayline_file_region_vo?.is_deleted) {
- await ElMessageBox.confirm(`当前的航线已被删除,是否重新选择航线?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- });
- // 如果是还确定那边重新把关联航线和机巢放出来选
- // 确保wayline_file_region_vo对象存在再进行赋值
- if (formParams.value && formParams.value.wayline_file_region_vo) {
- formParams.value.wayline_file_region_vo.is_deleted = false;
- }
- formParams.value.file_id = '';
- formParams.value.device_sns = [];
- }
-
- formParams.value.begin_time = formatDate(formParams.value.date_range[0])
- formParams.value.end_time = formatDate(formParams.value.date_range[1])
- // 如果选中日期包含当前天,那么选中的时间点不能小于当前时间
- if (formParams.value.deal_time) {
- const selectedDate = dayjs(formParams.value.date_range[0]).format('YYYY-MM-DD')
- const selectedTime = dayjs(selectedDate + ' ' + formParams.value.deal_time).toDate()
- const now = new Date()
-
- if (selectedDate === dayjs().format('YYYY-MM-DD') && selectedTime < now) {
- return ElMessage({ message: '任务时间不能小于当前时间', type: 'warning' })
- }
- }
- let checkedList = drone_sns.value.filter(item => formParams.value.device_sns.includes(item.device_sn))
- const maxItem = checkedList.reduce((max, item) => {
- return item.drone_height > max.drone_height ? item : max
- })
- // 返航绝对高度
- let backHeight = formParams.value.rth_altitude // + maxItem.drone_height
- console.log(backHeight, 'backHeight')
- // 安全起飞高度
- let positions = positionsArr.value
- positions.unshift({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- positions.push({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- let resultHeight = 0
- let valueHeight = 0
- await getWaylineMaxTerrainHeight(positions).then(res => {
- resultHeight = (safeHeight.value + maxItem.drone_height) > (res.data.data + 30) ? (safeHeight.value + maxItem.drone_height) : (res.data.data + 30)
- console.log(resultHeight, maxItem.drone_height, '999')
- valueHeight = (resultHeight - maxItem.drone_height) > backHeight ? _.round(resultHeight - maxItem.drone_height) : 0
- })
- if (valueHeight > 0) {
- await ElMessageBox.confirm(`当前返航高度存在安全隐患,建议调整为${valueHeight}米以上后进行发布`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- }
- formParams.value.enable_custom_area = formParams.value.enable_custom_area ? 1 : 0
- const submitData = {
- ...formParams.value,
- status: status,
- ai_types: formParams.value.ai_types?.length ? formParams.value.ai_types : []
- }
- await saveUpdateOrderLog(submitData)
- if (txtTitle === '新建工单') {
- ElMessage({ message: '工单创建成功', type: 'success' })
- } else {
- ElMessage({ message: '工单发布成功', type: 'success' })
- }
- cancel()
- } else {
- console.log('表单验证失败', fields)
- }
- })
-}
-// 审核通过
-function orderPass (id) {
- orderLogPass(id).then(res => {
- ElMessage.success('审核通过')
- cancel()
- })
-}
-// 驳回
-const orderReject = async (id) => {
- try {
- const { value } = await ElMessageBox.prompt('', '驳回原因', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- inputPlaceholder: '请输入驳回原因',
- inputValidator: (value) => {
- if (!value) {
- return '驳回原因不能为空'
- }
- }
- })
- // 用户输入了内容并点击确定
- await orderLogReject(id, value)
- ElMessage.success('驳回成功')
- cancel()
- } catch (error) {
- // 用户点击取消或关闭弹窗
- if (error !== 'cancel' && error !== 'close') {
- ElMessage.error('驳回失败')
- console.error('驳回错误:', error)
- }
- }
-}
-
-const initMapPosition = async () => {
- await nextTick()
-
- if (mapContainerRef.value?.initAddEntity) {
- mapContainerRef.value.initAddEntity('initPosition')
- }
-}
-
-// 监听txtTitle
-watch(isShowAddEditDetails, async (newVal, oldVal) => {
- formParams.value = { rth_altitude: 120 }
- if (txtTitle.value === '工单审核' || txtTitle.value === '工单详情' || txtTitle.value === '工单编辑') {
- const response = await orderLogDetails(rowObj.value.id)
- const data = response.data.data
- formParams.value = {
- ...data
- }
- formParams.value.enable_custom_area = formParams.value.enable_custom_area === 1 ? true : false
- drone_sns.value = data.device_list
- initMapLine(data.device_map_infos)
- } else {
- initMapPosition()
- }
-}, {
- immediate: true // 立即执行一次
-})
-function closeFun() {
- formParams.value = {}
- isShowAddEditDetails.value = false
-}
-
-// function handleBeforeClose () {
-// cancel()
-// }
-function cancel () {
- formParams.value = {}
- isShowAddEditDetails.value = false
- emit('refresh')
-}
-
-// 自定义识别区渲染
-const {setArea,removeArea } = useIdentificationArea()
-watch(()=>[formParams.value.enable_custom_area,formParams.value.ai_types],async () => {
- const {enable_custom_area,ai_types} = formParams.value
- if (enable_custom_area && ai_types?.length > 0) {
- setArea(formParams.value.ai_types,mapContainerRef.value?.getViewer())
- } else{
- removeArea()
- }
-},{ immediate: true }) // 待验证 等后端加enable_custom_area
-
-// onMounted(async () => {
-// aitypeList()
-// getLines()
-// });
-</script>
-
-<style lang="scss" scoped>
-.add-edit-details {
- .safe-height {
- display: flex;
- align-items: center;
- :deep(.el-form-item__label) {
- width: 120px !important;
- }
-
- :deep(.el-input-number) {
- width: 180px !important;
- }
- }
-
- .week_pc_one {
- flex: 1;
-
- .week-r {
- margin-right: 4px;
- }
-
- &> ::v-deep(div) {
- width: 100% !important;
- }
- }
-
- .process {
- .order_title {
- height: 30px;
- line-height: 30px;
- text-align: center;
- font-size: 20px;
- font-weight: bold;
- color: #333;
- }
-
- .custom-steps-container {
- width: 100%;
- margin: 7px 0;
- }
-
- .steps-titles {
- display: flex;
- justify-content: space-between;
- margin-bottom: 16px;
- position: relative;
- }
-
- .step-title {
- text-align: center;
- flex: 1;
- font-size: 16px;
- color: #999;
- position: relative;
- padding-bottom: 10px;
- }
-
- .step-title.active {
- color: #409eff;
- font-weight: bold;
- }
-
- .custom-steps {
- margin-top: -20px;
- /* 向上移动与标题重叠 */
- }
-
- .el-step__head {
- margin-top: 0;
- }
-
- .el-step__description {
- margin-top: 8px;
- padding: 0 20px;
- }
-
- .step-description {
- font-size: 14px;
- color: #666;
- line-height: 2.2;
- }
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/component/SearchBox.vue b/applications/drone-command/src/views/tickets/component/SearchBox.vue
deleted file mode 100644
index 967ca72..0000000
--- a/applications/drone-command/src/views/tickets/component/SearchBox.vue
+++ /dev/null
@@ -1,313 +0,0 @@
-<template>
- <div class="search-box-test">
- <el-form :model="searchForm" inline>
- <div class="search-first">
- <el-form-item label="关键字:">
- <el-input v-model="searchForm.key_word" placeholder="编号/名称/内容/姓名" clearable />
- </el-form-item>
- <el-form-item label="选择日期:" :style="{ width: pxToRem(460) }">
- <el-date-picker
- v-model="dateRange"
- type="daterange"
- range-separator="至" start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-value="datePickerDefaultVal" @change="handleSearch" />
- </el-form-item>
- <el-form-item label="关联航线:">
- <el-select
- :teleported="false"
- v-model="searchForm.file_id"
- placeholder="请选择关联航线"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in lineList"
- :key="item.wayline_id"
- :label="item.name"
- :value="item.wayline_id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="关联算法:">
- <el-select
- :teleported="false"
- v-model="searchForm.ai_typesValue"
- placeholder="请选择关联算法"
- clearable @change="handleSearch">
- <el-option
- v-for="item in aiTypeList"
- :key="item.dictKey"
- :label="item.dictValue"
- :value="item.dictKey"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="工单状态:">
- <el-select
- :teleported="false"
- :disabled="activeTab === 'WAIT_AUDIT' || activeTab === 'REJECTED' || activeTab === 'PASS'"
- v-model="searchForm.status"
- placeholder="请选择单状态"
- @change="handleSearch"
- clearable>
- <el-option
- v-for="item in orderStatus"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="工单周期:" :style="{ width: pxToRem(460) }">
- <el-date-picker
- v-model="cycleDateRange"
- type="daterange"
- range-separator="至" start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-value="datePickerDefaultVal" @change="handleSearch"/>
- </el-form-item>
- <el-form-item label="选择频次:">
- <el-select v-model="searchForm.rep_fre_type" placeholder="请选择频次" clearable @change="handleSearch">
- <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
- </el-select>
- </el-form-item>
- <el-form-item label="执行时间:">
- <el-time-picker @change="handleSearch"
- v-model="searchForm.deal_time"
- placeholder="请选择执行时间"
- prop="deal_time"
- value-format="HH:mm"
- :picker-options="{ selectableRange: '00:00 - 23:59'}" />
- </el-form-item>
- <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
- <el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
- </div>
- </el-form>
- </div>
-</template>
-<script setup>
-import { pxToRem } from '@/utils/rem';
-import { calculateDefaultRange } from '@/utils/util'
-import { newGetWorkspacesPage } from '@/api/resource/wayline'
-import { getDictionaryByCode } from '@/api/system/dictbiz'
-import dayjs from 'dayjs';
-// 选择日期
-const dateRange = ref('')
-let datePickerDefaultVal = calculateDefaultRange()
-// 选择周期
-const cycleDateRange = ref('')
-const searchForm = reactive({
- ai_types: [],
- ai_typesValue: '',
- deal_time: "",
- file_id: "",
- key_word: "",
- status: '',
- rep_fre_type: '',
-})
-
-const emit = defineEmits(['search']);
-
-const rowObj = inject('rowObj')
-const activeTab = inject('activeTab')
-const lineList = inject('lineList')
-const aiTypeList = inject('aiTypeList')
-
-watch(activeTab, (newTab, oldTab) => {
- if (newTab === 'all') {
- searchForm.status = ''
- }
- if(newTab === 'WAIT_AUDIT') {
- searchForm.status = '1'
- }
- if(newTab === 'REJECTED') {
- searchForm.status = '2'
- }
- if(newTab === 'PASS') {
- searchForm.status = '3'
- }
- emit('search', searchForm);
-})
-
-// 周期
-const cycles = ref(['每天', '周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日'])
-// 工单状态
-const orderStatus = ref([
- { label: '待审核', value: '1' },
- { label: '已驳回', value: '2' },
- { label: '已通过', value: '3' }
-])
-const timeFormat = 'YYYY-MM-DD HH:mm:ss';
-// 搜索
-const handleSearch = () => {
- if (!dateRange.value) {
- dateRange.value = [];
- }
- if (!cycleDateRange.value) {
- cycleDateRange.value = [];
- }
- // if (dateRange.value && dateRange.value.length) {
- // checked.value = '';
- // searchForm.date_enum = '';
- // }
- // 提交至store
- let params = {
- ...searchForm,
- create_start_date: dateRange.value.length
- ? dayjs(dateRange?.value[0]).startOf('day').format(timeFormat)
- : null,
- create_end_date: dateRange?.value.length
- ? dayjs(dateRange?.value[1]).endOf('day').format(timeFormat)
- : null,
- start_date: cycleDateRange?.value.length
- ? dayjs(cycleDateRange?.value[0]).startOf('day').format(timeFormat)
- : null,
- end_date: cycleDateRange?.value.length
- ? dayjs(cycleDateRange?.value[1]).startOf('day').format(timeFormat)
- : null,
- };
- emit('search', params);
-};
-
-function handleReset () {
- searchForm.ai_types = []
- searchForm.ai_typesValue = ''
- searchForm.deal_time = ""
- searchForm.file_id = ""
- searchForm.key_word = ""
- if (activeTab.value === 'all') {
- searchForm.status = ''
- }
- searchForm.rep_fre_type = ''
- dateRange.value = ''
- searchForm.create_start_date = null
- searchForm.create_end_date = null
- cycleDateRange.value = ''
- searchForm.start_date = null
- searchForm.emd_date = null
- emit('search', searchForm);
-}
-
-// onMounted(() => {
-// aitypeList()
-// getLines()
-// });
-</script>
-
-<style lang="scss" scoped>
-// .taskAlgorithm {
-// :deep() {
-// .task-algorithm > div {
-// width: 233px !important;
-// }
-// }
-// }
-.search-box-test {
- margin-bottom: 16px;
- transition: all 0.3s;
-
- .search-first {
- position: relative;
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 20px 15px; // 设置行间距和列间距
-
- .more {
- cursor: pointer;
- width: 32px;
- height: 32px;
- color: #1c5cff;
- line-height: 32px;
- font-size: 16px;
- margin: 0 28px;
- }
-
- .search-btn {
- // position: absolute;
- // right: 0;
- display: flex;
- justify-content: space-between;
- cursor: pointer;
- font-size: 14px;
-
- .btn {
- width: 80px;
- height: 32px;
- border-radius: 4px 4px 4px 4px;
- line-height: 32px;
- display: flex;
- justify-content: center;
- align-items: center;
- // margin-left: px;
- img {
- width: 14px;
- height: 14px;
- }
- }
- .search {
- background: #409eff;
- color: #fff;
- margin-right: 10px;
- }
- .clear {
- border: 1px solid #d2d1d1;
- color: #676767;
- margin-right: 10px;
- }
- .add {
- background: #ff9243;
- color: #fff;
- }
- }
-
- .time-card {
- text-align: center;
- background: #ffffff;
- border-radius: 4px 0px 0px 4px;
- border: 1px solid #e5e5e5;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 14px;
- color: #7c8091;
- display: flex;
- height: 32px;
-
- .card-item {
- width: 60px;
- height: 100%;
- line-height: 32px;
- cursor: pointer;
- }
-
- .active {
- background: #ffffff;
- border-radius: 0px 0px 0px 0px;
- border: 1px solid #1c5cff;
- color: #1441ff;
- }
- }
- }
-
- :deep(.el-form) {
- :deep(.el-input__wrapper.is-disabled) {
- box-shadow: 0 0 0 1px #026ad6;
- }
- .el-form-item__label {
- width: 80px;
- }
-
- .el-form-item {
- margin-bottom: 0;
- width: 280px;
- margin-right: 20px;
-
- .el-form-item__label {
- color: #363636;
- line-height: 32px;
- }
- }
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/orderLog.vue b/applications/drone-command/src/views/tickets/orderLog.vue
deleted file mode 100644
index 1bb5074..0000000
--- a/applications/drone-command/src/views/tickets/orderLog.vue
+++ /dev/null
@@ -1,528 +0,0 @@
-<!-- 任务统计表格 -->
-<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>
- <el-button v-if="permission?.order_log_add && activeTab != 'WAIT_AUDIT'" type="primary" icon="el-icon-plus" @click="handleAddOrder">新建工单
- </el-button>
- <el-button type="success" plain icon="el-icon-download" @click="exportData">导出
- </el-button>
- <div class="task-table">
- <el-table border :data="orderListTable" class="custom-header" @cell-click="handleCellClick">
- <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="150" show-overflow-tooltip>
- <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="100" show-overflow-tooltip>
- <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="工单状态" width="88">
- <template #default="scope">
- <el-tag :type="getStatusTagType(scope.row.status)">{{ getOrderStatus(scope.row.status) }}</el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="dept_name" label="所属单位" width="88" show-overflow-tooltip/>
- <el-table-column prop="create_time" label="创建时间" width="120" show-overflow-tooltip/>
- <el-table-column prop="job_num" label="已执行次数" width="100" 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="100" align="center" show-overflow-tooltip/>
- <el-table-column prop="device_names" label="关联机巢" width="100" align="center" show-overflow-tooltip/>
- <el-table-column prop="creator_name" label="创建人" width="100" align="center" show-overflow-tooltip />
- <el-table-column prop="cycle_time_value" label="工单周期频次" width="110" align="center" show-overflow-tooltip />
- <el-table-column label="操作" width="200" fixed="right" align="center">
- <template #default="scope">
-<!-- {{scope.row.status}}-->
- <template v-if="scope.row.status === 1">
- <el-button type="text" icon="el-icon-view" v-if="permission.order_log_review" @click="handleCheckDetail(scope.row, '工单审核')">审核</el-button>
- <!--待审核状态-->
- <el-button type="text" icon="el-icon-warning" v-if="permission.order_log_recall" @click="revokeOrder(scope.row.id)">撤回</el-button>
- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(scope.row, '工单详情')">详情</el-button>
- </template>
- <!--已驳回-->
- <template v-if="scope.row.status === 2">
- <el-button type="text" icon="el-icon-warning" @click="rejectReason(scope.row.id, scope.row)">驳回原因</el-button>
- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(scope.row, '工单详情')">详情</el-button>
-<!-- <el-button type="text" icon="el-icon-view" v-if="userInfo.user_id === scope.row.create_user" @click="handleViewDetail(scope.row, '工单编辑')">编辑</el-button>-->
-<!-- <el-button type="text" icon="el-icon-view" v-else @click="handleViewDetail(scope.row, '工单详情')">详情</el-button>-->
- </template>
- <!-- 已通过 -->
- <template v-if="scope.row.status === 3">
- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(scope.row, '工单详情')">详情</el-button>
- </template>
- <!--草稿-->
-<!-- <template v-if="scope.row.status === 0">-->
-<!-- <el-button type="text" icon="el-icon-edit" @click="handleViewDetail(scope.row, '工单编辑')">编辑</el-button>-->
-<!-- <el-button type="text" icon="el-icon-position" @click="userPublishPush(scope.row.id)">发布</el-button>-->
-<!-- <el-button type="text" icon="el-icon-delete" @click="deleteOrder(scope.row.id)">删除</el-button>-->
-<!-- </template>-->
- </template>
- </el-table-column>
- <template #empty>
- <el-empty
- class="custom-empty"
- :image-size="100"
- >
- <template #description>
- <span class="custom-text">暂无数据</span>
- </template>
- </el-empty>
- </template>
- </el-table>
- </div>
- <div class="pagination" v-if="orderListTable.length > 0">
- <el-pagination class="command-pagination" popper-class="custom-pagination-dropdown" background
- :page-sizes="[10, 20, 30, 40, 50, 100]" 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>
- <AddEditDetails v-model:show="isShowAddEditDetails" @refresh="refreshGetOrderList" />
-</template>
-
-<script setup>
-import SearchBox from './component/SearchBox.vue'
-import AddEditDetails from './component/AddEditDetails.vue'
-import NProgress from 'nprogress'
-import { useStore } from 'vuex'
-import { useRoute } from 'vue-router'
-import { downloadXls } from '@/utils/util'
-import {
- getList,
- orderLogDetails,
- orderLogExport,
- jobStatusNum,
- deleteOrderLog,
-} from '@/api/tickets/orderLog'
-import { newGetWorkspacesPage } from '@/api/resource/wayline'
-import { getDictionaryByCode } from '@/api/system/dictbiz'
-import { cloneDeep } from 'lodash';
-import { computed, onMounted } from 'vue';
-import { ElMessage, ElMessageBox } from 'element-plus'
-import dayjs from 'dayjs'
-import 'dayjs/locale/zh-cn' // 导入中文语言包
-import weekday from 'dayjs/plugin/weekday'
-import { aiImagesPage } from '@/api/dataCenter/dataCenter';
-
-const store = useStore()
-const route = useRoute()
-
-const userInfo = computed(() => store.state.user.userInfo)
-const permission = computed(() => store.state.user.permission);
-
-const isShowAddEditDetails = ref(false)
-
-const activeTab = ref('all')
-provide('activeTab', activeTab)
-let tabsList = ref([
- // { label: '我的工单', name: 'my_order', value: null, count: 0 },
- // { 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 }
-])
-function filteredTabs () {
- if (permission?.value.orderLog_tab_allOrders) {
- tabsList.value.push({ label: '全部工单', name: 'all', value: null, count: 0 })
- }
- if (permission?.value.orderLog_tab_pending) {
- tabsList.value.push({ label: '待审核', name: 'WAIT_AUDIT', value: 1, count: 0 })
- }
- if (permission?.value.orderLog_tab_reject) {
- tabsList.value.push({ label: '已驳回', name: 'REJECTED', value: 2, count: 0 })
- }
- if (permission?.value.orderLog_tab_pass) {
- tabsList.value.push({ label: '已通过', name: 'PASS', value: 3, count: 0 })
- }
- activeTab.value = tabsList.value[0].name
- // tab值传
- orderListParams.status = tabsList.value[0].value
- // tabsList.value
- // .map(tab => {
- // if (tab.name === 'all') {
- // return { ...tab, isShow: permission?.value.orderLog_tab_allOrders }
- // }
- // if (tab.name === 'WAIT_AUDIT') {
- // return { ...tab, isShow: permission?.value.orderLog_tab_pending }
- // }
- // if (tab.name === 'REJECTED') {
- // return { ...tab, isShow: permission?.value.orderLog_tab_reject }
- // }
- // if (tab.name === 'PASS') {
- // return { ...tab, isShow: permission?.value.orderLog_tab_pass }
- // }
- // // return { ...tab, isShow: true }
- // })
- // .filter(tab => tab.isShow)
-}
-
-// tab切换
-function handleTabChange (tab) {
- activeTab.value = tab.paneName
- // orderListParams.status = ''
- // if (tab.paneName === 'WAIT_AUDIT') {
- // orderListParams.status = '1'
- // } else if (tab.paneName === 'REJECTED') {
- // orderListParams.status = '2'
- // } else if (tab.paneName === 'PASS') {
- // orderListParams.status = '3'
- // } else if (tab.paneName === 'DRAFT') {
- // orderListParams.status = '0'
- // }
- // refreshGetOrderList()
-}
-
-// 更新统计数
-async function updateGlobalCounts() {
- let res = await jobStatusNum()
- res.data.data.forEach(item => {
- const tab = tabsList.value.find(t => t.name === item.dict_key)
- if (tab) {
- tab.count = item.num
- }
- })
-}
-
-// 获取航线
-let lineList = ref([])
-provide('lineList', lineList)
-function getLines() {
- const formData = {
- name: '',
- waylineType: undefined,
- current: 1,
- size: 99999999,
- descs: 'update_time'
- }
- newGetWorkspacesPage(formData).then(res => {
- lineList.value = res.data.data.records
- })
-}
-
-// 获取算法
-let aiTypeList = ref([])
-provide('aiTypeList', aiTypeList)
-function aitypeList() {
- getDictionaryByCode('SF').then(res => {
- aiTypeList.value = res.data.data['SF']
- })
-}
-
-const total = ref(0)
-const orderListParams = reactive({
- current: 1,
- size: 10,
- searchParams: {},
- status: ''
-})
-
-const orderListTable = ref([])
-function getTableList() {
- orderListParams.searchParams.ai_types = orderListParams.searchParams.ai_typesValue ? [ orderListParams.searchParams.ai_typesValue] : null
- const apiParams = {
- ...cloneDeep(orderListParams),
- ...cloneDeep(orderListParams.searchParams)
- }
- getList(apiParams, orderListParams.current, orderListParams.size).then(res => {
- orderListTable.value = res.data.data.records
- total.value = res.data.data.total
- // updateGlobalCounts()
- })
-}
-
-// 分页大小改变
-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 refreshGetOrderList = () => {
- orderListParams.current = 1
- orderListParams.size = 10
- getTableList()
-}
-
-function getOrderStatus (status) {
- const statusTextMap = {
- // 0: '草稿',
- 1: '待审核',
- 2: '已驳回',
- 3: '已通过'
- }
- return statusTextMap[status] || '未知状态'
-}
-function getStatusTagType (status) {
- const statusMap = {
- 1: 'warning',
- 2: 'info',
- 3: 'primary',
- 4: 'success',
- 5: 'danger'
- }
- return statusMap[status] || 'info'
-}
-// 新增按钮 和 导出按钮
-// function hasAddBtnPermission () {
-// return permission && permission?.value.order_log_add
-// }
-
-// 新建工单、编辑、详情
-const txtTitle = ref('新建工单')
-const rowObj = ref({})
-provide('txtTitle', txtTitle)
-provide('rowObj', rowObj)
-function handleAddOrder() {
- txtTitle.value = '新建工单'
- isShowAddEditDetails.value = true
-}
-// 详情、编辑
-function handleViewDetail(row, txt) {
- rowObj.value = row
- txtTitle.value = txt
- isShowAddEditDetails.value = true
-}
-
-// 审核
-function handleCheckDetail(row, txt) {
- rowObj.value = row
- txtTitle.value = txt
- isShowAddEditDetails.value = true
-}
-
-// 导出
-async function exportData() {
- try {
- await ElMessageBox.confirm('是否导出智飞工单数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
-
- NProgress.start()
-
- orderListParams.searchParams.ai_types = orderListParams.searchParams.ai_typesValue ? [ orderListParams.searchParams.ai_typesValue] : null
- const apiParams = {
- ...cloneDeep(orderListParams),
- ...cloneDeep(orderListParams.searchParams)
- }
- const res = await orderLogExport(apiParams)
- downloadXls(res.data, `智飞工单${dayjs().format('YYYY-MM-DD')}.xlsx`)
- ElMessage.success('导出成功')
-
- } catch (error) {
- if (error !== 'cancel') {
- ElMessage.error('导出失败')
- console.error('导出错误:', error)
- }
- } finally {
- NProgress.done()
- }
-}
-
-// 撤回工单
-async function revokeOrder(id) {
- try {
- await ElMessageBox.confirm('撤回会删除本工单,需重新提交?', '是否撤回', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- // 用户点击确定,执行撤回操作
- // await orderLogRecall(id)
- await deleteOrderLog(id)
- // 显示成功消息
- ElMessage.success('撤回成功')
- // 触发搜索刷新
- refreshGetOrderList()
- } catch (error) {
- // 用户点击取消,不执行任何操作
- if (error !== 'cancel') {
- ElMessage.error('撤回失败')
- console.error('撤回错误:', error)
- }
- }
-}
-
-// 驳回原因
-async function rejectReason(id, row) {
- try {
- const res = await orderLogDetails(id)
- const data = res.data.data
-
- await ElMessageBox.confirm(data.remark, '驳回原因', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
-
- // 用户点击确定后的逻辑 TODO
- // form.value = { ...res.data.data }
- handleViewDetail(row, userInfo.value.user_id === row.create_user ? '工单编辑':'工单详情')
-
- } catch (error) {
- // 用户点击取消,不执行任何操作
- if (error !== 'cancel') {
- ElMessage.error('操作失败')
- console.error('错误:', error)
- }
- }
-}
-
-function handleCellClick (row, column) {
- if (column.no === 1) {
- navigator.clipboard.writeText(row.job_info_num).then(() => {
- ElMessage.success('复制工单编号成功')
- })
- } else if (column.no === 2) {
- navigator.clipboard.writeText(row.name).then(() => {
- ElMessage.success('复制工单名称成功')
- })
- } else if (column.no === 4) {
- navigator.clipboard.writeText(row.dept_name).then(() => {
- ElMessage.success('复制所属单位成功')
- })
- } else if (column.no === 8) {
- navigator.clipboard.writeText(row.wayline_name).then(() => {
- ElMessage.success('复制关联航线成功')
- })
- } else if (column.no === 9) {
- navigator.clipboard.writeText(row.ai_type_str).then(() => {
- ElMessage.success('复制关联算法成功')
- })
- }
-}
-
-// 删除
-async function deleteOrder(id) {
- try {
- await ElMessageBox.confirm('确定删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- deleteOrderLog(id)
- ElMessage.success('删除成功')
- // 触发搜索刷新
- refreshGetOrderList()
- } catch (error) {
- if (error !== 'cancel') {
- ElMessage.error('删除失败')
- console.error('删除错误:', error)
- }
- }
-}
-
-onMounted(() => {
- getLines()
- aitypeList()
- filteredTabs()
- getTableList()
- updateGlobalCounts()
- if (route.query.id) {
- route.query.status === '1' ? handleCheckDetail({ id: route.query.id}, '工单审核') : handleCheckDetail({ id: route.query.id}, '工单详情')
- }
-})
-</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;
- height: calc(100vh - 380px);
- margin-top: 18px;
- overflow: auto;
- :deep(.el-scrollbar__view) {
- height: 100%;
- }
- :deep(.el-table--fit,.el-scrollbar__view) {
- height: 100%;
- }
- }
-
- .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;
- padding: 20px 0;
- }
-
- :deep(.el-pagination button) {
- background: center center no-repeat none !important;
- color: #8eb8ea !important;
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/orderLogCopy.vue b/applications/drone-command/src/views/tickets/orderLogCopy.vue
deleted file mode 100644
index 6a8bdf2..0000000
--- a/applications/drone-command/src/views/tickets/orderLogCopy.vue
+++ /dev/null
@@ -1,1666 +0,0 @@
-<template>
- <basic-container>
- <el-tabs v-model="activeTab" @tab-click="handleTabChange">
- <el-tab-pane v-for="tab in filteredTabs" :key="tab.name" :label="`${tab.label} (${tab.count})`" :name="tab.name">
- <basic-main-content>
- <!-- 查询条件筛选栏 -->
- <div class="command-form-search">
- <el-form :model="filters" inline>
- <el-row :gutter="24">
- <el-col :span="4">
- <el-form-item label="关键字:">
- <el-input v-model="filters.key_word" placeholder="编号/名称/内容/姓名" clearable
- @keyup.enter="handleSearch" />
- </el-form-item>
-
- <!-- <div class="search-bar-box-item">-->
- <!-- <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>-->
-
- </el-col>
- <el-col :span="8">
- <el-form-item label="选择日期:">
- <el-date-picker @change="handleSearch" v-model="filters.dateRange" type="daterange"
- range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
- :default-value="datePickerDefaultVal" />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="关联航线:">
- <el-select @change="handleSearch" v-model="filters.file_id" placeholder="请选择关联航线" filterable
- clearable>
- <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
- :value="item.wayline_id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="关联算法:">
- <el-select @change="handleSearch" v-model="filters.ai_types" placeholder="关联算法" clearable>
- <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue"
- :value="item.dictKey" />
- </el-select>
- </el-form-item>
-
- <!-- <div class="search-bar-box-item">
- <el-select v-model="filters.type" placeholder="请选择工单类型" clearable>
- <el-option v-for="item in types" :key="item.dictValue" :label="item.dictValue"
- :value="item.dictKey" />
- </el-select>
- </div> -->
-
- </el-col>
- <el-col :span="4">
- <el-form-item label="工单状态:">
- <el-select @change="handleSearch" v-model="filters.status" placeholder="请选择工单状态" clearable
- :disabled="activeTab !== 'all'">
- <el-option v-for="item in statuses" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="8">
- <el-form-item label="工单周期:">
- <el-date-picker @change="handleSearch" v-model="filters.cycleDateRange" type="daterange"
- range-separator="至" start-placeholder="工单周期开始日期" end-placeholder="工单周期结束日期"
- :default-value="datePickerDefaultVal" />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="选择频次:">
- <el-select @change="handleSearch" v-model="filters.rep_fre_type" placeholder="请选择频次" clearable>
- <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="执行时间:">
- <el-time-picker @change="handleSearch" v-model="filters.deal_time" placeholder="请选择执行时间"
- prop="deal_time" value-format="HH:mm" :picker-options="{
- selectableRange: '00:00 - 23:59',
- }" />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索
- </el-button>
- <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button>
- </el-col>
- </el-row>
- </el-form>
- </div>
-
- <!-- 表格部分 -->
- <avue-crud class="command-public-general-avue-crud" :data="tableData" :option="option" v-model:page="page"
- ref="crud" :table-loading="loading" @current-change="currentChange" @refresh-change="refreshChange"
- @on-load="onLoad" @search-change="searchChange" @size-change="sizeChange" v-if="activeTab === tab.name">
- <template #job_info_num="{ row }">
- <el-tooltip-copy :content="row.job_info_num" :showCopyText="true" textAlign="left">
- {{ row.job_info_num }}
- </el-tooltip-copy>
- </template>
-
- <template #name="{ row }">
- <el-tooltip-copy :content="row.name" :showCopyText="true" textAlign="left">
- {{ row.name }}
- </el-tooltip-copy>
- </template>
-
- <template #menu-left>
- <el-button v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'" type="primary" icon="el-icon-plus"
- @click="handleAdd">新建工单
- </el-button>
- <el-button type="success" plain icon="el-icon-download" @click="exportData">导出
- </el-button>
- </template>
-
- <template #menu="{ row }">
- <div class="menu-custom-box">
- <template v-if="row.status == 1">
- <el-button v-if="hasPaddingBtnPermission()" type="text" icon="el-icon-view"
- @click="handleCheckDetail(row)">审核
- </el-button>
- </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" v-if="hasRecallPaddingBtnPermission()"
- @click="orderLogRecall(row.id)">撤回
- </el-button>
- <!-- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> -->
- </template>
- <!--已驳回-->
- <template v-if="row.status == 2">
- <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)">驳回原因
- </el-button>
- <el-button v-if="userInfo.user_id == row.create_user" type="text" icon="el-icon-view"
- @click="handleViewDetail(row)">编辑
- </el-button>
- <el-button v-else 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>
- <!--草稿-->
- <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 }">
- <el-tag :type="getStatusTagType(row.status)">{{ mapStatus(row.status) }}</el-tag>
- </template>
- <template #keyData="{ row }">
- <el-tooltip :content="row.address" placement="top" effect="light">
- <span>{{ row.keyData }}</span>
- </el-tooltip>
- </template>
- </avue-crud>
- </basic-main-content>
- </el-tab-pane>
- </el-tabs>
-
- <!-- 新建工单对话框 -->
- <el-dialog class="command-dialog-mange" v-model="dialogVisible" title="新建工单" width="70%" :close-on-click-modal="false"
- @close="resetForm">
- <el-form :model="form" :rules="rules" ref="testform" label-width="100px">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input v-model="form.name" placeholder="请输入工单名称" maxlength="100" show-word-limit></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关联航线" prop="file_id">
- <el-select v-model="form.file_id" placeholder="请选择航线" filterable @change="getFlyingNestBy">
- <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
- :value="item.wayline_id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
- <el-input-number class="command-input" v-model="form.rth_altitude" :min="50" :max="500"></el-input-number>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="关联机巢" prop="device_sns">
- <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="!device_sns.length">
- <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
- :value="item.device_sn" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="关联算法" prop="ai_types">
- <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple>
- <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容" maxlength="255"
- show-word-limit></el-input>
- </el-form-item>
- </el-col>
-
- <el-col :span="8">
- <el-form-item label="周期频次" prop="date_range">
- <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
- end-placeholder="结束日期" :disabled-date="disabledDate" />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <div class="flex">
- <div class="flex-1">
- <el-select v-model="form.rep_fre_type" placeholder="请选择频次">
- <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
- </el-select>
- </div>
- <div class="flex-1">
- <el-time-picker style="width: 100px" v-model="form.deal_time" prop="deal_time" value-format="HH:mm"
- :picker-options="{
- selectableRange: '00:00 - 23:59',
- }" />
- </div>
- </div>
- </el-col>
- </el-row>
-
- <el-row :gutter="20" style="height: 400px">
- <el-col :span="24">
- <map-container v-if="dialogVisible" ref="MapContainer"></map-container>
- </el-col>
- </el-row>
-
- <!-- <el-row>-->
- <!-- <div class="add-box-btns">-->
- <!-- <el-button type="danger" @click="submitForm(1)">发起</el-button>-->
- <!-- <el-button type="primary" @click="submitForm(0)">存草稿</el-button>-->
- <!-- <el-button @click="dialogVisible = false">取消</el-button>-->
- <!-- </div>-->
- <!-- </el-row>-->
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="danger" @click="submitForm(1)" icon="el-icon-position">发起</el-button>
- <el-button type="primary" @click="submitForm(0)" icon="el-icon-document-add">存草稿</el-button>
- <el-button @click="dialogVisible = false" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 工单详情对话框 -->
- <el-dialog class="command-dialog-mange" align-center v-model="detailVisible" :title="detailTitle" width="70%"
- :close-on-click-modal="false" @close="resetForm">
- <div class="event-title-center">{{ form.name }}</div>
- <el-form :model="form" :rules="rules" ref="testform" label-width="100px">
- <div class="custom-steps-container">
- <!-- 标题行 -->
- <div class="steps-titles" v-if="filters.status !== '0'">
- <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }" :key="index"
- class="step-title">
- {{ record.status_str }}
- </div>
- </div>
-
- <!-- Element Steps 组件 -->
- <el-steps :active="form.active" align-center class="custom-steps" v-if="filters.status !== '0'">
- <el-step v-for="(record, index) in form.record_list" :key="index">
- <template #description>
- <span class="step-description" style="position: relative; display: inline-block">
- {{ record.user_name }}
- </span>
- <span class="step-timer">
- {{ record.interval_time_str }}
- </span>
- <div class="step-description">
- {{ record.create_time_str }}
- </div>
- </template>
- </el-step>
- </el-steps>
- </div>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input v-model="form.name" placeholder="请输入工单名称" :disabled="detailTitle === '工单详情'"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关联航线" prop="file_id">
- <el-select v-model="form.file_id" placeholder="请选择航线" @change="getFlyingNestBy" filterable
- :disabled="detailTitle === '工单详情'">
- <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
- :value="item.wayline_id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
- <el-input-number class="command-input" :disabled="detailTitle === '工单详情'" v-model="form.rth_altitude" :min="50"
- :max="500"></el-input-number>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="关联机巢" prop="device_sns">
- <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="detailTitle === '工单详情'">
- <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
- :value="item.device_sn" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="关联算法" prop="ai_types">
- <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple :disabled="detailTitle === '工单详情'">
- <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12" prop="statusStr">
- <el-form-item label="当前状态">
- {{ mapStatus(form.status) }}
- </el-form-item>
- </el-col>
-
- <el-col :span="6">
- <el-form-item label="周期频次" prop="date_range">
- <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
- end-placeholder="结束日期" :disabled-date="disabledDate" :disabled="detailTitle === '工单详情'" />
- </el-form-item>
- </el-col>
-
- <el-col :span="3">
- <el-select v-model="form.rep_fre_type" placeholder="请选择频次" :disabled="detailTitle === '工单详情'">
- <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
- </el-select>
- </el-col>
-
- <el-col :span="3">
- <el-time-picker class="timeStyle" :style="{ width: pxToRem(140) }" v-model="form.deal_time" prop="deal_time"
- value-format="HH:mm" :picker-options="{
- selectableRange: '00:00 - 23:59',
- }" :disabled="detailTitle === '工单详情'" />
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容" maxlength="255"
- show-word-limit :disabled="detailTitle === '工单详情'"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20" style="height: 400px">
- <el-col :span="24">
- <map-container v-if="detailVisible" ref="MapContainer"></map-container>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="danger" v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
- @click="submitForm(1)" icon="el-icon-position">发布
- </el-button>
- <el-button type="primary"
- v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)" @click="submitForm(0)"
- icon="el-icon-plus">保存
- </el-button>
- <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
- @click="submitForm(0)">保存</el-button> -->
-
- <el-button type="primary" v-if="form.status == 1 && hasPaddingBtnPermission()"
- @click="orderLogPass(form.id)">通过
- </el-button>
- <el-button type="danger" v-if="form.status == 1 && hasRejectionBtnPermission()"
- @click="orderLogReject(form.id)">驳回
- </el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 工单详情 -->
- <el-dialog class="command-dialog-mange" align-center v-model="detailVisibleCopy" title="工单详情" width="70%"
- :close-on-click-modal="false" @close="resetForm">
- <div class="event-title-center">{{ form.name }}</div>
- <el-form :model="form" ref="testform" label-width="100px">
- <div class="custom-steps-container">
- <!-- 标题行 -->
- <div class="steps-titles" v-if="filters.status !== '0'">
- <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }" :key="index"
- class="step-title">
- {{ record.status_str }}
- </div>
- </div>
-
- <!-- Element Steps 组件 -->
- <el-steps :active="form.active" align-center class="custom-steps" v-if="filters.status !== '0'">
- <el-step v-for="(record, index) in form.record_list" :key="index">
- <template #description>
- <span class="step-description" style="position: relative; display: inline-block">
- {{ record.user_name }}
- </span>
- <span class="step-timer">
- {{ record.interval_time_str }}
- </span>
- <div class="step-description">
- {{ record.create_time_str }}
- </div>
- </template>
- </el-step>
- </el-steps>
- </div>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input v-model="form.name" placeholder="请输入工单名称" :disabled="true"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="关联航线" prop="file_id">
- <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
- <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
- :value="item.wayline_id" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item label="安全返航真高" prop="rth_altitude" class="safe-height">
- <el-input-number class="command-input" :disabled="true" v-model="form.rth_altitude" :min="50" :max="500"></el-input-number>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="关联机巢" prop="device_sns">
- <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="true">
- <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
- :value="item.device_sn" />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="关联算法" prop="ai_types">
- <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple :disabled="true">
- <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12" prop="statusStr">
- <el-form-item label="当前状态">
- {{ mapStatus(form.status) }}
- </el-form-item>
- </el-col>
-
- <el-col :span="6">
- <el-form-item label="周期频次" prop="date_range">
- <el-date-picker v-model="form.date_range" type="daterange" range-separator="至" start-placeholder="开始日期"
- end-placeholder="结束日期" :disabled="true" />
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-select v-model="form.rep_fre_type" placeholder="请选择频次" :disabled="true">
- <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
- </el-select>
- </el-col>
-
- <el-col :span="3">
- <el-time-picker style="width: 100px" v-model="form.deal_time" prop="deal_time" :disabled="true"
- value-format="HH:mm" :picker-options="{
- selectableRange: '00:00 - 23:59',
- }" />
- </el-col>
- </el-row>
-
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input type="textarea" v-model="form.content" rows="2" placeholder="请输入工单内容" maxlength="255"
- show-word-limit :readonly="true" :disabled="true"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="20" style="height: 400px">
- <el-col :span="24">
- <map-container v-if="detailVisibleCopy" ref="MapContainer"></map-container>
- </el-col>
- </el-row>
-
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="danger" v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
- @click="submitForm(1)" icon="el-icon-position">发布
- </el-button>
- <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user"
- @click="submitForm(0)">保存</el-button> -->
-
- <el-button type="primary" v-if="form.status == 1 && hasPaddingBtnPermission()" @click="orderLogPass(form.id)"
- icon="el-icon-check">通过
- </el-button>
- <el-button type="danger" v-if="form.status == 1 && hasRejectionBtnPermission()"
- @click="orderLogReject(form.id)" icon="el-icon-close">驳回
- </el-button>
- <el-button @click="detailVisibleCopy = false" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- </el-dialog>
- </basic-container>
-</template>
-
-<script>
-import { pxToRem, pxToRemNum } from '@/utils/rem'
-import { calculateDefaultRange } from '@/utils/util'
-import {
- getList,
- saveUpdateOrderLog,
- orderLogDetails,
- orderLogRecall,
- orderLogReject,
- orderLogPass,
- orderLogExport,
- jobStatusNum,
- userPublish,
- deleteOrderLog,
- getWaylineMaxTerrainHeight
-} from '@/api/tickets/orderLog'
-import { getTicketInfo } from '@/api/tickets/ticket'
-import { getDictionaryByCode } from '@/api/system/dictbiz'
-import { getWaylineFileListByArea, newGetWorkspacesPage } from '@/api/resource/wayline'
-import { export_json_to_excel } from '@/utils/exportExcel'
-import { getFlyingNestBy } from '@/api/device/device'
-import { mapGetters } from 'vuex'
-import NProgress from 'nprogress'
-import { downloadXls } from '@/utils/util'
-import 'nprogress/nprogress.css'
-import { analyzeKmzFile, removeTextKey, XMLToJSON } from '@/utils/cesium/kmz'
-import dayjs from 'dayjs'
-import 'dayjs/locale/zh-cn' // 导入中文语言包
-import weekday from 'dayjs/plugin/weekday'
-import elTooltipCopy from '@/components/ElTooltipCopy.vue'
-import { CircleClose, Promotion, Select } from '@element-plus/icons-vue'
-import { useStore } from 'vuex'
-import _ from 'lodash'
-// const store = useStore()
-dayjs.extend(weekday)
-dayjs.locale('zh-cn')
-
-// const lastHeight = computed(() => store.state.common.lastHeight)
-
-export default {
- components: { elTooltipCopy },
- name: 'TicketPage',
- data () {
- return {
- activeTab: 'all',
- getlastHeight: 0,
- tabs: [
- { 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 }
- ],
- filters: {
- key_word: '',
- create_dept: '',
- start_date: null,
- end_date: null,
- file_id: '',
- ai_types: [],
- status: '',
- dateRange: []
- },
- departments: [],
- types: [],
- device_sns: [],
- ai_types: [],
- wayLineList: [],
- detailTitle: '编辑工单',
- detailVisibleCopy: false,
-
- statuses: [
- { label: '草稿', value: '0' },
- { label: '待审核', value: '1' },
- { label: '已驳回', value: '2' },
- { label: '已通过', value: '3' }
- ],
- //周期
- cycles: ['每天', '周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日'],
-
- tableData: [],
- option: {
- index: true,
- indexWidth: 66,
- indexLabel: '序号',
- indexFixed: true,
-
- align: 'left',
- border: true,
- stripe: false,
- searchShow: true,
- searchBtnText: '搜索',
- searchMenuSpan: 6,
- addBtnText: '新建工单',
- addBtn: false,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- cancelBtn: true,
- cancelBtnText: '取消',
-
- menu: true,
- menuWidth: 210,
- menuClassName: 'cur-menu',
-
- height: 'auto',
- calcHeight: 196,
-
- column: [
- {
- label: '工单编号',
- prop: 'job_info_num',
- width: 150
- },
- {
- label: '工单名称',
- prop: 'name',
- width: 100,
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
- {
- label: '工单状态',
- prop: 'status',
- width: 88,
- showOverflowTooltip: true
- },
- {
- label: '所属单位',
- prop: 'dept_name',
- ellipsis: true,
- showOverflowTooltip: true
- },
- {
- label: '创建时间',
- prop: 'create_time',
- width: 144,
- ellipsis: true,
- showOverflowTooltip: true
- },
- {
- label: '已执行次数',
- prop: 'job_num',
- width: 70,
- ellipsis: true,
- showOverflowTooltip: true
- },
- {
- label: '工单内容',
- prop: 'content',
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
- {
- label: '关联航线',
- prop: 'wayline_name',
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
- {
- label: '关联算法',
- prop: 'ai_type_str',
- width: 100,
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
- {
- label: '关联机巢',
- prop: 'device_names',
- width: 100,
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
-
- {
- label: '创建人',
- prop: 'creator_name',
- width: 96,
- ellipsis: true,
- overHidden: true,
- showOverflowTooltip: true
- },
- // {
- // label: '关联机巢', prop: 'device_names', width: 112, ellipsis: true, overHidden: true,
- // showOverflowTooltip: true,
- // },
- {
- label: '工单周期频次',
- prop: '',
- width: 110,
- formatter: row => this.formatCycleTime(row),
- html: true,
- ellipsis: true,
- showOverflowTooltip: true
- // overHidden: true
- }
- ]
- },
-
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- dialogVisible: false,
- detailVisible: false,
- currentDetail: {},
- form: {},
- rules: {
- name: [
- { required: true, message: '请输入工单名称', trigger: 'blur' },
- { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' }
- ],
- file_id: [{ required: true, message: '需要选择航线', trigger: 'change' }],
- device_sns: [{ required: true, message: '请选择机巢', trigger: 'change' }],
- content: [
- { required: true, message: '请输入工单内容', trigger: 'blur' },
- { max: 255, message: '工单内容不能超过255个字', trigger: 'blur' }
- ],
- date_range: [{ required: true, message: '请选择时间不能为空', trigger: 'blur' }],
- rep_fre_type: [{ required: true, message: '请选择周期', trigger: 'blur' }],
- deal_time: [{ required: true, message: '请选择执行时间', trigger: 'blur' }]
- },
- loading: false,
- globalCounts: {},
- mapLoaded: false,
-
- // 配置时间选择器默认配置
- datePickerDefaultVal: calculateDefaultRange()
- }
- },
- async created () {
- var response = await getDictionaryByCode('SF')
- var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE')
- this.ai_types = response.data.data['SF']
- this.types = word_order_typeResponse.data.data['WORK_ORDER_TYPE']
- //获取航线
- this.asyncgetWaylineFileListByArea()
- const response2 = await getTicketInfo()
- const { dept_data, event_type, ai_type } = response2.data.data
- this.departments = dept_data.map(item => ({
- label: item.dept_name,
- value: item.id
- }))
- },
- mounted () {
- this.fetchTableData()
- const id = this.$route.query.id
- console.log('idddddd', id)
-
- if (id) {
- // 确保 id 存在
- this.handleViewDetail({ id })
- const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/orderLog')
- find && (find.query = {})
- } else {
- console.error('工单ID不存在!')
- }
- },
- computed: {
- CircleClose () {
- return CircleClose
- },
- ...mapGetters(['userInfo', 'permission']),
- safeHeight () {
- const safeHeight = this.$store.state.common.safeHeight
- return Number(safeHeight) || 0 // 确保是数字类型
- },
- positionsArr () {
- const positionsArr = this.$store.state.common.positionsArr
- return positionsArr || [] // 确保是数字类型
- },
- filteredTabs () {
- // rejection_and_draft 权限控制“已驳回”和“草稿”tab
- // console.log(this.permission, '权限信息')
- // console.log(this.userInfo, '权限信息22')
- const canShowRejectAndDraft = this.permission?.rejection_and_draft === true
- return this.tabs
- .map(tab => {
- if (tab.name === 'DRAFT') {
- return { ...tab, isShow: canShowRejectAndDraft }
- }
- if (tab.name === 'REJECTED') {
- return { ...tab, isShow: canShowRejectAndDraft }
- }
- return { ...tab, isShow: true }
- })
- .filter(tab => tab.isShow)
- }
- },
-
- methods: {
- handleCellClick (row, column) {
- if (column.no === 1) {
- navigator.clipboard.writeText(row.job_info_num).then(() => {
- this.$message.success('复制工单编号成功')
- })
- } else if (column.no === 2) {
- navigator.clipboard.writeText(row.name).then(() => {
- this.$message.success('复制工单名称成功')
- })
- } else if (column.no === 4) {
- navigator.clipboard.writeText(row.dept_name).then(() => {
- this.$message.success('复制所属单位成功')
- })
- } else if (column.no === 8) {
- navigator.clipboard.writeText(row.wayline_name).then(() => {
- this.$message.success('复制关联航线成功')
- })
- } else if (column.no === 9) {
- navigator.clipboard.writeText(row.ai_type_str).then(() => {
- this.$message.success('复制关联算法成功')
- })
- }
- },
- disabledDate (time) {
- return time.getTime() < Date.now() - 8.64e7 // 86400000 = 24 * 60 * 60 * 1000
- },
- searchChange (params, done) {
- // console.log('searchChange')
- this.query = params
- this.parentId = ''
- this.page.currentPage = 1
- this.onLoad(this.page, params)
- done()
- },
- async onLoad (page, params = {}) {
- this.loading = true
- getList(
- null,
- this.page.currentPage,
- this.page.pageSize,
- Object.assign(params, this.query)
- ).then(res => {
- this.tableData = res.data.data
- this.loading = false
- this.selectionClear()
- })
- },
- selectionClear () {
- this.selectionList = []
- this.$refs.crud.toggleSelection()
- },
- async loadAMapScripts () {
- try {
- // await loadAMap();
- // await loadAMapUI();
- this.mapLoaded = true
- } catch (error) {
- console.error('Failed to load AMap scripts:', error)
- this.$message.error('地图加载失败,请检查网络或API Key配置')
- }
- },
- formatCycleTime (row) {
- return `${row.cycle_time_value}`
- },
-
- async fetchTableData () {
- this.loading = true
- try {
- let params = this.getQueryParam()
- // console.log('发送的参数:', params)
- const response = await getList(params, this.page.currentPage, this.page.pageSize)
- if (!response?.data?.data?.records) {
- throw new Error('接口返回数据格式不正确')
- }
-
- const { total, records } = response.data.data
- this.tableData = records.map(item => {
- return item
- })
-
- // console.log('权限检查:', this.permission)
- this.page.total = total || 0
- this.updateGlobalCounts()
- } catch (error) {
- // console.error('获取数据失败:', error)
- this.$message.error(error.message || '获取数据失败')
- this.tableData = []
- this.page.total = 0
- } finally {
- this.loading = false
- }
- },
-
- 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])
- // )
- }
-
- const params = {
- key_word: this.filters.key_word || undefined,
- create_dept: this.filters.create_dept || undefined,
- ai_types:
- this.filters.ai_types && this.filters.ai_types.length > 0
- ? [this.filters.ai_types]
- : null,
- file_id: this.filters.file_id || undefined,
- status: this.filters.status !== '' ? Number(this.filters.status) : currentTab?.value,
- dept_id: this.filters.department || undefined,
- create_start_date: this.filters.dateRange?.[0]
- ? this.formatDate(this.filters.dateRange[0])
- : undefined,
- create_end_date: this.filters.dateRange?.[1]
- ? this.formatDate(this.filters.dateRange[1]).replace('00:00:00', '23:59:59')
- : undefined,
-
- start_date: this.filters.cycleDateRange?.[0]
- ? this.formatDate(this.filters.cycleDateRange[0])
- : undefined,
- end_date: this.filters.cycleDateRange?.[1]
- ? this.formatDate(this.filters.cycleDateRange[1]).replace('00:00:00', '23:59:59')
- : undefined,
- rep_fre_type: this.filters.rep_fre_type || undefined,
- deal_time: this.filters.deal_time || undefined,
- current: this.page.currentPage,
- size: this.page.pageSize
- }
- return params
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- },
- async submitForm (status) {
- this.$refs.testform.validate(async valid => {
- if (valid) {
- let dateRange = this.form.date_range
- // console.log('dateRange' + dateRange)
-
- this.form.begin_time = this.formatDate(dateRange[0])
- this.form.end_time = this.formatDate(dateRange[1])
-
- // 如果选中日期包含当前天,那么选中的时间点不能小于当前时间
- if (this.form.deal_time) {
- const selectedDate = dayjs(this.form.date_range[0]).format('YYYY-MM-DD')
- const selectedTime = dayjs(selectedDate + ' ' + this.form.deal_time).toDate()
- const now = new Date()
-
- if (selectedDate === dayjs().format('YYYY-MM-DD') && selectedTime < now) {
- return this.$message.warning('任务时间不能小于当前时间')
- }
- }
- let checkedList = this.device_sns.filter(item => this.form.device_sns.includes(item.device_sn))
- const maxItem = checkedList.reduce((max, item) => {
- return item.drone_height > max.drone_height ? item : max
- })
- // 返航绝对高度
- let backHeight = this.form.rth_altitude // + maxItem.drone_height
- console.log(backHeight, 'backHeight')
- // 安全起飞高度
- let positions = this.positionsArr
- positions.unshift({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- positions.push({ latitude: maxItem.latitude, longitude: maxItem.longitude, height: maxItem.drone_height })
- let resultHeight = 0
- await getWaylineMaxTerrainHeight(positions).then(res => {
- resultHeight = this.safeHeight > (res.data.data + 30) ? this.safeHeight : (res.data.data + 30)
- })
- let valueHeight = _.round(backHeight - resultHeight, 2)
- console.log('打印比较值', valueHeight)
-
- if (valueHeight < 0) {
- this.$confirm(`当前返航高度存在安全隐患,建议调整为${resultHeight}米以上后进行发布`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- const submitData = {
- ...this.form,
- status: status,
- ai_types: this.form.ai_types?.length ? this.form.ai_types : []
- }
- await saveUpdateOrderLog(submitData)
- let id = this.form.id
- if (id) {
- this.$message.success('工单发布成功')
- } else {
- this.$message.success('工单创建成功')
- }
- this.dialogVisible = false
- this.detailVisible = false;
- (this.device_sns = []), (this.wayLineList = []), this.fetchTableData()
- }).catch(() => {
-
- })
- } else {
- const submitData = {
- ...this.form,
- status: status,
- ai_types: this.form.ai_types?.length ? this.form.ai_types : []
- }
- await saveUpdateOrderLog(submitData)
- let id = this.form.id
- if (id) {
- this.$message.success('工单发布成功')
- } else {
- this.$message.success('工单创建成功')
- }
- this.dialogVisible = false
- this.detailVisible = false;
- (this.device_sns = []), (this.wayLineList = []), this.fetchTableData()
- }
- }
- })
- },
- //驳回原因显示
- async rejectDetail (id) {
- const response = await orderLogDetails(id)
- let data = response.data.data
- this.$confirm(data.remark, '驳回原因', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.form = {
- ...response.data.data
- }
- // this.detailVisible = true
- this.handleViewDetail(data)
- })
- },
- formatDate (date) {
- if (!date) return undefined
- const d = new Date(date)
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
- d.getDate()
- ).padStart(2, '0')} 00:00:00`
- },
-
- mapStatus (status) {
- const statusTextMap = {
- 0: '草稿',
- 1: '待审核',
- 2: '已驳回',
- 3: '已通过'
- }
- return statusTextMap[status] || '未知状态'
- },
-
- getStatusTagType (status) {
- const statusMap = {
- 1: 'warning',
- 2: 'info',
- 3: 'primary',
- 4: 'success',
- 5: 'danger'
- }
- return statusMap[status] || 'info'
- },
-
- handleTabChange (tab) {
- this.activeTab = tab.props?.name || tab.name
- this.filters.status = ''
- if (tab.props?.name === 'WAIT_AUDIT') {
- this.filters.status = '1'
- } else if (tab.props?.name === 'REJECTED') {
- this.filters.status = '2'
- } else if (tab.props?.name === 'PASS') {
- this.filters.status = '3'
- } else if (tab.props?.name === 'DRAFT') {
- this.filters.status = '0'
- }
- this.page.currentPage = 1
- this.fetchTableData()
- },
-
- handleSearch () {
- this.page.currentPage = 1
- this.fetchTableData()
- },
-
- handleReset () {
- this.filters = {
- keyword: '',
- department: '',
- type: '',
- dateRange: [],
- status: ''
- }
- this.page.currentPage = 1
- this.fetchTableData()
- },
-
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- },
-
- async updateGlobalCounts () {
- const counts = {
- all: 0,
- DRAFT: 0,
- WAIT_AUDIT: 0,
- REJECTED: 0,
- PASS: 0
- }
- var reponse = await jobStatusNum()
- // console.log('统计' + reponse.data.data)
- reponse.data.data.forEach(item => {
- const tab = this.tabs.find(t => t.name === item.dict_key)
- if (tab) {
- tab.count = item.num
- }
- })
- },
-
- handleAdd () {
- this.form = {}
- this.form.rth_altitude = 120
- this.dialogVisible = true
-
- this.$nextTick(() => {
- if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
- this.$refs.MapContainer.initAddEntity('initPosition')
- }
- })
-
- //航线列表
- this.asyncgetWaylineFileListByArea()
- },
-
- resetForm () {
- this.form = {
- name: '',
- type: '',
- handler: '',
- algorithm: '',
- location: '',
- address: '',
- content: '',
- photos: []
- }
- if (this.$refs.testform) {
- this.$refs.testform.resetFields()
- }
- },
-
- formatLocation (location) {
- if (!Array.isArray(location)) {
- return '未知位置'
- }
- return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`
- },
- async handleViewDetail (row) {
- const response = await orderLogDetails(row.id)
- const data = response.data.data
- this.form = {
- ...data
- }
-
- // 更新机巢列表
- this.device_sns = data.device_map_infos// data.device_list;
- this.permission &&
- (this.permission.order_log_review || this.permission.order_log_recall) &&
- (data.status == 1 || data.status == 3 || (data.status == 2 && this.userInfo.user_id !== this.form.create_user))
- ? (this.detailTitle = '工单详情')
- : (this.detailTitle = '编辑工单')
-
- 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)
- const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/orderLog')
- find && (find.query = {})
- },
- 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
- this.initMapLine(data.device_map_infos)
- },
- //导出
- async exportData () {
- this.$confirm('是否智飞工单数据?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- NProgress.start()
- let params = this.getQueryParam()
- orderLogExport(params).then(res => {
- downloadXls(res.data, `智飞工单${this.$dayjs().format('YYYY-MM-DD')}.xlsx`)
- NProgress.done()
- })
- })
- },
- hasAddBtnPermission () {
- // undefined 或 false 都返回 false,只有 true 返回 true
- // 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)
- return this.permission && this.permission.order_log_review === true
- },
- hasRecallPaddingBtnPermission () {
- // undefined 或 false 都返回 false,只有 true 返回 true
- // console.log('权限检查:', this.permission)
- // 智飞工单撤回
- return this.permission && this.permission.order_log_recall === true
- },
- //驳回按钮权限
- hasRejectionBtnPermission () {
- // undefined 或 false 都返回 false,只有 true 返回 true
- // console.log('权限检查:', this.permission)
- return this.permission && this.permission.rejection_btn === true
- },
- //自己点发布
- userPublishPush (id) {
- this.$confirm('确定发布吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let response = userPublish(id)
- this.$message.success('发布成功')
- this.fetchTableData()
- })
- },
-
- //删除
- deleteOrderLog (id) {
- this.$confirm('确定删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let response = deleteOrderLog(id)
- this.$message.success('删除')
- this.fetchTableData()
- })
- },
- refreshChange () {
- this.fetchTableData()
- },
- //获取航线列表
- async asyncgetWaylineFileListByArea (name) {
- const formData = {
- name: '',
- waylineType: undefined,
- current: 1,
- size: 99999999,
- descs: 'update_time'
- }
- var wayLineListResponse = await newGetWorkspacesPage(formData)
- this.wayLineList = wayLineListResponse.data.data.records
-
- this.initMapLine()
- },
-
- initMapLine (infos = {}, cb = () => {
- }) {
- let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id)
-
- if (!currentLine) return
-
- 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,
- infos
- })
- }
- })
- },
-
- //可飞行机巢列表
- async getFlyingNestBy (waylineId) {
- const that = this
-
- // 先清空
- that.form.device_sns = []
- that.device_sns = []
-
- this.initMapLine({}, async polygon => {
- const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId)
- //按照航线来
- const params = {
- type: ['2', '4', '5', '7', '8', '9', '10'].includes(currentLine.wayline_type) ? 2 : 0,
- wayline_id: waylineId,
- polygon
- }
- var wayLineListResponse = await getFlyingNestBy(params)
- // 再赋值
- that.device_sns = wayLineListResponse.data.data
- })
- },
-
- //撤回
- async orderLogRecall (id) {
- this.$confirm('确定撤回则到草稿箱。', '是否撤回?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- let reposne = await orderLogRecall(id)
- this.handleSearch()
- })
- },
- onLoad () {
- this.fetchTableData()
- },
- /**
- * 通过
- */
- async orderLogPass (id) {
- let response = await orderLogPass(id)
- let data = response.data.data
- this.$message.success('审核通过')
- this.detailVisibleCopy = false
-
- this.detailVisible = false
-
- this.page.currentPage = 1
- this.onLoad(this.page, this.query)
- // this.handleViewDetail()
- },
- /**
- * 驳回
- */
- async orderLogReject (id) {
- this.$prompt('', '驳回原因', {
- confirmButtonText: '确定',
- cancelButtonText: '取消'
- }).then(async ({ value }) => {
- let response = await orderLogReject(id, value)
- let data = response.data.data
- this.$message.success('驳回成功')
- this.detailVisibleCopy = false
-
- // this.detailVisible = false
-
- this.page.currentPage = 1
- this.onLoad(this.page, this.query)
- })
- }
- },
- watch: {
- // lastHeight(newVal, oldVal) {
- // console.log('lastHeight', newVal, oldVal);
- // this.getlastHeight = newVal;
- // },
- tableData: {
- handler () {
- // this.updateTabCounts()
- },
- deep: true
- }
- }
-}
-</script>
-
-<style lang="scss" scoped>
-//:deep(.el-input-number) {
-// width: 200px;
-//}
-
-//:deep(.el-form-item__label) {
-// width: 100px !important;
-//}
-
-::v-deep(.el-tabs) {
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-tabs__header {
- order: 1;
- }
-
- .el-tabs__content {
- order: 2;
- }
-
- .el-tabs__content {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .el-tab-pane {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- }
-}
-
-.filter-bar {
- // align-items: center;
-
- .search-bar-box {
- margin-bottom: 15px;
- display: flex;
- justify-content: space-between;
- gap: 8px;
-
- &-item {
- flex: 1;
-
- &> ::v-deep(.el-date-editor) {
- width: 100%;
- box-sizing: border-box;
- }
- }
-
- .search-btn {
- flex: 1;
- display: flex;
- justify-content: flex-end;
- }
-
- .flex-2 {
- min-width: 454px;
- }
- }
-}
-
-: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;
-}
-
-:deep(.el-input__inner),
-:deep(.el-select),
-:deep(.el-select .el-input) {
- width: 100%; // 确保所有输入框和选择框宽度一致
-}
-
-:deep(.el-textarea__inner) {
- resize: none;
-}
-
-.action-bar {
- margin-bottom: 16px;
-}
-
-.el-tabs {
- :deep(.el-tabs__content) {
- overflow: visible;
- }
-}
-
-.el-dialog {
- .el-form-item {
- margin-bottom: 10px;
- }
-}
-
-.el-upload {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
-
- :deep(.el-upload-list__item) {
- transition: all 0.3s ease;
- }
-
- :deep(.el-upload-list__item:hover) {
- background-color: #f5f7fa;
- }
-}
-
-.el-upload__tip {
- font-size: 12px;
- color: #909399;
- margin-top: 7px;
-}
-
-.custom-steps-container {
- width: 100%;
- margin: 20px 0;
-}
-
-.steps-titles {
- display: flex;
- justify-content: space-between;
- margin-bottom: 16px;
- position: relative;
-}
-
-.step-title {
- text-align: center;
- flex: 1;
- font-size: 16px;
- color: #999;
- position: relative;
- padding-bottom: 10px;
-}
-
-.step-title.active {
- color: #409eff;
- font-weight: bold;
-}
-
-.custom-steps {
- margin-top: -20px;
- /* 向上移动与标题重叠 */
-}
-
-.el-step__head {
- margin-top: 0;
-}
-
-.el-step__description {
- margin-top: 8px;
- padding: 0 20px;
-}
-
-.step-description {
- font-size: 14px;
- color: #666;
- line-height: 1.5;
-}
-
-.event-title-center {
- text-align: center;
- font-size: 20px;
- font-weight: bold;
- margin-bottom: 12px;
- color: #333;
-}
-
-.cur-menu {
- .menu-custom-box {
- display: flex;
- justify-content: center;
- flex-wrap: wrap;
-
- &> ::v-deep(.el-button) {
- flex: 1;
- margin-left: 0;
- margin-right: 10px;
- }
- }
-}
-
-.add-box-btns {
- width: 100%;
- display: flex;
- justify-content: center;
-}
-
-.safe-height {
- :deep(.el-form-item__label) {
- width: 120px !important;
- }
-
- :deep(.el-input-number) {
- width: 180px !important;
- }
-}
-
-.flex {
- display: flex;
-}
-
-.flex-1 {
- flex: 1;
-
- &> ::v-deep(div) {
- width: 100% !important;
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/ticket-copy.vue b/applications/drone-command/src/views/tickets/ticket-copy.vue
deleted file mode 100644
index 1121e1f..0000000
--- a/applications/drone-command/src/views/tickets/ticket-copy.vue
+++ /dev/null
@@ -1,4072 +0,0 @@
-<template>
- <basic-container>
- <el-tabs v-model="activeTab" @tab-click="handleTabChange">
- <el-tab-pane
- v-for="tab in filteredTabs"
- :key="tab.name"
- :label="`${tab.label} (${tab.count})`"
- :name="tab.name"
- >
- <basic-main-content>
- <!-- 查询条件筛选栏 -->
- <!-- 查询条件筛选栏 -->
- <div class="command-form-search">
- <el-form :model="filters" inline>
- <el-row :gutter="24">
- <el-col :span="4">
- <el-form-item label="关键字:">
- <el-input
- v-model="filters.keyword"
- placeholder="请输入关键字"
- class="filter-item"
- clearable
- @clear="handleKeyWords"
- @keyup.enter="handleSearch"
- />
- </el-form-item>
- </el-col>
-
- <!-- <el-select
- v-model="filters.department"
- placeholder="请选择所属部门"
- class="filter-item"
- clearable
- >
- <el-option
- v-for="item in departments"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select> -->
- <!-- <el-select
- v-model="filters.type"
- placeholder="请选择工单类型"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in types"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select> -->
- <el-col :span="5">
- <el-form-item label="选择日期:">
- <el-date-picker
- v-model="filters.dateRange"
- type="daterange"
- class="filter-item"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-value="datePickerDefaultVal"
- >
- </el-date-picker>
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="选择状态:">
- <el-select
- :disabled="activeTab !== 'all'"
- v-model="filters.status"
- placeholder="请选择状态"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in statuses"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
-
- <!-- <el-select
- v-model="filters.algorithm"
- placeholder="请选择关联算法"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in algorithms"
- :key="item.dict_key"
- :label="item.dict_value"
- :value="item.dict_key"
- />
- </el-select> -->
- <!-- <el-tree-select
- popper-class="custom-tree-select"
- :style="{ width: pxToRem(186) }"
- placeholder="请选择关联算法"
- v-model="dictKey"
- :data="dataList"
- :default-expanded-keys="[dictKey]"
- check-strictly
- node-key="id"
- :props="treePropsSF"
- @node-click="handleSFNodeClick"
- clearable
- @clear="handleClear"
- /> -->
- <el-col :span="4">
- <el-form-item label="选择算法:">
- <el-tree-select
- style="z-index: 1000"
- :teleported="false"
- class="custom-tree-select"
- :style="{ width: pxToRem(186) }"
- v-model="dictKey"
- :data="dataList"
- :default-expanded-keys="[dictKey]"
- :props="treePropsSF"
- :render-after-expand="false"
- :default-checked-keys="checkedKeys"
- node-key="id"
- multiple
- show-checkbox
- collapse-tags
- collapse-tags-tooltip
- clearable
- @check="handleCheck"
- @clear="handleClear"
- />
- </el-form-item>
- </el-col>
- <el-col :span="4">
- <el-form-item label="复核状态:">
- <el-select
- v-model="filters.isReview"
- placeholder="请选择复核状态"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in reviewStatuses"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="3">
- <el-button type="primary" icon="el-icon-search" @click="handleSearch"
- >搜索</el-button
- >
- <el-button icon="el-icon-refresh" @click="handleReset">清空</el-button>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <!-- 表格部分 -->
- <avue-crud
- class="command-public-general-avue-crud"
- ref="avueCrud"
- v-model="tableData"
- :option="option"
- :data="tableData"
- v-model:page="page"
- @size-change="sizeChange"
- @current-change="handleCurrentChange"
- @refresh-change="refreshChange"
- :table-loading="loading"
- @selection-change="handleSelectionChange"
- :permission="permissionList"
- v-if="activeTab === tab.name"
- >
- <template #orderNumber="{ row }">
- <el-tooltip-copy :content="row.orderNumber" :showCopyText="true" textAlign="left">
- {{ row.orderNumber }}
- </el-tooltip-copy>
- </template>
- <template #orderName="{ row }">
- <el-tooltip-copy :content="row.orderName" :showCopyText="true" textAlign="left">
- {{ row.orderName }}
- </el-tooltip-copy>
- </template>
- <template #menu-left>
- <el-button
- v-if="(activeTab === 'all' || activeTab === 'myTickets') && permissionList.addBtn"
- type="primary"
- icon="el-icon-plus"
- @click="handleAdd"
- >新建工单
- </el-button>
- <el-button
- v-if="activeTab === 'pending' && permissionList.reviewBtn"
- type="success"
- icon="el-icon-check"
- @click="openReviewDialog"
- >批量审核
- </el-button>
-
- <el-button
- v-if="permissionList.exportBtn"
- type="success"
- plain
- icon="el-icon-download"
- @click="exportData"
- >导出
- </el-button>
- </template>
- <template #menu="{ row }">
- <template v-if="row.status === -1">
- <el-button type="text" icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
- <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>
-
- <template v-if="row.status === 4 && activeTab === 'completed'">
- <el-button type="text" icon="el-icon-download" @click="exportTheTick(row)"
- >导出
- </el-button>
- </template>
- <template v-if="permission.tickets_repeat_review">
- <el-button
- v-if="row.status === 4 && row.isReview !== 1"
- type="text"
- icon="el-icon-check"
- @click="reCheck(row)"
- >复核
- </el-button>
- </template>
- </template>
- <template #status="{ row }">
- <span
- :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''"
- >
- {{ mapStatus(row.status) }}
- </span>
- </template>
- <template #keyData="{ row }">
- <span>{{ row.address }}</span>
- </template>
-
- <template #isReview="{ row }">
- <span>{{ showIsReviewText(row) }}</span>
- </template>
- </avue-crud>
- </basic-main-content>
- </el-tab-pane>
- </el-tabs>
-
- <!-- 新建工单对话框 -->
- <el-dialog
- v-model="dialogVisible"
- v-if="dialogVisible"
- title="新建工单"
- width="70%"
- :close-on-click-modal="false"
- @close="resetForm"
- >
- <el-form
- :model="form"
- :rules="rules"
- ref="form"
- label-width="90px"
- class="create-ticket-form"
- >
- <div class="form-section">
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input v-model="form.name" placeholder="请输入工单名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="工单类型" prop="type">
- <el-select
- @change="handleTypeChange"
- v-model="form.type"
- placeholder="请选择工单类型"
- class="full-width"
- >
- <el-option
- v-for="item in types"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="处理部门" prop="department">
- <el-select
- v-model="form.department"
- placeholder="请选择处理部门"
- @change="handleDepartmentChange"
- class="full-width"
- >
- <el-option
- v-for="dept in departments"
- :key="dept.value"
- :label="dept.label"
- :value="dept.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="处理人员" prop="handler">
- <el-select
- v-model="form.handler"
- placeholder="请先选择处理人员"
- :disabled="!form.department"
- class="full-width"
- >
- <el-option
- v-for="user in availableHandlers"
- :key="user.id"
- :label="user.name"
- :value="user.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="关联算法" prop="algorithm">
- <el-select
- v-model="form.algorithm"
- multiple
- placeholder="请选择关联算法"
- class="full-width"
- :disabled="!form.type"
- >
- <el-option
- v-for="item in algorithms2"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="事件位置" prop="location">
- <div class="location-wrapper">
- <avue-input-map
- v-model="form.location"
- :clearable="false"
- :params="mapParams"
- @change="handleLocationChange"
- type="button"
- >
- <el-button type="primary" plain class="map-button">
- <i class="el-icon-map-location"></i> 地图选点
- </el-button>
- </avue-input-map>
- <!-- <div v-if="form.location?.length >= 3">
- {{ form.location[2] || '获取地址中...' }}
- </div> -->
- </div>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input
- type="textarea"
- v-model="form.content"
- :rows="4"
- placeholder="请输入工单内容描述"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="事件图片" prop="photos" required class="upload-wrapper">
- <el-upload
- v-if="createoredit === 1"
- ref="upload"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="form.photos"
- :limit="1"
- accept="image/*"
- class="create-upload"
- >
- <template v-if="form.photos.length < 1">
- <!-- <i class="el-icon-plus">+</i> -->
- <div class="el-icon-plus">
- <span>+</span>
- </div>
- </template>
- </el-upload>
- <el-upload
- v-else
- ref="upload"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="popupShowImage(form.photos)"
- :limit="1"
- accept="image/*"
- class="create-upload"
- >
- <template v-if="form.photos.length < 1">
- <div class="el-icon-plus">
- <span>+</span>
- </div>
- </template>
- </el-upload>
- <div class="upload-tip">需上传含有地址信息的照片(jpg、jpeg、png),且不超过5M</div>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-form>
- <template #footer>
- <div class="dialog-footer-new">
- <el-button
- type="danger"
- :loading="submitLoading"
- @click="submitForm"
- icon="el-icon-position"
- >发布
- </el-button>
- <el-button
- type="infoprimary"
- plain
- :loading="draftLoading"
- @click="saveDraft"
- icon="el-icon-document-add"
- >存草稿
- </el-button>
-
- <el-button @click="handleCancel" icon="el-icon-circle-close">取 消</el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 工单详情对话框 -->
- <el-dialog
- class="custom-dialog"
- align-center
- v-model="detailVisible"
- title="工单详情"
- width="80%"
- append-to-body
- >
- <div class="detail-container">
- <div class="detail-top-title">
- <div class="event-title-center event-orderNumber">
- {{ currentDetail.orderNumber || '工单编号' }}
- </div>
- <div class="event-title-center">{{ currentDetail.orderName || '事件名称' }}</div>
- </div>
- <div v-if="totalTime" class="event-total-time">总耗时:{{ totalTime }}</div>
- <!-- 工单状态流程 -->
- <div class="custom-steps-container">
- <!-- 标题行 -->
- <div class="steps-titles">
- <div
- v-for="(status, index) in stepStatusList"
- :key="index"
- :class="{
- 'step-title': true,
- active: index <= stepStatusList.indexOf(String(currentDetail.status)),
- }"
- >
- {{ mapStatus(status) }}
- </div>
- </div>
-
- <!-- Element Steps 组件 -->
- <el-steps :active="getActiveStep() - 1" align-center class="custom-steps">
- <el-step v-for="(status, index) in stepStatusList" :key="index">
- <template #description>
- <span class="step-description">
- {{ getStepHandler(status) }}
- </span>
- <div class="step-description" v-if="getStepTime(status)">
- <span class="step-timer"> 耗时:{{ getStepTime(status) }} </span>
- </div>
- <div class="step-description">
- {{ getStepCreateTime(status) }}
- </div>
- </template>
- </el-step>
- </el-steps>
- </div>
-
- <div class="PopUpTableScrolls">
- <!-- 基本信息表格 -->
- <el-table :show-header="false" :data="formattedDetailFields" border class="tableCss">
- <el-table-column prop="label1" label="基本信息" width="150">
- <template #default="{ row }">
- <!-- 添加必填星号的标签 -->
- <span
- v-if="
- currentDetail.status === 0 &&
- (row.label1 === '关联算法' || row.label1 === '工单名称')
- "
- class="required-label"
- >
- <span class="required-star">*</span>{{ row.label1 }}
- </span>
- <span v-else>{{ row.label1 }}</span>
- </template>
- </el-table-column>
- <el-table-column>
- <template #default="{ row }">
- <template
- v-if="
- currentDetail.status === 0 &&
- row.label1 === '工单名称' &&
- hasProcessingBtnPermission()
- "
- >
- <el-input
- v-model="currentDetail.orderName"
- placeholder="请输入工单名称"
- class="required-input"
- />
- </template>
- <template
- v-else-if="
- currentDetail.status === 0 &&
- row.label1 === '关联算法' &&
- hasProcessingBtnPermission()
- "
- >
- <el-select
- v-model="currentDetail.aiType"
- placeholder="请选择关联算法"
- class="required-input"
- >
- <el-option
- v-for="item in algorithms2"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </template>
- <template v-else>{{ row.value1 }}</template>
- </template>
- </el-table-column>
- <el-table-column prop="label2" label="基本信息" width="150">
- <template #default="{ row }">
- <!-- 添加必填星号的标签 -->
-
- <span
- v-if="currentDetail.status === 0 && row.label2 === '工单内容'"
- class="required-label"
- >
- <span class="required-star">*</span>{{ row.label2 }}
- </span>
- <span v-else>{{ row.label2 }}</span>
- </template>
- </el-table-column>
- <el-table-column>
- <template #default="{ row }">
- <!-- 修改工单类型和工单内容的显示 -->
-
- <template
- v-if="
- currentDetail.status === 0 &&
- row.label2 === '工单内容' &&
- hasProcessingBtnPermission()
- "
- >
- <el-input
- type="textarea"
- v-model="currentDetail.content"
- placeholder="请输入工单内容"
- class="required-input"
- />
- </template>
- <template v-else>{{ row.value2 }}</template>
- </template>
- </el-table-column>
- </el-table>
-
- <!-- 事件处理详情 -->
- <div v-if="[3, 4].includes(currentDetail.status)" class="form-section">
- <div class="section-title">
- <!-- 处理中状态显示必填星号 -->
- <template v-if="currentDetail.status === 3">
- <span class="required-label">
- <span class="required-star">*</span>事件处理详情
- </span>
- </template>
- <template v-else> 事件处理详情</template>
- </div>
- <!-- 处理中状态显示输入框 -->
- <template v-if="currentDetail.status === 3 && hasProcessedAndOverBtnPermission()">
- <el-input
- type="textarea"
- v-model="currentDetail.processingDetail"
- placeholder="请输入事件处理详情"
- :rows="4"
- style="width: 100%; margin-bottom: 10px"
- />
- </template>
- <!-- 已完成和已完结状态显示只读文本 -->
- <template v-else>
- <div class="readonly-processing-detail">
- {{ currentDetail.processingDetail }}
- </div>
- </template>
- </div>
-
- <!-- 上传图片 -->
- <div v-if="[3].includes(currentDetail.status)" class="form-section uploadImg">
- <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">
- <!-- 已完成状态显示必填星号 -->
- <template v-if="currentDetail.status === 3">
- <span class="required-label"> <span class="required-star">*</span>上传图片 </span>
- </template>
- <template v-else> 上传图片</template>
- </div>
- <el-upload
- v-if="hasProcessedAndOverBtnPermission()"
- ref="upload"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="currentDetail.photos || []"
- :limit="1"
- accept="image/*"
- class="detail-upload"
- >
- <template v-if="!currentDetail.photos || currentDetail.photos.length < 1">
- <!-- <i class="el-icon-plus">+</i> -->
- <div class="el-icon-plus">
- <span>+</span>
- </div>
- </template>
- </el-upload>
- <div class="el-upload__tip" v-if="hasProcessedAndOverBtnPermission()">
- (上传照片即可完结工单,只能上传jpg、jpeg、png照片,且不超过5M)
- </div>
- </div>
-
- <!-- 图片和地图部分 -->
- <div class="media-section">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="media-box">
- <div class="media-title">事件图片</div>
- <div class="media-content">
- <el-image
- v-if="currentDetail.mediaUrl"
- :src="getThumbUrl(currentDetail.mediaUrl)"
- :preview-src-list="[getPreviewUrl(currentDetail.mediaUrl)]"
- fit="contain"
- style=" cursor: pointer"
- >
- <template #placeholder>
- <div class="image-placeholder">
- <i class="el-icon-picture-outline"></i>
- <span>加载中...</span>
- </div>
- </template>
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-media">暂无图片/视频</div>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="media-box">
- <!-- 根据状态显示不同的标题和内容 -->
-
- <template v-if="currentDetail.status === 4">
- <div class="media-title">工单处理图片</div>
- <div class="media-content">
- <el-image
- v-if="currentDetail.updatePhotoUrl"
- :src="getThumbUrl(currentDetail.updatePhotoUrl)"
- :preview-src-list="[getPreviewUrl(currentDetail.updatePhotoUrl)]"
- fit="fill"
- >
- <template #placeholder>
- <div class="image-placeholder">
- <i class="el-icon-picture-outline"></i>
- <span>加载中...</span>
- </div>
- </template>
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-media">暂无处理图片</div>
- </div>
- </template>
- <template v-else>
- <div class="media-title">
- 地图标记事件点
- <el-popover
- v-if="currentDetail.status === 3 || currentDetail.status === 0"
- popper-class="custom-qrcode-popover"
- :width="120"
- :visible="currentDetail.showQR && detailVisible"
- placement="top"
- title=""
- trigger="click"
- >
- <template #reference>
- <img
- @click.stop="handleQRCode(currentDetail)"
- class="QRCodeImg"
- src="@/assets/images/dataCenter/qrCode.svg"
- alt=""
- title="事件导航"
- />
- </template>
- <div class="qrcode-content">
- <div class="close-btn" @click.stop="currentDetail.showQR = false">×</div>
- <CreateQRcode
- v-if="currentDetail.showQR && detailVisible"
- :latAndLon="currentDetail.location"
- ></CreateQRcode>
- </div>
- </el-popover>
- </div>
- <div class="media-content">
- <map-container v-if="detailVisible" ref="MapContainer"></map-container>
- </div>
- </template>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
-
- <!-- 操作按钮 -->
- <div class="dialog-footer1-new">
- <div class="leftBtn" :class="currentIndex === 0 ? 'disableds' : ''" @click="leftClick">
- 上一页
- </div>
- <div class="btngroups">
- <template v-if="currentDetail.status === 2">
- <!-- 待审核 -->
- <el-button
- v-if="hasReviewBtnPermission()"
- type="primary"
- :loading="approveLoading"
- @click="approveTicket"
- icon="el-icon-check"
- >通过
- </el-button>
- <el-button
- v-if="hasReviewBtnPermission()"
- type="danger"
- :loading="rejectLoading"
- @click="rejectTicket"
- icon="el-icon-close"
- >不通过
- </el-button>
- <el-button @click="detailVisible = false" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-else-if="currentDetail.status === 0">
- <el-button
- v-if="hasProcessingBtnPermission()"
- type="primary"
- :loading="dispatchLoading"
- @click="approveAndDispatch"
- icon="el-icon-check"
- >受理
- </el-button>
- <el-button
- v-if="hasProcessingBtnPermission()"
- type="danger"
- :loading="rejectLoading"
- @click="rejectTicket"
- icon="el-icon-close"
- >不受理
- </el-button>
- <el-button @click="detailVisible = false" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-if="currentDetail.status === 3">
- <!-- 处理中 -->
- <el-button
- v-if="hasProcessedAndOverBtnPermission()"
- type="primary"
- :loading="completeLoading"
- @click="completeTicket"
- icon="el-icon-circle-check"
- >完成工单
- </el-button>
- <el-button @click="detailVisible = false" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-else-if="currentDetail.status === 4">
- <!-- 已完成 -->
- <!-- <el-button v-if="hasProcessedAndOverBtnPermission()" type="primary" :loading="finalizeLoading"
- @click="finalizeTicket">完结工单</el-button> -->
- <el-button @click="detailVisible = false" icon="el-icon-circle-close">取消</el-button>
- </template>
- </div>
- <div
- :class="currentIndex === tableData.length - 1 ? 'disableds' : ''"
- class="leftBtn"
- @click="rightClick"
- >
- 下一页
- </div>
- </div>
- </div>
- </el-dialog>
-
- <!-- 派发工单对话框 -->
- <el-dialog
- v-model="dispatchDialogVisible"
- title="派发工单"
- width="40%"
- :close-on-click-modal="false"
- >
- <el-form :model="dispatchForm" :rules="dispatchRules" ref="dispatchForm" label-width="100px">
- <el-form-item label="选择部门" prop="department">
- <el-select
- v-model="dispatchForm.department"
- placeholder="请选择部门"
- @change="handleDispatchDepartmentChange"
- >
- <el-option
- v-for="dept in departments"
- :key="dept.value"
- :label="dept.label"
- :value="dept.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="选择处理人" prop="handler">
- <el-select
- filterable
- v-model="dispatchForm.handler"
- placeholder="请选择处理人"
- :disabled="!dispatchForm.department"
- >
- <el-option
- v-for="user in availableDispatchHandlers"
- :key="user.id"
- :label="user.name"
- :value="user.id"
- />
- </el-select>
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button @click="dispatchDialogVisible = false" icon="el-icon-circle-close"
- >取消
- </el-button>
- <el-button type="primary" :loading="dispatchLoading" @click="submitDispatch"
- >确认派发
- </el-button>
- </template>
- </el-dialog>
-
- <!-- 添加在其他 dialog 组件之后 -->
- <el-dialog
- v-model="reviewDialogVisible"
- title="批量审核"
- width="1100"
- append-to-body
- class="command-dialog-mange"
- custom-class="review-dialog"
- @close="cancleBatchReject"
- >
- <div class="review-container">
- <div class="review-image-wrapper">
- <!-- 修改左右箭头的显示条件 -->
- <el-button
- v-if="selections.length > 1 && currentReviewImage"
- class="arrow-button left"
- @click="handlePrevImage"
- icon="el-icon-arrow-left"
- >
- </el-button>
-
- <div class="review-image-container">
- <!-- <el-image v-if="currentReviewImage" :src="getThumbUrl(currentReviewImage)" fit="fill"
- :preview-src-list="getImageList()" :initial-index="currentImageIndex - 1" class="preview-image"
- style="cursor: pointer"> -->
- <el-image
- v-if="currentReviewImage"
- :src="getPreviewUrl(currentReviewImage)"
- fit="fill"
- :initial-index="currentImageIndex - 1"
- class="preview-image"
- style="cursor: pointer"
- >
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>图片加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-image">暂无图片</div>
- </div>
-
- <!-- 修改右箭头的显示条件 -->
- <el-button
- v-if="selections.length > 1 && currentReviewImage"
- class="arrow-button right"
- @click="handleNextImage"
- icon="el-icon-arrow-right"
- >
- </el-button>
- </div>
-
- <!-- 修改分页器的显示条件 -->
- <div class="review-pagination" v-if="selections.length > 1 && currentReviewImage">
- <el-pagination
- small
- layout="prev, pager, next"
- hide-on-single-page
- :total="selections.length"
- :current-page="currentImageIndex"
- :page-size="1"
- @current-change="handleImagePageChange"
- >
- </el-pagination>
- </div>
- </div>
-
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="handleBatchApprove" icon="el-icon-check"
- >通过
- </el-button>
- <el-button type="danger" @click="handleBatchReject" icon="el-icon-close"
- >不通过
- </el-button>
- <el-button @click="cancleBatchReject" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 复核弹出层 -->
-
- <el-dialog
- v-model="reCheckDialog"
- title="工单复核"
- width="30%"
- append-to-body
- class="command-dialog-mange"
- @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 {ALL_WORK_ORDER_TYPE_OPTIONS} from '@ztzf/constants'
-
-import { pxToRem, pxToRemNum } from '@/utils/rem';
-import { getSmallImg, getShowImg } from '@/utils/util';
-import { ElMessageBox, ElLoading } from 'element-plus';
-import { calculateDefaultRange } from '@/utils/util';
-import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation';
-import _ from 'lodash';
-import {
- getList,
- createTicket,
- getTicketInfo,
- flowEvent,
- getstatusCount,
- getStepInfo,
- getReviewById,
- getCreateEventJob,
- exportTheTicket
-} from '@/api/tickets/ticket';
-import { getSFDictionaryTree } from '@/api/job/task';
-import { export_json_to_excel } from '@/utils/exportExcel';
-import geoJson from '@/assets/geoJson.json';
-import { mapGetters } from 'vuex';
-import { getAdcodeObj } from '@/utils/disposeData';
-import elTooltipCopy from '@/components/ElTooltipCopy.vue';
-import getBaseConfig from '@/buildConfig/config';
-import CreateQRcode from '@/components/CreateQRcode/CreateQRcode.vue';
-import { CircleClose } from '@element-plus/icons-vue';
-
-const { envName } = getBaseConfig();
-
-function regExp(label, name) {
- var reg = new RegExp(label + '=([^&]*)(&|$)', 'g');
- return name.match(reg)[0].split('=')[1];
-}
-
-export default {
- components: { elTooltipCopy, CreateQRcode },
- name: 'TicketPage',
- data() {
- return {
- currentIndex: null, // 当前显示的数据索引
- submitLoading: false, // 新增loading状态
- draftLoading: false,
- approveLoading: false,
- rejectLoading: false,
- dispatchLoading: false,
- completeLoading: false,
- finalizeLoading: false,
- createoredit: '',
- activeTab: 'all',
- // tabs 只保留静态结构,不做权限判断
- tabs: [
- { label: '全部工单', name: 'all', value: null, count: 0 },
- { label: '待审核', name: 'pending', value: 2, count: 0 },
- { label: '待处理', name: 'processing', value: 0, count: 0 },
- { label: '处理中', name: 'inProgress', value: 3, count: 0 },
- { label: '已完成', name: 'completed', value: 4, count: 0 },
- // { label: "已完结", name: "closed", value: 5, count: 0 },
- { label: '我的工单', name: 'myTickets', value: null, count: 0 },
- ],
- filters: {
- keyword: '',
- department: '',
- type: '',
- dateRange: [],
- status: '',
- algorithm: '', // 新增算法筛选字段
- isReview: '', // 添加复核状态筛选字段
- },
- departments: [],
- types: [],
- allAlgorithms: [],
- handlers: [
- { label: '处理人A', value: 'handlerA' },
- { label: '处理人B', value: 'handlerB' },
- ],
-
- algorithms: [],
- algorithms2: [],
- statuses: [
- { label: '待审核', value: '2' },
- { label: '待处理', value: '0' },
- { label: '处理中', value: '3' },
- { label: '已完成', value: '4' },
- ],
- reviewStatuses: [
- { label: '否', value: 0 },
- { label: '是', value: 1 },
- ],
- tableData: [],
- option: {
- border: true,
- stripe: false,
- selection: true, // 添加多选功能
- index: true, // 保留序号功能
- indexLabel: '序号',
- indexWidth: 60,
- menuWidth: 150,
- searchMenuSpan: 6,
- viewBtn: false,
- editBtn: false,
- delBtn: false,
- addBtn: false,
- menu: true,
- page: true,
-
- height: 'auto',
- calcHeight: 196,
-
- column: [
- // { label: "序号", prop: "id", width: 70 },
- { label: '工单编号', prop: 'orderNumber', width: 170 },
- { label: '工单名称', prop: 'orderName', width: 150, overHidden: true, tooltip: true },
- { label: '所属部门', prop: 'department', overHidden: true, tooltip: true },
- { label: '发起任务时间', prop: 'startTime', width: 160, overHidden: true },
- { label: '关联算法', prop: 'aiType', overHidden: true, tooltip: true },
- {
- label: '工单类型',
- prop: 'type',
- width: 110,
- overHidden: true,
- tooltip: true,
- type: 'select',
- dicData: [],
- },
- {
- label: '工单内容',
- prop: 'content',
- slot: true,
- width: 152,
- overHidden: true,
- },
- { label: '创建人', prop: 'creator', width: 120, overHidden: true },
- { label: '处理人', prop: 'handler', width: 120, overHidden: true },
- {
- slot: true,
- hide: false,
- label: '复核状态',
- prop: 'isReview',
- width: 90,
- },
- { label: '工单状态', prop: 'status', slot: true, width: 90 },
- ],
- },
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- },
- dialogVisible: false,
- detailVisible: false,
- currentDetail: {},
- form: {
- name: '',
- type: '',
- department: '',
- handler: '',
- algorithm: [], // 关联算法改为数组
- location: [], // 将存储为[经度, 纬度, 地址]格式
- address: '',
- photos: [],
- content: '', // 新增字段,用于存储后端返回的 content
- },
- rules: {
- name: [{ required: true, message: '请输入工单名称', trigger: 'blur' }],
- type: [{ required: true, message: '请选择工单类型', trigger: 'change' }],
- department: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
- handler: [{ required: true, message: '请选择处理人员', trigger: 'change' }],
- content: [{ required: true, message: '请输入工单内容', trigger: 'blur' }],
- algorithm: [{ required: true, message: '请选择关联算法', trigger: 'change' }],
- location: [
- {
- required: true,
- validator: (rule, value, callback) => {
- if (!value || value.length < 2) {
- callback(new Error('请选择位置信息'));
- } else if (!value[0] || !value[1]) {
- callback(new Error('请选择位置信息'));
- } else {
- callback();
- }
- },
- trigger: 'change',
- },
- ],
- photos: [
- {
- validator: (rule, value, callback) => {
- if (!this.form.photos || this.form.photos.length === 0) {
- callback(new Error('请上传工单图片'));
- } else {
- callback();
- }
- },
- trigger: 'change',
- },
- ],
- },
- departmentUsers: {},
- loading: false,
- globalCounts: {},
- mapLoaded: false,
- isFetching: false,
- mapParams: {
- zoom: 15,
- center: null, // 初始设为 null,等待动态设置
- },
- dispatchDepartment: '', // 新增:派发部门
- dispatchHandler: '', // 新增:派发处理人
- dispatchDialogVisible: false, // 新增:派发对话框可见性
- dispatchForm: {
- department: '',
- handler: '',
- }, // 新增:派发表单数据
- dispatchRules: {
- department: [{ required: true, message: '请选择部门', trigger: 'change' }],
- handler: [{ required: true, message: '请选择处理人', trigger: 'change' }],
- }, // 新增:派发表单验证规则
- stepInfos: [], // 新增:存储步骤信息
- fixedStatuses: ['2', '0', '3', '4'], // 固定的五个状态
- userNameToIdMap: {}, // 新增用户名到ID的映射
- workType: 0, // 新增:当前工单work_type
- selections: [], // 添加选中行数据数组
- reviewDialogVisible: false, // 新增:审核对话框可见性
- currentReviewImage: '', // 新增:当前审核图片
- currentImageIndex: 1, // 新增:当前图片索引
- totalTime: '',
- isShowInfo: false,
-
- // 配置时间选择器默认配置
- datePickerDefaultVal: calculateDefaultRange(),
-
- // 复核弹窗
- reCheckDialog: false,
- treePropsSF: {
- label: 'dictValue',
- value: 'id',
- children: 'children',
- },
- dictKey: '',
- dataList: [],
- checkedKeys: [],
- };
- },
- created() {
- this.inputMapShowDefaultCenter = null;
-
- this.loadAMapScripts();
- this.fetchDropdownData();
- },
-
- mounted() {
- this.getAlgorithmList();
-
- const href = this.$route.href;
- if (this.$route?.query?.status !== undefined && this.$route?.query?.status !== null) {
- this.filters.status = this.$route?.query?.status + '';
- this.$router.replace({});
- }
-
- let curQueryParams = {};
- let isTabProcessed = false;
- if (href.indexOf('?') != -1 && href.split('?').length > 0) {
- curQueryParams = href
- .split('?')[1]
- .split('&')
- .reduce((pre, cur) => {
- let newArr = cur.split('=');
-
- pre[newArr[0]] = newArr[1];
-
- return pre;
- }, {});
-
- const { orderNumber = undefined, day = undefined, tab = undefined } = curQueryParams;
-
- // 日历传值
- if (day) {
- const date = new Date(day + 'T00:00:00+08:00');
- const dateArray = [date, date];
- const handler = {
- get(target, prop) {
- if (typeof prop === 'string' && /^\d+$/.test(prop)) {
- const index = parseInt(prop);
- const dateObj = target[index];
- return dateObj.toDateString() + ' 00:00:00 GMT+0800 (中国标准时间)';
- }
- return Reflect.get(target, prop);
- },
- };
-
- const proxyArray = new Proxy(dateArray, handler);
- this.filters.dateRange = proxyArray;
- }
-
- if (orderNumber) {
- this.filters.keyword = orderNumber;
- this.$nextTick(() => {
- this.isShowInfo = true;
- const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/ticket');
- find && (find.query = {});
- });
- }
- if (tab) {
- const isTabValid = this.filteredTabs.some(t => t.name === tab);
- if (isTabValid) {
- this.activeTab = tab;
- this.handleTabChangeAfterJump();
- isTabProcessed = true;
- const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/ticket');
- find && (find.query = {});
- }
- }
- }
-
- this.fetchTabCounts(); // 新增:初始化时获取 tab 数据
- this.fetchTableData();
- },
- computed: {
- CircleClose() {
- return CircleClose;
- },
- firstRowData() {
- return this.tableData.length > 0 ? this.tableData[0] : null;
- },
- availableHandlers() {
- return this.form.department ? this.departmentUsers[this.form.department] || [] : [];
- },
- availableDispatchHandlers() {
- return this.dispatchForm.department
- ? this.departmentUsers[this.dispatchForm.department] || []
- : [];
- },
- detailTableData() {
- return [
- {
- label: '工单名称',
- value: this.currentDetail.orderName,
- editable: this.currentDetail.status === 0,
- type: 'input',
- },
- {
- label: '关键任务',
- value: this.currentDetail.keyData,
- editable: false,
- },
- {
- label: '工单创建人',
- value: this.currentDetail.creator,
- editable: false,
- },
- {
- label: '当前状态',
- value: this.mapStatus(this.currentDetail.status),
- editable: false,
- },
- {
- label: '事件地址',
- value: this.currentDetail.address,
- editable: false,
- },
- {
- label: '工单类型',
- value: this.currentDetail.type,
- editable: this.currentDetail.status === 0,
- type: 'select',
- options: this.types,
- },
- {
- label: '关联算法',
- value: this.currentDetail.aiType,
- editable: false,
- },
- {
- label: '发起单位',
- value: this.currentDetail.department,
- editable: false,
- },
- {
- label: '发起任务时间',
- value: this.currentDetail.startTime,
- editable: false,
- },
- {
- label: '工单内容',
- value: this.currentDetail.content,
- editable: this.currentDetail.status === 0,
- type: 'textarea',
- },
- ];
- },
- detailFields() {
- return [
- {
- label: '工单名称',
- value: this.currentDetail.orderName,
- editable: this.currentDetail.status === 0,
- type: 'input',
- },
- { label: '关键任务', value: this.currentDetail.keyData, editable: false },
- { label: '工单创建人', value: this.currentDetail.creator, editable: false },
- { label: '当前状态', value: this.mapStatus(this.currentDetail.status), editable: false },
- { label: '事件地址', value: this.currentDetail.address, editable: false },
- {
- label: '工单类型',
- value: this.currentDetail.type,
- editable: this.currentDetail.status === 0,
- type: 'select',
- options: this.types,
- },
- { label: '关联算法', value: this.currentDetail.aiType, editable: false },
- { label: '发起单位', value: this.currentDetail.department, editable: false },
- { label: '发起任务时间', value: this.currentDetail.startTime, editable: false },
- {
- label: '工单内容',
- value: this.currentDetail.content,
- editable: this.currentDetail.status === 0,
- type: 'textarea',
- },
- ];
- },
- formattedDetailFields() {
- const fields = [
- { label: '工单名称', value: this.currentDetail.orderName },
- {
- label: '工单类型',
- // 修改这里:使用 types 数组查找对应的 label
- value:
- this.types.find(t => t.value === this.currentDetail.type)?.label ||
- this.currentDetail.type,
- },
- { label: '关联任务', value: this.currentDetail.job_name || '/' },
- { label: '工单创建人', value: this.currentDetail.creator },
- { label: '当前状态', value: this.mapStatus(this.currentDetail.status) },
- { label: '事件地址', value: this.currentDetail.address || this.currentDetail.latAndLon }, // 包含经纬度信息
- {
- label: '关联算法',
- value:
- this.algorithms.find(t => t.value === this.currentDetail.aiType)?.label ||
- this.currentDetail.aiType,
- },
- { label: '发起单位', value: this.currentDetail.department },
- { label: '发起任务时间', value: this.currentDetail.startTime },
- { label: '工单内容', value: this.currentDetail.content },
- ];
-
- // 过滤掉值为 '/' 的列
- const filteredFields = fields.filter(field => field.value !== '/');
- // 将字段分成两列
- const formattedFields = [];
- for (let i = 0; i < filteredFields.length; i += 2) {
- formattedFields.push({
- label1: filteredFields[i]?.label || '',
- value1: filteredFields[i]?.value || (filteredFields[i]?.label ? '暂无数据' : ''),
- label2: filteredFields[i + 1]?.label || '',
- value2: filteredFields[i + 1]?.value || (filteredFields[i + 1]?.label ? '暂无数据' : ''),
- });
- }
-
- return formattedFields;
- },
- dynamicFixedStatuses() {
- // 直接使用接口返回的 stepInfos
- return this.stepInfos.map(step => String(step.status));
- },
- ...mapGetters(['userInfo', 'permission']),
- // 动态过滤tabs,保证isShow为true/false
- filteredTabs() {
- // 统一处理权限,undefined视为false
- const tabStatus = this.permission?.tickets_tab_status === true;
- const tabPending = this.permission?.tickets_tab_pending === true;
- const tabMyTickets = this.permission?.tickets_tab_mytickets === true;
- return this.tabs
- .map(tab => {
- if (tab.name === 'all') {
- return { ...tab, isShow: true };
- }
- if (tab.name === 'pending') {
- return { ...tab, isShow: tabPending };
- }
- if (['processing', 'inProgress', 'completed', 'closed'].includes(tab.name)) {
- return { ...tab, isShow: tabStatus };
- }
- if (tab.name === 'myTickets') {
- return { ...tab, isShow: tabMyTickets };
- }
- return { ...tab, isShow: false };
- })
- .filter(tab => tab.isShow);
- },
- permissionList() {
- // 可根据实际后端权限key调整
- return {
- addBtn: this.validData(this.permission.tickets_add, false),
- delBtn: this.validData(this.permission.tickets_delete, false),
- exportBtn: this.validData(this.permission.tickets_export, false),
- reviewBtn: this.validData(this.permission.tickets_review, false),
- };
- },
- stepStatusList() {
- // “我发起的工单”tab用默认流程,其它tab用接口返回的stepInfos
- if (this.activeTab === 'myTickets') {
- if (this.workType === 1) {
- return ['3', '4'];
- }
- return this.fixedStatuses;
- }
-
- // 其它tab直接用接口返回的stepInfos
- return this.stepInfos.map(step => String(step.status));
- },
-
- showIsReviewText() {
- return row => {
- if (['4'].includes(String(row.status))) return row.isReview === 1 ? '是' : '否';
-
- return '/';
- };
- },
-
- popupShowImage() {
- return list => {
- return list.map(item => ({
- ...item,
- url: getShowImg(item.url),
- }));
- };
- },
- },
-
- methods: {
- handleCheck(data, { checkedKeys, checkedNodes }) {
- this.checkedKeys = checkedKeys;
- // 获取所有选中节点的 dictKey
- const selectedDictKeys = checkedNodes.map(node => node.dictKey).filter(Boolean);
- this.filters.type = selectedDictKeys;
- this.fetchTableData();
- },
- // 算法
- getAlgorithmList() {
- getSFDictionaryTree({ code: 'SF' }).then(res => {
- if (res.data.code === 200) {
- const result = res.data.data[0].children;
- // 过滤第一层数据
- const filteredData = result.map(item => {
- // 过滤第二层数据
- const children = item.children?.map(child => ({
- ...child,
- children: [], // 清空第三层数据
- }));
- return {
- ...item,
- children: children || [],
- };
- });
- this.dataList = filteredData;
- }
- });
- },
-
- handleSFNodeClick(data) {
- this.filters.type = '';
- this.filters.algorithm = '';
- this.filters.type = data.dictKey;
- // 更新列表请求
- this.fetchTableData();
- },
- handleClear() {
- this.dictKey = '';
- this.filters.algorithm = '';
- this.filters.type = '';
- this.fetchTableData();
- },
- handleCellClick(row, column) {
- console.log(row, column.no);
- if (column.no === 2) {
- navigator.clipboard.writeText(row.orderNumber).then(() => {
- this.$message.success('复制工单编号成功');
- });
- } else if (column.no === 3) {
- navigator.clipboard.writeText(row.orderName).then(() => {
- this.$message.success('复制工单名称成功');
- });
- } else if (column.no === 4) {
- navigator.clipboard.writeText(row.department).then(() => {
- this.$message.success('复制所属部门成功');
- });
- }
- },
- // 左切换
- leftClick() {
- if (this.tableData.length === 0) return;
- this.currentIndex = Math.max(0, this.currentIndex - 1);
- this.updateCurrentDetail();
- },
- // 右切换
- rightClick() {
- if (this.tableData.length === 0) return;
- this.currentIndex = Math.min(this.tableData.length - 1, this.currentIndex + 1);
- this.updateCurrentDetail();
- },
- // 更新当前详情
- updateCurrentDetail() {
- this.currentDetail = this.tableData[this.currentIndex];
- this.currentDetail.mediaUrl = this.currentDetail.photo_url;
- this.currentDetail.updatePhotoUrl = this.currentDetail.update_photo_url;
- this.currentDetail.processingDetail = this.currentDetail.content;
- this.handleViewDetail(this.currentDetail);
-
- // 如果使用地图组件,需要更新地图标记
- this.$nextTick(() => {
- if (this.$refs.MapContainer && this.currentDetail.location) {
- this.$refs.MapContainer.initAddEntity('point', this.currentDetail.location);
- }
- });
- },
- async handleQRCode(val) {
- val.showQR = !val.showQR;
- },
- async loadAMapScripts() {
- try {
- const areaCode = this.userInfo.detail.areaCode;
- const subAreaCode = areaCode ? areaCode.substring(0, 6) : '';
- const adcodeObj = getAdcodeObj(geoJson, 'adcode', subAreaCode);
-
- // console.log('区域代码:', subAreaCode);
-
- // 直接从返回对象中获取正确的路径
- const center = adcodeObj?.payload?.objects?.collection?.geometries?.[0]?.properties?.center;
-
- if (Array.isArray(center) && center.length === 2) {
- this.inputMapShowDefaultCenter = center;
- } else {
- // 如果找不到中心点,尝试使用 bbox 的中心点
- const bbox = adcodeObj?.payload?.bbox;
- if (Array.isArray(bbox) && bbox.length === 4) {
- const centerX = (bbox[0] + bbox[2]) / 2;
- const centerY = (bbox[1] + bbox[3]) / 2;
- this.inputMapShowDefaultCenter = [centerX, centerY];
- } else {
- this.inputMapShowDefaultCenter = [115.861365, 28.621311];
- }
- }
- this.mapParams.center = [...this.inputMapShowDefaultCenter];
-
- this.mapLoaded = true;
- } catch (error) {
- this.$message.error('地图加载失败,请检查网络或API Key配置');
- }
- },
- async handleBatchApprove() {
- try {
- if (this.selections.length === 0) {
- this.$message.warning('没有选中的工单');
- return;
- }
-
- const currentItem = this.selections[this.currentImageIndex - 1];
- if (!currentItem) {
- this.$message.warning('当前工单数据无效');
- return;
- }
-
- await this.$confirm('确认审核通过当前工单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- });
-
- const data = {
- id: currentItem.id,
- status: currentItem.status,
- isPass: 0,
- eventNum: currentItem.orderNumber,
- eventName: currentItem.orderName,
- };
-
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- this.$message.success('工单审核通过');
-
- // 创建新的数组而不是修改原数组
- const newSelections = [...this.selections];
- newSelections.splice(this.currentImageIndex - 1, 1);
- this.selections = newSelections;
-
- // 修正索引并更新图片
- if (this.selections.length > 0) {
- if (this.currentImageIndex > this.selections.length) {
- this.currentImageIndex = this.selections.length;
- }
- this.updateCurrentReviewImage();
- } else {
- this.reviewDialogVisible = false;
- this.currentImageIndex = 1;
- this.currentReviewImage = '';
- }
-
- // 刷新表格数据
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '审核失败');
- }
- } catch (error) {
- if (error === 'cancel') return;
- this.$message.error(error.message || '审核失败,请稍后重试');
- }
- },
- async fetchDropdownData() {
- try {
- const response = await getTicketInfo();
-
- const { dept_data, event_type, ai_type, info } = response.data.data;
-
- this.departments = dept_data.map(item => ({
- label: item.dept_name,
- value: item.id,
- }));
-
- this.departmentUsers = dept_data.reduce((acc, dept) => {
- acc[dept.id] = dept.user_data || [];
- return acc;
- }, {});
-
- this.types = Object.entries(event_type).map(([key, value]) => ({
- label: value,
- value: key,
- }));
-
- const columnType = this.findObject(this.option.column, 'type');
- columnType.dicData = this.types;
- this.allAlgorithms = info;
-
- console.log('工单类型', this.types);
- console.log('关联算法', this.allAlgorithms);
- // 确保算法数据的映射一致
- this.algorithms =
- ai_type?.map(item => ({
- dict_key: item.dict_key,
- dict_value: item.dict_value,
- // 同时添加 label 和 value 以兼容两处使用
- label: item.dict_value,
- value: item.dict_key,
- })) || [];
-
- this.algorithms2 = _.cloneDeep(this.algorithms);
-
- // 构建用户ID和名称的映射关系
- this.userNameToIdMap = {};
- dept_data.forEach(dept => {
- (dept.user_data || []).forEach(user => {
- this.userNameToIdMap[user.name] = user.id;
- });
- });
- } catch (error) {
- this.$message.error('加载下拉框数据失败');
- }
- },
- // 工单类型变化时触发
- handleTypeChange(typeValue) {
- this.form.algorithm = [];
- if (!typeValue) {
- // 未选择类型时清空算法列表
- this.algorithms2 = [];
- return;
- }
-
- const matchedCategory = this.allAlgorithms.find(category => category.dict_key === typeValue);
-
- if (
- !matchedCategory ||
- !matchedCategory.algorithms ||
- matchedCategory.algorithms.length === 0
- ) {
- // 无匹配的算法时清空
- this.algorithms2 = [];
- this.$message.info('该工单类型暂无关联算法');
- return;
- }
- this.algorithms2 = matchedCategory.algorithms.map(algo => ({
- label: algo.dict_value,
- value: algo.dict_key,
- dict_key: algo.dict_key,
- dict_value: algo.dict_value,
- }));
- },
-
- async fetchTableData() {
- if (this.isFetching) return;
- this.isFetching = true;
- this.loading = true;
- try {
- const currentTab = this.tabs.find(tab => tab.name === this.activeTab);
- const params = {
- // word_order_types: this.filters.type || undefined,
- ai_types: this.filters.type || undefined, // 算法使用该字段筛选
- status:
- currentTab?.name === 'myTickets'
- ? undefined
- : this.filters.status !== ''
- ? Number(this.filters.status)
- : currentTab?.value,
- event_name: this.filters.keyword || undefined,
- dept_id: this.filters.department || undefined,
- start_date: this.filters.dateRange?.[0]
- ? this.formatDate(this.filters.dateRange[0])
- : undefined,
- end_date: this.filters.dateRange?.[1]
- ? this.formatDate(this.filters.dateRange[1]).replace('00:00:00', '23:59:59')
- : undefined,
- current: Number(this.page.currentPage), // 使用当前页码
- size: Number(this.page.pageSize), // 使用每页条数
- ai_type: this.filters.algorithm || undefined, // 添加算法参数
- // 添加 is_draft 参数,仅在"我发起的"标签页时设置为1
- is_draft: currentTab?.name === 'myTickets' ? 1 : undefined,
-
- user_id: currentTab?.name === 'myTickets' ? this.userInfo.user_id : undefined,
- is_review: this.filters.isReview === '' ? undefined : this.filters.isReview, // 添加复核状态查询参数
- source:1 ,//数据来源
- work_types: ALL_WORK_ORDER_TYPE_OPTIONS
- };
-
- const response = await getList(params);
- if (!response?.data?.data?.records) {
- throw new Error('接口返回数据格式不正确');
- }
-
- const { total, records } = response.data.data;
- let filteredRecords = records;
-
- // 如果是"我发起的"tab,过滤数据
- // if (currentTab?.name === 'myTickets') {
- // filteredRecords = records.filter(item =>
- // String(item.create_user_id) === String(item.user_id)
- // );
- // }
-
- this.tableData = filteredRecords.map(item => {
- const longitude = Number(item.longitude) || 0;
- const latitude = Number(item.latitude) || 0;
- return {
- id: item.id,
- orderNumber: item.event_num, // 修改这里:优先使用 event_num
- orderName: item.event_name,
- department:
- this.departments.find(d => d.value === item.dept_id)?.label || item.dept_name,
- startTime: item.job_create_time || '/',
- aiType: item.ai_types,
- content: item.content, // 将后端返回的 content 映射为 content
- type: item.work_order_type_dict_key,
- keyData:
- !isNaN(longitude) && !isNaN(latitude)
- ? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`
- : '未知位置',
- address: item.address,
- creator: item.event_num?.slice(0, 2) === 'AI' ? '智飞agent' : item.create_user,
- handler: item.update_user || '未分配',
- status: Number(item.status || 0),
- // 保存原始字段
- photo_url: item.photo_url || '', // 保存原始 photo_url
- video_url: item.video_url || '', // 保存原始 video_url
- location: !isNaN(longitude) && !isNaN(latitude) ? [longitude, latitude] : null,
- processing_details: item.processing_details || '', // 添加处理详情字段
- update_photo_url: item.update_photo_url || '', // 添加处理图片字段
- work_type: item.work_type !== undefined ? Number(item.work_type) : 0, // 保留work_type字段并转为数字
- job_name: item.job_name || '',
- job_create_time: item.job_create_time || '',
- isReview: item.is_review, // 添加复核状态字段映射
-
-
- };
- });
-
- // 更新总数显示
- this.page.total = total || 0;
-
- // 是否弹出详情页
- if (this.isShowInfo) {
- this.handleViewDetail(this.firstRowData);
- this.isShowInfo = false; // 生效一次
- }
- await this.fetchTabCounts();
- } catch (error) {
- this.$message.error(error.message || '获取数据失败');
- this.tableData = [];
- this.page.total = 0;
- } finally {
- this.loading = false;
- this.isFetching = false;
- }
- },
-
- async submitForm() {
- if (this.submitLoading) return; // 防止重复提交
- this.submitLoading = true;
- try {
- // 提交时需要完整验证
- await this.$refs.form.validate();
-
- // 验证位置信息
- if (!this.form.location || this.form.location.length < 2) {
- this.$message.warning('请在地图上选择位置');
- return;
- }
-
- // 修改图片验证逻辑
- if (!this.form.photos || this.form.photos.length === 0) {
- this.$message.warning('请上传工单图片');
- return;
- }
-
- let [lng, lat] = this.disposeLocation(true, this.form);
-
- const submitData = {
- eventName: this.form.name,
- content: this.form.content,
- workType: '1',
- longitude: lng,
- latitude: lat,
- address: this.form.address,
- workOrderTypeDictKey: this.form.type,
- aiType: Array.isArray(this.form.algorithm) ? this.form.algorithm : [this.form.algorithm], // 传数组
- updateUser: this.form.handler,
- createDept: this.form.department,
- isDraft: 0,
- };
-
- if (this.form.id) {
- submitData.id = this.form.id;
- }
-
- // 修改获取文件的逻辑
- let file = null;
- const photoInfo = this.form.photos[0];
-
- if (photoInfo.raw) {
- // 如果有新上传的文件,使用新文件
- file = photoInfo.raw;
- } else if (photoInfo.existingUrl) {
- // 如果是已存在的图片,将URL添加到提交数据中
- submitData.photoUrl = photoInfo.existingUrl;
- } else {
- this.$message.warning('图片文件无效,请重新上传');
- return;
- }
-
- const response = await createTicket(submitData, file);
- if (response.data.code === 0) {
- this.$message.success('工单创建成功');
- this.dialogVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '创建失败');
- }
- } catch (error) {
- if (error.message.includes('验证未通过')) {
- this.$message.warning('请填写完整的工单信息');
- } else {
- this.$message.error(error.message || '工单创建失败,请稍后重试');
- }
- } finally {
- this.submitLoading = false;
- }
- },
-
- async saveDraft() {
- if (this.draftLoading) return; // 防止重复提交
- this.draftLoading = true;
- try {
- let handlerValue = this.form.handler;
- if (!handlerValue || handlerValue === '未分配') {
- handlerValue = undefined;
- }
-
- // 验证位置信息
- if (
- !this.form.location ||
- this.form.location.length < 2 ||
- !this.form.location[0] ||
- !this.form.location[1]
- ) {
- this.$message.warning('请在地图上选择位置');
- return;
- }
-
- let [lng, lat] = this.disposeLocation(true, this.form);
-
- const submitData = {
- id: this.form.id,
- eventName: this.form.name || undefined,
- content: this.form.content || undefined,
- workType: '1',
- longitude: lng,
- latitude: lat,
- address: this.form.address || undefined,
- workOrderTypeDictKey: this.form.type || undefined,
- aiType:
- this.form.algorithm && this.form.algorithm.length > 0 ? this.form.algorithm : undefined, // 传数组
- updateUser: handlerValue,
- createDept: this.form.department || undefined,
- isDraft: 1,
- };
-
- // 草稿时也至少需要工单名称
- if (!submitData.eventName) {
- this.$message.warning('请输入工单名称');
- return;
- }
-
- // 过滤掉所有 undefined 的字段
- Object.keys(submitData).forEach(
- key => submitData[key] === undefined && delete submitData[key]
- );
-
- let file = null;
- if (this.form.photos && this.form.photos.length > 0) {
- file = this.form.photos[0].raw;
- }
-
- const response = await createTicket(submitData, file);
- if (response.data.code === 0) {
- this.$message.success('草稿保存成功');
- this.dialogVisible = false;
- (this.form = {
- name: '',
- type: '',
- department: '',
- handler: '',
- algorithm: [], // 关联算法改为数组
- location: [], // 将存储为[经度, 纬度, 地址]格式
- address: '',
- photos: [],
- content: '', // 新增字段,用于存储后端返回的 content
- }),
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '保存失败');
- }
- } catch (error) {
- this.$message.error(error.message || '保存草稿失败,请稍后重试');
- } finally {
- this.draftLoading = false;
- }
- },
- handleCancel() {
- this.resetForm();
- this.dialogVisible = false;
- },
- handleLocationChange(val) {
- let locationValue = val.value;
- if (locationValue && locationValue.length >= 2) {
- // 兼容第三项为地址
- const [lng, lat] = gcj02ToWgs84(locationValue[0], locationValue[1]);
- this.form.location = [Number(lng), Number(lat), locationValue[2] || ''];
- this.form.address = locationValue[2] || '';
- } else {
- this.form.location = [];
- this.form.address = '';
- }
- },
-
- formatDate(date) {
- if (!date) return undefined;
- const d = new Date(date);
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
- d.getDate()
- ).padStart(2, '0')} 00:00:00`;
- },
-
- mapStatus(status) {
- const statusTextMap = {
- '-1': '草稿', // 添加草稿状态
- 2: '待审核',
- 0: '待处理',
- 3: '处理中',
- 4: '已完成',
- };
- return statusTextMap[status] || '未知状态';
- },
-
- getStatusTagType(status) {
- // 草稿不加颜色
- if (status === -1 || status === '-1') return '';
- // 状态颜色映射
- const colorMap = {
- 0: '#FF7411', // 待处理-淡红
- 3: '#FFC300', // 处理中-更淡红
- 2: '#FF472F', // 待审核-橙色
- 4: '#0291A1', // 已完成-淡蓝
- };
- return colorMap[String(status)] || '';
- },
-
- async fetchTabCounts() {
- try {
- // 判断是否有部门筛选
- let params = {};
- if (this.filters.department) {
- params.deptId = this.filters.department;
- }
- const response = await getstatusCount(params);
- const { statusCount, totalCount, userCount } = response.data.data;
- this.tabs.forEach(tab => {
- if (tab.name === 'all') {
- tab.count = totalCount || 0; // 总工单数
- } else if (tab.name === 'myTickets') {
- tab.count = userCount || 0; // 我发起的工单数
- } else {
- tab.count = statusCount[String(tab.value)] || 0; // 根据状态值映射
- }
- });
- } catch (error) {
- this.$message.error('获取 tab 数据失败');
- }
- },
-
- handleTabChange(tab) {
- this.activeTab = tab.props?.name || tab.name;
- const isReview = this.findObject(this.option.column, 'isReview');
- // 根据条件切换显隐
- isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
-
- this.handleReset();
- this.page.currentPage = 1;
- this.fetchTableData();
- this.fetchTabCounts(); // 切换 tab 时重新获取数据
- },
- //新增 跳转后触发的Tab切换
- handleTabChangeAfterJump() {
- const isReview = this.findObject(this.option.column, 'isReview');
- isReview.hide = !['all', 'completed', 'myTickets'].includes(this.activeTab);
- this.handleReset();
- this.page.currentPage = 1;
- this.fetchTableData();
- this.fetchTabCounts();
- },
- handleSearch() {
- this.page.currentPage = 1;
- this.fetchTableData();
- this.fetchTabCounts();
- },
-
- handleReset() {
- this.dictKey = '';
- this.filters = {
- keyword: '',
- department: '',
- type: '',
- dateRange: [],
- status: '',
- algorithm: '', // 重置时清空算法筛选
- isReview: '', // 重置时清空复核状态
- };
- this.page.currentPage = 1;
- this.$router.replace({}); //清除url参数
- this.fetchTableData();
- },
- handleKeyWords() {
- this.$router.replace({}); //清除url参数
- },
-
- async handleCurrentChange(val) {
- // 先更新页码
- this.page.currentPage = val;
- // 等待 DOM 更新后再请求数据
- await this.$nextTick();
- await this.fetchTableData();
- },
-
- async sizeChange(val) {
- this.page.pageSize = val;
- this.page.currentPage = 1; // 重置到第一页
- await this.$nextTick();
- await this.fetchTableData();
- },
-
- handleAdd() {
- this.createoredit = 1;
- this.dialogVisible = true;
- this.mapParams.center = [...this.inputMapShowDefaultCenter];
- this.form.location = [];
- },
-
- resetForm() {
- this.form = {
- name: '',
- type: '',
- department: '',
- handler: '',
- algorithm: [], // 关联算法改为数组
- location: [], // 将存储为[经度, 纬度, 地址]格式
- address: '',
- content: '',
- photos: [],
- content: '', // 新增字段,用于存储后端返回的 content
- };
- if (this.$refs.form) {
- this.$refs.form.resetFields();
- }
- },
-
- formatLocation(location) {
- if (!Array.isArray(location)) {
- return '未知位置';
- }
- return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`;
- },
-
- async handleViewDetail(row) {
- // 找到当前行在tableData中的索引
- this.currentIndex = this.tableData.findIndex(item => item.id === row.id);
- // 先设置workType,直接从row读取
- this.workType = row.work_type !== undefined ? Number(row.work_type) : 0;
-
- // 重置上传组件的文件列表
- this.$nextTick(() => {
- if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
- this.$refs.MapContainer.initAddEntity('point', this.currentDetail.location);
- }
- });
-
- const detailData = {
- ...row,
- processingDetail: row.processing_details || '',
- mediaUrl: row.photo_url || row.video_url || '',
- updatePhotoUrl: row.update_photo_url || '',
- photos: [],
- job_name: row.job_name || '', // 新增
- };
-
- let stepArr = [];
- try {
- const stepResponse = await getStepInfo(row.orderNumber);
- const steps = Array.isArray(stepResponse.data.data)
- ? stepResponse.data.data
- : stepResponse.data.data?.steps || [];
- const finishedStep = steps.find(s => String(s.status) === '4');
- this.totalTime = finishedStep && finishedStep.total_time ? finishedStep.total_time : '';
- if (this.activeTab !== 'myTickets') {
- this.stepInfos = steps.map(step => ({
- status: String(step.status),
- name: step.name,
- time: step.time,
- create_time: step.create_time,
- }));
- } else {
- const statusArr = this.workType === 1 ? ['3', '4'] : this.fixedStatuses;
- this.stepInfos = statusArr.map(status => {
- const step = steps.find(s => String(s.status) === String(status));
- return {
- status,
- name: step ? step.name : '',
- time: step ? step.time : null,
- create_time: step ? step.create_time : null,
- };
- });
- }
- this.currentDetail.status = row.status;
- } catch (error) {
- if (this.activeTab === 'myTickets') {
- const statusArr = this.workType === 1 ? ['3', '4'] : this.fixedStatuses;
- this.stepInfos = statusArr.map(status => ({
- status,
- name: status === row.status ? row.handler || '未分配' : '未处理',
- time: status === row.status ? row.startTime || '未知时间' : null,
- }));
- } else {
- this.stepInfos = [];
- }
- }
- console.log(detailData, 'detailDatadetailDatadetailData');
- this.currentDetail = {
- ...detailData,
- // address: null,
- showQR: false,
- latAndLon: _.round(detailData.location[0], 6) + ',' + _.round(detailData.location[1], 6),
- };
-
- console.log('this.currentDetail', this.currentDetail);
-
- this.detailVisible = true;
- this.handleTypeChange(this.currentDetail.type);
-
-
- this.$nextTick(() => {
- if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) {
- this.$refs.MapContainer.initAddEntity('point', this.currentDetail.location);
- }
- });
- },
-
- getStepHandler(status) {
- const step = this.stepInfos.find(step => step.status === status);
- return step ? step.name : '';
- },
-
- getStepTime(status) {
- const step = this.stepInfos.find(step => step.status === status);
- // 如果 step 不存在或 step.time 为 0,返回 false
- return step && step.time && step.time !== '0' ? step.time : false;
- },
- getStepCreateTime(status) {
- const step = this.stepInfos.find(step => step.status === status);
- return step ? step.create_time : null;
- },
- getActiveStep() {
- // 步骤索引适配
- const arr = this.stepStatusList;
- const index = arr.indexOf(String(this.currentDetail.status));
- return index !== -1 ? index + 2 : 1;
- },
-
- openMap() {
- const areaCode = this.userInfo.detail.areaCode;
- const subAreaCode = areaCode ? areaCode.substring(0, 6) : '';
- getAdcodeObj(geoJson, 'adcode', subAreaCode);
- this.$message.info('地图选址功能暂未实现');
- },
-
- handlePreview(file) {
- this.$message.info(`预览图片:${file.name}`);
- },
-
- handleRemove(file) {
- this.$message.info(`移除图片:${file.name}`);
- },
-
- refreshChange() {
- if (this.isFetching) return;
- this.fetchTableData();
- },
-
- onLoad() {
- if (this.isFetching) return;
- this.fetchTableData();
- },
-
- async exportData() {
- try {
- this.loading = true;
- let exportData = [];
-
- // 如果有选中的数据,则导出选中的数据
- if (this.selections.length > 0) {
- exportData = this.selections.map(item => this.formatExportItem(item));
- } else {
- // 没有选中数据时,导出当前页面的数据
- exportData = this.tableData.map(item => this.formatExportItem(item));
- }
-
- if (exportData.length === 0) {
- this.$message.warning('没有数据可供导出');
- return;
- }
-
- const headers = [
- '工单编号',
- '工单名称',
- '所属部门',
- '发起时间',
- '关联算法',
- '工单内容',
- '工单类型',
- '经纬度',
- '创建人',
- '处理人',
- '工单状态',
- ];
-
- export_json_to_excel(headers, exportData, '工单数据');
- this.$message.success('数据导出成功');
- } catch (error) {
- // console.error('导出失败:', error);
- this.$message.error(error.message || '导出失败,请稍后重试');
- } finally {
- this.loading = false;
- }
- },
-
- formatExportItem(item) {
- const longitude = Number(item.longitude) || Number(item.location?.[0]) || 0;
- const latitude = Number(item.latitude) || Number(item.location?.[1]) || 0;
-
- return {
- 工单编号: item.orderNumber || item.event_num || '',
- 工单名称: item.orderName || item.event_name || '',
- 所属部门: item.department || item.dept_name || '',
- 发起时间: item.startTime || item.create_time || '',
- 关联算法: item.aiType || item.ai_types || '',
- 工单内容: item.address || item.content || '',
- 工单类型:
- this.types.find(t => t.value === (item.type || item.work_order_type_dict_key))?.label ||
- '',
- 经纬度:
- !isNaN(longitude) && !isNaN(latitude)
- ? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`
- : '',
- 创建人: item.creator || item.create_user || '',
- 处理人: item.handler || item.update_user || '',
- 工单状态: this.mapStatus(Number(item.status || 0)),
- };
- },
-
- handleDepartmentChange(deptId) {
- this.form.handler = '';
- },
-
- handleDispatchDepartmentChange(deptId) {
- this.dispatchForm.handler = ''; // 清空处理人选择
- },
-
- // 文件改变时的钩子
- handleFileChange(file, fileList) {
- // 保持最新的文件列表
- this.form.photos = fileList.map(item => ({
- ...item,
- existingUrl: item.url && !item.raw ? item.url : null, // 标记已存在的图片URL
- }));
- this.currentDetail.photos = this.form.photos;
- },
-
- // 文件移除时的钩子
- handleUploadRemove(file, fileList) {
- this.form.photos = fileList;
- this.currentDetail.photos = fileList;
- },
-
- // 上传前的验证
- beforeUpload(file) {
- const isImage = file.type.includes('image');
- const isLt5M = file.size / 1024 / 1024 < 5;
-
- if (!isImage) {
- this.$message.error('只能上传图片文件!');
- return false;
- }
- if (!isLt5M) {
- this.$message.error('图片大小不能超过5MB!');
- return false;
- }
- return true;
- },
-
- async approveTicket() {
- if (this.approveLoading) return;
- this.approveLoading = true;
- try {
- const data = {
- id: this.currentDetail.id,
- status: this.currentDetail.status,
- isPass: 0, // 0 表示通过
- eventNum: this.currentDetail.orderNumber,
- };
-
- const file = this.currentDetail.file || null; // 如果没有文件,则为 null
-
- const response = await flowEvent(data, file);
- if (response.data.code === 0) {
- this.$message.success('工单已通过');
- this.detailVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- this.$message.error(error.message || '操作失败,请稍后重试');
- } finally {
- this.approveLoading = false;
- }
- },
- async rejectTicket() {
- if (this.rejectLoading) return;
- this.rejectLoading = true;
- try {
- const data = {
- id: this.currentDetail.id,
- status: this.currentDetail.status,
- isPass: 1, // 1 表示不通过
- };
-
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- this.$message.success('工单未通过');
- this.detailVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- this.$message.error(error.message || '操作失败,请稍后重试');
- } finally {
- this.rejectLoading = false;
- }
- },
- async submitProcessing() {
- if (this.currentDetail.status !== 3) {
- this.$message.warning('只有处理中状态的工单可以提交处理详情');
- return;
- }
-
- try {
- const data = {
- id: this.currentDetail.id, // 当前工单 ID
- status: this.currentDetail.status, // 当前工单状态
- processing_details: this.currentDetail.processingDetail, // 事件处理详情
- };
-
- // 如果有图片,添加 file 参数
- const file = this.currentDetail.photos?.[0]?.raw || null;
-
- const response = await flowEvent(data, file);
- if (response.data.code === 0) {
- this.$message.success('处理详情提交成功');
- this.detailVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '提交失败');
- }
- } catch (error) {
- console.error('处理详情提交失败:', error);
- this.$message.error(error.message || '提交失败,请稍后重试');
- }
- },
- markAsCompleted() {
- this.$message.success('工单已标记为完成');
- },
- async completeTicket() {
- if (this.completeLoading) return;
- this.completeLoading = true;
- try {
- if (!this.currentDetail.processingDetail) {
- this.$message.warning('请先填写事件处理详情');
- return;
- }
- // 检查图片上传
- if (!this.currentDetail.photos || this.currentDetail.photos.length === 0) {
- this.$message.warning('请选择上传图片');
- this.completeLoading = false;
- return;
- }
-
- const data = {
- id: this.currentDetail.id,
- status: this.currentDetail.status,
- processingDetails: this.currentDetail.processingDetail,
- eventNum: this.currentDetail.orderNumber,
- };
-
- // 如果有上传的图片,添加到请求中
- const file = this.currentDetail.photos?.[0]?.raw || null;
-
- const response = await flowEvent(data, file);
-
- if (response.data.code === 0) {
- this.$message.success('工单已完成');
- this.detailVisible = false;
- this.fetchTableData(); // 刷新列表数据
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- console.error('完成工单失败:', error);
- this.$message.error(error.message || '操作失败,请稍后重试');
- } finally {
- this.completeLoading = false;
- }
- },
- async approveAndDispatch() {
- if (this.dispatchLoading) return;
-
- // 添加必填项检查
- if (!this.currentDetail.orderName || !this.currentDetail.orderName.trim()) {
- this.$message.warning('请填写工单名称');
- return;
- }
- if (!this.currentDetail.aiType) {
- this.$message.warning('请选择关联算法');
- return;
- }
- if (!this.currentDetail.content || !this.currentDetail.content.trim()) {
- this.$message.warning('请填写工单内容');
- return;
- }
-
- // 通过验证后,打开派发对话框
- this.dispatchDialogVisible = true;
-
- console.log('受理', this.currentDetail);
- },
- hasProcessingBtnPermission() {
- // undefined 或 false 都返回 false,只有 true 返回 true
- // console.log('权限检查:', this.permission.tickets_processing_btn)
- return this.permission && this.permission.tickets_processing_btn === true;
- },
- hasProcessedAndOverBtnPermission() {
- // undefined 或 false 都返回 false,只有 true 返回 true
- //console.log('权限检查:', this.permission)
- return this.permission && this.permission.tickets_view_processedAndOver === true;
- },
- hasReviewBtnPermission() {
- // undefined 或 false 都返回 false,只有 true 返回 true
- // console.log('权限检查:', this.permission)
- return this.permission && this.permission.tickets_review_btn === true;
- },
-
- async submitDispatch() {
- if (this.dispatchLoading) return;
- if (!this.currentDetail.orderName || !this.currentDetail.orderName.trim()) {
- this.$message.warning('请填写工单名称');
- return;
- }
- if (!this.currentDetail.type) {
- this.$message.warning('请选择工单类型');
- return;
- }
- if (!this.currentDetail.content || !this.currentDetail.content.trim()) {
- this.$message.warning('请填写工单内容');
- return;
- }
- if (!this.dispatchForm.department) {
- this.$message.warning('请选择部门');
- return;
- }
- if (!this.dispatchForm.handler) {
- this.$message.warning('请选择处理人');
- return;
- }
- this.dispatchLoading = true;
- console.log('派发成功', this.currentDetail);
- const isValue = this.algorithms.some(item => item.value === this.currentDetail.aiType);
- let resultValue;
-
- if (isValue) {
- // 如果已经是value,直接使用
- resultValue = this.currentDetail.aiType;
- } else {
- // 否则查找对应的value
- const matched = this.algorithms.find(
- item => item.dict_value === this.currentDetail.aiType ||
- item.label === this.currentDetail.aiType
- );
- resultValue = matched ? matched.value : null;
- }
-
-// console.log('resultValue',resultValue);
- this.$refs.dispatchForm.validate(async valid => {
- if (valid) {
- try {
- const data = {
- id: this.currentDetail.id,
- status: this.currentDetail.status,
- isPass: 0, // 0 表示通过
- eventName: this.currentDetail.orderName, // 工单名称
- eventNum: this.currentDetail.orderNumber,
- workOrderTypeDictKey: this.currentDetail.type, // 直接使用原始的 dict_key
- content: this.currentDetail.content, // 使用 content 替代原来的 remark
- createDept: this.dispatchForm.department, // 派发部门 ID
- updateUser: this.dispatchForm.handler, // 处理人 ID
- aiType:resultValue,
- };
- console.log('派发', data);
-
- const file = this.currentDetail.file || null; // 如果没有文件,则为 null
-
- const response = await flowEvent(data, file);
- if (response.data.code === 0) {
- this.$message.success('工单已成功派发');
- this.dispatchDialogVisible = false;
- this.detailVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '派发失败');
- }
- } catch (error) {
- console.error('派发失败:', error);
- this.$message.error(error.message || '派发失败,请稍后重试');
- } finally {
- this.dispatchLoading = false;
- }
- } else {
- this.dispatchLoading = false;
- }
- });
- },
- async finalizeTicket() {
- if (this.finalizeLoading) return;
- this.finalizeLoading = true;
- try {
- // 检查是否上传了图片
- if (!this.currentDetail.photos || !this.currentDetail.photos.length) {
- this.$message.warning('请上传事件处理照片,或飞行任务结束核验工单是否完结');
- return;
- }
-
- const data = {
- id: this.currentDetail.id,
- status: this.currentDetail.status,
- eventNum: this.currentDetail.orderNumber,
- };
-
- const file = this.currentDetail.photos[0].raw;
-
- const response = await flowEvent(data, file);
-
- if (response.data.code === 0) {
- this.$message.success('工单已完结');
- this.detailVisible = false;
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- console.error('完结工单失败:', error);
- this.$message.error(error.message || '操作失败,请稍后重试');
- } finally {
- this.finalizeLoading = false;
- }
- },
-
- // 添加编辑方法
- handleEdit(row) {
- this.createoredit = 2;
- console.log('编辑原始数据:', row);
-
- // 尝试从row.dept_id或通过部门名称查找对应的部门ID
- let deptId = row.dept_id; // 优先使用原始数据中的dept_id
-
- // 如果没有dept_id,则通过部门名称查找
- if (!deptId) {
- // 输出所有可用的部门数据用于调试
- console.log('可用部门列表:', this.departments);
- console.log('当前部门名称:', row.department);
-
- const deptInfo = this.departments.find(
- dept => dept.label && dept.label.trim() === row.department.trim()
- );
- deptId = deptInfo?.value;
- }
-
- // 获取工单类型值 - 从types中找到匹配的值
- const typeValue =
- this.types.find(t => t.value === row.type)?.value || row.work_order_type_dict_key;
- // 获取处理人ID - 使用userNameToIdMap映射
- const handlerId = this.userNameToIdMap[row.handler] || row.handler;
-
- console.log('数据映射:', {
- 部门名称: row.department,
- 找到的部门ID: deptId,
- 原始处理人: row.handler,
- 处理人ID: handlerId,
- 原始工单类型: row.type,
- 映射后类型值: typeValue,
- });
-
- // 修改算法数组的处理逻辑
- let algorithmArr = [];
- if (Array.isArray(row.aiType)) {
- algorithmArr = row.aiType;
- } else if (typeof row.aiType === 'string' && row.aiType) {
- // 首先尝试将字符串按照逗号或顿号分割
- algorithmArr = row.aiType.split(/[,、]/).map(item => item.trim());
- }
-
- // 确保算法值与选项匹配
- algorithmArr = algorithmArr
- .map(item => {
- // 如果是字符串值,尝试找到对应的 dict_key
- if (typeof item === 'string') {
- const matchedAlgorithm = this.algorithms.find(
- algo => algo.dict_value === item || algo.dict_key === item
- );
- return matchedAlgorithm ? matchedAlgorithm.dict_key : item;
- }
- return item;
- })
- .filter(Boolean); // 过滤掉无效值
-
- console.log('算法处理:', {
- 原始值: row.aiType,
- 分割后: algorithmArr,
- });
-
- this.form = {
- id: row.id,
- name: row.orderName,
- type: typeValue,
- department: deptId,
- handler: handlerId,
- algorithm: algorithmArr,
- location:
- Array.isArray(row.location) && row.location.length >= 2
- ? [Number(row.location[0]), Number(row.location[1])]
- : [],
- address: row.address || '',
- content: row.content,
- photos: [],
- };
-
- let curLocation = [];
-
- if (Array.isArray(row.location) && row.location.length >= 2) {
- let [lng, lat] = this.disposeLocation(false, row);
-
- curLocation = [lng, lat, row.location[2] || row.address || ''];
- }
-
- this.form.location = curLocation;
- this.form.address = this.form.location[2] || '';
- // 设置地图中心点
- if (Array.isArray(this.form.location) && this.form.location.length >= 2) {
- this.mapParams.center = [Number(this.form.location[0]), Number(this.form.location[1])];
- } else {
- this.mapParams.center = [...this.inputMapShowDefaultCenter];
- }
- // 如果有图片,添加到表单中
- if (row.photo_url) {
- // 创建一个带有必要信息的文件对象
- this.form.photos = [
- {
- name: 'existing-photo.jpg', // 添加默认扩展名
- url: row.photo_url, // 用于预览的URL
- status: 'success', // 标记为已上传成功
- raw: null, // 初始化为null
- existingUrl: row.photo_url, // 保存原始URL,用于区分是否为已存在的图片
- },
- ];
- }
-
- // 调试输出
- console.log('编辑表单数据:', {
- 原始算法值: row.aiType,
- 处理后算法值: algorithmArr,
- 表单数据: this.form,
- });
-
- this.dialogVisible = true;
- },
-
- // 添加删除方法
- handleDelete(row) {
- this.$confirm('确认删除该工单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(async () => {
- try {
- const response = await flowEvent({
- id: row.id,
- status: 0,
- isDelete: 1,
- });
-
- if (response.data.code === 0) {
- this.$message.success('删除成功');
- this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '删除失败');
- }
- } catch (error) {
- console.error('删除失败:', error);
- this.$message.error(error.message || '删除失败,请稍后重试');
- }
- })
- .catch(() => {});
- },
-
- // 添加选择变化处理方法
- handleSelectionChange(selection) {
- this.selections = selection;
- console.log('已选择的行:', selection);
- },
-
- // 添加全选方法
- handleSelectAll(val) {
- this.$refs.avueCrud.toggleSelection(val);
- },
-
- // 添加单行选择方法
- handleSelect(selection, row) {
- console.log('选中行变化:', selection, row);
- },
-
- // 如果需要手动选中某些行
- setSelection(rows) {
- this.$nextTick(() => {
- rows.forEach(row => {
- this.$refs.avueCrud.toggleSelection(row, true);
- });
- });
- },
-
- // 清空选择
- clearSelection() {
- this.$refs.avueCrud.clearSelection();
- },
-
- // 打开审核对话框
- openReviewDialog() {
- if (this.selections.length === 0) {
- this.$message.warning('请先选择要审核的工单');
- return;
- }
- this.currentImageIndex = 1;
- this.updateCurrentReviewImage();
- this.reviewDialogVisible = true;
- },
-
- // 更新当前审核图片
- updateCurrentReviewImage() {
- // 修正索引范围
- if (!this.selections || this.selections.length === 0) {
- this.currentReviewImage = '';
- this.currentImageIndex = 1;
- return;
- }
- // 如果当前索引超出范围,自动回退到最后一张
- if (this.currentImageIndex > this.selections.length) {
- this.currentImageIndex = this.selections.length;
- }
- if (this.currentImageIndex < 1) {
- this.currentImageIndex = 1;
- }
- const index = this.currentImageIndex - 1;
- if (index >= 0 && index < this.selections.length) {
- const currentItem = this.selections[index];
- this.currentReviewImage = currentItem.photo_url || '';
- } else {
- this.currentReviewImage = '';
- }
- },
-
- // 处理图片分页变化
- handleImagePageChange(page) {
- if (page > 0 && page <= this.selections.length) {
- this.currentImageIndex = page;
- this.updateCurrentReviewImage();
- }
- },
-
- // 批量审核通过
- async handleBatchApprove() {
- try {
- if (this.selections.length === 0) {
- this.$message.warning('没有选中的工单');
- return;
- }
-
- const currentItem = this.selections[this.currentImageIndex - 1];
- if (!currentItem) {
- this.$message.warning('当前工单数据无效');
- return;
- }
-
- await this.$confirm('确认审核通过当前工单?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- });
-
- const data = {
- id: currentItem.id,
- status: currentItem.status,
- isPass: 0,
- eventNum: currentItem.orderNumber,
- };
- console.log('删除前:', this.selections);
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- this.$message.success('工单审核通过');
-
- // 创建新的数组而不是修改原数组
- const newSelections = [...this.selections];
- newSelections.splice(this.currentImageIndex - 1, 1);
-
- // 修正索引并更新图片
- if (newSelections.length > 0) {
- if (this.currentImageIndex > this.selections.length) {
- this.currentImageIndex = this.selections.length;
- }
- this.updateCurrentReviewImage();
- } else {
- this.reviewDialogVisible = false;
- this.currentImageIndex = 1;
- this.currentReviewImage = '';
- this.fetchTableData();
- }
-
- // 刷新表格数据
- // this.fetchTableData();
- this.selections = newSelections;
- } else {
- throw new Error(response.data.msg || '审核失败');
- }
- } catch (error) {
- if (error === 'cancel') return;
- this.$message.error(error.message || '审核失败,请稍后重试');
- }
- },
-
- cancleBatchReject() {
- this.reviewDialogVisible = false;
- this.selections = [];
- this.currentImageIndex = 1;
- this.currentReviewImage = '';
- this.fetchTableData();
- },
- // 批量审核不通过
- async handleBatchReject() {
- try {
- if (this.selections.length === 0) {
- this.$message.warning('没有选中的工单');
- return;
- }
-
- const currentItem = this.selections[this.currentImageIndex - 1];
- if (!currentItem) {
- this.$message.warning('当前工单数据无效');
- return;
- }
-
- await this.$confirm('确认该工单审核不通过?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- });
-
- const data = {
- id: currentItem.id,
- status: currentItem.status,
- isPass: 1,
- eventNum: currentItem.orderNumber,
- eventName: currentItem.orderName,
- };
-
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- this.$message.success('工单审核不通过');
-
- // 创建新的数组而不是修改原数组
- const newSelections = [...this.selections];
- newSelections.splice(this.currentImageIndex - 1, 1);
- this.selections = newSelections;
-
- // 修正索引并更新图片
- if (this.selections.length > 0) {
- if (this.currentImageIndex > this.selections.length) {
- this.currentImageIndex = this.selections.length;
- }
- this.updateCurrentReviewImage();
- } else {
- this.reviewDialogVisible = false;
- this.currentImageIndex = 1;
- this.currentReviewImage = '';
- this.fetchTableData();
- }
-
- // 刷新表格数据
- // this.fetchTableData();
- } else {
- throw new Error(response.data.msg || '驳回失败');
- }
- } catch (error) {
- if (error === 'cancel') return;
- this.$message.error(error.message || '驳回失败,请稍后重试');
- }
- },
-
- // 获取所有图片列表用于预览
- getImageList() {
- return this.selections.map(item => this.getPreviewUrl(item.photo_url)).filter(url => url); // 过滤掉空值
- },
-
- // 处理图片点击
- handleImageClick() {
- // 图片点击事件由 el-image 的预览功能处理
- },
-
- // 处理上一张图片
- handlePrevImage() {
- if (this.currentImageIndex > 1) {
- this.currentImageIndex--;
- this.updateCurrentReviewImage();
- }
- },
-
- // 处理下一张图片
- handleNextImage() {
- if (this.currentImageIndex < this.selections.length) {
- this.currentImageIndex++;
- this.updateCurrentReviewImage();
- }
- },
-
- /**
- * 获取缩略图地址
- * @param {string} url 原图地址
- * @returns {string} 缩略图地址
- */
- getThumbUrl(url) {
- if (!url) return '';
- const lastDot = url.lastIndexOf('.');
- if (lastDot === -1) return url;
- return url.slice(0, lastDot) + '_small' + url.slice(lastDot);
- },
-
- // 添加新方法:获取预览图地址
- getPreviewUrl(url) {
- if (!url) return '';
- const lastDot = url.lastIndexOf('.');
- if (lastDot === -1) return url;
- return url.slice(0, lastDot) + '_show' + url.slice(lastDot);
- },
-
- /**
- * 坐标转换方法处理
- * @param goWgs84 是否由国测转换到84,默认false----由84转换到国测
- */
- disposeLocation(goWgs84 = false, data) {
- let lng = '',
- lat = '';
-
- if (Array.isArray(data.location) && data.location.length > 0) {
- if (goWgs84) {
- lng = data.location?.[0] ? String(data.location[0]) : undefined;
- lat = data.location?.[1] ? String(data.location[1]) : undefined;
-
- if (lng && lat) {
- [lng, lat] = gcj02ToWgs84(Number(lng), Number(lat));
- }
- } else {
- lng = Number(data.location[0]);
- lat = Number(data.location[1]);
-
- if (lng && lat) {
- [lng, lat] = wgs84ToGcj02(Number(lng), Number(lat));
- }
- }
- }
-
- return [String(lng), String(lat)];
- },
-
- // 复核按钮
- reCheck(row) {
- this.reCheckData = row;
- this.reCheckDialog = true;
- },
-
- // 复核确认框按钮事件
- reCheckConfirm(key) {
- const that = this;
- if (key == 1) {
- getReviewById(that.reCheckData.id).then(res => {
- that.reCheckDialog = false;
- that.page.currentPage = 1;
- that.fetchTableData();
- that.fetchTabCounts();
- });
- } else {
- const loading = ElLoading.service({
- lock: true,
- text: '复核任务创建中……',
- background: 'rgba(0, 0, 0, 0.7)',
- });
-
- function closeConfirm() {
- that.reCheckDialog = false;
- that.page.currentPage = 1;
- that.fetchTableData();
- that.fetchTabCounts();
- loading.close();
- }
-
- // 获取时间的接口
- getCreateEventJob(that.reCheckData.id)
- .then(res => {
- ElMessageBox.confirm(`预计复核执行时间为${res.data.data}`, '提示', {
- confirmButtonText: '确定',
- showCancelButton: false, // 关键配置
- closeOnClickModal: false,
- closeOnPressEscape: false,
- type: 'warning',
- })
- .then(() => {
- closeConfirm();
- })
- .catch(() => {
- closeConfirm();
- });
- })
- .catch(() => {
- closeConfirm();
- });
- }
- },
- // 导出工单报表
- exportTheTick(row){
- const params = {
- num:row.orderNumber
- }
- exportTheTicket(params).then(res=>{
- const elink = document.createElement('a')
- elink.download = row.orderName + '.docx'
- elink.style.display = 'none'
- const blob = new Blob([res.data])
- elink.href = URL.createObjectURL(blob)
- document.body.appendChild(elink)
- elink.click()
- document.body.removeChild(elink)
- })
- this.$message.success('数据导出成功');
- }
- },
- activated() {
- this.handleReset();
- },
-};
-</script>
-<style lang="scss">
-.custom-dialog {
- max-height: 96vh;
-
- .el-dialog__body {
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.custom-qrcode-popover {
- min-width: 160px !important;
- min-height: 140px !important;
- position: relative;
-
- .qrcode-content {
- margin-top: 8px;
-
- .close-btn {
- position: absolute;
- top: 2px;
- right: 2px;
- width: 16px;
- height: 16px;
- line-height: 16px;
- text-align: center;
- cursor: pointer;
- color: #999;
- font-size: 16px;
- z-index: 10;
- }
- }
-}
-</style>
-<style lang="scss" scoped>
-::v-deep(.el-tabs) {
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-tabs__header {
- order: 1;
- }
-
- .el-tabs__content {
- order: 2;
- }
-
- .el-tabs__content {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .el-tab-pane {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- }
-}
-
-.filter-bar {
- display: flex;
- align-items: center;
- margin-bottom: 15px;
- flex-wrap: wrap;
- gap: 8px; // 使用 gap 统一设置间距
-
- .filter-item {
- width: 280px; // 减小宽度
- }
-
- .date-picker {
- // width: 240px; // 日期选择器宽度适当调整
- }
-
- .el-button {
- margin-left: 0; // 覆盖 element-ui 默认的按钮间距
- }
-}
-
-.uploadImg {
- margin-bottom: 32px;
-}
-
-.tableCss {
- width: 100%;
- margin-bottom: 10px;
-}
-
-.step-timer {
- position: absolute;
- right: 80%;
- top: 50%;
- transform: translateY(-50%);
- width: 100px;
- margin-left: 4px;
- color: #666;
- font-size: 12px;
-}
-
-.event-total-time {
- text-align: center;
- color: #666;
- font-size: 15px;
- margin-bottom: 12px;
-}
-
-.action-bar {
- margin-bottom: 16px;
-}
-
-.el-dialog {
- .el-form-item {
- margin-bottom: 20px;
- }
-}
-
-.el-upload {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
-
- :deep(.el-upload-list__item) {
- transition: all 0.3s ease;
- }
-
- :deep(.el-upload-list__item:hover) {
- background-color: #f5f7fa;
- }
-}
-
-.el-upload__tip {
- font-size: 12px;
- color: #909399;
- margin-top: 12px;
-}
-
-.create-ticket-form {
- padding: 20px 10px;
-
- .form-section {
- background-color: #fff;
- border-radius: 4px;
-
- .el-row {
- margin-bottom: 16px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
-
- .location-wrapper {
- width: 100%; // 修改为100%以适应父容器
- height: auto; // 修改为auto以自适应内容
-
- .map-button {
- width: 100%; // 让按钮填满容器宽度
- height: 36px; // 与其他输入框保持一致的高度
- display: flex;
- align-items: center;
- justify-content: center;
-
- i {
- margin-right: 4px;
- }
- }
-
- .location-text {
- margin-top: 8px;
- padding: 8px 12px;
- background-color: #f5f7fa;
- border-radius: 4px;
- color: #606266;
- font-size: 13px;
- line-height: 1.4;
- }
- }
-
- .upload-wrapper {
- .uploader {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 128px;
- }
-
- :deep(.el-upload-list__item) {
- width: 120px;
- height: 120px;
- }
- }
-
- .upload-tip {
- font-size: 12px;
- color: #909399;
- line-height: 1.4;
- margin-top: 8px;
- }
- }
-
- .el-form-item {
- margin-bottom: 18px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- :deep(.el-form-item__label) {
- font-weight: 500;
- color: #606266;
- }
-
- // :deep(.el-input__inner) {
- // height: 36px;
- // line-height: 36px;
- // }
-
- :deep(.el-textarea__inner) {
- padding: 8px 12px;
- }
-
- // :deep(.el-input__inner),
- // :deep(.el-select),
- // :deep(.el-select .el-input) {
- // width: 100%; // 确保所有输入框和选择框宽度一致
- // }
-
- .full-width {
- width: 100%;
- }
-}
-
-:deep(.el-dialog__body) {
- border-top: 0.1rem solid #f0f0f0;
-}
-
-.dialog-footer-new {
- text-align: right;
- padding-top: 16px;
- border-top: 1px solid #ebeef5;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- }
- }
-}
-
-.dialog-footer1-new {
- position: sticky;
- bottom: 28px;
- left: 0;
- right: 0;
- background: white;
- z-index: 10;
- padding: 16px 20px;
- border-top: 1px solid #ebeef5;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .btngroups {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- margin-right: 12px;
- }
- }
-}
-
-.map-container {
- width: 100%;
- height: 400px;
- margin-bottom: 15px;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- overflow: hidden;
-
- :deep(.el-input-map) {
- height: 100%;
- }
-}
-
-.location-info {
- margin-top: 10px;
- padding: 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
-}
-
-.map-select {
- display: flex;
- align-items: flex-start;
- gap: 15px;
-
- .selected-location {
- flex: 1;
- padding: 5px 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
- }
-}
-
-.preview-image {
- border-radius: 4px;
- overflow: hidden;
- background-color: #f5f7fa;
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- height: 200px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- i {
- font-size: 32px;
- margin-bottom: 8px;
- }
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.detail-container {
- padding: 0 20px;
-
- .detail-top-title {
- display: flex;
- justify-content: center;
- align-items: center;
-
- .event-orderNumber {
- margin-right: 10px;
- }
- }
-}
-
-.status-flow {
- margin-bottom: 20px;
-
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 添加发起任务步骤的特殊样式
- .init-step-info {
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- width: 130px;
-
- .creator-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- margin-bottom: 4px;
- }
-
- .create-time {
- font-size: 10px;
- color: #909399;
- }
- }
-
- // 保持其他步骤的原有样式
- .step-info {
- display: flex;
- margin: 0;
- padding: 0;
- justify-content: space-between;
- align-items: center;
- width: 200px;
-
- .process-time {
- font-size: 10px;
- color: #909399;
- text-align: left;
- margin-left: -50%;
- padding-left: 0%;
- flex: 1;
- }
-
- .handler-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- text-align: left;
- flex: 1;
- }
- }
- }
-}
-
-.basic-info {
- margin-bottom: 20px;
-}
-
-.media-section {
- // margin-bottom: 20px;
-
- .el-row {
- display: flex;
- align-items: center;
- }
-}
-
-.leftBtn {
- width: 70px;
- height: 32px;
- background-color: #999;
- border-radius: 5px;
- text-align: center;
- line-height: 32px;
- color: #fff;
- cursor: pointer;
- opacity: 0.8;
-}
-
-.disableds {
- background: #999 !important;
- cursor: not-allowed !important;
- pointer-events: none;
- opacity: 0.3 !important;
-}
-
-.PopUpTableScrolls {
- max-height: 600px;
- overflow-y: scroll;
- overflow-x: hidden;
-}
-
-.media-box {
- width: 100%;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- padding: 10px;
- background: #fff;
- box-sizing: border-box;
-
- .media-title {
- font-weight: bold;
- margin-bottom: 5px;
- display: flex;
- align-items: center;
-
- .QRCodeImg {
- width: 18px;
- height: 18px;
- cursor: pointer;
- padding-bottom: 1px;
- }
- }
-
- .media-content {
- position: relative;
- height: 500px;
-
- :deep(.el-image) {
- width: 100% !important;
- max-width: 100%;
- max-height: 100%;
-
- .el-image__inner {
- width: 100%;
- height: 100%;
- object-fit: cover !important;
- }
- }
- }
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-}
-
-.image-placeholder i,
-.image-error i {
- font-size: 32px;
- margin-bottom: 8px;
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.info-table {
- margin-bottom: 20px;
-}
-
-.info-item {
- display: flex;
- margin-bottom: 10px;
-}
-
-.info-label {
- font-weight: bold;
- width: 120px;
- color: #606266;
-}
-
-.info-value {
- flex: 1;
- color: #303133;
- word-break: break-word;
-}
-
-.readonly-processing-detail {
- background-color: #f5f7fa;
- padding: 12px;
- border-radius: 4px;
- min-height: 30px;
- color: #606266;
- line-height: 1.5;
- display: block;
- text-align: left;
- margin-bottom: 5px;
-
- &:first-child {
- font-weight: bold;
- margin-bottom: 4px;
- }
-}
-
-// 添加删除按钮样式
-.danger-button {
- color: #f56c6c;
-}
-
-.danger-button:hover {
- color: #f78989;
-}
-
-.custom-steps-container {
- width: 100%;
- margin: 10px 0;
-}
-
-.steps-titles {
- display: flex;
- justify-content: space-between;
- margin-bottom: 14px;
- position: relative;
-}
-
-.step-title {
- text-align: center;
- flex: 1;
- font-size: 14px;
- color: #999;
- position: relative;
- padding-bottom: 5px;
-}
-
-.step-title.active {
- color: #409eff;
- font-weight: bold;
-}
-
-.event-title-center {
- text-align: center;
- font-size: 20px;
- font-weight: bold;
- margin-bottom: 5px;
- color: #333;
-}
-
-.custom-steps {
- margin-top: -20px;
-
- :deep(.el-step__description) {
- margin-top: 8px;
- padding: 0 20px;
- }
-}
-
-.step-description {
- font-size: 14px;
- color: #666;
- line-height: 1.5;
- display: block;
- text-align: center;
-
- &:first-child {
- font-weight: bold;
- margin-bottom: 4px;
- }
-}
-
-// 覆盖其他相关样式
-.status-flow {
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 移除之前的样式
- .init-step-info,
- .step-info {
- display: block;
- width: auto;
- text-align: center;
- }
- }
-}
-
-// 添加新的样式
-.review-dialog {
- :deep(.el-dialog__body) {
- padding: 0;
- background-color: #f5f7fa;
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.re-check-dialog {
- :deep(.el-dialog__body) {
- padding: 0;
- background-color: #f5f7fa;
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.review-container {
- position: relative;
-
- .review-image-wrapper {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 600px;
- background-color: #f5f7fa;
- }
-
- .review-image-container {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- :deep(.el-image) {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .el-image__inner {
- max-height: 100%;
- max-width: 100%;
- object-fit: contain;
- }
- }
- }
-
- .arrow-button {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 44px;
- height: 44px;
- background: rgba(0, 0, 0, 0.3);
- border-radius: 50%;
- border: none;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- transition: all 0.3s;
- z-index: 100;
-
- &:hover {
- background: rgba(0, 0, 0, 0.6);
- }
-
- i {
- color: #fff;
- font-size: 24px;
- }
-
- &.left {
- left: 20px;
- color: #ffffff;
- }
-
- &.right {
- right: 20px;
- color: #ffffff;
- }
- }
-
- .preview-image {
- max-width: 100%;
- max-height: 100%;
- }
-
- .review-pagination {
- padding: 16px 0;
- display: flex;
- justify-content: center;
- background-color: #fff;
-
- :deep(.el-pagination) {
- .btn-prev,
- .btn-next {
- display: none;
- }
-
- .el-pager {
- .number {
- margin: 0 4px;
- }
- }
- }
- }
-
- .image-error {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
-
- i {
- font-size: 48px;
- margin-bottom: 16px;
- }
-
- span {
- font-size: 16px;
- }
- }
-}
-
-/* 新建工单和处理工单的上传组件样式 */
-.create-upload,
-.detail-upload {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 100px;
- }
-
- /* 隐藏额外的上传按钮 */
- :deep(.el-upload.el-upload--picture-card) {
- display: none;
- }
-
- /* 当没有图片时显示上传按钮 */
- :deep(.el-upload.el-upload--picture-card:first-child) {
- display: flex;
- }
-
- /* 上传组件的预览图片样式 */
- :deep(.el-upload-list--picture-card .el-upload-list__item) {
- width: 120px;
- height: 100px;
- }
-}
-
-/* 原有图片预览的样式 */
-.el-image-viewer__wrapper {
- :deep(.el-image-viewer__img) {
- max-width: 100%;
- max-height: 100%;
- object-fit: contain;
- }
-}
-
-/* 必填项样式 */
-.required-label {
- position: relative;
- display: inline-block;
-
- .required-star {
- color: #f56c6c;
- margin-right: 4px;
- }
-}
-
-/* 必填输入框样式 */
-.required-input {
- width: 100%;
-
- :deep(.el-input__inner),
- :deep(.el-textarea__inner) {
- &:focus {
- border-color: #409eff;
- }
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/ticket.vue b/applications/drone-command/src/views/tickets/ticket.vue
deleted file mode 100644
index 1cedd03..0000000
--- a/applications/drone-command/src/views/tickets/ticket.vue
+++ /dev/null
@@ -1,2358 +0,0 @@
-<template>
- <basic-container>
- <el-tabs v-model="activeTab" @tab-click="handleTabChange">
- <el-tab-pane
- v-for="tab in filteredTabs"
- :key="tab.name"
- :label="tab.name === 'myTickets' ? tab.label : `${tab.label} (${tab.count})`"
- :name="tab.name"
- >
- <basic-main-content>
- <!-- 查询条件筛选栏 -->
- <div class="command-form-search">
- <el-form :model="filters" inline>
- <div class="searchBox">
- <el-form-item label="关键字:">
- <el-input
- v-model="filters.keyword"
- placeholder="请输入关键字"
- class="filter-item"
- clearable
- @clear="handleKeyWords"
- @keyup.enter="handleSearch"
- />
- </el-form-item>
- <el-form-item label="选择日期:">
- <el-date-picker
- clearable
- @clear="handleKeyWords"
- @change="handleSearch"
- v-model="filters.dateRange"
- type="daterange"
- class="filter-item"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :default-value="datePickerDefaultVal"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="选择状态:">
- <el-select
- :disabled="activeTab !== 'all'"
- v-model="filters.status"
- placeholder="请选择状态"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in statuses"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="选择机巢:">
- <el-select
- v-model="filters.device_sn"
- placeholder="请选择机巢"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in machineData"
- :key="item.device_sn"
- :label="item.nickname"
- :value="item.device_sn"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="选择算法:">
- <el-tree-select
- style="z-index: 1200"
- :teleported="false"
- class="custom-tree-select"
-
- v-model="dictKey"
- :data="dataList"
- :default-expanded-keys="[dictKey]"
- :props="treePropsSF"
- :render-after-expand="false"
- :default-checked-keys="checkedKeys"
- node-key="id"
- multiple
- show-checkbox
- collapse-tags
- collapse-tags-tooltip
- clearable
- @check="handleCheck"
- @clear="handleClear"
- />
- </el-form-item>
- <el-form-item label="复核状态:" v-if="activeTab === 'completed'">
- <el-select
- v-model="filters.isReview"
- placeholder="请选择复核状态"
- class="filter-item"
- clearable
- @change="handleSearch"
- >
- <el-option
- v-for="item in reviewStatuses"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- <div class="btnGroup">
- <el-button type="primary" icon="el-icon-search" @click="handleSearch"
- >搜索</el-button
- >
- <el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
- </div>
- </div>
- </el-form>
- </div>
- <!-- 表格部分 -->
- <div class="table-operations">
- <div class="left-operations">
- <el-button
- v-if="(activeTab === 'all' || activeTab === 'myTickets') && permissionList.addBtn"
- type="primary"
- icon="el-icon-plus"
- @click="handleAdd"
- >
- 新建工单
- </el-button>
- <el-button
- v-if="activeTab === 'pending' && permissionList.reviewBtn"
- type="success"
- icon="el-icon-check"
- @click="openReviewDialog"
- >
- 批量审核
- </el-button>
-
- <el-button
- v-if="permissionList.exportBtn"
- type="success"
- plain
- icon="el-icon-download"
- @click="exportData"
- >
- 导出
- </el-button>
- </div>
- </div>
- <div class="titketBox">
- <div class="dataTable">
- <el-table
- class="command-public-general-el-table custom-header"
- ref="elTable"
- :data="tableData"
- v-loading="loading"
- @selection-change="handleSelectionChange"
- border
- style="width: 100%"
- v-if="activeTab === tab.name"
- >
- <el-table-column type="selection" width="55" v-if="permissionList.reviewBtn || permissionList.exportBtn" />
- <el-table-column type="index" label="序号" width="60" />
- <el-table-column prop="orderNumber" label="工单编号" width="170">
- <template #default="{ row }">
- <el-tooltip-copy :content="row.orderNumber" :showCopyText="true" textAlign="left">
- {{ row.orderNumber }}
- </el-tooltip-copy>
- </template>
- </el-table-column>
- <el-table-column prop="orderName" label="工单名称" width="150" show-overflow-tooltip>
- <template #default="{ row }">
- <el-tooltip-copy :content="row.orderName" :showCopyText="true" textAlign="left">
- {{ row.orderName }}
- </el-tooltip-copy>
- </template>
- </el-table-column>
-
- <el-table-column prop="department" label="所属部门" width="120" show-overflow-tooltip />
-
-
- <el-table-column prop="startTime" label="发起任务时间" width="160" show-overflow-tooltip />
-
- <el-table-column prop="aiType" label="关联算法" width="120" show-overflow-tooltip />
-
- <el-table-column prop="type" label="工单类型" width="110" show-overflow-tooltip>
- <template #default="{ row }">
- {{ getTypeLabel(row.type) }}
- </template>
- </el-table-column>
- <el-table-column prop="device_names" label="所属机巢" width="120" show-overflow-tooltip />
- <el-table-column prop="dataSources" label="工单来源" width="90">
- </el-table-column>
- <el-table-column prop="content" label="工单内容" width="132" show-overflow-tooltip>
- <template #default="{ row }">
- {{ row.address || row.content }}
- </template>
- </el-table-column>
-
- <el-table-column prop="creator" label="创建人" width="120" show-overflow-tooltip />
-
- <el-table-column prop="handler" label="处理人" width="120" show-overflow-tooltip />
-
- <el-table-column
- v-if="['all', 'completed', 'myTickets'].includes(activeTab)"
- label="复核状态"
- prop="isReview"
- width="90"
- >
- <template #default="{ row }">
- <span>{{ showIsReviewText(row) }}</span>
- </template>
- </el-table-column>
-
- <el-table-column label="工单状态" prop="status" width="90">
- <template #default="{ row }">
- <span :style="getStatusTagType(row.status) ? 'color:' + getStatusTagType(row.status) : ''">
- {{ mapStatus(row.status) }}
- </span>
- </template>
- </el-table-column>
-
- <!-- 操作列 -->
- <el-table-column label="操作" width="200" align="center">
- <template #default="{ row }">
- <template v-if="row.status === -1">
- <el-button type="text" icon="el-icon-edit" @click="handleEdit(row)">编辑</el-button>
- <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>
-
- <!-- <template v-if="row.status === 4 && !isProd">
- <el-button type="text" icon="el-icon-download" @click="exportTheTick(row)">导出</el-button>
- </template> -->
-
- <template v-if="permission.tickets_repeat_review">
- <el-button
- v-if="row.status === 4 && row.isReview !== 1"
- type="text"
- icon="el-icon-check"
- @click="reCheck(row)"
- >
- 复核
- </el-button>
- </template>
- </template>
- </el-table-column>
- <template #empty>
- <el-empty
- class="custom-empty"
- :image-size="100"
- >
- <template #description>
- <span class="custom-text">暂无数据</span>
- </template>
- </el-empty>
- </template>
- </el-table>
- </div>
- <div class="pagination" v-if="tableData.length > 0">
- <el-pagination
- class="table-pagination"
- v-model:current-page="page.currentPage"
- v-model:page-size="page.pageSize"
- :page-sizes="[10, 20, 30, 40]"
- :total="page.total"
- background
- layout="total, sizes, prev, pager, next, jumper"
- @size-change="sizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </div>
- </basic-main-content>
- </el-tab-pane>
- </el-tabs>
-
- <!-- 新建工单对话框 -->
- <create-ticket-dialog
- v-model="dialogVisible"
- :departments="departments"
- :department-users="departmentUsers"
- :types="types"
- :all-algorithms="allAlgorithms"
- :edit-data="editFormData"
- :map-center="inputMapShowDefaultCenter"
- @create-success="handleCreateSuccess"
- @draft-success="handleDraftSuccess"
- @create-error="handleCreateError"
- />
- <!-- 工单详情对话框 -->
- <ticket-detail-dialog
- v-model="detailVisible"
- :current-detail="currentDetail"
- :current-index="currentIndex"
- :total-items="tableData.length"
- :algorithms="algorithms2"
- :types="types"
- :permission="permission"
- :step-status-list="stepStatusList"
- :work-type="workType"
- @detail-success="handleDetailSuccess"
- @detail-error="handleDetailError"
- @prev-item="handlePrevItem"
- @next-item="handleNextItem"
- @update:current-detail="handleCurrentDetailUpdate"
- @approve-and-dispatch="handleApproveAndDispatch"
- />
-
- <!-- 派发工单对话框 -->
- <dispatch-dialog
- v-model="dispatchDialogVisible"
- :current-detail="currentDetail"
- :department-users="departmentUsers"
- :algorithms="algorithms"
- :types="types"
- @dispatch-success="handleDispatchSuccess"
- @dispatch-error="handleDispatchError"
- />
-
- <!-- 批量审核对话框 -->
- <el-dialog
- v-model="reviewDialogVisible"
- title="批量审核"
- width="1100"
- align-center
- append-to-body
- class="command-dialog-mange"
- custom-class="review-dialog"
- @close="cancleBatchReject"
- >
- <div class="review-container">
- <div class="review-image-wrapper">
- <!-- 修改左右箭头的显示条件 -->
- <el-button
- v-if="selections.length > 1 && currentReviewImage"
- class="arrow-button left"
- @click="handlePrevImage"
- icon="el-icon-arrow-left"
- >
- </el-button>
-
- <div class="review-image-container">
- <!-- <el-image v-if="currentReviewImage" :src="getThumbUrl(currentReviewImage)" fit="fill"
- :preview-src-list="getImageList()" :initial-index="currentImageIndex - 1" class="preview-image"
- style="cursor: pointer"> -->
- <el-image
- v-if="currentReviewImage"
- :src="getPreviewUrl(currentReviewImage)"
- fit="fill"
- :initial-index="currentImageIndex - 1"
- class="preview-image"
- style="cursor: pointer"
- >
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>图片加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-image">暂无图片</div>
- </div>
-
- <!-- 修改右箭头的显示条件 -->
- <el-button
- v-if="selections.length > 1 && currentReviewImage"
- class="arrow-button right"
- @click="handleNextImage"
- icon="el-icon-arrow-right"
- >
- </el-button>
- </div>
-
- <!-- 修改分页器的显示条件 -->
- <div class="review-pagination" v-if="selections.length > 1 && currentReviewImage">
- <el-pagination
- small
- layout="prev, pager, next"
- hide-on-single-page
- :total="selections.length"
- :current-page="currentImageIndex"
- :page-size="1"
- @current-change="handleImagePageChange"
- >
- </el-pagination>
- </div>
- </div>
-
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="handleBatchApprove" icon="el-icon-check"
- >通过
- </el-button>
- <el-button type="danger" @click="handleBatchReject" icon="el-icon-close"
- >不通过
- </el-button>
- <el-button @click="cancleBatchReject" icon="el-icon-circle-close">取消</el-button>
- </div>
- </template>
- </el-dialog>
- <!-- 复核弹出层 -->
- <recheck-dialog
- v-model="reCheckDialog"
- :recheck-data="reCheckData"
- @recheck-success="handleRecheckSuccess"
-/>
- </basic-container>
-</template>
-
-<script setup>
-import {ALL_WORK_ORDER_TYPE_OPTIONS} from '@ztzf/constants'
-import { getDateRange } from '@/utils/date'
-import { getDeviceRegion } from '@/api/job/task';
-import { ElMessage} from 'element-plus';
-import { useRoute, useRouter } from 'vue-router'
-import { useStore } from 'vuex'
-import { pxToRem, pxToRemNum } from '@/utils/rem';
-import { getSmallImg, getShowImg } from '@/utils/util';
-import { calculateDefaultRange } from '@/utils/util';
-import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation';
-import _ from 'lodash';
-import {
- getList,
- getTicketInfo,
- flowEvent,
- getstatusCount,
- getStepInfo,
- exportTheTicket
-} from '@/api/tickets/ticket';
-import { getSFDictionaryTree } from '@/api/job/task';
-import { export_json_to_excel } from '@/utils/exportExcel';
-import geoJson from '@/assets/geoJson.json';
-import { mapGetters } from 'vuex';
-import { getAdcodeObj } from '@/utils/disposeData';
-import elTooltipCopy from '@/components/ElTooltipCopy.vue';
-import getBaseConfig from '@/buildConfig/config';
-import RecheckDialog from '@/views/tickets/ticketComponent/RecheckDialog.vue';
-import DispatchDialog from '@/views/tickets/ticketComponent/DispatchDialog.vue';
-import CreateTicketDialog from '@/views/tickets/ticketComponent/CreateTicketDialog.vue';
-import TicketDetailDialog from '@/views/tickets/ticketComponent/TicketDetailDialog.vue';
-const { envName } = getBaseConfig();
-const isProd = import.meta.env.VITE_APP_ENV === 'production'
-const route = useRoute()
-const router = useRouter()
-const store = useStore()
-const userAreaCode = computed(() => store.getters.userInfo.detail.areaCode);
-const currentIndex = ref(null)
-const finalizeLoading = ref(false)
-const activeTab = ref('all')
-let machineData = ref([]);
-const tabs = ref([
- { label: '我的工单', name: 'myTickets', value: null, count: 0 },
- { label: '全部工单', name: 'all', value: null, count: 0 },
- { label: '待审核', name: 'pending', value: 2, count: 0 },
- { label: '待处理', name: 'processing', value: 0, count: 0 },
- { label: '处理中', name: 'inProgress', value: 3, count: 0 },
- { label: '已完成', name: 'completed', value: 4, count: 0 },
-])
-const dateRanges = {
- today: getDateRange('today').map(d => new Date(d)), // 转为 Date 对象
- week: getDateRange('week').map(d => new Date(d)),
- month: getDateRange('month').map(d => new Date(d)),
- year: getDateRange('year').map(d => new Date(d)),
-}
-const filters = reactive({
- keyword: '',
- department: '',
- type: '',
- dateRange: [],
- status: '',
- algorithm: '',
- isReview: '',
- device_sn:''
-})
-const departments = ref([])
-const types = ref([])
-const allAlgorithms = ref([])
-const handlers = ref([
- { label: '处理人A', value: 'handlerA' },
- { label: '处理人B', value: 'handlerB' },
-])
-const algorithms = ref([])
-const algorithms2 = ref([])
-const statuses = ref([
- { label: '待审核', value: '2' },
- { label: '待处理', value: '0' },
- { label: '处理中', value: '3' },
- { label: '已完成', value: '4' },
-])
-const reviewStatuses = ref([
- { label: '否', value: 0 },
- { label: '是', value: 1 },
-])
-const tableData = ref([])
-const page = reactive({
- pageSize: 10,
- currentPage: 1,
- total: 0,
-})
-const dialogVisible = ref(false)
-const editFormData = ref(null)
-const detailVisible = ref(false)
-const currentDetail = ref({})
-const departmentUsers = ref({})
-const loading = ref(true)
-const globalCounts = ref({})
-const mapLoaded = ref(false)
-const isFetching = ref(false)
-const mapParams = reactive({
- zoom: 15,
- center: null,
-})
-const dispatchDialogVisible = ref(false)
-const stepInfos = ref([])
-const userNameToIdMap = ref({})
-const workType = ref(0)
-const selections = ref([])
-const reviewDialogVisible = ref(false)
-const currentReviewImage = ref('')
-const currentImageIndex = ref(1)
-const totalTime = ref('')
-const isShowInfo = ref(false)
-const datePickerDefaultVal = ref(calculateDefaultRange())
-const reCheckDialog = ref(false)
-const reCheckData = ref({})
-const treePropsSF = reactive({
- label: 'dictValue',
- value: 'id',
- children: 'children',
-})
-const dictKey = ref('')
-const dataList = ref([])
-const checkedKeys = ref([])
-const inputMapShowDefaultCenter = ref(null)
-const userInfo = computed(() => store.state.user.userInfo)
-const permission = computed(() => store.state.user.permission);
-
-// 计算属性
-const firstRowData = computed(() => {
- return tableData.value.length > 0 ? tableData.value[0] : null
-})
- // 动态过滤tabs,保证isShow为true/false
- const filteredTabs = computed(() => {
- const tabPending = permission.value?.tickets_tab_pending === true//待审核
- const tabMyTickets = permission.value?.tickets_tab_mytickets === true //我的工单
- const tabALL = permission.value?.tickets_allWorkOrders === true //全部工单
- const tabInProgress= permission.value?.tickets_inProgress === true //处理中
- const tabProcessing= permission.value?.tickets_pending === true //待处理
- const tabCompleted= permission.value?.tickets_wasDone === true //已完成
- return tabs.value
- .map(tab => {
- switch (tab.name) {
- case 'all':
- return { ...tab, isShow: tabALL } // 全部工单
- case 'pending':
- return { ...tab, isShow: tabPending } // 待审核
- case 'myTickets':
- return { ...tab, isShow: tabMyTickets } // 我的工单
- case 'processing':
- return { ...tab, isShow: tabProcessing } // 待处理
- case 'inProgress':
- return { ...tab, isShow: tabInProgress } // 处理中
- case 'completed':
- return { ...tab, isShow: tabCompleted } // 已完成
- default:
- return { ...tab, isShow: false } // 其他标签默认隐藏
- }
- })
- .filter(tab => tab.isShow)
-})
- // 可根据实际后端权限key调整
-const permissionList = computed(() => {
- return {
- addBtn: validData(permission.value.tickets_add, false),
- delBtn: validData(permission.value.tickets_delete, false),
- exportBtn: validData(permission.value.tickets_export, false),
- reviewBtn: validData(permission.value.tickets_review_btn, false),
- }
-})
-// 计算默认激活的标签(无全部工单时优先激活待审核)
-const defaultActiveTab = computed(() => {
- const hasAllTab = filteredTabs.value.some(tab => tab.name === 'all')
- const hasPendingTab = filteredTabs.value.some(tab => tab.name === 'pending')
- if (!hasAllTab && hasPendingTab) {
- return 'pending'
- }
- else if (hasAllTab) {
- return 'all'
- }
- else {
- return filteredTabs.value[0]?.name || 'all'
- }
-})
-
-
-const handleNodeClick = async data => {
- const droneList = await getDeviceRegion({ areaCode: userAreaCode.value });
- machineData.value = droneList?.data?.data;
-
-};
-// 提取状态列表计算属性
-const statusList = computed(() => {
- const visibleTabs = filteredTabs.value;
- return visibleTabs
- .filter(tab => tab.name !== 'all' && tab.name !== 'myTickets' && tab.value !== undefined)
- .map(tab => String(tab.value));
-});
-const stepStatusList = computed(() => {
- return stepInfos.value.map(step => String(step.status))
-})
-const showIsReviewText = computed(() => (row) => {
- if (['4'].includes(String(row.status))) return row.isReview === 1 ? '是' : '否'
- return '/'
-})
-const popupShowImage = computed(() => (list) => {
- return list.map(item => ({
- ...item,
- url: getShowImg(item.url),
- }))
-})
-// 方法
-function validData(value, defaultValue) {
- return value !== undefined ? value : defaultValue
-}
-// 获取表格数据
-async function fetchTableData() {
- if (isFetching.value) return
- isFetching.value = true
- loading.value = true
- const statusListVal = statusList.value;
- try {
- const currentTab = tabs.value.find(tab => tab.name === activeTab.value)
- const params = {
- ai_types: filters.type || undefined,
- status: currentTab?.name === 'myTickets'
- ? undefined
- : filters.status !== ''
- ? Number(filters.status)
- : currentTab?.value,
- event_name: filters.keyword || undefined,
- dept_id: filters.department || undefined,
- start_date: filters.dateRange?.[0]
- ? formatDate(filters.dateRange[0])
- : undefined,
- end_date: filters.dateRange?.[1]
- ? formatDate(filters.dateRange[1]).replace('00:00:00', '23:59:59')
- : undefined,
- current: Number(page.currentPage),
- size: Number(page.pageSize),
- ai_type: filters.algorithm || undefined,
- is_draft: currentTab?.name === 'myTickets' ? 1 : undefined,
- user_id: currentTab?.name === 'myTickets' ? userInfo.value.user_id : undefined,
- is_review: filters.isReview === '' ? undefined : filters.isReview,
- source: 1,
- status_list:currentTab?.name !== 'myTickets'? statusListVal : undefined,
- device_sn:filters.device_sn,
- work_types: ALL_WORK_ORDER_TYPE_OPTIONS
- }
-
- const response = await getList(params)
- if (!response?.data?.data?.records) {
- throw new Error('接口返回数据格式不正确')
- }
- const { total, records } = response.data.data
- let filteredRecords = records
- tableData.value = filteredRecords.map(item => {
- const longitude = Number(item.longitude) || 0
- const latitude = Number(item.latitude) || 0
- const matchedMachine = machineData.value.find(m => m.device_sn === item.device_sn);
- const deviceNickname = matchedMachine?.nickname || ''
- return {
- id: item.id,
- orderNumber: item.event_num,
- orderName: item.event_name,
- department: departments.value.find(d => d.value === item.dept_id)?.label || item.dept_name,
- startTime: item.job_create_time || '/',
- aiType: item.ai_types,
- content: item.content,
- type: item.work_order_type_dict_key,
- keyData: !isNaN(longitude) && !isNaN(latitude)
- ? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`
- : '未知位置',
- address: item.address,
- creator: item.event_num?.slice(0, 2) === 'AI' ? '智飞agent' : item.create_user,
- handler: item.update_user || '未分配',
- status: Number(item.status || 0),
- photo_url: item.photo_url || '',
- video_url: item.video_url || '',
- location: !isNaN(longitude) && !isNaN(latitude) ? [longitude, latitude] : null,
- processing_details: item.processing_details || '',
- update_photo_url: item.update_photo_url || '',
- work_type: item.work_type !== undefined ? Number(item.work_type) : 0,
- job_name: item.job_name || '',
- job_create_time: item.job_create_time || '',
- isReview: item.is_review,
- handle_user_id:item.handle_user_id,
- dataSources:item.work_type === '0' ? '巡检任务' :
- item.work_type === '1' ? '人工上报' :
- item.work_type === '2' ? '识别分析' :
- item.work_type === '3' ? '变化检测' :
- '',
- device_names:deviceNickname ? deviceNickname :''
-
- }
-
- })
-
- page.total = total || 0
- if (isShowInfo.value) {
- handleViewDetail(firstRowData.value)
- isShowInfo.value = false
- }
- await fetchTabCounts()
- } catch (error) {
- console.error('获取数据失败:', error)
- tableData.value = []
- page.total = 0
- } finally {
- loading.value = false
- isFetching.value = false
- }
-}
-// 获取工单类型标签
-function getTypeLabel(typeValue) {
- const typeObj = types.value.find(item => item.value === typeValue)
- return typeObj ? typeObj.label : typeValue
-}
-function handleCheck(data, { checkedKeys: keys, checkedNodes }) {
- checkedKeys.value = keys
- const selectedDictKeys = checkedNodes.map(node => node.dictKey).filter(Boolean)
- filters.type = selectedDictKeys
- fetchTableData()
-}
-// 算法
-function getAlgorithmList() {
- getSFDictionaryTree({ code: 'SF' }).then(res => {
- if (res.data.code === 200) {
- const result = res.data.data[0].children
- const filteredData = result.map(item => {
- const children = item.children?.map(child => ({
- ...child,
- children: [],
- }))
- return {
- ...item,
- children: children || [],
- }
- })
- dataList.value = filteredData
-
- }
- })
-}
-function handleSFNodeClick(data) {
- filters.type = ''
- filters.algorithm = ''
- filters.type = data.dictKey
- fetchTableData()
-}
-function handleClear() {
- dictKey.value = ''
- filters.algorithm = ''
- filters.type = ''
- fetchTableData()
-}
-// 上一项
-function handlePrevItem() {
- currentIndex.value = Math.max(0, currentIndex.value - 1)
- updateCurrentDetail()
-}
-
-// 下一项
-function handleNextItem() {
- currentIndex.value = Math.min(tableData.value.length - 1, currentIndex.value + 1)
- updateCurrentDetail()
-}
-
-// 更新当前详情
-function updateCurrentDetail() {
- currentDetail.value = tableData.value[currentIndex.value]
- currentDetail.value.mediaUrl = currentDetail.value.photo_url
- currentDetail.value.updatePhotoUrl = currentDetail.value.update_photo_url
- currentDetail.value.processingDetail = currentDetail.value.processing_details
- currentDetail.value.showQR = false
- currentDetail.value.latAndLon = _.round(currentDetail.value.location[0], 6) + ',' + _.round(currentDetail.value.location[1], 6)
- getStepInfoData(currentDetail.value.orderNumber)
-}
-
-// 更新当前详情数据
-function handleCurrentDetailUpdate(updatedDetail) {
- currentDetail.value = updatedDetail
-}
-// 受理并派发
-function handleApproveAndDispatch(detail) {
-if(!detail.orderName){
- ElMessage.warning('请填写工单名称');
- return;
-}
-if(!detail.aiType){
- ElMessage.warning('请选择关联算法');
- return;
-}
-
-if(!detail.content){
- ElMessage.warning('请填写工单内容');
- return;
-}
- currentDetail.value = detail
- dispatchDialogVisible.value = true
-}
-async function loadAMapScripts() {
- try {
- const areaCode = userInfo.value.detail.areaCode
- const subAreaCode = areaCode ? areaCode.substring(0, 6) : ''
- const adcodeObj = getAdcodeObj(geoJson, 'adcode', subAreaCode)
-
- const center = adcodeObj?.payload?.objects?.collection?.geometries?.[0]?.properties?.center
-
- if (Array.isArray(center) && center.length === 2) {
- inputMapShowDefaultCenter.value = center
- } else {
- const bbox = adcodeObj?.payload?.bbox
- if (Array.isArray(bbox) && bbox.length === 4) {
- const centerX = (bbox[0] + bbox[2]) / 2
- const centerY = (bbox[1] + bbox[3]) / 2
- inputMapShowDefaultCenter.value = [centerX, centerY]
- } else {
- inputMapShowDefaultCenter.value = [115.861365, 28.621311]
- }
- }
- mapParams.center = [...inputMapShowDefaultCenter.value]
- mapLoaded.value = true
- } catch (error) {
- console.error('地图加载失败:', error)
- }
-}
-async function fetchDropdownData() {
- try {
- const response = await getTicketInfo()
- const { dept_data, event_type, ai_type, info } = response.data.data
- departments.value = dept_data.map(item => ({
- label: item.dept_name,
- value: item.id,
- }))
-
- departmentUsers.value = dept_data.reduce((acc, dept) => {
- acc[dept.id] = dept.user_data || []
- return acc
- }, {})
-
- types.value = Object.entries(event_type).map(([key, value]) => ({
- label: value,
- value: key,
- }))
- allAlgorithms.value = info
-
- algorithms.value = ai_type?.map(item => ({
- dict_key: item.dict_key,
- dict_value: item.dict_value,
- label: item.dict_value,
- value: item.dict_key,
- })) || []
-
- algorithms2.value = _.cloneDeep(algorithms.value)
-
- userNameToIdMap.value = {}
- dept_data.forEach(dept => {
- (dept.user_data || []).forEach(user => {
- userNameToIdMap.value[user.name] = user.id
- })
- })
- } catch (error) {
- console.error('加载下拉框数据失败:', error)
- }
-}
-
-function handleTypeChange(typeValue) {
- if (!typeValue) {
- algorithms2.value = []
- return
- }
- const matchedCategory = allAlgorithms.value.find(category => category.dict_key === typeValue)
- if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) {
- algorithms2.value = []
- return
- }
- algorithms2.value = matchedCategory.algorithms.map(algo => ({
- label: algo.dict_value,
- value: algo.dict_key,
- dict_key: algo.dict_key,
- dict_value: algo.dict_value,
- }))
-}
-function formatDate(date) {
- if (!date) return undefined
- const d = new Date(date)
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
- d.getDate()
- ).padStart(2, '0')} 00:00:00`
-}
-
-function mapStatus(status) {
- const statusTextMap = {
-
- 2: '待审核',
- 0: '待处理',
- 3: '处理中',
- 4: '已完成',
- }
- return statusTextMap[status] || '未知状态'
-}
-function getStatusTagType(status) {
- if (status === -1 || status === '-1') return ''
- const colorMap = {
- 0: '#FF7411',
- 3: '#FFC300',
- 2: '#FF472F',
- 4: '#0291A1',
- }
- return colorMap[String(status)] || ''
-}
-// 获取tab数据
-async function fetchTabCounts() {
- const statusListVal = statusList.value;
- const params = {
- status_list: statusListVal,
- work_types: ALL_WORK_ORDER_TYPE_OPTIONS
- }
- try {
- const response = await getstatusCount(params)
- const statusCount = response.data.data || {}
- const totalCount = Object.entries(statusCount).reduce((sum, [key, count]) => {
- if (key === '6') return sum
- return sum + (count || 0)
- }, 0)
- tabs.value.forEach(tab => {
- if (tab.name === 'all') {
- tab.count = totalCount
- } else if (tab.name === 'myTickets') {
- tab.count = 0
- } else {
- tab.count = statusCount[String(tab.value)] || 0
- }
- })
- } catch (error) {
- console.error('获取标签页计数失败:', error)
- tabs.value.forEach(tab => {
- tab.count = 0
- })
- }
-}
-
-function handleTabChange(tab) {
- activeTab.value = tab.props?.name || tab.name
- fetchTabCounts()
- handleReset()
- page.currentPage = 1
- fetchTableData()
-}
-
-// 跳转后触发的Tab切换
-function handleTabChangeAfterJump() {
- // handleReset()
- page.currentPage = 1
- handleSearch()
- fetchTableData()
- fetchTabCounts()
-}
-function handleSearch() {
- page.currentPage = 1
- fetchTableData()
- fetchTabCounts()
-}
-function handleReset() {
- dictKey.value = ''
- Object.assign(filters, {
- keyword: '',
- department: '',
- type: '',
- dateRange: [],
- status: '',
- algorithm: '',
- isReview: '',
- device_sn:''
- })
- page.currentPage = 1
- router.replace({})
- fetchTableData()
-}
-
-function handleKeyWords() {
- router.replace({})
-}
-
-// 分页
-async function handleCurrentChange(val) {
- page.currentPage = val
- await nextTick()
- await fetchTableData()
-}
-
-async function sizeChange(val) {
- page.pageSize = val
- page.currentPage = 1
- await nextTick()
- await fetchTableData()
-}
-
-function handleAdd() {
- editFormData.value = null
- dialogVisible.value = true
-}
-
-async function getStepInfoData(val) {
- const orderNum = val
- const stepResponse = await getStepInfo(orderNum)
- const steps = Array.isArray(stepResponse.data.data)
- ? stepResponse.data.data
- : stepResponse.data.data?.steps || []
- const finishedStep = steps.find(s => String(s.status) === '4')
- totalTime.value = finishedStep && finishedStep.total_time ? finishedStep.total_time : ''
- stepInfos.value = steps.map(step => ({
- status: String(step.status),
- name: step.name,
- time: step.time,
- create_time: step.create_time,
- }))
-}
-// 详情
-async function handleViewDetail(row) {
-console.log('row',row);
-
- currentIndex.value = tableData.value.findIndex(item => item.id === row.id)
- workType.value = row.work_type !== undefined ? Number(row.work_type) : 0
- const detailData = {
- ...row,
- processingDetail: row.processing_details || '',
- mediaUrl: row.photo_url || row.video_url || '',
- updatePhotoUrl: row.update_photo_url || '',
- photos: [],
- job_name: row.job_name || '',
- }
-
- await getStepInfoData(row.orderNumber)
- currentDetail.value.status = row.status
-
- currentDetail.value = {
- ...detailData,
- showQR: false,
- latAndLon: _.round(detailData.location[0], 6) + ',' + _.round(detailData.location[1], 6),
- }
-// console.log('currentDetail.value',currentDetail.value);
-
- detailVisible.value = true
- handleTypeChange(currentDetail.value.type)
-}
-
-// 详情成功回调
-function handleDetailSuccess() {
- fetchTableData()
-}
-
-// 详情错误回调
-function handleDetailError(error) {
- console.error('工单操作失败:', error)
-}
-
-function refreshChange() {
- if (isFetching.value) return
- fetchTableData()
-}
-
-function onLoad() {
- if (isFetching.value) return
- fetchTableData()
-}
-// 导出数据
-async function exportData() {
- try {
- loading.value = true
- let exportData = []
-
- if (selections.value.length > 0) {
- exportData = selections.value.map(item => formatExportItem(item))
- } else {
- exportData = tableData.value.map(item => formatExportItem(item))
- }
-
- if (exportData.length === 0) {
- console.warn('没有数据可供导出')
- ElMessage.warning('没有数据可供导出');
- return
- }
-
- const headers = [
- '工单编号',
- '工单名称',
- '所属部门',
- '发起时间',
- '关联算法',
- '工单内容',
- '工单类型',
- '经纬度',
- '创建人',
- '处理人',
- '工单状态',
- ]
-
- export_json_to_excel(headers, exportData, '工单数据')
- } catch (error) {
- console.error('导出失败:', error)
- } finally {
- loading.value = false
- }
-}
-
-function formatExportItem(item) {
- const longitude = Number(item.longitude) || Number(item.location?.[0]) || 0
- const latitude = Number(item.latitude) || Number(item.location?.[1]) || 0
-
- return {
- 工单编号: item.orderNumber || item.event_num || '',
- 工单名称: item.orderName || item.event_name || '',
- 所属部门: item.department || item.dept_name || '',
- 发起时间: item.startTime || item.create_time || '',
- 关联算法: item.aiType || item.ai_types || '',
- 工单内容: item.address || item.content || '',
- 工单类型: types.value.find(t => t.value === (item.type || item.work_order_type_dict_key))?.label || '',
- 经纬度: !isNaN(longitude) && !isNaN(latitude)
- ? `${longitude.toFixed(6)}, ${latitude.toFixed(6)}`
- : '',
- 创建人: item.creator || item.create_user || '',
- 处理人: item.handler || item.update_user || '',
- 工单状态: mapStatus(Number(item.status || 0)),
- }
-}
-// 派发成功回调
-function handleDispatchSuccess() {
- detailVisible.value = false
- fetchTableData()
-}
-// 派发错误回调
-function handleDispatchError(error) {
- console.error('派发失败:', error)
-}
-// 编辑工单
-function handleEdit(row) {
- editFormData.value = row
- dialogVisible.value = true
-}
-
-// 创建成功回调
-function handleCreateSuccess() {
- fetchTableData()
-}
-
-// 草稿保存成功回调
-function handleDraftSuccess() {
- fetchTableData()
-}
-
-// 创建失败回调
-function handleCreateError(error) {
- console.error('工单操作失败:', error)
-}
-
-// 删除方法
-function handleDelete(row) {
-
-}
-
-// 添加选择变化处理方法
-function handleSelectionChange(selection) {
- selections.value = selection
-}
-
-// 打开审核对话框
-function openReviewDialog() {
- if (selections.value.length === 0) {
- ElMessage.warning('请先选择要审核的工单');
- return
- }
- currentImageIndex.value = 1
- updateCurrentReviewImage()
- reviewDialogVisible.value = true
-}
-
-// 更新当前审核图片
-function updateCurrentReviewImage() {
- if (!selections.value || selections.value.length === 0) {
- currentReviewImage.value = ''
- currentImageIndex.value = 1
- return
- }
- if (currentImageIndex.value > selections.value.length) {
- currentImageIndex.value = selections.value.length
- }
- if (currentImageIndex.value < 1) {
- currentImageIndex.value = 1
- }
- const index = currentImageIndex.value - 1
- if (index >= 0 && index < selections.value.length) {
- const currentItem = selections.value[index]
- currentReviewImage.value = currentItem.photo_url || ''
- } else {
- currentReviewImage.value = ''
- }
-}
-
-// 处理图片分页变化
-function handleImagePageChange(page) {
- if (page > 0 && page <= selections.value.length) {
- currentImageIndex.value = page
- updateCurrentReviewImage()
- }
-}
-
-// 批量审核通过
-async function handleBatchApprove() {
- try {
- if (selections.value.length === 0) {
- console.warn('没有选中的工单')
- return
- }
-
- const currentItem = selections.value[currentImageIndex.value - 1]
- if (!currentItem) {
- console.warn('当前工单数据无效')
- return
- }
-
- // 在Vue 3中需要使用ElMessageBox.confirm
-
- const data = {
- id: currentItem.id,
- status: currentItem.status,
- isPass: 0,
- eventNum: currentItem.orderNumber,
- }
-
- const response = await flowEvent(data)
- if (response.data.code === 0) {
-
-
- const newSelections = [...selections.value]
- newSelections.splice(currentImageIndex.value - 1, 1)
-
- if (newSelections.length > 0) {
- if (currentImageIndex.value > selections.value.length) {
- currentImageIndex.value = selections.value.length
- }
- updateCurrentReviewImage()
- } else {
- reviewDialogVisible.value = false
- currentImageIndex.value = 1
- currentReviewImage.value = ''
- fetchTableData()
- }
-
- selections.value = newSelections
- } else {
- throw new Error(response.data.msg || '审核失败')
- }
- } catch (error) {
- console.error('审核失败:', error)
- }
-}
-
-function cancleBatchReject() {
- reviewDialogVisible.value = false
- selections.value = []
- currentImageIndex.value = 1
- currentReviewImage.value = ''
- fetchTableData()
-}
-
-// 批量审核不通过
-async function handleBatchReject() {
- try {
- if (selections.value.length === 0) {
- console.warn('没有选中的工单')
- return
- }
-
- const currentItem = selections.value[currentImageIndex.value - 1]
- if (!currentItem) {
- console.warn('当前工单数据无效')
- return
- }
-
- // 在Vue 3中需要使用ElMessageBox.confirm
- const data = {
- id: currentItem.id,
- status: currentItem.status,
- isPass: 1,
- eventNum: currentItem.orderNumber,
- eventName: currentItem.orderName,
- }
-
- const response = await flowEvent(data)
- if (response.data.code === 0) {
-
-
- const newSelections = [...selections.value]
- newSelections.splice(currentImageIndex.value - 1, 1)
- selections.value = newSelections
-
- if (selections.value.length > 0) {
- if (currentImageIndex.value > selections.value.length) {
- currentImageIndex.value = selections.value.length
- }
- updateCurrentReviewImage()
- } else {
- reviewDialogVisible.value = false
- currentImageIndex.value = 1
- currentReviewImage.value = ''
- fetchTableData()
- }
- } else {
- throw new Error(response.data.msg || '驳回失败')
- }
- } catch (error) {
- console.error('驳回失败:', error)
- }
-}
-
-// 获取所有图片列表用于预览
-function getImageList() {
- return selections.value.map(item => getPreviewUrl(item.photo_url)).filter(url => url)
-}
-
-// 处理上一张图片
-function handlePrevImage() {
- if (currentImageIndex.value > 1) {
- currentImageIndex.value--
- updateCurrentReviewImage()
- }
-}
-
-// 处理下一张图片
-function handleNextImage() {
- if (currentImageIndex.value < selections.value.length) {
- currentImageIndex.value++
- updateCurrentReviewImage()
- }
-}
-
-/**
- * 获取缩略图地址
- */
-function getThumbUrl(url) {
- if (!url) return ''
- const lastDot = url.lastIndexOf('.')
- if (lastDot === -1) return url
- return url.slice(0, lastDot) + '_small' + url.slice(lastDot)
-}
-
-// 获取预览图地址
-function getPreviewUrl(url) {
- if (!url) return ''
- const lastDot = url.lastIndexOf('.')
- if (lastDot === -1) return url
- return url.slice(0, lastDot) + '_show' + url.slice(lastDot)
-}
-
-/**
- * 坐标转换方法处理
- */
-function disposeLocation(goWgs84 = false, data) {
- let lng = ''
- let lat = ''
-
- if (Array.isArray(data.location) && data.location.length > 0) {
- if (goWgs84) {
- lng = data.location?.[0] ? String(data.location[0]) : undefined
- lat = data.location?.[1] ? String(data.location[1]) : undefined
-
- if (lng && lat) {
- [lng, lat] = gcj02ToWgs84(Number(lng), Number(lat))
- }
- } else {
- lng = Number(data.location[0])
- lat = Number(data.location[1])
-
- if (lng && lat) {
- [lng, lat] = wgs84ToGcj02(Number(lng), Number(lat))
- }
- }
- }
-
- return [String(lng), String(lat)]
-}
-
-// 复核按钮
-function reCheck(row) {
- reCheckData.value = row
- reCheckDialog.value = true
-}
-
-// 复核成功回调
-function handleRecheckSuccess() {
- page.currentPage = 1
- fetchTableData()
- fetchTabCounts()
-}
-
-// 导出工单报表
-function exportTheTick(row) {
- const params = {
- num: row.orderNumber
- }
- exportTheTicket(params).then(res => {
- const elink = document.createElement('a')
- elink.download = row.orderName + '.docx'
- elink.style.display = 'none'
- const blob = new Blob([res.data])
- elink.href = URL.createObjectURL(blob)
- document.body.appendChild(elink)
- elink.click()
- document.body.removeChild(elink)
- })
-
-}
-
-// 生命周期
-onMounted(() => {
- handleNodeClick()
- inputMapShowDefaultCenter.value = null
- loadAMapScripts()
- fetchDropdownData()
- getAlgorithmList()
- // 设置默认activeTab
- activeTab.value = defaultActiveTab.value
- const href = window.location.href;
- if (route?.query?.status !== undefined && route?.query?.status !== null) {
- filters.status = route?.query?.status + ''
- router.replace({})
- }
-
- let curQueryParams = {}
-
- if (href?.indexOf('?') != -1 && href?.split('?').length > 0) {
- curQueryParams = href
- .split('?')[1]
- .split('&')
- .reduce((pre, cur) => {
- let newArr = cur.split('=')
- pre[newArr[0]] = newArr[1]
- return pre
- }, {})
-
- const { orderNumber = undefined, day = undefined, tab = undefined,enumerateDates=undefined } = curQueryParams
-
- if (day) {
- const date = new Date(day + 'T00:00:00+08:00')
- const dateArray = [date, date]
- const handler = {
- get(target, prop) {
- if (typeof prop === 'string' && /^\d+$/.test(prop)) {
- const index = parseInt(prop)
- const dateObj = target[index]
- return dateObj.toDateString() + ' 00:00:00 GMT+0800 (中国标准时间)'
- }
- return Reflect.get(target, prop)
- },
- }
-
- const proxyArray = new Proxy(dateArray, handler)
- filters.dateRange = proxyArray
- }
-
- if (orderNumber) {
- filters.keyword = orderNumber
- nextTick(() => {
- isShowInfo.value = true
- const find = store.state.tags.bsTagList.find(i => i.path === '/tickets/ticket')
- if (find) {
- find.query = {}
- }
- })
- }
-
- if (tab) {
-
- if(enumerateDates === 'CURRENT_WEEK') {
- filters.dateRange = [...dateRanges['week']]
- } else if(enumerateDates === 'CURRENT_MONTH') {
- filters.dateRange = [...dateRanges['month']]
- } else {
- filters.dateRange = [...dateRanges['year']]
- }
- const isTabValid = filteredTabs.value.some(t => t.name === tab)
- if (isTabValid) {
- activeTab.value = tab
- handleTabChangeAfterJump()
- const find = store.state.tags.bsTagList.find(i => i.path === '/tickets/ticket')
- if (find) {
- find.query = {}
- }
- }
- }
- }
-
- fetchTabCounts()
- fetchTableData()
-})
-
-onActivated(() => {
- handleReset()
-})
-</script>
-
-<style lang="scss" scoped>
-.searchBox {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- margin-bottom: 15px;
- gap: 15px 15px;
-
- :deep() {
- .el-form-item__label {
- width: 80px;
- }
- .el-form-item {
- width: 350px;
- margin-bottom: 0 !important;
- margin-right: 20px !important;
- .el-form-item__label {
- color: #363636;
- line-height: 32px;
- }
- // .el-form-item__content{
- // width: 280px;
- // }
- }
- }
- .btnGroup {
- display: flex;
- align-items: center;
- }
-}
-.el-card__body {
-height: 100%;}
-.titketBox {
-
- flex: 1;
- display: flex;
- flex-direction: column;
-}
-.dataTable {
- // height: 0;
- // flex: 1;
- height: calc(100vh - 374px);
- :deep(.el-scrollbar__view) {
- height: 100%;
- }
- :deep(.el-table--fit,.el-scrollbar__view) {
- height: 100%;
- }
-}
-
-.pagination {
- display: flex;
- justify-content: flex-end;
- margin-top: 20px;
- position: fixed;
- bottom: 20px;
- left: 0;
- right: 0;
- padding: 0 30px;
-
- z-index: 1000;
-}
-:deep(.custom-header th.el-table__cell) {
- color: rgba(0, 0, 0, 0.85);
- background: #fafafa;
- height: 55px !important;
-}
-/* 表格操作区域样式 */
-.table-operations {
- margin-bottom: 16px;
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
-
-.left-operations {
- display: flex;
- gap: 8px;
-}
-
-/* 表格样式 */
-.command-public-general-el-table {
- margin-bottom: 16px;
-}
-
-/* 分页样式 */
-.table-pagination {
- display: flex;
- justify-content: flex-end;
- margin-top: 10px;
-}
-.command-public-general-el-table {
- :deep(.el-table__header-wrapper) {
- background-color: #f5f7fa;
- }
-
- :deep(.el-table th) {
- background-color: #f5f7fa;
- color: #606266;
- font-weight: 600;
- }
-
- :deep(.el-table--border) {
- border: 1px solid #ebeef5;
- }
-
- :deep(.el-table__empty-block) {
- height: calc(100vh - 400px) !important;
- }
-}
-::v-deep(.el-tabs) {
- height: 100%;
- display: flex;
- flex-direction: column;
-
- .el-tabs__header {
- order: 1;
- }
-
- .el-tabs__content {
- order: 2;
- }
-
- .el-tabs__content {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .el-tab-pane {
- height: 0;
- flex: 1;
- display: flex;
- flex-direction: column;
- }
- }
-}
-
-.filter-bar {
- display: flex;
- align-items: center;
- margin-bottom: 15px;
- flex-wrap: wrap;
- gap: 8px; // 使用 gap 统一设置间距
-
- .filter-item {
- width: 280px; // 减小宽度
- }
-
- .date-picker {
- // width: 240px; // 日期选择器宽度适当调整
- }
-
- .el-button {
- margin-left: 0; // 覆盖 element-ui 默认的按钮间距
- }
-}
-
-.uploadImg {
- margin-bottom: 32px;
-}
-
-
-.action-bar {
- margin-bottom: 16px;
-}
-
-.el-dialog {
- .el-form-item {
- margin-bottom: 20px;
- }
-}
-
-.el-upload {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
-
- :deep(.el-upload-list__item) {
- transition: all 0.3s ease;
- }
-
- :deep(.el-upload-list__item:hover) {
- background-color: #f5f7fa;
- }
-}
-
-.el-upload__tip {
- font-size: 12px;
- color: #909399;
- margin-top: 12px;
-}
-
-.create-ticket-form {
- padding: 20px 10px;
-
- .form-section {
- background-color: #fff;
- border-radius: 4px;
-
- .el-row {
- margin-bottom: 16px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
-
- .location-wrapper {
- width: 100%; // 修改为100%以适应父容器
- height: auto; // 修改为auto以自适应内容
-
- .map-button {
- width: 100%; // 让按钮填满容器宽度
- height: 36px; // 与其他输入框保持一致的高度
- display: flex;
- align-items: center;
- justify-content: center;
-
- i {
- margin-right: 4px;
- }
- }
-
- .location-text {
- margin-top: 8px;
- padding: 8px 12px;
- background-color: #f5f7fa;
- border-radius: 4px;
- color: #606266;
- font-size: 13px;
- line-height: 1.4;
- }
- }
-
- .upload-wrapper {
- .uploader {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 128px;
- }
-
- :deep(.el-upload-list__item) {
- width: 120px;
- height: 120px;
- }
- }
-
- .upload-tip {
- font-size: 12px;
- color: #909399;
- line-height: 1.4;
- margin-top: 8px;
- }
- }
-
- .el-form-item {
- margin-bottom: 18px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- :deep(.el-form-item__label) {
- font-weight: 500;
- color: #606266;
- }
-
- // :deep(.el-input__inner) {
- // height: 36px;
- // line-height: 36px;
- // }
-
- :deep(.el-textarea__inner) {
- padding: 8px 12px;
- }
-
- // :deep(.el-input__inner),
- // :deep(.el-select),
- // :deep(.el-select .el-input) {
- // width: 100%; // 确保所有输入框和选择框宽度一致
- // }
-
- .full-width {
- width: 100%;
- }
-}
-
-:deep(.el-dialog__body) {
- border-top: 0.1rem solid #f0f0f0;
-}
-
-.dialog-footer-new {
- text-align: right;
- padding-top: 16px;
- border-top: 1px solid #ebeef5;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- }
- }
-}
-
-.dialog-footer1-new {
- position: sticky;
- bottom: 28px;
- left: 0;
- right: 0;
- background: white;
- z-index: 10;
- padding: 16px 20px;
- border-top: 1px solid #ebeef5;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .btngroups {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- margin-right: 12px;
- }
- }
-}
-
-.map-container {
- width: 100%;
- height: 400px;
- margin-bottom: 15px;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- overflow: hidden;
-
- :deep(.el-input-map) {
- height: 100%;
- }
-}
-
-.location-info {
- margin-top: 10px;
- padding: 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
-}
-
-.map-select {
- display: flex;
- align-items: flex-start;
- gap: 15px;
-
- .selected-location {
- flex: 1;
- padding: 5px 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
- }
-}
-
-.preview-image {
- border-radius: 4px;
- overflow: hidden;
- background-color: #f5f7fa;
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- height: 200px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- i {
- font-size: 32px;
- margin-bottom: 8px;
- }
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.detail-container {
- padding: 0 20px;
-
- .detail-top-title {
- display: flex;
- justify-content: center;
- align-items: center;
-
- .event-orderNumber {
- margin-right: 10px;
- }
- }
-}
-
-.status-flow {
- margin-bottom: 20px;
-
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 添加发起任务步骤的特殊样式
- .init-step-info {
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- width: 130px;
-
- .creator-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- margin-bottom: 4px;
- }
-
- .create-time {
- font-size: 10px;
- color: #909399;
- }
- }
-
- // 保持其他步骤的原有样式
- .step-info {
- display: flex;
- margin: 0;
- padding: 0;
- justify-content: space-between;
- align-items: center;
- width: 200px;
-
- .process-time {
- font-size: 10px;
- color: #909399;
- text-align: left;
- margin-left: -50%;
- padding-left: 0%;
- flex: 1;
- }
-
- .handler-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- text-align: left;
- flex: 1;
- }
- }
- }
-}
-
-.basic-info {
- margin-bottom: 20px;
-}
-
-.media-section {
- // margin-bottom: 20px;
-
- .el-row {
- display: flex;
- align-items: center;
- }
-}
-
-.leftBtn {
- width: 70px;
- height: 32px;
- background-color: #999;
- border-radius: 5px;
- text-align: center;
- line-height: 32px;
- color: #fff;
- cursor: pointer;
- opacity: 0.8;
-}
-
-.disableds {
- background: #999 !important;
- cursor: not-allowed !important;
- pointer-events: none;
- opacity: 0.3 !important;
-}
-
-.PopUpTableScrolls {
- max-height: 600px;
- overflow-y: scroll;
- overflow-x: hidden;
-}
-
-.media-box {
- width: 100%;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- padding: 10px;
- background: #fff;
- box-sizing: border-box;
-
- .media-title {
- font-weight: bold;
- margin-bottom: 5px;
- display: flex;
- align-items: center;
-
- .QRCodeImg {
- width: 18px;
- height: 18px;
- cursor: pointer;
- padding-bottom: 1px;
- }
- }
-
- .media-content {
- position: relative;
- height: 500px;
-
- :deep(.el-image) {
- width: 100% !important;
- max-width: 100%;
- max-height: 100%;
-
- .el-image__inner {
- width: 100%;
- height: 100%;
- object-fit: cover !important;
- }
- }
- }
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-}
-
-.image-placeholder i,
-.image-error i {
- font-size: 32px;
- margin-bottom: 8px;
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.info-table {
- margin-bottom: 20px;
-}
-
-.info-item {
- display: flex;
- margin-bottom: 10px;
-}
-
-.info-label {
- font-weight: bold;
- width: 120px;
- color: #606266;
-}
-
-.info-value {
- flex: 1;
- color: #303133;
- word-break: break-word;
-}
-
-
-
-// 添加删除按钮样式
-.danger-button {
- color: #f56c6c;
-}
-
-.danger-button:hover {
- color: #f78989;
-}
-
-.custom-steps-container {
- width: 100%;
- margin: 10px 0;
-}
-
-.steps-titles {
- display: flex;
- justify-content: space-between;
- margin-bottom: 14px;
- position: relative;
-}
-
-.step-title {
- text-align: center;
- flex: 1;
- font-size: 14px;
- color: #999;
- position: relative;
- padding-bottom: 5px;
-}
-
-.step-title.active {
- color: #409eff;
- font-weight: bold;
-}
-
-.event-title-center {
- text-align: center;
- font-size: 20px;
- font-weight: bold;
- margin-bottom: 5px;
- color: #333;
-}
-
-.custom-steps {
- margin-top: -20px;
-
- :deep(.el-step__description) {
- margin-top: 8px;
- padding: 0 20px;
- }
-}
-
-.step-description {
- font-size: 14px;
- color: #666;
- line-height: 1.5;
- display: block;
- text-align: center;
-
- &:first-child {
- font-weight: bold;
- margin-bottom: 4px;
- }
-}
-
-// 覆盖其他相关样式
-.status-flow {
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 移除之前的样式
- .init-step-info,
- .step-info {
- display: block;
- width: auto;
- text-align: center;
- }
- }
-}
-
-// 添加新的样式
-.review-dialog {
- :deep(.el-dialog__body) {
- padding: 0;
- background-color: #f5f7fa;
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.re-check-dialog {
- :deep(.el-dialog__body) {
- padding: 0;
- background-color: #f5f7fa;
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.review-container {
- position: relative;
-
- .review-image-wrapper {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 600px;
- background-color: #f5f7fa;
- }
-
- .review-image-container {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- :deep(.el-image) {
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .el-image__inner {
- max-height: 100%;
- max-width: 100%;
- object-fit: contain;
- }
- }
- }
-
- .arrow-button {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 44px;
- height: 44px;
- background: rgba(0, 0, 0, 0.3);
- border-radius: 50%;
- border: none;
- display: flex;
- align-items: center;
- justify-content: center;
- cursor: pointer;
- transition: all 0.3s;
- z-index: 100;
-
- &:hover {
- background: rgba(0, 0, 0, 0.6);
- }
-
- i {
- color: #fff;
- font-size: 24px;
- }
-
- &.left {
- left: 20px;
- color: #ffffff;
- }
-
- &.right {
- right: 20px;
- color: #ffffff;
- }
- }
-
- .preview-image {
- max-width: 100%;
- max-height: 100%;
- }
-
- .review-pagination {
- padding: 16px 0;
- display: flex;
- justify-content: center;
- background-color: #fff;
-
- :deep(.el-pagination) {
- .btn-prev,
- .btn-next {
- display: none;
- }
-
- .el-pager {
- .number {
- margin: 0 4px;
- }
- }
- }
- }
-
- .image-error {
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
-
- i {
- font-size: 48px;
- margin-bottom: 16px;
- }
-
- span {
- font-size: 16px;
- }
- }
-}
-
-
-/* 原有图片预览的样式 */
-.el-image-viewer__wrapper {
- :deep(.el-image-viewer__img) {
- max-width: 100%;
- max-height: 100%;
- object-fit: contain;
- }
-}
-</style>
diff --git a/applications/drone-command/src/views/tickets/ticketComponent/CreateTicketDialog.vue b/applications/drone-command/src/views/tickets/ticketComponent/CreateTicketDialog.vue
deleted file mode 100644
index a5beef5..0000000
--- a/applications/drone-command/src/views/tickets/ticketComponent/CreateTicketDialog.vue
+++ /dev/null
@@ -1,713 +0,0 @@
-<template>
- <el-dialog
- v-model="dialogVisible"
- title="新建工单"
- width="70%"
- :close-on-click-modal="false"
- @close="handleClose"
- >
- <el-form
- :model="form"
- :rules="rules"
- ref="formRef"
- label-width="90px"
- class="create-ticket-form"
- @submit.prevent
- >
- <div class="form-section">
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="工单名称" prop="name">
- <el-input
- v-model="form.name"
- placeholder="请输入工单名称"
- clearable
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="事件位置" prop="location">
- <div class="location-wrapper">
- <avue-input-map
- v-model="form.location"
- :clearable="false"
- :params="mapParams"
- @change="handleLocationChange"
- type="button"
- >
- <el-button type="primary" plain class="map-button">
- <i class="el-icon-map-location"></i> 地图选点
- </el-button>
- </avue-input-map>
- </div>
- </el-form-item>
- </el-col>
-
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="处理部门" prop="department">
- <el-select
- v-model="form.department"
- placeholder="请选择处理部门"
- @change="handleDepartmentChange"
- class="full-width"
- clearable
- >
- <el-option
- v-for="dept in departments"
- :key="dept.value"
- :label="dept.label"
- :value="dept.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="处理人员" prop="handler">
- <el-select
- v-model="form.handler"
- placeholder="请先选择处理人员"
- :disabled="!form.department"
- class="full-width"
- clearable
- >
- <el-option
- v-for="user in availableHandlers"
- :key="user.id"
- :label="user.name"
- :value="user.id"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="工单类型" prop="type">
- <el-select
- @change="handleTypeChange"
- v-model="form.type"
- placeholder="请选择工单类型"
- class="full-width"
- clearable
- >
- <el-option
- v-for="item in types"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
-
- <el-col :span="12">
- <el-form-item label="关联算法" prop="algorithm">
- <el-select
- v-model="form.algorithm"
- multiple
- placeholder="请选择关联算法"
- class="full-width"
- :disabled="!form.type"
- clearable
- >
- <el-option
- v-for="item in availableAlgorithms"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </el-form-item>
- </el-col>
-
- </el-row>
-
- <el-row :gutter="16">
- <el-col :span="12">
- <el-form-item label="工单内容" prop="content">
- <el-input
- type="textarea"
- v-model="form.content"
- :rows="4"
- placeholder="请输入工单内容描述"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="事件图片" prop="photos" required class="upload-wrapper">
- <el-upload
- ref="uploadRef"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="form.photos"
- :limit="1"
- accept="image/*"
- class="create-upload"
- >
- <template v-if="form.photos.length < 1">
- <div class="el-icon-plus">
- <span>+</span>
- </div>
- </template>
- </el-upload>
- <div class="upload-tip">需上传含有地址信息的照片(jpg、jpeg、png),且不超过5M</div>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </el-form>
-
- <template #footer>
- <div class="dialog-footer-new">
- <el-button
- type="danger"
- :loading="submitLoading"
- @click="handleSubmit"
- icon="el-icon-position"
- >
- 发布
- </el-button>
-
- <el-button @click="handleClose" icon="el-icon-circle-close">取 消</el-button>
- </div>
- </template>
- </el-dialog>
-</template>
-
-<script>
-import { createTicket } from '@/api/tickets/ticket';
-import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation';
-
-export default {
- name: 'CreateTicketDialog',
- props: {
- modelValue: {
- type: Boolean,
- default: false
- },
- departments: {
- type: Array,
- default: () => []
- },
- departmentUsers: {
- type: Object,
- default: () => ({})
- },
- types: {
- type: Array,
- default: () => []
- },
- allAlgorithms: {
- type: Array,
- default: () => []
- },
- editData: {
- type: Object,
- default: null
- },
- mapCenter: {
- type: Array,
- default: () => [115.861365, 28.621311]
- }
- },
- emits: ['update:modelValue', 'create-success', 'draft-success', 'create-error'],
- data() {
- return {
- form: {
- name: '',
- type: '',
- department: '',
- handler: '',
- algorithm: [],
- location: [],
- address: '',
- content: '',
- photos: []
- },
- rules: {
- name: [{ required: true, message: '请输入工单名称', trigger: 'blur' }],
- type: [{ required: true, message: '请选择工单类型', trigger: 'change' }],
- department: [{ required: true, message: '请选择所属部门', trigger: 'change' }],
- handler: [{ required: true, message: '请选择处理人员', trigger: 'change' }],
- content: [{ required: true, message: '请输入工单内容', trigger: 'blur' }],
- algorithm: [{ required: true, message: '请选择关联算法', trigger: 'change' }],
- location: [
- {
- required: true,
- validator: (rule, value, callback) => {
- if (!value || value.length < 2) {
- callback(new Error('请选择位置信息'));
- } else if (!value[0] || !value[1]) {
- callback(new Error('请选择位置信息'));
- } else {
- callback();
- }
- },
- trigger: 'change',
- },
- ],
- photos: [
- {
- validator: (rule, value, callback) => {
- if (!this.form.photos || this.form.photos.length === 0) {
- callback(new Error('请上传工单图片'));
- } else {
- callback();
- }
- },
- trigger: 'change',
- },
- ],
- },
- availableAlgorithms: [],
- mapParams: {
- zoom: 15,
- center: null
- },
- submitLoading: false,
- draftLoading: false
- };
- },
- computed: {
- dialogVisible: {
- get() {
- return this.modelValue;
- },
- set(value) {
- this.$emit('update:modelValue', value);
- }
- },
- availableHandlers() {
- return this.form.department ? this.departmentUsers[this.form.department] || [] : [];
- },
- isEditMode() {
- return !!this.editData;
- }
- },
- watch: {
- modelValue(newVal) {
- if (newVal) {
- this.initForm();
- this.mapParams.center = [...this.mapCenter];
- }
- }
- },
- methods: {
- initForm() {
- if (this.isEditMode && this.editData) {
- // 编辑模式:填充表单数据
- this.loadEditData();
- } else {
- // 新建模式:重置表单
- this.resetForm();
- }
- },
-
- loadEditData() {
- const data = this.editData;
-
- // 获取部门ID
- let deptId = data.dept_id;
- if (!deptId) {
- const deptInfo = this.departments.find(
- dept => dept.label && dept.label.trim() === data.department.trim()
- );
- deptId = deptInfo?.value;
- }
-
- // 获取工单类型值
- const typeValue = this.types.find(t => t.value === data.type)?.value || data.work_order_type_dict_key;
-
- // 处理算法数组
- let algorithmArr = [];
- if (Array.isArray(data.aiType)) {
- algorithmArr = data.aiType;
- } else if (typeof data.aiType === 'string' && data.aiType) {
- algorithmArr = data.aiType.split(/[,、]/).map(item => item.trim());
- }
-
- // 确保算法值与选项匹配
- algorithmArr = algorithmArr
- .map(item => {
- if (typeof item === 'string') {
- const matchedAlgorithm = this.allAlgorithms.find(
- algo => algo.dict_value === item || algo.dict_key === item
- );
- return matchedAlgorithm ? matchedAlgorithm.dict_key : item;
- }
- return item;
- })
- .filter(Boolean);
-
- // 处理位置数据
- let curLocation = [];
- if (Array.isArray(data.location) && data.location.length >= 2) {
- let [lng, lat] = this.disposeLocation(false, data);
- curLocation = [lng, lat, data.location[2] || data.address || ''];
- }
-
- this.form = {
- id: data.id,
- name: data.orderName,
- type: typeValue,
- department: deptId,
- handler: data.handler,
- algorithm: algorithmArr,
- location: curLocation,
- address: curLocation[2] || '',
- content: data.content,
- photos: data.photo_url ? [{
- name: 'existing-photo.jpg',
- url: data.photo_url,
- status: 'success',
- raw: null,
- existingUrl: data.photo_url,
- }] : []
- };
-
- // 更新算法选项
- this.handleTypeChange(typeValue);
- },
-
- resetForm() {
- this.form = {
- name: '',
- type: '',
- department: '',
- handler: '',
- algorithm: [],
- location: [],
- address: '',
- content: '',
- photos: []
- };
- this.availableAlgorithms = [];
-
- if (this.$refs.formRef) {
- this.$refs.formRef.clearValidate();
- }
- },
-
- handleClose() {
- this.dialogVisible = false;
- this.resetForm();
- },
- handleTypeChange(typeValue) {
- this.form.algorithm = [];
- if (!typeValue) {
- this.availableAlgorithms = [];
- return;
- }
- const matchedCategory = this.allAlgorithms.find(category => category.dict_key === typeValue);
- if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) {
- this.availableAlgorithms = [];
- this.$message.info('该工单类型暂无关联算法');
- return;
- }
-
- this.availableAlgorithms = matchedCategory.algorithms.map(algo => ({
- label: algo.dict_value,
- value: algo.dict_key,
- dict_key: algo.dict_key,
- dict_value: algo.dict_value,
- }));
- },
-
- handleDepartmentChange() {
- this.form.handler = '';
- },
-
- handleLocationChange(val) {
- let locationValue = val.value;
- if (locationValue && locationValue.length >= 2) {
- const [lng, lat] = gcj02ToWgs84(locationValue[0], locationValue[1]);
- this.form.location = [Number(lng), Number(lat), locationValue[2] || ''];
- this.form.address = locationValue[2] || '';
- } else {
- this.form.location = [];
- this.form.address = '';
- }
- },
-
- handleFileChange(file, fileList) {
- this.form.photos = fileList.map(item => ({
- ...item,
- existingUrl: item.url && !item.raw ? item.url : null,
- }));
- },
-
- handleUploadRemove(file, fileList) {
- this.form.photos = fileList;
- },
-
- beforeUpload(file) {
- const isImage = file.type.includes('image');
- const isLt5M = file.size / 1024 / 1024 < 5;
-
- if (!isImage) {
- this.$message.error('只能上传图片文件!');
- return false;
- }
- if (!isLt5M) {
- this.$message.error('图片大小不能超过5MB!');
- return false;
- }
- return true;
- },
-
- async handleSubmit() {
- if (this.submitLoading) return;
-
- try {
- await this.$refs.formRef.validate();
-
- // 验证位置信息
- if (!this.form.location || this.form.location.length < 2) {
- this.$message.warning('请在地图上选择位置');
- return;
- }
-
- // 验证图片
- if (!this.form.photos || this.form.photos.length === 0) {
- this.$message.warning('请上传工单图片');
- return;
- }
-
- this.submitLoading = true;
-
- let [lng, lat] = this.disposeLocation(true, this.form);
-
- const submitData = {
- eventName: this.form.name,
- content: this.form.content,
- workType: '1',
- longitude: lng,
- latitude: lat,
- address: this.form.address,
- workOrderTypeDictKey: this.form.type,
- aiType: Array.isArray(this.form.algorithm) ? this.form.algorithm : [this.form.algorithm],
- updateUser: this.form.handler,
- createDept: this.form.department,
- isDraft: 0,
- };
-
- if (this.form.id) {
- submitData.id = this.form.id;
- }
-
- // 获取文件
- let file = null;
- const photoInfo = this.form.photos[0];
-
- if (photoInfo.raw) {
- file = photoInfo.raw;
- } else if (photoInfo.existingUrl) {
- submitData.photoUrl = photoInfo.existingUrl;
- } else {
- this.$message.warning('图片文件无效,请重新上传');
- return;
- }
-
- const response = await createTicket(submitData, file);
- if (response.data.code === 0) {
- this.$message.success(this.isEditMode ? '工单编辑成功' : '工单创建成功');
- this.$emit('create-success');
- this.handleClose();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- if (error.message.includes('验证未通过')) {
- this.$message.warning('请填写完整的工单信息');
- } else {
- this.$message.error(error.message || '操作失败,请稍后重试');
- this.$emit('create-error', error);
- }
- } finally {
- this.submitLoading = false;
- }
- },
-
-
- disposeLocation(goWgs84 = false, data) {
- let lng = '', lat = '';
-
- if (Array.isArray(data.location) && data.location.length > 0) {
- if (goWgs84) {
- lng = data.location?.[0] ? String(data.location[0]) : undefined;
- lat = data.location?.[1] ? String(data.location[1]) : undefined;
-
- if (lng && lat) {
- [lng, lat] = gcj02ToWgs84(Number(lng), Number(lat));
- }
- } else {
- lng = Number(data.location[0]);
- lat = Number(data.location[1]);
-
- if (lng && lat) {
- [lng, lat] = this.wgs84ToGcj02(Number(lng), Number(lat));
- }
- }
- }
-
- return [String(lng), String(lat)];
- },
-
-
- }
-};
-</script>
-
-<style lang="scss" scoped>
-.full-width {
- width: 100%;
-}
-
-.location-wrapper {
- width: 100%;
- height: auto;
-}
-
-.map-button {
- width: 100%;
- height: 36px;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.create-ticket-form {
- padding: 20px 10px;
-
- .form-section {
- background-color: #fff;
- border-radius: 4px;
-
- .el-row {
- margin-bottom: 16px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
-
- .location-wrapper {
- width: 100%; // 修改为100%以适应父容器
- height: auto; // 修改为auto以自适应内容
-
- .map-button {
- width: 100%; // 让按钮填满容器宽度
- height: 36px; // 与其他输入框保持一致的高度
- display: flex;
- align-items: center;
- justify-content: center;
-
- i {
- margin-right: 4px;
- }
- }
-
- .location-text {
- margin-top: 8px;
- padding: 8px 12px;
- background-color: #f5f7fa;
- border-radius: 4px;
- color: #606266;
- font-size: 13px;
- line-height: 1.4;
- }
- }
-
- .upload-wrapper {
- .uploader {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 128px;
- }
-
- :deep(.el-upload-list__item) {
- width: 120px;
- height: 120px;
- }
- }
-
- .upload-tip {
- font-size: 12px;
- color: #909399;
- line-height: 1.4;
- margin-top: 8px;
- }
- }
-
- .el-form-item {
- margin-bottom: 18px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- :deep(.el-form-item__label) {
- font-weight: 500;
- color: #606266;
- }
-
- // :deep(.el-input__inner) {
- // height: 36px;
- // line-height: 36px;
- // }
-
- :deep(.el-textarea__inner) {
- padding: 8px 12px;
- }
-
- // :deep(.el-input__inner),
- // :deep(.el-select),
- // :deep(.el-select .el-input) {
- // width: 100%; // 确保所有输入框和选择框宽度一致
- // }
-
- .full-width {
- width: 100%;
- }
-}
-
-:deep(.el-dialog__body) {
- border-top: 0.1rem solid #f0f0f0;
-}
-/* 新建工单和处理工单的上传组件样式 */
-.create-upload,
-.detail-upload {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 100px;
- }
-
- /* 隐藏额外的上传按钮 */
- :deep(.el-upload.el-upload--picture-card) {
- display: none;
- }
-
- /* 当没有图片时显示上传按钮 */
- :deep(.el-upload.el-upload--picture-card:first-child) {
- display: flex;
- }
-
- /* 上传组件的预览图片样式 */
- :deep(.el-upload-list--picture-card .el-upload-list__item) {
- width: 120px;
- height: 100px;
- }
-}
-</style>
\ No newline at end of file
diff --git a/applications/drone-command/src/views/tickets/ticketComponent/DispatchDialog.vue b/applications/drone-command/src/views/tickets/ticketComponent/DispatchDialog.vue
deleted file mode 100644
index 1ee5389..0000000
--- a/applications/drone-command/src/views/tickets/ticketComponent/DispatchDialog.vue
+++ /dev/null
@@ -1,244 +0,0 @@
-<template>
- <el-dialog
- v-model="dialogVisible"
- title="派发工单"
- width="40%"
- :close-on-click-modal="false"
- @close="handleClose"
- >
- <el-form
- :model="form"
- :rules="rules"
- ref="formRef"
- label-width="100px"
- @submit.prevent
- >
- <el-form-item label="选择部门" prop="department">
- <el-tree-select
- v-model="form.department"
- placeholder="请选择部门"
- :data="deptTreeData"
- :props="treeProps"
- :filterable="true"
- :allow-clear="true"
- :check-strictly="true"
- @change="handleDepartmentChange"
- class="full-width"
- />
- </el-form-item>
- <el-form-item label="选择处理人" prop="handler">
- <el-select
- filterable
- v-model="form.handler"
- placeholder="请选择处理人"
- :disabled="!form.department"
- class="full-width"
- >
- <el-option
- v-for="user in availableHandlers"
- :key="user.id"
- :label="user.name"
- :value="user.id"
- />
- </el-select>
- </el-form-item>
- </el-form>
-
- <template #footer>
- <el-button @click="handleClose" icon="el-icon-circle-close">取消</el-button>
- <el-button
- type="primary"
- :loading="loading"
- @click="handleSubmit"
- icon="el-icon-check"
- >
- 确认派发
- </el-button>
- </template>
- </el-dialog>
-</template>
-
-<script setup>
-import { getDeptTree, getDeptLazyTree } from '@/api/system/dept'
-import { ElMessage } from 'element-plus';
-import { flowEvent } from '@/api/tickets/ticket';
-import { onMounted } from 'vue';
-const props = defineProps({
- modelValue: {
- type: Boolean,
- default: false
- },
- currentDetail: {
- type: Object,
- default: () => ({})
- },
-
- departmentUsers: {
- type: Object,
- default: () => ({})
- },
- algorithms: {
- type: Array,
- default: () => []
- },
- types: {
- type: Array,
- default: () => []
- }
-});
-const emit = defineEmits(['update:modelValue', 'dispatch-success', 'dispatch-error']);
-const formRef = ref(null); // 表单引用
-const loading = ref(true);
-const form = ref({
- department: '',
- handler: ''
-});
-const deptTreeData =ref([])
-// 树形选择器配置
-const treeProps = ref({
- value: 'id', // 对应部门数据的id字段(作为选中值)
- label: 'name', // 对应部门数据的name字段(作为显示文本)
- children: 'children' // 对应子部门字段
-});
-// 获取树形数据
- const getDepartmentTree=() =>{
- const tenantId = '000000'
- getDeptTree(tenantId).then(res => {
- deptTreeData.value = res.data.data
-
- })
-}
-// 表单校验规则
-const rules = ref({
- department: [{ required: true, message: '请选择部门', trigger: 'change' }],
- handler: [{ required: true, message: '请选择处理人', trigger: 'change' }]
-});
-const dialogVisible = computed({
- get() {
- return props.modelValue;
- },
- set(value) {
- emit('update:modelValue', value);
- }
-});
-
-// 处理人列表
-const availableHandlers = computed(() => {
- return form.value.department ? props.departmentUsers[form.value.department] || [] : [];
-});
-watch(
- () => props.modelValue,
- (newVal) => {
- if (newVal) {
- resetForm();
- }
- },
- { immediate: true }
-);
-
-// 重置表单
-const resetForm = () => {
- form.value = {
- department: '',
- handler: ''
- };
- if (formRef.value) {
- formRef.value.clearValidate();
- }
-};
-
-// 关闭对话框
-const handleClose = () => {
- dialogVisible.value = false;
- resetForm();
-};
-
-// 部门切换时清空处理人
-const handleDepartmentChange = () => {
- form.value.handler = '';
-};
-
-// 验证必填字段(currentDetail 中的必填项)
-const validateRequiredFields = () => {
- if (!props.currentDetail.orderName || !props.currentDetail.orderName.trim()) {
- ElMessage.warning('请填写工单名称');
- return false;
- }
- if (!props.currentDetail.type) {
- ElMessage.warning('请选择工单类型');
- return false;
- }
- if (!props.currentDetail.content || !props.currentDetail.content.trim()) {
- ElMessage.warning('请填写工单内容');
- return false;
- }
- return true;
-};
-
-// 获取算法值
-const getAlgorithmValue = () => {
- const { aiType } = props.currentDetail;
- // 检查是否直接匹配 value
- const isValueMatch = props.algorithms.some(item => item.value === aiType);
- if (isValueMatch) {
- return aiType;
- }
- // 尝试匹配 dict_value 或 label
- const matched = props.algorithms.find(
- item => item.dict_value === aiType || item.label === aiType
- );
- return matched ? matched.value : null;
-};
-
-// 提交派发
-const handleSubmit = async () => {
- try {
- const valid = await formRef.value.validate();
- if (!valid) return;
- if (!validateRequiredFields()) {
- return;
- }
-
- loading.value = true;
- const algorithmValue = getAlgorithmValue();
- const data = {
- id: props.currentDetail.id,
- status: props.currentDetail.status,
- isPass: 0, // 0 表示通过
- eventName: props.currentDetail.orderName,
- eventNum: props.currentDetail.orderNumber,
- workOrderTypeDictKey: props.currentDetail.type,
- content: props.currentDetail.content,
- createDept: form.value.department,
- updateUser: form.value.handler,
- aiType: algorithmValue,
- };
-
- // 发送请求
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- ElMessage.success('工单已成功派发');
- emit('dispatch-success');
- handleClose();
- } else {
- throw new Error(response.data.msg || '派发失败');
- }
- } catch (error) {
- console.error('派发失败:', error);
- emit('dispatch-error', error);
- ElMessage.error(error.message || '派发失败,请稍后重试');
- } finally {
- loading.value = false;
- }
-};
-onMounted(()=>{
- getDepartmentTree()
-})
-</script>
-<style scoped>
-.full-width {
- width: 100%;
-}
-.el-form {
-margin-top: 20px;}
-</style>
\ No newline at end of file
diff --git a/applications/drone-command/src/views/tickets/ticketComponent/RecheckDialog.vue b/applications/drone-command/src/views/tickets/ticketComponent/RecheckDialog.vue
deleted file mode 100644
index 03b3b42..0000000
--- a/applications/drone-command/src/views/tickets/ticketComponent/RecheckDialog.vue
+++ /dev/null
@@ -1,117 +0,0 @@
-<template>
- <el-dialog
- v-model="dialogVisible"
- title="工单复核"
- width="30%"
- append-to-body
- class="command-dialog-mange"
- @close="handleClose"
- >
- <div class="dialog-footer">
- <el-button type="primary" @click="handleConfirm(1)">人工复核</el-button>
- <el-button type="primary" @click="handleConfirm(2)">无人机复核</el-button>
- </div>
- </el-dialog>
-</template>
-
-<script>
-import { ElMessageBox, ElLoading } from 'element-plus';
-import { getReviewById, getCreateEventJob } from '@/api/tickets/ticket';
-
-export default {
- name: 'RecheckDialog',
- props: {
- modelValue: {
- type: Boolean,
- default: false
- },
- recheckData: {
- type: Object,
- default: () => ({})
- }
- },
- emits: ['update:modelValue', 'recheck-success'],
- computed: {
- dialogVisible: {
- get() {
- return this.modelValue;
- },
- set(value) {
- this.$emit('update:modelValue', value);
- }
- }
- },
- methods: {
- handleClose() {
- this.dialogVisible = false;
- },
-
- handleConfirm(key) {
- if (key === 1) {
- this.handleManualRecheck();
- } else {
- this.handleUAVRecheck();
- }
- },
-
- async handleManualRecheck() {
- try {
- await getReviewById(this.recheckData.id);
- this.$message.success('人工复核成功');
- this.$emit('recheck-success');
- this.dialogVisible = false;
- } catch (error) {
- this.$message.error('人工复核失败');
- console.error('人工复核失败:', error);
- }
- },
-
- async handleUAVRecheck() {
- const loading = ElLoading.service({
- lock: true,
- text: '复核任务创建中……',
- background: 'rgba(0, 0, 0, 0.7)',
- });
-
- try {
- const response = await getCreateEventJob(this.recheckData.id);
- const estimatedTime = response.data.data;
-
- loading.close();
-
- await ElMessageBox.confirm(
- `预计复核执行时间为${estimatedTime}`,
- '提示',
- {
- confirmButtonText: '确定',
- showCancelButton: false,
- closeOnClickModal: false,
- closeOnPressEscape: false,
- type: 'warning',
- }
- );
-
- this.$message.success('无人机复核任务创建成功');
- this.$emit('recheck-success');
- this.dialogVisible = false;
- } catch (error) {
- loading.close();
- if (error !== 'cancel') {
- this.$message.error('无人机复核任务创建失败');
- console.error('无人机复核失败:', error);
- }
- this.dialogVisible = false;
- }
- }
- }
-};
-</script>
-
-<style scoped>
-.dialog-footer {
- display: flex;
- justify-content: center;
- gap: 20px;
- padding: 20px 0;
-}
-</style>
\ No newline at end of file
diff --git a/applications/drone-command/src/views/tickets/ticketComponent/TicketDetailDialog.vue b/applications/drone-command/src/views/tickets/ticketComponent/TicketDetailDialog.vue
deleted file mode 100644
index 94f84ad..0000000
--- a/applications/drone-command/src/views/tickets/ticketComponent/TicketDetailDialog.vue
+++ /dev/null
@@ -1,1441 +0,0 @@
-<template>
- <el-dialog
- class="custom-dialog"
- align-center
- v-model="dialogVisible"
- :title="isEditMode ? '编辑工单' : '工单详情'"
- width="80%"
- append-to-body
- @close="handleClose"
- >
- <div class="detail-container">
- <div class="detail-top-title">
- <div class="event-title-center event-orderNumber">
- {{ currentDetail.orderNumber || '工单编号' }}
- </div>
- <div class="event-title-center">{{ currentDetail.orderName || '事件名称' }}</div>
- </div>
- <div v-if="totalTime" class="event-total-time">总耗时:{{ totalTime }}</div>
- <!-- 工单状态流程 -->
- <div class="custom-steps-container">
- <!-- 标题行 -->
- <div class="steps-titles">
- <div
- v-for="(status, index) in stepStatusList"
- :key="index"
- :class="{
- 'step-title': true,
- active: index <= stepStatusList.indexOf(String(currentDetail.status)),
- }"
- >
- {{ mapStatus(status) }}
- </div>
- </div>
-
- <!-- Element Steps 组件 -->
- <el-steps :active="getActiveStep() - 1" align-center class="custom-steps">
- <el-step v-for="(status, index) in stepStatusList" :key="index">
- <template #description>
- <span class="step-description">
- {{ getStepHandler(status) }}
- </span>
- <div class="step-description" v-if="getStepTime(status)">
- <span class="step-timer"> 耗时:{{ getStepTime(status) }} </span>
- </div>
- <div class="step-description">
- {{ getStepCreateTime(status) }}
- </div>
- </template>
- </el-step>
- </el-steps>
- </div>
-
- <div class="PopUpTableScrolls">
- <!-- 基本信息表格 -->
- <el-table :show-header="false" :data="formattedDetailFields" border class="tableCss">
- <el-table-column prop="label1" label="基本信息" width="150">
- <template #default="{ row }">
- <span
- v-if="
- currentDetail.status === 0 &&
- (row.label1 === '关联算法' || row.label1 === '工单名称')
- "
- class="required-label"
- >
- <span class="required-star">*</span>{{ row.label1 }}
- </span>
- <span v-else>{{ row.label1 }}</span>
- </template>
- </el-table-column>
- <el-table-column>
- <template #default="{ row }">
- <template
- v-if="
- currentDetail.status === 0 &&
- row.label1 === '工单名称' &&
- hasProcessingBtnPermission()
- "
- >
- <el-input
- v-model="currentDetail.orderName"
- placeholder="请输入工单名称"
- class="required-input"
- />
- </template>
- <template
- v-else-if="
- currentDetail.status === 0 &&
- row.label1 === '关联算法' &&
- hasProcessingBtnPermission()
- "
- >
- <el-select
- v-model="currentDetail.aiType"
- placeholder="请选择关联算法"
- class="required-input"
- >
- <el-option
- v-for="item in algorithms"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- />
- </el-select>
- </template>
- <template v-else>{{ row.value1 }}</template>
- </template>
- </el-table-column>
- <el-table-column prop="label2" label="基本信息" width="150">
- <template #default="{ row }">
- <span
- v-if="currentDetail.status === 0 && row.label2 === '工单内容'"
- class="required-label"
- >
- <span class="required-star">*</span>{{ row.label2 }}
- </span>
- <span v-else>{{ row.label2 }}</span>
- </template>
- </el-table-column>
- <el-table-column>
- <template #default="{ row }">
- <template
- v-if="
- currentDetail.status === 0 &&
- row.label2 === '工单内容' &&
- hasProcessingBtnPermission()
- "
- >
- <el-input
- type="textarea"
- :maxlength="200"
- show-word-limit
- v-model="currentDetail.content"
- placeholder="请输入工单内容"
- class="required-input"
- />
- </template>
- <template v-else>{{ row.value2 }}</template>
- </template>
- </el-table-column>
- </el-table>
-
- <!-- 事件处理详情 -->
- <div v-if="[3, 4].includes(currentDetail.status)" class="form-section">
- <div class="section-title">
- <template v-if="currentDetail.status === 3">
- <span class="required-label">
- <span class="required-star">*</span>事件处理详情
- </span>
- </template>
- <template v-else> 事件处理详情</template>
- </div>
- <!-- 处理中状态显示输入框 -->
- <template v-if="currentDetail.status === 3 && hasProcessedAndOverBtnPermission()">
- <el-input
- type="textarea"
- v-model="currentDetail.processingDetail"
- placeholder="请输入事件处理详情"
- :rows="4"
- :maxlength="200"
- show-word-limit
- style="width: 100%; margin-bottom: 10px"
- :disabled="!isCurrentUserAssigned"
- />
- </template>
- <!-- 已完成和已完结状态显示只读文本 -->
- <template v-else>
- <div class="readonly-processing-detail">
- {{ currentDetail.processingDetail }}
- </div>
- </template>
- </div>
-
- <!-- 上传图片 -->
- <div v-if="[3].includes(currentDetail.status)" class="form-section uploadImg">
- <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">
- <template v-if="currentDetail.status === 3">
- <span class="required-label"> <span class="required-star">*</span>上传图片 </span>
- </template>
- <template v-else> 上传图片</template>
- </div>
- <el-upload
- :disabled="!isCurrentUserAssigned"
- v-if="hasProcessedAndOverBtnPermission()"
- ref="uploadRef"
- :action="'#'"
- :auto-upload="false"
- list-type="picture-card"
- :on-change="handleFileChange"
- :on-remove="handleUploadRemove"
- :before-upload="beforeUpload"
- :file-list="currentDetail.photos || []"
- :limit="1"
- accept="image/*"
- class="detail-upload"
- >
- <template v-if="!currentDetail.photos || currentDetail.photos.length < 1">
- <div class="el-icon-plus">
- <span>+</span>
- </div>
- </template>
- </el-upload>
- <div class="el-upload__tip" v-if="hasProcessedAndOverBtnPermission()">
- (上传照片即可完结工单,只能上传jpg、jpeg、png照片,且不超过5M)
- </div>
- </div>
-
- <!-- 图片和地图部分 -->
- <div class="media-section">
- <el-row :gutter="20">
- <el-col :span="12">
- <div class="media-box">
- <div class="media-title">事件图片</div>
- <div class="media-content">
- <el-image
- v-if="currentDetail.mediaUrl"
- :src="getThumbUrl(currentDetail.mediaUrl)"
- :preview-src-list="[getPreviewUrl(currentDetail.mediaUrl)]"
- fit="contain"
- style="cursor: pointer"
- >
- <template #placeholder>
- <div class="image-placeholder">
- <i class="el-icon-picture-outline"></i>
- <span>加载中...</span>
- </div>
- </template>
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-media">暂无图片/视频</div>
- </div>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="media-box">
- <template v-if="currentDetail.status === 4">
- <div class="media-title">工单处理图片</div>
- <div class="media-content">
- <el-image
- v-if="currentDetail.updatePhotoUrl"
- :src="getThumbUrl(currentDetail.updatePhotoUrl)"
- :preview-src-list="[getPreviewUrl(currentDetail.updatePhotoUrl)]"
- fit="fill"
- >
- <template #placeholder>
- <div class="image-placeholder">
- <i class="el-icon-picture-outline"></i>
- <span>加载中...</span>
- </div>
- </template>
- <template #error>
- <div class="image-error">
- <i class="el-icon-picture-outline"></i>
- <span>加载失败</span>
- </div>
- </template>
- </el-image>
- <div v-else class="no-media">暂无处理图片</div>
- </div>
- </template>
- <template v-else>
- <div class="media-title">
- 地图标记事件点
- <el-popover
- v-if="currentDetail.status === 3 || currentDetail.status === 0"
- popper-class="custom-qrcode-popover"
- :width="120"
- :visible="currentDetail.showQR && dialogVisible"
- placement="top"
- title=""
- trigger="click"
- >
- <template #reference>
- <img
- @click.stop="handleQRCode(currentDetail)"
- class="QRCodeImg"
- src="@/assets/images/dataCenter/qrCode.svg"
- alt=""
- title="事件导航"
- />
- </template>
- <div class="qrcode-content">
- <div class="close-btn" @click.stop="currentDetail.showQR = false">×</div>
- <CreateQRcode
- v-if="currentDetail.showQR && dialogVisible"
- :lat-and-lon="currentDetail.location"
- />
- </div>
- </el-popover>
- </div>
- <div class="media-content">
- <map-container v-if="dialogVisible" ref="mapContainerRef" />
- </div>
- </template>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
-
- <!-- 操作按钮 -->
- <div class="dialog-footer1-new">
- <div
- :class="currentIndex === 0 ? 'disableds' : ''"
- class="leftBtn"
- @click="handlePrev"
- >
- 上一页
- </div>
- <div class="btngroups">
- <template v-if="currentDetail.status === 2">
- <!-- 待审核 -->
- <el-button
- v-if="hasReviewBtnPermission()"
- type="primary"
- :loading="approveLoading"
- @click="handleApprove"
- icon="el-icon-check"
- >
- 通过
- </el-button>
- <el-button
- v-if="hasReviewBtnPermission()"
- type="danger"
- :loading="rejectLoading"
- @click="handleReject"
- icon="el-icon-close"
- >
- 不通过
- </el-button>
- <el-button @click="handleClose" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-else-if="currentDetail.status === 0">
- <el-button
- v-if="hasProcessingBtnPermission()"
- type="primary"
- :loading="dispatchLoading"
- @click="handleApproveAndDispatch"
- icon="el-icon-check"
- >
- 受理
- </el-button>
- <el-button
- v-if="hasProcessingBtnPermission()"
- type="danger"
- :loading="rejectLoading"
- @click="handleReject"
- icon="el-icon-close"
- >
- 不受理
- </el-button>
- <el-button @click="handleClose" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-if="currentDetail.status === 3">
- <!-- 处理中 -->
- <el-button
- v-if="hasProcessedAndOverBtnPermission()"
- type="primary"
- :loading="completeLoading"
- @click="handleComplete"
- icon="el-icon-circle-check"
- :disabled="!isCurrentUserAssigned"
- >
- 完成工单
- </el-button>
- <el-button @click="handleClose" icon="el-icon-circle-close">取消</el-button>
- </template>
- <template v-else-if="currentDetail.status === 4">
- <!-- 已完成 -->
- <el-button @click="handleClose" icon="el-icon-circle-close">取消</el-button>
- </template>
- </div>
- <div
- :class="currentIndex === totalItems - 1 ? 'disableds' : ''"
- class="leftBtn"
- @click="handleNext"
- >
- 下一页
- </div>
- </div>
- </div>
- </el-dialog>
-</template>
-
-<script setup>
-import { useStore } from 'vuex'
-import { ref, computed, watch, nextTick } from 'vue';
-import { flowEvent, getStepInfo } from '@/api/tickets/ticket';
-import { getSmallImg, getShowImg } from '@/utils/util';
-import CreateQRcode from '@/components/CreateQRcode/CreateQRcode.vue';
-import { ElMessage} from 'element-plus';
-const store = useStore()
-const userInfo = computed(() => store.state.user.userInfo)
-const isLoading = ref(false);
-// console.log('userInfo',userInfo.value);
-// 定义props
-const props = defineProps({
- modelValue: {
- type: Boolean,
- default: false
- },
- currentDetail: {
- type: Object,
- default: () => ({})
- },
- currentIndex: {
- type: Number,
- default: 0
- },
- totalItems: {
- type: Number,
- default: 0
- },
- algorithms: {
- type: Array,
- default: () => []
- },
- types: {
- type: Array,
- default: () => []
- },
- permission: {
- type: Object,
- default: () => ({})
- },
- stepStatusList: {
- type: Array,
- default: () => []
- },
- workType: {
- type: Number,
- default: 0
- }
-});
-
-// 定义emits
-
-const emit = defineEmits([
- 'update:modelValue',
- 'detail-success',
- 'detail-error',
- 'prev-item',
- 'next-item',
- 'update:currentDetail',
- 'approve-and-dispatch'
-]);
-
-// 响应式数据
-const stepInfos = ref([]);
-const totalTime = ref('');
-const approveLoading = ref(false);
-const rejectLoading = ref(false);
-const dispatchLoading = ref(false);
-const completeLoading = ref(false);
-const finalizeLoading = ref(false);
-const uploadRef = ref(null);
-const mapContainerRef = ref(null);
-
-// 计算属性
-const dialogVisible = computed({
- get() {
- return props.modelValue;
- },
- set(value) {
- emit('update:modelValue', value);
- }
-});
-
-const isEditMode = computed(() => {
- return props.currentDetail.status === -1;
-});
-// 是否有权限完成工单
-const isCurrentUserAssigned =computed(()=>{
- const handleUserId = props.currentDetail?.handle_user_id;
- const currentUserId = userInfo.value?.user_id;
- return !!handleUserId && !!currentUserId && String(handleUserId) === String(currentUserId);
-})
-const formattedDetailFields = computed(() => {
- const fields = [
- { label: '工单名称', value: props.currentDetail.orderName },
- {
- label: '工单类型',
- value: props.types.find(t => t.value === props.currentDetail.type)?.label || props.currentDetail.type,
- },
- { label: '关联任务', value: props.currentDetail.job_name || '/' },
- { label: '工单创建人', value: props.currentDetail.creator },
- { label: '当前状态', value: mapStatus(props.currentDetail.status) },
- { label: '事件地址', value: props.currentDetail.address || props.currentDetail.latAndLon },
- {
- label: '关联算法',
- value: props.algorithms.find(t => t.value === props.currentDetail.aiType)?.label || props.currentDetail.aiType,
- },
- { label: '发起单位', value: props.currentDetail.department },
- { label: '发起任务时间', value: props.currentDetail.startTime },
- { label: '所属机巢', value: props.currentDetail.device_names },
- { label: '工单来源', value: props.currentDetail.dataSources },
- { label: '工单内容', value: props.currentDetail.content },
- ];
-
- const filteredFields = fields.filter(field => field.value !== '/');
- const formattedFields = [];
- for (let i = 0; i < filteredFields.length; i += 2) {
- formattedFields.push({
- label1: filteredFields[i]?.label || '',
- value1: filteredFields[i]?.value || (filteredFields[i]?.label ? '暂无数据' : ''),
- label2: filteredFields[i + 1]?.label || '',
- value2: filteredFields[i + 1]?.value || (filteredFields[i + 1]?.label ? '暂无数据' : ''),
- });
- }
-
- return formattedFields;
-});
-
-// 监听
-watch(
- () => props.modelValue,
- (newVal) => {
- if (newVal) {
- loadStepInfo();
- initMap();
- }
- }
-);
-
-watch(
- () => props.currentDetail,
- (newVal) => {
- if (newVal && dialogVisible.value) {
- isLoading.value = true;
- setTimeout(() => {
- loadStepInfo();
- initMap();
- isLoading.value = false;
- }, 50);
-
- }
- },
- { deep: true }
-);
-
-// 方法
-const handleClose = () => {
- dialogVisible.value = false;
-};
-
-const handlePrev = () => {
- if (props.currentIndex > 0) {
- emit('prev-item');
- }
-};
-
-const handleNext = () => {
- if (props.currentIndex < props.totalItems - 1) {
- emit('next-item');
- }
-};
-
-const loadStepInfo = async () => {
- try {
- const stepResponse = await getStepInfo(props.currentDetail.orderNumber);
- const steps = Array.isArray(stepResponse.data.data)
- ? stepResponse.data.data
- : stepResponse.data.data?.steps || [];
-
- const finishedStep = steps.find(s => String(s.status) === '4');
- totalTime.value = finishedStep && finishedStep.total_time ? finishedStep.total_time : '';
-
- stepInfos.value = steps.map(step => ({
- status: String(step.status),
- name: step.name,
- time: step.time,
- create_time: step.create_time,
- }));
- } catch (error) {
- stepInfos.value = [];
- }
-};
-
-const initMap = () => {
- nextTick(() => {
- if (mapContainerRef.value && mapContainerRef.value.initAddEntity && props.currentDetail.location) {
- mapContainerRef.value.initAddEntity('point', props.currentDetail.location);
- }
- });
-};
-
-const mapStatus = (status) => {
- const statusTextMap = {
- 2: '待审核',
- 0: '待处理',
- 3: '处理中',
- 4: '已完成',
- };
- return statusTextMap[status] || '未知状态';
-};
-
-const getStepHandler = (status) => {
- const step = stepInfos.value.find(step => step.status === status);
- return step ? step.name : '';
-};
-
-const getStepTime = (status) => {
- const step = stepInfos.value.find(step => step.status === status);
- return step && step.time && step.time !== '0' ? step.time : false;
-};
-
-const getStepCreateTime = (status) => {
- const step = stepInfos.value.find(step => step.status === status);
- return step ? step.create_time : null;
-};
-
-const getActiveStep = () => {
- const arr = props.stepStatusList;
- const index = arr.indexOf(String(props.currentDetail.status));
- return index !== -1 ? index + 2 : 1;
-};
-
-const handleQRCode = (val) => {
- emit('update:currentDetail', {
- ...props.currentDetail,
- showQR: !val.showQR
- });
-};
-
-const getThumbUrl = (url) => {
- if (!url) return '';
- return getSmallImg(url);
-};
-
-const getPreviewUrl = (url) => {
- if (!url) return '';
- return getShowImg(url);
-};
-
-const hasProcessingBtnPermission = () => {
- return props.permission && props.permission.tickets_processing_btn === true;
-};
-
-const hasProcessedAndOverBtnPermission = () => {
- return props.permission && props.permission.tickets_view_processedAndOver === true;
-};
-// 通过不通过
-const hasReviewBtnPermission = () => {
- return props.permission && props.permission.tickets_review_btn === true;
-};
-
-// 文件操作方法
-const handleFileChange = (file, fileList) => {
- emit('update:currentDetail', {
- ...props.currentDetail,
- photos: fileList
- });
-};
-
-const handleUploadRemove = (file, fileList) => {
- emit('update:currentDetail', {
- ...props.currentDetail,
- photos: fileList
- });
-};
-
-const beforeUpload = (file) => {
- const isImage = file.type.includes('image');
- const isLt5M = file.size / 1024 / 1024 < 5;
-
- if (!isImage) {
- ElMessage.error('只能上传图片文件!');
- return false;
- }
- if (!isLt5M) {
- ElMessage.error('图片大小不能超过5MB!');
- return false;
- }
- return true;
-};
-
-// 工单操作方法
-const handleApprove = async () => {
- if (approveLoading.value) return;
- approveLoading.value = true;
-
- try {
- const data = {
- id: props.currentDetail.id,
- status: props.currentDetail.status,
- isPass: 0,
- eventNum: props.currentDetail.orderNumber,
- };
-
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- ElMessage.success('工单已通过');
- emit('detail-success');
- handleClose();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- ElMessage.error(error.message || '操作失败,请稍后重试');
- emit('detail-error', error);
- } finally {
- approveLoading.value = false;
- }
-};
-
-const handleReject = async () => {
- if (rejectLoading.value) return;
- rejectLoading.value = true;
-
- try {
- const data = {
- id: props.currentDetail.id,
- status: props.currentDetail.status,
- isPass: 1,
- };
-
- const response = await flowEvent(data);
- if (response.data.code === 0) {
- ElMessage.success('工单未通过');
- emit('detail-success');
- handleClose();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- } catch (error) {
- ElMessage.error(error.message || '操作失败,请稍后重试');
- emit('detail-error', error);
- } finally {
- rejectLoading.value = false;
- }
-};
-
-const handleApproveAndDispatch = () => {
- // 触发派发工单操作,由父组件处理
- emit('approve-and-dispatch', props.currentDetail);
-};
-
-const handleComplete = async () => {
- if (completeLoading.value) return;
- completeLoading.value = true;
- if (!props.currentDetail.processingDetail) {
- ElMessage.warning('请先填写事件处理详情');
- completeLoading.value = false;
- return;
- }
-
- if (!props.currentDetail.photos || props.currentDetail.photos.length === 0) {
- ElMessage.warning('请选择上传图片');
- completeLoading.value = false;
- return;
- }
- try {
- const data = {
- id: props.currentDetail.id,
- status: props.currentDetail.status,
- processingDetails: props.currentDetail.processingDetail,
- eventNum: props.currentDetail.orderNumber,
- };
- const file = props.currentDetail.photos?.[0]?.raw || null;
- const response = await flowEvent(data, file);
- if (response.data.code === 0) {
- ElMessage.success('工单已完成');
- emit('detail-success');
- handleClose();
- } else {
- throw new Error(response.data.msg || '操作失败');
- }
- handleClose();
- } catch (error) {
- console.error('完成工单失败:', error);
- ElMessage.error(error.message || '操作失败,请稍后重试');
- emit('detail-error', error);
- handleClose();
- } finally {
- completeLoading.value = false;
- handleClose();
- }
-};
-</script>
-
-<style lang="scss">
-.custom-dialog {
- height: 96vh;
-// min-height: 50vh;
- .el-dialog__body {
- border-top: 0.1rem solid #f0f0f0;
- }
-}
-
-.custom-qrcode-popover {
- min-width: 160px !important;
- min-height: 140px !important;
- position: relative;
-
- .qrcode-content {
- margin-top: 8px;
-
- .close-btn {
- position: absolute;
- top: 2px;
- right: 2px;
- width: 16px;
- height: 16px;
- line-height: 16px;
- text-align: center;
- cursor: pointer;
- color: #999;
- font-size: 16px;
- z-index: 10;
- }
- }
-}
-</style>
-<style lang="scss" scoped>
-.uploadImg {
- margin-bottom: 32px;
-}
-
-.tableCss {
- width: 100%;
- margin-bottom: 10px;
-}
-
-.step-timer {
- position: absolute;
- right: 92%;
- top: 50%;
- transform: translateY(-50%);
- width: 100px;
- margin-left: 4px;
- color: #666;
- font-size: 12px;
- white-space: nowrap;
-}
-
-.event-total-time {
- text-align: center;
- color: #666;
- font-size: 15px;
- margin-bottom: 12px;
-}
-
-.action-bar {
- margin-bottom: 16px;
-}
-
-.el-dialog {
- .el-form-item {
- margin-bottom: 20px;
- }
-}
-
-.el-upload {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
-
- :deep(.el-upload-list__item) {
- transition: all 0.3s ease;
- }
-
- :deep(.el-upload-list__item:hover) {
- background-color: #f5f7fa;
- }
-}
-
-.el-upload__tip {
- font-size: 12px;
- color: #909399;
- margin-top: 12px;
-}
-
-.create-ticket-form {
- padding: 20px 10px;
-
- .form-section {
- background-color: #fff;
- border-radius: 4px;
-
- .el-row {
- margin-bottom: 16px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
-
- .location-wrapper {
- width: 100%; // 修改为100%以适应父容器
- height: auto; // 修改为auto以自适应内容
-
- .map-button {
- width: 100%; // 让按钮填满容器宽度
- height: 36px; // 与其他输入框保持一致的高度
- display: flex;
- align-items: center;
- justify-content: center;
-
- i {
- margin-right: 4px;
- }
- }
-
- .location-text {
- margin-top: 8px;
- padding: 8px 12px;
- background-color: #f5f7fa;
- border-radius: 4px;
- color: #606266;
- font-size: 13px;
- line-height: 1.4;
- }
- }
-
- .upload-wrapper {
- .uploader {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 128px;
- }
-
- :deep(.el-upload-list__item) {
- width: 120px;
- height: 120px;
- }
- }
-
- .upload-tip {
- font-size: 12px;
- color: #909399;
- line-height: 1.4;
- margin-top: 8px;
- }
- }
-
- .el-form-item {
- margin-bottom: 18px;
-
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- :deep(.el-form-item__label) {
- font-weight: 500;
- color: #606266;
- }
- :deep(.el-textarea__inner) {
- padding: 8px 12px;
- }
- .full-width {
- width: 100%;
- }
-}
-
-:deep(.el-dialog__body) {
- border-top: 0.1rem solid #f0f0f0;
-}
-
-.dialog-footer-new {
- text-align: right;
- padding-top: 16px;
- border-top: 1px solid #ebeef5;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- }
- }
-}
-
-.dialog-footer1-new {
- position: sticky;
- bottom: 28px;
- left: 0;
- right: 0;
- background: white;
- z-index: 10;
- padding: 16px 20px;
- border-top: 1px solid #ebeef5;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .el-button + .el-button {
- margin-left: 12px;
- }
-
- .btngroups {
- margin-left: 12px;
- }
-
- .el-button {
- padding: 9px 20px;
-
- &:last-child {
- margin-left: 12px;
- margin-right: 12px;
- }
- }
-}
-
-.map-container {
- width: 100%;
- height: 400px;
- margin-bottom: 15px;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- overflow: hidden;
-
- :deep(.el-input-map) {
- height: 100%;
- }
-}
-
-.location-info {
- margin-top: 10px;
- padding: 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
-}
-
-.map-select {
- display: flex;
- align-items: flex-start;
- gap: 15px;
-
- .selected-location {
- flex: 1;
- padding: 5px 10px;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- p {
- margin: 5px 0;
- color: #606266;
- font-size: 14px;
- }
- }
-}
-
-.preview-image {
- border-radius: 4px;
- overflow: hidden;
- background-color: #f5f7fa;
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- height: 200px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-
- i {
- font-size: 32px;
- margin-bottom: 8px;
- }
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.detail-container {
- padding: 0 20px;
-
- .detail-top-title {
- display: flex;
- justify-content: center;
- align-items: center;
-
- .event-orderNumber {
- margin-right: 10px;
- }
- }
-}
-
-.status-flow {
- margin-bottom: 20px;
-
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 添加发起任务步骤的特殊样式
- .init-step-info {
- display: flex;
- flex-direction: column;
- align-items: center;
- text-align: center;
- width: 130px;
-
- .creator-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- margin-bottom: 4px;
- }
-
- .create-time {
- font-size: 10px;
- color: #909399;
- }
- }
-
- // 保持其他步骤的原有样式
- .step-info {
- display: flex;
- margin: 0;
- padding: 0;
- justify-content: space-between;
- align-items: center;
- width: 200px;
-
- .process-time {
- font-size: 10px;
- color: #909399;
- text-align: left;
- margin-left: -50%;
- padding-left: 0%;
- flex: 1;
- }
-
- .handler-name {
- font-size: 14px;
- font-weight: bold;
- color: #303133;
- text-align: left;
- flex: 1;
- }
- }
- }
-}
-
-.basic-info {
- margin-bottom: 20px;
-}
-
-.media-section {
- // margin-bottom: 20px;
-
- .el-row {
- display: flex;
- align-items: center;
- }
-}
-
-.leftBtn {
- width: 70px;
- height: 32px;
- background-color: #999;
- border-radius: 5px;
- text-align: center;
- line-height: 32px;
- color: #fff;
- cursor: pointer;
- opacity: 0.8;
-}
-
-.disableds {
- background: #999 !important;
- cursor: not-allowed !important;
- pointer-events: none;
- opacity: 0.3 !important;
-}
-
-.PopUpTableScrolls {
- max-height: 600px;
- overflow-y: scroll;
- overflow-x: hidden;
-
-}
-
-.media-box {
- width: 100%;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- padding: 10px;
- background: #fff;
- box-sizing: border-box;
-
- .media-title {
- font-weight: bold;
- margin-bottom: 5px;
- display: flex;
- align-items: center;
-
- .QRCodeImg {
- width: 18px;
- height: 18px;
- cursor: pointer;
- padding-bottom: 1px;
- }
- }
-
- .media-content {
- position: relative;
- height: 500px;
-
- :deep(.el-image) {
- width: 100% !important;
- max-width: 100%;
- max-height: 100%;
-
- .el-image__inner {
- width: 100%;
- height: 100%;
- object-fit: cover !important;
- }
- }
- }
-}
-
-.image-placeholder,
-.image-error,
-.no-media {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- color: #909399;
- background-color: #f5f7fa;
- border-radius: 4px;
-}
-
-.image-placeholder i,
-.image-error i {
- font-size: 32px;
- margin-bottom: 8px;
-}
-
-.no-media {
- border: 1px dashed #d9d9d9;
-}
-
-.info-table {
- margin-bottom: 20px;
-}
-
-.info-item {
- display: flex;
- margin-bottom: 10px;
-}
-
-.info-label {
- font-weight: bold;
- width: 120px;
- color: #606266;
-}
-
-.info-value {
- flex: 1;
- color: #303133;
- word-break: break-word;
-}
-
-.readonly-processing-detail {
- background-color: #f5f7fa;
- padding: 12px;
- border-radius: 4px;
- min-height: 30px;
- color: #606266;
- line-height: 1.5;
- display: block;
- text-align: left;
- margin-bottom: 5px;
-
- &:first-child {
- font-weight: bold;
- margin-bottom: 4px;
- }
-}
-
-// 添加删除按钮样式
-.danger-button {
- color: #f56c6c;
-}
-
-.danger-button:hover {
- color: #f78989;
-}
-
-.custom-steps-container {
- width: 100%;
- margin: 10px 0;
-}
-
-.steps-titles {
- display: flex;
- justify-content: space-between;
- margin-bottom: 14px;
- position: relative;
-}
-
-.step-title {
- text-align: center;
- flex: 1;
- font-size: 14px;
- color: #999;
- position: relative;
- padding-bottom: 5px;
-}
-
-.step-title.active {
- color: #409eff;
- font-weight: bold;
-}
-
-.event-title-center {
- text-align: center;
- font-size: 20px;
- font-weight: bold;
- margin-bottom: 5px;
- color: #333;
-}
-
-.custom-steps {
- margin-top: -20px;
-
- :deep(.el-step__description) {
- margin-top: 8px;
- padding: 0 20px;
- }
-}
-
-.step-description {
- font-size: 14px;
- color: #666;
- line-height: 1.5;
- display: block;
- text-align: center;
-
- &:first-child {
- font-weight: bold;
- margin-bottom: 4px;
- }
-}
-
-// 覆盖其他相关样式
-.status-flow {
- .custom-steps {
- .el-step__description {
- position: relative;
- margin: 0;
- padding: 0;
- }
-
- // 移除之前的样式
- .init-step-info,
- .step-info {
- display: block;
- width: auto;
- text-align: center;
- }
- }
-}
-/* 新建工单和处理工单的上传组件样式 */
-.create-upload,
-.detail-upload {
- :deep(.el-upload--picture-card) {
- width: 120px;
- height: 100px;
- line-height: 100px;
- }
-
- /* 隐藏额外的上传按钮 */
- :deep(.el-upload.el-upload--picture-card) {
- display: none;
- }
-
- /* 当没有图片时显示上传按钮 */
- :deep(.el-upload.el-upload--picture-card:first-child) {
- display: flex;
- }
-
- /* 上传组件的预览图片样式 */
- :deep(.el-upload-list--picture-card .el-upload-list__item) {
- width: 120px;
- height: 100px;
- }
-}
-
-/* 原有图片预览的样式 */
-.el-image-viewer__wrapper {
- :deep(.el-image-viewer__img) {
- max-width: 100%;
- max-height: 100%;
- object-fit: contain;
- }
-}
-
-/* 必填项样式 */
-.required-label {
- position: relative;
- display: inline-block;
-
- .required-star {
- color: #f56c6c;
- margin-right: 4px;
- }
-}
-
-/* 必填输入框样式 */
-.required-input {
- width: 100%;
-
- :deep(.el-input__inner),
- :deep(.el-textarea__inner) {
- &:focus {
- border-color: #409eff;
- }
- }
-}
-</style>
diff --git a/applications/mobile-web-view/env/.env b/applications/mobile-web-view/env/.env
index 0020e3c..a9205bb 100644
--- a/applications/mobile-web-view/env/.env
+++ b/applications/mobile-web-view/env/.env
@@ -23,5 +23,3 @@
#地址搜索服务
VITE_APP_SEARCH_URL = https://wrj.shuixiongit.com/gd-restapi-amap
-#算法平台地址
-VITE_APP_AI_PLAT_URL = http://192.168.1.54:30800
diff --git a/applications/mobile-web-view/env/.env.development b/applications/mobile-web-view/env/.env.development
index 335cf71..903d8ac 100644
--- a/applications/mobile-web-view/env/.env.development
+++ b/applications/mobile-web-view/env/.env.development
@@ -1,13 +1,3 @@
-###
- # @Author : yuan
- # @Date : 2025-06-18 11:40:10
- # @LastEditors : yuan
- # @LastEditTime : 2025-09-27 15:06:24
- # @FilePath : \.env.development
- # @Description :
- # Copyright 2025 OBKoro1, All Rights Reserved.
- # 2025-06-18 11:40:10
-###
#开发环境配置
VITE_APP_ENV = 'development'
@@ -27,13 +17,10 @@
# 航线文件地址
VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
-#管理后台地址
-VITE_APP_ADMIN_URL = 'https://wrj.shuixiongit.com/manage/'
+
#内嵌航线规划iframe地址
VITE_APP_WAY_LINE_PLAN = 'https://wrj.shuixiongit.com/bigScreen/#/layout/iframeWayline'
-# 地形存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
@@ -41,14 +28,9 @@
# 国土举证 图片和视频
VITE_APP_MEDIAPANEL_API_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
-#域名
-VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
# arcgis服务图层地址
VITE_APP_ARCGIS_URL = https://wrj.shuixiongit.com/arcgis116
#地址搜索服务
VITE_APP_SEARCH_URL = https://wrj.shuixiongit.com/gd-restapi-amap
-
-# 3Dtiles地址
-VITE_APP_3DTILE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_tiles
diff --git a/applications/mobile-web-view/env/.env.localhost b/applications/mobile-web-view/env/.env.localhost
index 14ee4a4..f299240 100644
--- a/applications/mobile-web-view/env/.env.localhost
+++ b/applications/mobile-web-view/env/.env.localhost
@@ -17,13 +17,10 @@
VITE_APP_AIRLINE_URL = http://192.168.1.227:80/minio/cloud-bucket
VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
-#管理后台地址
-VITE_APP_ADMIN_URL = 'http://192.168.1.227:5174/manage/'
+
#内嵌航线规划iframe地址
VITE_APP_WAY_LINE_PLAN = 'http://192.168.1.227:80/bigScreen/#/layout/iframeWayline'
-# 地形存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
@@ -31,8 +28,6 @@
# 国土举证 图片和视频
VITE_APP_MEDIAPANEL_API_URL = http://192.168.1.227:80/minio/cloud-bucket
-#域名
-VITE_APP_AREA_NAME = http://192.168.1.227:80/dji_in_rectangle
# arcgis服务图层地址
VITE_APP_ARCGIS_URL = http://192.168.1.227:80/arcgis116
diff --git a/applications/mobile-web-view/env/.env.production b/applications/mobile-web-view/env/.env.production
index 475e309..bc56c1b 100644
--- a/applications/mobile-web-view/env/.env.production
+++ b/applications/mobile-web-view/env/.env.production
@@ -4,10 +4,10 @@
# @LastEditors : yuan
# @LastEditTime : 2025-09-27 15:09:17
# @FilePath : \.env.production
- # @Description :
- # Copyright 2025 OBKoro1, All Rights Reserved.
+ # @Description :
+ # Copyright 2025 OBKoro1, All Rights Reserved.
# 2025-09-26 16:06:57
-###
+###
#生产环境配置
VITE_APP_ENV = 'production'
@@ -27,14 +27,10 @@
VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
-# 管理后台地址
-VITE_APP_ADMIN_URL = 'https://aisky.org.cn/manage/'
#内嵌航线规划iframe地址
VITE_APP_WAY_LINE_PLAN = 'https://aisky.org.cn/bigScreen/#/layout/iframeWayline'
-# 地形存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
@@ -42,14 +38,8 @@
# 国土举证 图片和视频
VITE_APP_MEDIAPANEL_API_URL = https://aisky.org.cn/minio/cloud-bucket
-#域名
-VITE_APP_AREA_NAME = https://aisky.org.cn
-
# arcgis服务图层地址
VITE_APP_ARCGIS_URL = https://aisky.org.cn/arcgis116
#地址搜索服务
VITE_APP_SEARCH_URL = https://aisky.org.cn/gd-restapi-amap
-
-# 3Dtiles地址
-VITE_APP_3DTILE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_tiles
diff --git a/applications/mobile-web-view/env/.env.test b/applications/mobile-web-view/env/.env.test
index 0d93f42..f285209 100644
--- a/applications/mobile-web-view/env/.env.test
+++ b/applications/mobile-web-view/env/.env.test
@@ -24,14 +24,9 @@
VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
-#管理后台地址
-VITE_APP_ADMIN_URL = 'https://wrj.shuixiongit.com/manage/'
#内嵌航线规划iframe地址
VITE_APP_WAY_LINE_PLAN = 'https://wrj.shuixiongit.com/bigScreen/#/layout/iframeWayline'
-
-# 地形存放地址
-VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/
# 行政区划存放地址
VITE_APP_REGION_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_region
@@ -39,11 +34,5 @@
# 国土举证 图片和视频
VITE_APP_MEDIAPANEL_API_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
-#域名
-VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
-
# arcgis服务图层地址
VITE_APP_ARCGIS_URL = https://wrj.shuixiongit.com/arcgis116
-
-# 3Dtiles地址
-VITE_APP_3DTILE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_tiles
diff --git a/applications/mobile-web-view/index.html b/applications/mobile-web-view/index.html
index 0005035..b150ba6 100644
--- a/applications/mobile-web-view/index.html
+++ b/applications/mobile-web-view/index.html
@@ -28,7 +28,7 @@
<link rel="stylesheet" href="/iconfont/common/iconfont.css" />
<link rel="stylesheet" href="/css/loading.css" />
<link rel="stylesheet" href="/css/saber.css" />
- <title>掌控智飞</title>
+ <title></title>
</head>
<body>
diff --git a/applications/mobile-web-view/src/appPages/work/workDetail/index.vue b/applications/mobile-web-view/src/appPages/work/workDetail/index.vue
index a3c2d32..90aada8 100644
--- a/applications/mobile-web-view/src/appPages/work/workDetail/index.vue
+++ b/applications/mobile-web-view/src/appPages/work/workDetail/index.vue
@@ -10,641 +10,82 @@
</van-swipe>
<van-image-preview v-model:show="previewShow" :images="getImageList" :initial-index="previewIndex" />
- <div class="detailTitle">
- <div class="titleText">
- <div class="itemStatus">
- <span v-if="currentDetail.status === 0" style="background-color: #ff7411"></span>
- <span v-else-if="currentDetail.status === 2" style="background-color: #ff472f"></span>
- <span v-else-if="currentDetail.status === 3" style="background-color: #ffc300"></span>
- <span v-else-if="currentDetail.status === 4" style="background-color: #06d957"></span>
- <div>{{ currentDetail.event_name }}</div>
- </div>
- <div class="timeNavigation">
- <p>{{ formatDate(currentDetail.create_time) }}</p>
- <img @click="jumpMap(currentDetail)" src="/src/appDataSource/appwork/navigation.svg"
- alt="" />
- </div>
- </div>
- </div>
</div>
</div>
- <!-- 步骤条 -->
- <div class="stepBox">
- <div class="stepContainer">
- <van-steps direction="vertical" :active="currentStep">
- <van-step v-for="(step, index) in displayedSteps" :key="step.status">
- <div class="horizontal-step">
- <span class="step-title" :class="getStatusClass(index)">{{ step.title }}</span>
+ <!-- 工单内容 -->
+ <div class="worderContainer">
+ <div class="workOrderContent">
+ <div class="workOrderTitle">工单内容</div>
+ <div class="workOrderContainer">
+ <div class="orderRow">
+ <div class="rowTitle">工单编号</div>
+ <div>{{ workDetailData.eventNum }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">工单处置人</div>
+ <div>{{ workDetailData.disposeUserName }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">处置部门</div>
+ <div>{{ workDetailData.disposeDeptName }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">拍摄时间</div>
+ <div>{{ workDetailData.shootTime }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">分发人员</div>
+ <div>{{ workDetailData.distributeUserName }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">分发部门</div>
+ <div>{{ workDetailData.distributeDeptName }}</div>
+ </div>
- <div class="step-desc" v-if="stepResponse[index]">
- <span>{{ stepResponse[index].name || '' }}</span>
- <span>{{ stepResponse[index].create_time || '' }}</span>
- </div>
- </div>
- </van-step>
- </van-steps>
- </div>
- </div>
- <!-- 工单内容 -->
- <div class="worderContainer">
- <div class="workOrderContent">
- <div class="workOrderTitle">工单内容</div>
- <div class="workOrderContainer">
- <div class="orderRow">
- <span class="required-mark" v-if="isEditable">*</span>
- <div class="rowTitle">工单名称</div>
- <div v-if="!isEditable">{{ currentDetail.event_name }}</div>
- <van-field v-else v-model="currentDetail.event_name" name="event_name" required
- input-align="right" placeholder="请输入" class="custom-field" />
- </div>
- <div class="orderRow">
- <div class="rowTitle">工单编号</div>
- <div>{{ currentDetail.event_num }}</div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">工单类型</div>
- <div>{{ workOrderTypeName }}</div>
- </div>
- <div class="orderRow" v-if="currentDetail.work_type == '0'">
- <div class="rowTitle">关联任务</div>
- <div>{{ currentDetail.job_name }}</div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">工单创建人</div>
- <div>{{ currentDetail.event_num?.slice(0, 2) === 'AI' ? '智飞agent' : currentDetail.create_user }}
- </div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">事件地址</div>
- <div class="addressBox" @click="jumpMap(currentDetail)">
- <div class="rowAddress">{{ currentDetail.address }}</div>
- <img class="pointing" src="/src/appDataSource/appwork/pointing.svg" alt="" />
- </div>
- </div>
-
- <div class="orderRow">
- <div class="guanlian">
- <span class="required-mark" v-if="isEditable">*</span>
- <div class="rowTitle">关联算法</div>
- </div>
- <div v-if="!isEditable">{{ currentDetail.ai_types }}</div>
- <div v-else>
- <span @click="openselect" class="selectTrigger">
- {{ currentDetail.ai_types }}
- <img class="downpointing" src="/src/appDataSource/appwork/downpointing.svg" alt="" />
- </span>
-
- <van-popup v-model:show="showPicker" destroy-on-close position="bottom"
- :close-on-click-overlay="true">
- <van-picker v-model="selectedValues" title="选择关联算法" :columns="columns"
- @confirm="onConfirm" @cancel="onCancel" />
- </van-popup>
- </div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">发起部门</div>
- <div>{{ currentDetail.dept_name }}</div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">发起任务时间</div>
- <div>{{ currentDetail.create_time }}</div>
- </div>
- <div class="orderRow">
- <div class="rowTitle">所属机巢</div>
- <div>{{ currentDetail.device_names }}</div>
- </div>
- <div class="orderRow">
- <span class="required-mark" v-if="isEditable">*</span>
- <div class="rowTitle">工单内容</div>
- <div v-if="!isEditable">{{ currentDetail.content }}</div>
- <van-field v-else class="custom-field" input-align="right" v-model="currentDetail.content"
- name="remark" required placeholder="请输入" />
- </div>
- <div class="rowCard" v-if="isEditableProcess">
- <div class="guanlian">
- <span class="required-mark">*</span>
- <div class="rowTitle">
- 上传图片
- <span>(只能上传jpg、jpeg、png照片,且不超过5M)</span>
- </div>
- </div>
- <div>
- <van-field name="uploader">
- <template #input>
- <van-uploader :disabled="!isCurrentUserAssigned" v-model="fileList"
- :after-read="afterRead" :max-count="1" :max-size="5 * 1024 * 1024"
- @oversize="onOversize" :before-read="beforeRead" @delete="handleDelete"
- accept="image/jpeg,image/jpg,image/png" />
- </template>
- </van-field>
- </div>
- </div>
- <div class="orderRow" v-if="isEditableProcess">
- <span class="required-mark">*</span>
- <div class="rowTitle">事件处理详情</div>
- <van-field class="custom-field" input-align="right" v-model="currentDetail.processingDetail"
- name="event_name" required placeholder="请输入" :disabled="!isCurrentUserAssigned" />
- </div>
- <div class="orderRow" v-if="isComplent">
- <div class="rowTitle">事件处理详情</div>
- <div>{{ currentDetail.processingDetail }}</div>
- </div>
- </div>
- </div>
- </div>
- <!-- 操作按钮 -->
- <div class="actionButton">
- <div class="floatingBtn leftFloatingBtn" @click="leftClick">
- <img src="/src/appDataSource/appwork/leftBtn1.svg" alt="" />
- </div>
- <div class="paginationInfo">
- <span>{{ currentPage }} / {{ totalRecords }}</span>
- </div>
- <div class="btngroups" v-if="currentDetail.status === 2">
- <van-button type="primary" color="#FF452C" round text="不通过" @click="rejectTicket"></van-button>
- <van-button type="primary" color="#1D6FE9" round text="通过" @click="approveTicket"></van-button>
- </div>
- <div class="btngroups" v-else-if="currentDetail.status === 0">
- <van-button type="primary" color="#FF452C" round text="不受理" @click="rejectTicket"></van-button>
- <van-button type="primary" color="#1D6FE9" round text="受理" @click="approveAndDispatch"></van-button>
- </div>
- <div class="btngroups" v-else-if="currentDetail.status === 3">
- <van-button type="primary" color="#FF452C" round text="取消" @click="cancellation"></van-button>
- <van-button :disabled="!isCurrentUserAssigned" type="primary" color="#1D6FE9" round text="完成工单"
- @click="completeTicket"></van-button>
- </div>
- <div class="btngroups back-btn" v-else>
- <van-button type="primary" round color="#FF730F" text="返回" @click="cancellation"></van-button>
- </div>
- <div class="floatingBtn rightFloatingBtn" @click="rightClick">
- <img src="/src/appDataSource/appwork/rightBtn1.svg" alt="" />
- </div>
- </div>
-
- <!--派发工单对话框-->
- <van-dialog v-model:show="isshowDispatch" title="派发工单" show-cancel-button @confirm="submitDispatch"
- @cancel="dispatchCancel">
- <van-field v-model="dispatchForm.departmentName" is-link readonly label="选择部门" placeholder="请选择部门"
- @click="openPicker('department')" />
- <van-field v-model="dispatchForm.handlerName" is-link readonly label="选择处理人" placeholder="请选择处理人"
- @click="openPicker('processor')" :disabled="!dispatchForm.department" />
- </van-dialog>
-
- <teleport to="body">
- <van-popup v-model:show="showGlobalPicker" position="bottom">
- <!-- 部门选择器 -->
- <van-picker v-if="currentPickerType === 'department'" v-model="selectedDepartment" title="选择部门"
- :columns="departments" @confirm="onDepartmentConfirm" @cancel="onPickerCancel" />
-
- <!-- 处理人选择器 -->
- <van-picker v-if="currentPickerType === 'processor'" v-model="selectedProcessor" title="选择处理人"
- :columns="availableDispatchHandlers" @confirm="onProcessorConfirm" @cancel="onPickerCancel" />
- </van-popup>
- </teleport>
+ <div class="orderRow">
+ <div class="rowTitle">分发时间</div>
+ <div>{{ workDetailData.distributeTime }}</div>
+ </div>
+ <div class="orderRow">
+ <div class="rowTitle">工单位置</div>
+ <div class="rowAddress" @click="jumpMap(workDetailData)">{{ workDetailData.eventLocation }}</div>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</template>
<script setup>
-import {ALL_WORK_ORDER_TYPE_OPTIONS} from '@ztzf/constants'
-
-import { getDeviceRegion } from '@/api/home/aggregation'
-import { usePermission } from '@/appPages/work/usePermission'
+import { showToast, showNotify, showImagePreview } from 'vant'
import { getShowImg, getSmallImg } from '@/utils/util'
import { useRoute } from 'vue-router'
-import { getStepInfo, getList, flowEvent, getTicketInfo } from '/src/api/work/index.js'
-import { showToast, showNotify, showImagePreview } from 'vant'
-import dayjs from 'dayjs'
-import _ from 'lodash'
-import { useStore } from 'vuex'
-const store = useStore()
-const userInfo = computed(() => store?.state?.user?.userInfo)
-const { permission, getButtonsApi } = usePermission()
-const showPicker = ref(false)
-const selectedValues = ref([])
-const columns = ref([])
-const allAlgorithms = ref([])
-const algorithms = ref([])
-const types = ref([]) //工单类型
-const eventNum = ref('')
-const currentStatus = ref(0)
-const stepResponse = ref([])
-const currentStep = ref(0)
+
const route = useRoute()
-const currentDetail = ref({ status: 0 })
-const currentIndex = ref(null) //当前显示数据索引
-const departments = ref([]) //部门
-const departmentUsers = ref({})
-const fileList = ref([])
-// 机巢数据
-let machineData = ref([])
-// 处理人选择相关
-const processorColumns = ref([])
-// 可编辑状态
-const isEditable = computed(() => currentDetail.value.status === 0)
-const isEditableProcess = computed(() => currentDetail.value.status === 3)
-const isComplent = computed(() => currentDetail.value.status === 4)
-// 工单内容
+
const workDetailData = ref({})
-// 分页相关
-const currentPage = ref(1)
-const pageSize = ref(1)
-const totalRecords = ref(0)
-const formatDate = dateString => {
- return dayjs(dateString).format('MM/DD HH:mm')
-}
-const allStepConfigs = ref([
- { title: '待审核', status: 2 },
- { title: '待处理', status: 0 },
- { title: '处理中', status: 3 },
- { title: '已完成', status: 4 },
-])
-const hasProcessingBtnPermission = () => {
- return permission.value && permission.value.tickets_processing_btn === true
-}
-// 完成工单
-const hasProcessedAndOverBtnPermission = () => {
- return permission.value && permission.value.tickets_view_processedAndOver === true
-}
-// 通过不通过
-const hasReviewBtnPermission = () => {
- return permission.value && permission.value.tickets_review_btn === true
-}
-// 是否有权限完成工单
-const isCurrentUserAssigned = computed(() => {
- const handleUserId = currentDetail.value?.handle_user_id
- const currentUserId = userInfo.value?.user_id
- return !!handleUserId && !!currentUserId && String(handleUserId) === String(currentUserId)
+
+// 预览图片
+const previewShow = ref(false)
+const previewIndex = ref(0)
+const getImageList = computed(() => {
+ const imageArr = []
+ const detail = workDetailData.value
+ if (detail.eventImageUrl) {
+ const smallUrl = getSmallImg(detail.eventImageUrl)
+ imageArr.push(smallUrl)
+ }
+ return imageArr
})
-const getStatusClass = index => {
- if (index <= currentStep.value) {
- const status = Number(stepResponse.value[index]?.status) || 0
- const statusClasses = {
- 2: 'status-pending', // 待审核
- 0: 'status-waiting', // 待处理
- 3: 'status-processing', // 处理中
- 4: 'status-completed', // 已完成
- }
- return statusClasses[status] || ''
- }
-
- return 'status-default'
-}
-// 关联算法
-const getTicketInfoData = async () => {
- const response = await getTicketInfo()
- const { dept_data, event_type, ai_type, info } = response.data.data
- allAlgorithms.value = info
-
- types.value = Object.entries(event_type).map(([key, value]) => ({
- label: value,
- value: key,
- }))
- departments.value = dept_data.map(item => ({
- text: item.dept_name,
- value: item.id,
- }))
- departmentUsers.value = dept_data.reduce((acc, dept) => {
- acc[dept.id] = dept.user_data || []
- return acc
- }, {})
-}
-// 处理人
-const availableDispatchHandlers = computed(() => {
- if (!dispatchForm.value.department) return []
- const users = departmentUsers.value[dispatchForm.value.department]
- if (!users) return []
- return users.map(user => ({
- text: user.name,
- value: user.id,
- }))
-})
-
-// 关联算法选择
-const handleTypeChange = typeValue => {
- const matchedCategory = allAlgorithms.value.find(category => category.dict_key === typeValue)
- if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) {
- // 无匹配的算法时清空
- algorithms.value = []
- return
- }
- algorithms.value = matchedCategory.algorithms.map(algo => ({
- label: algo.dict_value,
- value: algo.dict_key,
- dict_key: algo.dict_key,
- dict_value: algo.dict_value,
- }))
- columns.value = algorithms.value.map(item => ({
- text: item.label,
- value: item.value,
- }))
-}
-// 机巢数据
-const handleNodeClick = async data => {
- const droneList = await getDeviceRegion({ areaCode: userInfo.value.detail.areaCode })
- machineData.value = droneList?.data?.data
-}
-const tableData = ref([])
-
-const fetchWorkData = async (val) => {
- const params = {
- current: Number(currentPage.value) || 1,
- size: pageSize.value,
- source: 1,
- // event_name: val.keyword || val.eventNum,
- ai_types: val.aiType,
- way_line_job_info_id: val.wLJobInfoId,
- work_types: ALL_WORK_ORDER_TYPE_OPTIONS
- }
- if (val.status !== 'undefined') {
- params.status = val.status
- }
-
- const res = await getList(params)
- const response = res.data.data.records
-
- totalRecords.value = res.data.data.total || 0
- console.log(totalRecords.value,res.data.data.total,2222)
-
- if (response && response.length > 0) {
- const item = response[0]
- const matchedMachine = machineData.value.find(m => m.device_sn === item.device_sn)
- const deviceNickname = matchedMachine?.nickname || ''
-
- currentDetail.value = {
- ...item,
- processingDetail: item.processing_details,
- update_photo_url: item.update_photo_url,
- photos: [],
- aiType: item.ai_type_key_list?.join(',') || '',
- status: Number(item.status) || 0,
- device_names: deviceNickname ? deviceNickname : ''
- }
- currentStatus.value = currentDetail.value.status
- handleTypeChange(currentDetail.value.work_order_type_dict_key)
-
- await getStepInfoData(currentDetail.value.event_num)
- }
-}
-// 计算要显示的步骤
-const displayedSteps = computed(() => {
- return allStepConfigs.value.filter(stepConfig => {
- return stepResponse.value.some(stepData => Number(stepData?.status) === stepConfig.status)
+const openPreview = index => {
+ const detail = workDetailData.value
+ const showUrl = getShowImg(detail.eventImageUrl)
+ showImagePreview({
+ images: [showUrl],
+ startPosition: 0,
})
-})
-// 计算工单类型显示名称
-const workOrderTypeName = computed(() => {
- const type = types.value.find(item => item.value === currentDetail.value.work_order_type_dict_key)
- return type ? type.label : currentDetail.value.work_order_type_dict_key
-})
-// 步骤条
-const calculateCurrentStep = status => {
- const stepIndex = displayedSteps.value.findIndex(step => step.status === status)
- return stepIndex !== -1 ? stepIndex : 0
-}
-const getStepInfoData = async val => {
- const res = await getStepInfo(val)
- stepResponse.value = res.data.data.map(item => ({
- ...item,
- status: Number(item.status) || 0,
- }))
- currentStep.value = calculateCurrentStep(currentStatus.value)
-}
-// 通过
-const approveTicket = async () => {
- const data = {
- id: currentDetail.value.id,
- status: currentDetail.value.status,
- isPass: 0, // 0 表示通过
- eventNum: currentDetail.value.event_num,
- }
- const file = currentDetail.value.file || null
- const response = await flowEvent(data, file)
- if (response.data.code === 0) {
- showToast('工单已通过')
- }
-
- const transmitData = { data: { type: 'workback', fun: 'add' } }
- wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
- wx.miniProgram.postMessage(transmitData)
- uni.postMessage(transmitData)
-}
-// 不通过/不受理
-const rejectTicket = async () => {
- const data = {
- id: currentDetail.value.id,
- status: currentDetail.value.status,
- isPass: 1,
- }
- const response = await flowEvent(data)
- if (response.data.code === 0) {
- showToast('工单未通过')
- }
- const transmitData = { data: { type: 'workback', fun: 'add' } }
- wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
- wx.miniProgram.postMessage(transmitData)
- uni.postMessage(transmitData)
-}
-const isshowDispatch = ref(false)
-// 受理
-const approveAndDispatch = () => {
- if (!currentDetail.value.event_name) {
- showToast('请填写工单名称')
- return
- }
- if (!currentDetail.value.ai_types) {
- showToast('请选择关联算法')
- return
- }
- if (!currentDetail.value.content) {
- showToast('请填写工单内容')
- return
- }
- isshowDispatch.value = true
-}
-const dispatchCancel = () => {
- // 重置表单
- dispatchForm.value = {
- department: '',
- departmentName: '',
- handler: '',
- handlerName: '',
- }
- isshowDispatch.value = false
-}
-const dispatchForm = ref({
- department: '', // 存储部门ID (value)
- departmentName: '', // 显示部门名称 (text)
- handler: '', // 存储处理人ID (value)
- handlerName: '', // 显示处理人名称 (text)
-})
-
-const selectedDepartment = ref([])
-const selectedProcessor = ref([])
-const showGlobalPicker = ref(false)
-const currentPickerType = ref('')
-
-const openPicker = type => {
- currentPickerType.value = type
- showGlobalPicker.value = true
-}
-// 部门选择确认
-const onDepartmentConfirm = value => {
- dispatchForm.value.department = value.selectedValues[0]
- dispatchForm.value.departmentName = value.selectedOptions[0].text
- showGlobalPicker.value = false
-}
-// 处理人选择确认
-const onProcessorConfirm = value => {
- if (!dispatchForm.value.department) {
- showToast('请先选择部门')
- return
- }
- dispatchForm.value.handler = value.selectedValues[0]
- dispatchForm.value.handlerName = value.selectedOptions[0].text
- showGlobalPicker.value = false
-}
-
-// 取消选择
-const onPickerCancel = () => {
- showGlobalPicker.value = false
-}
-// 派发工单
-const submitDispatch = async () => {
- if (!dispatchForm.value.department) {
- showToast('请选择部门')
- return
- }
-
- if (!dispatchForm.value.handler) {
- showToast('请选择处理人')
- return
- }
-
- try {
- const data = {
- id: currentDetail.value.id,
- status: currentDetail.value.status,
- isPass: 0,
- eventName: currentDetail.value.event_name,
- eventNum: currentDetail.value.event_num,
- workOrderTypeDictKey: currentDetail.value.work_order_type_dict_key,
- content: currentDetail.value.content,
- createDept: dispatchForm.value.department,
- updateUser: dispatchForm.value.handler,
- aiType: currentDetail.value.aiType,
- }
- const file = currentDetail.value.file || null
- const response = await flowEvent(data, file)
- if (response.data.code === 0) {
- showToast('工单派发成功')
- const transmitData = { data: { type: 'workback', fun: 'add' } }
- wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
- wx.miniProgram.postMessage(transmitData)
- uni.postMessage(transmitData)
- isshowDispatch.value = false
- }
- } catch (error) {
- showToast('工单派发失败')
- }
-}
-
-// 完成工单
-const completeTicket = async () => {
- if (!currentDetail.value.processingDetail) {
- showToast('请先填写事件处理详情')
- return
- }
- if (!currentDetail.value.photos || currentDetail.value.photos.length === 0) {
- showToast('请选择上传图片')
- return
- }
- const data = {
- id: currentDetail.value.id,
- status: currentDetail.value.status,
- processingDetails: currentDetail.value.processingDetail,
- eventNum: currentDetail.value.event_num,
- }
- const file = currentDetail.value.photos?.[0] || null
- const response = await flowEvent(data, file)
- if (response.data.code === 0) {
- showToast('工单已完成')
- }
- const transmitData = { data: { type: 'workback', fun: 'add' } }
- wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
- wx.miniProgram.postMessage(transmitData)
- uni.postMessage(transmitData)
-}
-// 取消
-const cancellation = () => {
- const transmitData = { data: { type: 'workback', fun: 'add' } }
- wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
- wx.miniProgram.postMessage(transmitData)
- uni.postMessage(transmitData)
-}
-
-// 下拉选择
-const openselect = () => {
- showPicker.value = true
-}
-// 选择器确认方法
-const onConfirm = val => {
- currentDetail.value.ai_types = val.selectedOptions.map(option => option.text).join(',')
- currentDetail.value.aiType = val.selectedValues.join(',')
- showPicker.value = false
-}
-// 选择器取消方法
-const onCancel = () => {
- showPicker.value = false
-}
-// 文件上传前的校验
-const beforeRead = file => {
- const ext = file.name.split('.').pop().toLowerCase()
- const allowedExts = ['jpg', 'jpeg', 'png']
- if (!allowedExts.includes(ext)) {
- showToast('请上传 jpg/jpeg/png 格式图片')
- return false
- }
- return true
-}
-// 文件大小超过限制时的回调
-const onOversize = file => {
- showToast('文件大小不能超过 5MB')
-}
-// 文件读取完成后的回调
-const afterRead = file => {
- currentDetail.value.photos = [file.file]
-}
-// 处理图片删除
-const handleDelete = () => {
- currentDetail.value.photos = []
-}
-// 更新当前显示的工单详情
-const updateCurrentDetail = () => {
- currentDetail.value = tableData.value[currentIndex.value]
- if (currentDetail.value.status !== undefined) {
- currentDetail.value.status = Number(currentDetail.value.status) || 0
- }
- currentStatus.value = currentDetail.value.status
- getStepInfoData(currentDetail.value.event_num)
-}
-// 上一页
-const leftClick = () => {
- if (currentPage.value > 1) {
- currentPage.value--
- fetchWorkData(route.query)
- } else {
- showToast('已经是第一页')
- }
-}
-
-// 下一页
-const rightClick = () => {
- if (currentPage.value < totalRecords.value) {
- currentPage.value++
- fetchWorkData(route.query)
- } else {
- showToast('已经是最后一页')
- }
+ previewIndex.value = index
+ previewShow.value = true
}
// 跳转地图
const jumpMap = item => {
@@ -653,57 +94,15 @@
wx.miniProgram.postMessage(transmitData)
uni.postMessage(transmitData)
}
-// 预览图片
-const previewShow = ref(false)
-const previewIndex = ref(0)
-const getImageList = computed(() => {
- const imageArr = []
- const detail = currentDetail.value
-
- if (detail.photo_url) {
- const smallUrl = getSmallImg(detail.photo_url)
- imageArr.push(smallUrl)
- }
-
- if (detail.update_photo_url) {
- const smallUrl = getSmallImg(detail.update_photo_url)
- imageArr.push(smallUrl)
- }
-
- return imageArr
-})
-
-const openPreview = index => {
- const detail = currentDetail.value
- const showUrl = getShowImg(detail.photo_url || detail.update_photo_url)
- showImagePreview({
- images: [showUrl],
- startPosition: 0,
- })
- previewIndex.value = index
- previewShow.value = true
-}
onMounted(async () => {
- handleNodeClick()
- eventNum.value = route.query.eventNum || ''
- await getTicketInfoData()
- currentPage.value = route.query.current
- await fetchWorkData(route.query)
- await getStepInfoData(eventNum.value)
- currentIndex.value = tableData.value.findIndex(item => item.event_num === currentDetail.value.event_num)
-
+workDetailData.value = JSON.parse(route.query.workDetailData)
+console.log('route.query',workDetailData.value);
})
</script>
<style lang="scss" scoped>
.workDetailContainer {
- position: relative;
-
- .required-mark {
- color: #ff4d4f; // 红色
- margin-left: 4px;
- }
-
+ padding-top: 44px;
.detailTop {
.image-container {
position: relative;
@@ -716,255 +115,6 @@
display: block;
object-fit: cover;
}
-
- .detailTitle {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- padding: 5px;
- height: 30px;
- background: rgba(7, 7, 7, 0.4);
- }
-
- .titleText {
- display: flex;
- width: 100%;
- justify-content: space-between;
- align-items: center;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 13px;
- color: #ffffff;
-
- .itemStatus {
- display: flex;
- align-items: center;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 13px;
- color: #ffffff;
-
- span {
- display: inline-block;
- width: 10px;
- height: 10px;
- border-radius: 50%;
- margin-right: 7px;
- }
- }
- }
-
- .timeNavigation {
- display: flex;
- align-items: center;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 13px;
- color: #ffffff;
-
- img {
- width: 20px;
- height: 20px;
- margin-left: 5px;
- }
- }
- }
- }
-
- .stepBox {
- padding: 0 12px;
- }
-
- .stepContainer {
- margin-top: 10px;
- display: flex;
-
- border-radius: 5px;
- padding: 10px;
- background: #fff;
-
- :deep() {
- .van-step__circle-container {
- font-size: 20px;
- }
-
- .van-step__circle {
- width: 15px;
- height: 15px;
- }
-
- .van-step--vertical {
- padding: 20px 20px 20px 0;
- }
-
- .van-step__circle-container,
- .van-step__line {
- top: 50%;
- }
-
- .van-step--vertical:not(:last-child):after {
- border-bottom-width: 0;
- }
- }
-
- .horizontal-step {
- display: flex;
- align-items: center;
- gap: 12px;
-
- .step-title {
- min-width: 60px;
- background: #e8e8e8;
- padding: 5px;
- border-radius: 5px;
- text-align: center;
-
- &.status-pending {
- background-color: #ffebeb; // 待审核
- color: #ff1414;
- }
-
- &.status-waiting {
- background-color: #fff1e6; // 待处理
- color: #ff7411;
- }
-
- &.status-processing {
- background-color: #fff6d8; // 处理中
- color: #ffbb00;
- }
-
- &.status-completed {
- background-color: #e5fcff; // 已完成
- color: #0291a1;
- }
-
- &.status-default {
- background-color: #e8e8e8; // 默认背景色
- color: #191919;
- }
- }
-
- .step-desc {
- display: flex;
- justify-content: space-between;
- gap: 28px;
- color: #222324;
- font-size: 14px;
- }
-
- .step-desc span:first-child {
- width: 60px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- span:last-child {
- margin-left: auto;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
-
- :deep(.van-step__circle) {
- width: 8px;
- height: 8px;
- }
-
- /* 悬浮左右按钮样式 */
- .floatingBtn {
- position: fixed;
- top: 50%;
- width: 46px;
- height: 46px;
- z-index: 9;
- transform: translateY(-50%);
- background: rgba(17, 17, 17, 0.28);
- backdrop-filter: blur(3px);
- border-radius: 50%;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- .leftFloatingBtn {
- left: 5px;
- /* 左边距离 */
- }
-
- .rightFloatingBtn {
- right: 5px;
- /* 右边距离 */
- }
-
- .floatingBtn img {
- width: 10px;
- height: 18px;
- }
-
- .paginationInfo {
- position: absolute;
- left: 50%;
- transform: translateX(-50%);
- font-size: 14px;
- color: #666;
- background: rgba(255, 255, 255, 0.9);
- padding: 4px 12px;
- border-radius: 12px;
- }
-
- .actionButton {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 61px;
- background: #ffffff;
- border-radius: 6px 6px 6px 6px;
- padding: 0 18px;
-
- .btngroups {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .van-button {
- padding: 9px 20px;
- height: 38px;
- width: 156px;
-
- &:last-child {
- margin-left: 12px;
- }
- }
- }
-
- .back-btn :deep(.van-button) {
- width: 100%;
- width: 324px;
- margin-left: 0px !important;
- }
-
- .leftBtn {
- width: 27px;
- height: 27px;
- cursor: pointer;
-
- img {
- width: 27px;
- height: 27px;
- }
- }
-
- .disableds {
- background: #999 !important;
- cursor: not-allowed !important;
- pointer-events: none;
- opacity: 0.3 !important;
}
}
@@ -986,12 +136,10 @@
font-weight: bold;
font-size: 16px;
color: #222324;
- // margin-bottom: 16px;
}
.workOrderContainer {
.orderRow {
- // margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: center;
@@ -1034,35 +182,16 @@
}
.rowAddress {
+ font-family: Source Han Sans CN, Source Han Sans CN;
+ font-weight: 400;
font-size: 14px;
color: #1d6fe9;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- text-overflow: ellipsis;
- // max-width: 74%;
+ text-decoration: underline;
+ text-align: right;
padding-top: 1px;
padding-left: 5px;
padding-right: 2px;
}
-
- .selectTrigger {
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 14px;
- color: #222324;
- }
-
- .pointing {
- width: 8px;
- height: 12px;
- }
-
- .downpointing {
- width: 12px;
- height: 7px;
- }
-
:deep(.custom-field) {
padding: 0 !important;
padding-left: 10px !important;
@@ -1072,20 +201,8 @@
padding: 0 !important;
}
- .titketName {
- display: flex;
- align-items: center;
- }
}
}
- .upload-link {
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 12px;
- color: #1d6fe9;
- cursor: pointer;
- text-decoration: underline;
- }
}
</style>
diff --git a/applications/mobile-web-view/src/layout/Header.vue b/applications/mobile-web-view/src/layout/Header.vue
deleted file mode 100644
index 8356c79..0000000
--- a/applications/mobile-web-view/src/layout/Header.vue
+++ /dev/null
@@ -1,251 +0,0 @@
-<!--
- * @Author : yuan
- * @Date : 2025-06-13 09:42:10
- * @LastEditors : yuan
- * @LastEditTime : 2025-06-13 11:23:40
- * @FilePath : \src\layout\Header.vue
- * @Description :
- * Copyright 2025 OBKoro1, All Rights Reserved.
- * 2025-06-13 09:42:10
--->
-<template>
- <div class="header">
- <div class="h-left">
- <div
- v-for="(item, index) in leftList"
- :key="index"
- class="left-item"
- :class="{ active: item.active, 'dom-visibility': item.hidden }"
- @click="handleClick(item)"
- >
- {{ item.name }}
- </div>
- </div>
- <div class="big-title">{{ baseHeaderTitle }}</div>
- <div class="h-right">
- <div
- v-for="(item, index) in rightList"
- :key="index"
- class="right-item"
- :class="{ active: item.active, 'dom-visibility': item.hidden }"
- @click="handleClick(item)"
- >
- {{ item.name }}
- </div>
- </div>
- </div>
-</template>
-
-<script setup>
-import { ref, onMounted } from 'vue'
-import { useRouter, useRoute } from 'vue-router'
-import { Message } from '@element-plus/icons-vue'
-import { ElMessage } from 'element-plus'
-import { ELocalStorageKey } from '@/utils/http/enums'
-import { useStore } from 'vuex'
-
-import getBaseConfig from '@/buildConfig/config'
-import { getConfigApi } from '@/api/home'
-
-const { menuLeftList, meneRightList, headerTitle } = getBaseConfig()
-
-const router = useRouter()
-const route = useRoute()
-
-const store = useStore()
-
-const baseHeaderTitle = ref(headerTitle)
-
-const leftList = ref(menuLeftList)
-
-const rightList = ref(meneRightList)
-
-const handleClick = ({ path, name }) => {
- const adminUrl = import.meta.env.VITE_APP_ADMIN_URL
- if (['系统运维'].includes(name)) {
- window.open(`${adminUrl}wel/index`, '_blank')
- return
- }
- // if (!['首页', '任务管理', '集群调度', '航线规划', 'AI识别分析', '数据中心'].includes(name))
- // return ElMessage.warning('正在加急开发中...')
- // 更新 leftList 的 active 状态
- leftList.value.forEach(item => {
- item.active = item.path === path
- })
-
- // 更新 rightList 的 active 状态
- rightList.value.forEach(item => {
- item.active = item.path === path
- })
- // 跳转到指定页面
- router.push(path)
-}
-// 重置所有菜单项的active状态
-const updateActiveMenu = path => {
- leftList.value.forEach(item => {
- item.active = item.path === path
- })
- rightList.value.forEach(item => {
- item.active = item.path === path
- })
-}
-// 监听跳转到数据中心
-watch(
- [() => store.state.dataCenter?.jumpDataCenter, () => route.path],
- ([jumpVal, currentPath], [oldJumpVal, oldPath]) => {
- // 跳转数据中心逻辑
- if (jumpVal) {
- updateActiveMenu('/dataCenter')
- }
-
- // 路由变化时恢复状态
- if (currentPath !== oldPath) {
- if (currentPath !== '/dataCenter') {
- store.commit('setJumpDataCenter', null)
- }
- updateActiveMenu(currentPath)
- }
- },
- { immediate: true }
-)
-// 监听从巡检任务概况提交的数据
-watch(
- [() => store.state.task.jumpTask, () => route.path],
- ([newVal, newPath], [oldVal, oldPath]) => {
- if (newVal) {
- const currentPath = '/taskManage'
- leftList.value.forEach(item => {
- item.active = item.path === currentPath
- })
- }
-
- if (newPath !== oldPath) {
- if (newPath !== '/taskManage') {
- store.commit('setJumpTask', {})
- }
- }
- leftList.value.forEach(item => {
- item.active = item.path === newPath
- })
- },
- { deep: true, immediate: true }
-)
-
-// 获取系统配置
-function getConfig() {
- getConfigApi().then(res => {
- const title = res?.data?.data?.name
- if (title){
- baseHeaderTitle.value = title
- }
- })
-}
-onMounted(() => {
- // 初始化 leftList 的 active 状态
- const currentPath = route.path
- leftList.value.forEach(item => {
- item.active = item.path === currentPath
- })
-
- // 初始化 rightList 的 active 状态
- rightList.value.forEach(item => {
- item.active = item.path === currentPath
- })
- getConfig()
-})
-</script>
-
-<style scoped lang="scss">
-.header {
- width: calc(100% - 57px - 59px);
- margin-left: 57px;
- padding-top: 30px;
- display: flex;
- justify-content: space-between;
- // position: relative;
-
- .h-left {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .left-item {
- width: 105px;
- height: 39px;
- background: url(@/assets/images/header-left.png) no-repeat;
- background-size: 100% 100%;
- margin-right: 3px;
- font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
- font-weight: 400;
- font-size: 18px;
- color: #ffffff;
- line-height: 42px;
- text-align: center;
- font-style: normal;
- text-transform: none;
- cursor: pointer;
- }
-
- .active {
- background: url(@/assets/images/header-active.png) no-repeat;
- background-size: 100% 100%;
- }
- }
-
- .big-title {
- position: relative;
- top: -12px;
- left: 8px;
- // border: 1px solid red;
- width: 710px;
- height: 58px;
- line-height: 58px;
- font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
- font-weight: 400;
- font-size: 48px;
- line-height: 53px;
- letter-spacing: 3px;
- text-shadow: 0px 4px 1px rgba(19, 80, 143, 0.66), 0px 0px 18px rgba(130, 165, 255, 0.4),
- inset 0px 0px 2px rgba(255, 255, 255, 0.8);
- text-align: center;
- font-style: normal;
- text-transform: none;
- background: linear-gradient(180deg, #ffffff 23%, #e9f8ff 46%, #77baff 76%);
- -webkit-background-clip: text;
- color: transparent;
- background-clip: text;
- }
-
- .h-right {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .right-item {
- width: 105px;
- height: 39px;
- background: url(@/assets/images/header-right.png) no-repeat;
- background-size: 100% 100%;
- margin-right: 3px;
- font-family: YouSheBiaoTiHei, YouSheBiaoTiHei, serif;
- font-weight: 400;
- font-size: 18px;
- color: #ffffff;
- line-height: 42px;
- text-align: center;
- font-style: normal;
- text-transform: none;
- cursor: pointer;
- }
-
- .active {
- background: url(@/assets/images/header-active-right.png) no-repeat;
- background-size: 100% 100%;
- }
- }
-}
-
-.dom-visibility {
- visibility: hidden;
-}
-</style>
diff --git a/applications/mobile-web-view/src/layout/showTips.vue b/applications/mobile-web-view/src/layout/showTips.vue
deleted file mode 100644
index 9bfee92..0000000
--- a/applications/mobile-web-view/src/layout/showTips.vue
+++ /dev/null
@@ -1,189 +0,0 @@
-<template>
- <div class="messagePrompt" v-if="allUnreadItems.length > 0 && showTip">
- <div
- class="messageList"
- :style="{ transform: `translateY(-${currentIndex * 3.8}rem)`, transition: 'transform 0.5s ease' }"
- >
- <div class="messageItem" v-for="(item, index) in allUnreadItems" :key="index">
- <div class="messageleft">
- <img src="@/assets/images/warning.png" alt="" />
- <span class="dots"></span>
- <div class="infodetail">
- <span>{{ item.name }}</span>
- <span>{{ item.date }}</span>
- </div>
- </div>
- <div class="messagebtn" @click="stopmessagetip">不再提醒</div>
- </div>
- </div>
- </div>
-</template>
-
-<script setup>
-import { useStore } from 'vuex'
-import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
-import notificationSound from '@/assets/audio/audio_8652e075da.mp3'
-import { getOrderOrEventApi } from '@/api/home'
-
-const store = useStore()
-const consoleShow = computed(() => store?.state?.task?.consoleShow)
-let audio = new Audio()
-audio.src = notificationSound
-audio.volume = 1
-audio.loop = true
-audio?.pause()
-const userInfo = computed(() => store.getters.userInfo)
-const todosData = computed(() => store.state.common?.todosData)
-const dateRange = computed(() => store.state.home.eventTimeRang)
-const showTip = ref(true)
-const currentIndex = ref(0)
-let carouselTimer = null
-const hasUnread = computed(() => todosData.value?.some(i => !i?.is_read))
-const allUnreadItems = computed(() => todosData.value?.filter(i => !i.is_read) || [])
-const newunread = ref(null)
-let refreshInterval = null // 自动刷新待办事项(每5秒)
-let pauseTimeout = null // 1分钟后暂停播放
-let cfTimeout = null //5分钟重复一次
-let retryTimeout = null // 1分钟后重试弹框
-const yzxs = ref(true) //一值提醒
-const todosParams = {
- type: 1,
- area_code: userInfo.value.detail.areaCode,
- start_time: dateRange.value[0],
- end_time: dateRange.value[1],
-}
-
-// 轮播
-const startCarousel = () => {
- if (carouselTimer) clearInterval(carouselTimer)
- if (allUnreadItems.value.length <= 1) return
-
- carouselTimer = setInterval(() => {
- currentIndex.value = (currentIndex.value + 1) % allUnreadItems.value.length
- }, 3000)
-}
-// 停止消息提示
-const stopmessagetip = () => {
- showTip.value = false
- yzxs.value = false // 设置手动关闭标志
- clearInterval(carouselTimer)
- audio?.pause()
-}
-watch(allUnreadItems, val => {
- if (!showTip.value) return
-
- if (val && !consoleShow.value && yzxs.value) {
- startCarousel()
- audio?.play()
- } else {
- audio?.pause()
- clearInterval(carouselTimer)
- }
-})
-
-// 获取待办事项
-const getListMatter = async () => {
- const res = await getOrderOrEventApi(todosParams)
- if (!res.data.data || res.data.data?.length === 0) {
- store.commit('setTodosData', [])
- return
- }
- const oldList = (todosData.value || []).filter(i => !i.is_read).map(i => i.id)
- const newList = (res.data.data || []).filter(i => !i.is_read).map(i => i.id)
- const hasNewItem = newList.filter(item => !oldList.includes(item))
- newunread.value = hasNewItem
- if (hasNewItem.length > 0) {
- showTip.value = true
- audio?.play()
- startCarousel()
- }
- store.commit('setTodosData', res.data.data)
-}
-const startAutoRefresh = () => {
- refreshInterval = setInterval(getListMatter, 5000)
-}
-
-watch(
- dateRange,
- newVal => {
- if (newVal) {
- todosParams.start_time = newVal[0]
- todosParams.end_time = newVal[1]
- getListMatter()
- }
- },
- { deep: true }
-)
-
-onMounted(() => {
- getListMatter()
- startAutoRefresh()
- startCarousel()
-})
-
-onBeforeUnmount(() => {
- refreshInterval && clearInterval(refreshInterval)
- pauseTimeout && clearTimeout(pauseTimeout)
- cfTimeout && clearInterval(cfTimeout)
- retryTimeout && clearTimeout(retryTimeout)
- clearInterval(carouselTimer)
- audio?.pause()
- audio = null
-})
-</script>
-
-<style scoped lang="scss">
-.messagePrompt {
- position: absolute;
- top: 105px;
- left: 50%;
- transform: translateX(-50%);
- color: #ffffff;
- border-radius: 4px;
- font-size: 14px;
- width: 633px;
- height: 38px;
- overflow: hidden;
- background: url('@/assets/images/warninfobg.png') no-repeat center;
- background-size: 100% 100%;
-
- .messageList {
- height: 38px;
- width: 100%;
- }
-
- .messageItem {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 633px;
- height: 38px;
- .messageleft {
- display: flex;
- align-items: center;
- margin-left: 85px;
- img {
- width: 32px;
- height: 32px;
- }
- .dots {
- display: inline-block;
- width: 6px;
- height: 6px;
- background: #ff5741;
- border-radius: 50%;
- }
- .infodetail {
- display: flex;
- width: 332px;
- justify-content: space-between;
- margin-left: 7px;
- }
- }
- .messagebtn {
- cursor: pointer;
- margin-right: 57px;
- }
- }
-}
-</style>
diff --git a/applications/mobile-web-view/src/layout/useGlobalWS.js b/applications/mobile-web-view/src/layout/useGlobalWS.js
deleted file mode 100644
index 2bf11b0..0000000
--- a/applications/mobile-web-view/src/layout/useGlobalWS.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import { onMounted } from 'vue'
-import { getWebsocketUrl } from '@/utils/websocket/config'
-import { useConnectWebSocket } from '@/utils/websocket/connect-websocket'
-import { useStore } from 'vuex'
-import dayjs from 'dayjs'
-import { aLinkDownloadUtil } from '@/utils/util'
-import EventBus from '@/utils/eventBus'
-import { getStore, setStore } from '@/utils/store'
-
-export const useGlobalWS = () => {
- const store = useStore()
- const loginUserInfo = computed(() => store.state.user.userInfo)
- const downloadProgress = computed(() => store.state.common.downloadProgress)
- let currentWebSocket = null
-
- // 下载进度处理
- function downloadProcessing(payload) {
- const {type,status,progress,download_url} = payload?.data || {}
- let setProgress = 0
- if (status === 'PENDING'){
- setProgress = 1
- }else if(status === 'CANCELLED'){
- setProgress = 100
- }else if(status !== 'COMPLETED' && progress === 100){
- setProgress = 99
- }else{
- setProgress = progress
- }
- store.commit('setDownloadProgress', {
- ...downloadProgress.value,
- [type]: setProgress,
- })
- if (status === 'COMPLETED' && ['dpsjzx','dplsrwxq'].includes(type)) {
- const name = `数据中心-${dayjs().format('YYYYMMDDHHmmss')}.zip`
- const currentUrl = getStore({name: 'downloadUrl'})
- if (currentUrl === download_url && download_url!== undefined) return
- aLinkDownloadUtil(download_url, name)
- setStore({ name: 'downloadUrl', content: download_url })
- }
- }
-
- const logOut = () => {
- store.commit('SET_THEME_NAME', '')
- store.dispatch('LogOut').then(() => {
- router.push({ path: '/login' })
- setTimeout(() => location.reload())
- })
- }
- function messageHandler(payload) {
- switch (payload.biz_code) {
- case 'JOB_ISREFRESH':
- store.commit('jobUpdateKeyAdd')
- break
- case 'DEVICE_ISREFRESH':
- store.commit('deviceUpdateKeyAdd')
- break
- case 'DOWNLOAD_PROGRESS':
- downloadProcessing(payload)
- break
- case 'LOGOUT_USER':
- logOut()
- break
- }
- }
-
- onMounted(() => {
- let webSocketUrl = getWebsocketUrl() + `&model_type=3&workspace-id=${loginUserInfo.value.userId}`
- currentWebSocket = useConnectWebSocket((result)=>{
- const payload = JSON.parse(result)
- messageHandler(payload)
- }, webSocketUrl)
- EventBus.on('useGlobalWS-messageHandler',messageHandler)
- })
-
- onBeforeUnmount(() => {
- currentWebSocket?.close()
- EventBus.off('useGlobalWS-messageHandler',messageHandler)
- })
- return {}
-}
diff --git a/applications/mobile-web-view/src/page/GatewayPage/GatewayPage.vue b/applications/mobile-web-view/src/page/GatewayPage/GatewayPage.vue
deleted file mode 100644
index 42f8394..0000000
--- a/applications/mobile-web-view/src/page/GatewayPage/GatewayPage.vue
+++ /dev/null
@@ -1,171 +0,0 @@
-<template>
- <div :class="{ GatewayPage: true, 'narrowScreen': narrowScreen }">
- <div class="gateway-page">
- <div class="logo" v-if="isShowAiSkyLogo">
- <img src="@/assets/images/login/aisky-logo.png" alt="" />
- </div>
- <div class="title">{{ gateTitle }}</div>
- <div class="en-title">{{ gateTitleEn }}</div>
- <div class="card-warp">
- <div
- class="card"
- v-for="(item, index) in cardList"
- :key="index"
- @mouseenter="activeIndex = index"
- @mouseleave="activeIndex = -1"
- >
- <div
- @click="activeClick(activeIndex)"
- class="card-bg"
- :style="{
- background: `url(${activeIndex === index ? item.active : item.normal}) no-repeat center 100% / 100%`,
- }"
- :class="{
- 'hover-image': activeIndex === index,
- }"
- ></div>
- </div>
- </div>
- </div>
- </div>
-</template>
-
-<script setup>
-import { useRouter, useRoute } from 'vue-router'
-import { ElMessage } from 'element-plus'
-
-import getBaseConfig from '@/buildConfig/config'
-
-const { gateTitle, gateTitleEn, isShowAiSkyLogo, gatewayMenu } = getBaseConfig()
-
-const router = useRouter()
-
-// 图片数据
-const cardList = ref([...gatewayMenu])
-const activeIndex = ref(-1) // 当前激活的卡片索引
-
-function activeClick(index) {
- if (index === 0) {
- const adminUrl = import.meta.env.VITE_APP_ADMIN_URL
- window.location.href = `${adminUrl}wel/index`
- }
- if (index === 1) {
- router.push('/index')
- }
- if (index === 2) {
- const url = encodeURIComponent(window.location.href)
- const { VITE_APP_AI_PLAT_URL } = import.meta.env
- window.location.href = `${VITE_APP_AI_PLAT_URL}/login?autoEnter=1&formUrl=${url}`
- // window.open(`http://localhost:8013/login?autoEnter=1&formUrl=${url}`)
- }
-}
-
-const narrowScreen = ref(false)
-const narrowScreenFun = () => {
- // 监听窗口变化,计算是不是 窄屏幕
- narrowScreen.value = window.innerWidth / window.innerHeight < 16 / 9
-}
-
-onMounted(() => {
- narrowScreenFun()
- window.addEventListener('resize', narrowScreenFun)
- document.title = 'appWebview'
-})
-</script>
-
-<style lang="scss" scoped>
-.GatewayPage {
- position: relative;
- background: #020f25;
- width: 100%;
- height: 100%;
-
- overflow-x: auto;
- scrollbar-width: none; /* Firefox 隐藏滚动条 */
- &::-webkit-scrollbar {
- display: none; /* Chrome、Safari 隐藏滚动条 */
- }
-
- &.narrowScreen {
- > div {
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- }
- > div {
- left: 0;
- top: 0;
- position: absolute;
- height: 1080px;
- width: 1920px;
- }
- .gateway-page {
- background: url('@/assets/images/login/gateway-bg.png') center no-repeat;
- background-size: 100% 100%;
- }
- .logo {
- position: absolute;
- left: 52px;
- top: 44px;
- img {
- width: 156px;
- height: 44px;
- }
- }
- .title {
- position: absolute;
- left: 184px;
- top: 294px;
- width: 968px;
- height: 110px;
- font-family: Segoe UI, Segoe UI;
- font-weight: bold;
- font-size: 60px;
- color: #ffffff;
- line-height: 99px;
- letter-spacing: 5px;
- text-align: left;
- }
- .en-title {
- position: absolute;
- left: 190px;
- top: 396px;
- width: 968px;
- height: 80px;
- font-family: Segoe UI, Segoe UI;
- font-weight: 600;
- font-size: 26px;
- color: #ffffff;
- line-height: 72px;
- letter-spacing: 3px;
- text-align: left;
- }
- .card-warp {
- position: absolute;
- top: 540px;
- left: 50%;
- display: flex;
- gap: 50px; /* 卡片间距 */
- z-index: 1;
- transform: translate(-50%, 0);
-
- .card {
- position: relative; /* 确保子元素绝对定位基于卡片 */
- width: 564px;
- height: 416px;
- cursor: pointer;
-
- .card-bg {
- width: 564px;
- height: 416px;
- border-radius: 8px; /* 可选:圆角效果 */
- }
-
- .hover-image {
- transform: scale(1.05);
- }
- }
- }
-}
-</style>
diff --git a/applications/mobile-web-view/src/permission.js b/applications/mobile-web-view/src/permission.js
index 6daf3b4..d475668 100644
--- a/applications/mobile-web-view/src/permission.js
+++ b/applications/mobile-web-view/src/permission.js
@@ -78,6 +78,6 @@
const isLoginPage = to.path === '/login'
// 根据是否登录页设置标题
// const pageTitle = isLoginPage ? 'appWebview' : 'appWebview'
- document.title = to.meta.title || '掌控智飞'
+ document.title = to.meta.title || ''
store.commit('SET_IS_SEARCH', false)
})
diff --git a/applications/task-work-order/env/.env b/applications/task-work-order/env/.env
index fd35dce..67e7e5f 100644
--- a/applications/task-work-order/env/.env
+++ b/applications/task-work-order/env/.env
@@ -1,6 +1,9 @@
#接口地址
VITE_APP_API=/api
+# 开发环境代理接口地址
+VITE_APP_URL=http://192.168.1.168
+
#开发环境代理接口地址-xt
VITE_APP_API_XT=/apiXT
@@ -22,4 +25,5 @@
# 预览地址 previewURL
VITE_APP_PREVIEW_URL=http://192.168.1.36:8012
-VITE_APP_TERRAIN_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_c_uas/
\ No newline at end of file
+#地形服务地址
+VITE_APP_TERRAIN_URL=https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_c_uas/
diff --git a/applications/task-work-order/env/.env.development b/applications/task-work-order/env/.env.development
index 5b55661..8179aa3 100644
--- a/applications/task-work-order/env/.env.development
+++ b/applications/task-work-order/env/.env.development
@@ -7,7 +7,7 @@
VITE_APP_URL=http://192.168.1.227
#新大屏地址
-VITE_APP_DASHBOARD_URL='https://wrj.shuixiongit.com/command-center-dashboard/'
+VITE_APP_DASHBOARD_URL=''
# ws地址
VITE_APP_WS_API_URL=wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
diff --git a/applications/task-work-order/env/.env.production b/applications/task-work-order/env/.env.production
index ec45574..91f581e 100644
--- a/applications/task-work-order/env/.env.production
+++ b/applications/task-work-order/env/.env.production
@@ -4,11 +4,8 @@
#生产环境配置
VITE_APP_ENV='production'
-# 服务地址
-VITE_APP_URL=https://aisky.org.cn/api
-
#新大屏地址
-VITE_APP_DASHBOARD_URL='https://aisky.org.cn/command-center-dashboard/'
+VITE_APP_DASHBOARD_URL=''
# ws地址
VITE_APP_WS_API_URL=wss://aisky.org.cn/drone-wss/api/v1/ws
diff --git a/applications/task-work-order/env/.env.test b/applications/task-work-order/env/.env.test
index 71ff553..1d98fff 100644
--- a/applications/task-work-order/env/.env.test
+++ b/applications/task-work-order/env/.env.test
@@ -1,33 +1,10 @@
-###
- # @Author : yuan
- # @Date : 2026-02-03 13:46:08
- # @LastEditors : yuan
- # @LastEditTime : 2026-02-03 15:44:11
- # @FilePath : \applications\task-work-order\env\.env.test
- # @Description :
- # Copyright 2026 OBKoro1, All Rights Reserved.
- # 2026-02-03 13:46:08
-###
-###
- # @Author : yuan
- # @Date : 2026-02-03 13:46:08
- # @LastEditors : yuan
- # @LastEditTime : 2026-02-03 15:44:01
- # @FilePath : \applications\task-work-order\env\.env.test
- # @Description :
- # Copyright 2026 OBKoro1, All Rights Reserved.
- # 2026-02-03 13:46:08
-###
NODE_ENV='test'
#开发环境配置
VITE_APP_ENV='test'
-# 服务地址
-VITE_APP_URL=https://wrj.shuixiongit.com/api
-
#新大屏地址
-VITE_APP_DASHBOARD_URL='https://wrj.shuixiongit.com/command-center-dashboard/'
+VITE_APP_DASHBOARD_URL=''
# ws地址
VITE_APP_WS_API_URL=wss://wrj.shuixiongit.com/drone-wss/api/v1/ws
diff --git a/applications/task-work-order/src/views/orderView/appConfiguration/process/index.vue b/applications/task-work-order/src/views/orderView/appConfiguration/process/index.vue
index 5899df8..05e5914 100644
--- a/applications/task-work-order/src/views/orderView/appConfiguration/process/index.vue
+++ b/applications/task-work-order/src/views/orderView/appConfiguration/process/index.vue
@@ -28,12 +28,12 @@
</el-form>
<div class="gd-table-toolbar">
- <el-button :icon="Plus" color="#4C34FF" type="primary" v-if="permission.flow_model_create" @click="handleCreate">
+ <el-button :icon="Plus" color="#4C34FF" type="primary" @click="handleCreate">
创建
</el-button>
<el-button
:icon="Delete"
- v-if="permission.flow_model_delete"
+
@click="handleBatchDelete"
>
删除
@@ -61,9 +61,9 @@
<el-table-column prop="lastUpdated" show-overflow-tooltip label="更新时间" />
<el-table-column label="操作" class-name="operation-btns" width="200">
<template v-slot="{ row }">
- <el-link type="primary" v-if="permission.flow_model_update" @click="handleUpdate(row)">配置</el-link>
- <el-link type="primary" v-if="permission.flow_model_deploy" @click="handleDeploy(row)">部署</el-link>
- <el-link type="primary" v-if="permission.flow_model_delete" @click="handleDelete(row)">删除</el-link>
+ <el-link type="primary" @click="handleUpdate(row)">配置</el-link>
+ <el-link type="primary" @click="handleDeploy(row)">部署</el-link>
+ <el-link type="primary" @click="handleDelete(row)">删除</el-link>
</template>
</el-table-column>
</el-table>
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
index e50d0aa..3c6a5c3 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
@@ -91,7 +91,9 @@
</el-table-column>
<el-table-column prop="taskStatus" show-overflow-tooltip label="巡查任务状态">
<template v-slot="{ row }">
- {{ getDictLabel(row.taskStatus, dictObj.taskStatus) }}
+ <span :style="{color: colors?.[row?.taskStatus]}">
+ {{ getDictLabel(row.taskStatus, dictObj.taskStatus) }}
+ </span>
</template>
</el-table-column>
<el-table-column prop="executeTime" show-overflow-tooltip label="任务执行时间" />
@@ -174,6 +176,19 @@
const activeName = ref('all')
provide('dictObj', dictObj)
+const colors = {
+ 0: '#F6A000',//0待签收
+ 1: '#FF0202',//1拒绝签收
+ 2: '#FF0202',//2已撤回
+ 3: '#212BF4',//3待审核
+ 4: '#FF0000',//4审核驳回
+ 5: '#0068F0',//5审核通过
+ 6: '#FD6716',//6待验收
+ 7: '#FF0000',//7拒绝验收
+ 8: '#019612',//8验收通过
+}
+
+
// 获取列表
async function getList() {
const range = dateRangeFormat(dateRange.value)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
index 2645760..2955350 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
@@ -90,7 +90,9 @@
</el-table-column>
<el-table-column prop="status" show-overflow-tooltip label="阶段状态">
<template v-slot="{ row }">
- {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus).split('_')[0] }}
+ <span :style="{color: colors?.[row?.workOrderStatus]}">
+ {{ getDictLabel(row.workOrderStatus, dictObj.workOrderStatus).split('_')[0] }}
+ </span>
</template>
</el-table-column>
<el-table-column prop="workOrderStatus" show-overflow-tooltip label="工单状态">
@@ -236,6 +238,20 @@
})
}
+const colors = {
+ 10: '#AE00FF',
+ 11: '#AE00FF',
+ 20: '#002BFF',
+ 21: '#002BFF',
+ 22: '#002BFF',
+ 23: '#002BFF',
+ 30: '#FF5106',
+ 31: '#FF5106',
+ 40: '#FF0000',
+ 50: '#008CFF',
+ 60: '#019612',
+}
+
// 删除
async function handleDelete(row) {
const tips = row ? '该条' : '选中的项'
--
Gitblit v1.9.3