From 7b3de0d64e0ec5b932ee04c6a2126606a64e2962 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Fri, 11 Apr 2025 11:34:13 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue |   13 ++++--
 src/utils/cesium-tsa.js                                             |    1 
 src/views/Home/EventOverviewDetail/EventOverviewDetailRight.vue     |    8 +++
 src/views/TaskManage/SearchBox.vue                                  |    8 ++--
 src/views/TaskManage/TaskIntermediateContent/AddTask.vue            |   20 +++++++--
 src/views/TaskManage/TaskIntermediateContent/initPointWayline.js    |   43 ++++++++++++++++++---
 6 files changed, 70 insertions(+), 23 deletions(-)

diff --git a/src/utils/cesium-tsa.js b/src/utils/cesium-tsa.js
index 7d61703..c8bc0dd 100644
--- a/src/utils/cesium-tsa.js
+++ b/src/utils/cesium-tsa.js
@@ -151,7 +151,6 @@
     minimumLevel: 3,
   })
   const _init = async id => {
-    console.log(id,'顶顶顶')
     Cesium.Camera.DEFAULT_VIEW_FACTOR = -0.45
     // 西南东北,默认显示中国
     Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(66, 4, 135, 53.55)
diff --git a/src/views/Home/EventOverviewDetail/EventOverviewDetailRight.vue b/src/views/Home/EventOverviewDetail/EventOverviewDetailRight.vue
index 72bdb59..bc9785a 100644
--- a/src/views/Home/EventOverviewDetail/EventOverviewDetailRight.vue
+++ b/src/views/Home/EventOverviewDetail/EventOverviewDetailRight.vue
@@ -38,7 +38,13 @@
 
 		<div class="eventList">
 			<div class="eventListItem" v-for="item in list">
-				<img class="eventListItemImg" :src="item.photo_url" alt="" />
+				<img class="eventListItemImg" 
+      	:src="item.photo_url ? 
+        item.photo_url.substring(0, item.photo_url.lastIndexOf('.')) + '_small' + 
+        item.photo_url.substring(item.photo_url.lastIndexOf('.')) 
+        : ''" 
+      alt="" 
+    />
 				<div class="eventListItemText">
 					<div class="eventListItemName">{{ item.event_name }}</div>
 					<div @click="positioning(item)">定位</div>
diff --git a/src/views/TaskManage/SearchBox.vue b/src/views/TaskManage/SearchBox.vue
index a9eb886..dfa9c47 100644
--- a/src/views/TaskManage/SearchBox.vue
+++ b/src/views/TaskManage/SearchBox.vue
@@ -97,10 +97,10 @@
   create_dept: '', // 创建部门
   date_enum: '', // 日期枚举,可用值:TODAY,CURRENT_WEEK,CURRENT_MONTH,CURRENT_YEAR
   device_sn: '', // 设备编号
-  end_date: '', // 结束时间
+  end_date: null, // 结束时间
   industry_type: '', // 行业key
   key_word: '', // 模糊搜索关键词(匹配名称/昵称/设备sn)
-  start_date: '', // 开始时间
+  start_date: null, // 开始时间
   status: '' // 作业状态
 });
 
@@ -117,8 +117,8 @@
 const handleSearch = () => {
   emit('search', {
     ...searchForm,
-    start_date: dateRange.value.length ? `${dateRange.value[0]} 00:00:00` : '',
-    end_date: dateRange.value.length ? `${dateRange.value[1]} 23:59:59` : ''
+    start_date: dateRange.value.length ? `${dateRange.value[0]} 00:00:00` : null,
+    end_date: dateRange.value.length ? `${dateRange.value[1]} 23:59:59` : null
   });
 };
 
diff --git a/src/views/TaskManage/TaskIntermediateContent/AddTask.vue b/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
index 451704a..6846ab1 100644
--- a/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/AddTask.vue
@@ -22,7 +22,7 @@
 					</div>
 					<div class="item">任务时间:
 						<el-time-picker
-							v-model="searchForm.execute_time_arr"
+							v-model="timeSlot"
 							placeholder="选择时间"
 							format="HH:mm"
 							value-format="HH:mm"/>
@@ -98,6 +98,7 @@
 // 添加子组件引用
 const taskTableRef = ref(null);
 const taskData = ref('');
+const timeSlot = ref('');
 const searchForm = reactive({
 	name: '',
 	ai_types: [],
@@ -198,13 +199,13 @@
     return;
   }
 	// 检查任务时间
-  if (searchForm.execute_time_arr) {
+  if (timeSlot.value) {
     const now = new Date();
     const today = now.toDateString();
     const selectedDate = new Date(taskData.value).toDateString();
     
     if (today === selectedDate) {
-      const [hours, minutes] = searchForm.execute_time_arr.split(':');
+      const [hours, minutes] = timeSlot.value.split(':');
       const selectedTime = new Date();
       selectedTime.setHours(parseInt(hours), parseInt(minutes));
       
@@ -217,14 +218,23 @@
       }
     }
   }
+	if (searchForm.dock_sns.length === 0) {
+		ElMessage({
+			message: '请选择机场',
+			type: 'warning'
+		});
+		return;
+	}
 	searchForm.begin_time = `${taskData.value} 00:00:00`;
   searchForm.end_time = `${taskData.value} 23:59:59`;
-	
+	searchForm.execute_time_arr = timeSlot.value ? [timeSlot.value] : [];
 	createTask(searchForm).then((res) => {
 		if (res.data.code === 0) {
 			ElMessage.success('任务创建成功');
 			// 关闭当前窗口,刷新任务管理列表
 			isShowAddTask.value = false;
+			// 清除数据
+			cancel();
 			emit('refresh');
 		}
 	});
@@ -237,7 +247,7 @@
   searchForm.file_id = '';
   searchForm.begin_time = '';
   searchForm.end_time = '';
-  searchForm.execute_time_arr = '';
+  timeSlot.value = '';
   searchForm.remark = '';
   searchForm.dock_sns = [];
   rangDate.value = [];
diff --git a/src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue b/src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue
index 6e2d512..15f4358 100644
--- a/src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue
+++ b/src/views/TaskManage/TaskIntermediateContent/CurrentTaskDetails.vue
@@ -27,8 +27,12 @@
 import cesiumOperation from '@/utils/cesium-tsa';
 import { useStore } from 'vuex';
 
+import { initPointWayline } from './initPointWayline';
+
+const { parsingFiles } = initPointWayline()
+
 const { _init, viewerDestory } = cesiumOperation()
-const store = useStore();
+
 
 const isShowCurrentTaskDetails = defineModel('show');
 const props = defineProps({
@@ -40,7 +44,6 @@
 
 // 获取直播地址
 const getVideoUrl = () => {
-  console.log(props.rowData, '当前任务详情');
   liveStart(props.rowData.deviceSns).then(res => {
     if (res.data.code !== 0) return;
     airPortUrl.value = res.data.data.rtcs_url;
@@ -50,9 +53,9 @@
 // 获取任务详情获取航线文件
 const getTaskDetails = () => {
 	getJobDetails({ wayLineJobInfoId: props.rowData.id }).then(res => {
-    console.log(res.data.data, '顶顶顶');
 		if (res.data.data.way_lines && res.data.data.way_lines.length === 1) {
-      const line = res.data.data.way_lines[0].url
+      // console.log(window.$viewer,'顶顶顶顶')
+      parsingFiles(res.data.data.way_lines[0].url, window.$viewer);
     }
 	})
 }
@@ -66,7 +69,7 @@
 // 监听 rowData 变化
 watch(() => props.rowData, (newVal) => {
   if (newVal && Object.keys(newVal).length) {
-    getVideoUrl();
+    // getVideoUrl();
     getTaskDetails();
   }
 }, { deep: true, immediate: true });
diff --git a/src/views/TaskManage/TaskIntermediateContent/initPointWayline.js b/src/views/TaskManage/TaskIntermediateContent/initPointWayline.js
index a53aabe..dd007f5 100644
--- a/src/views/TaskManage/TaskIntermediateContent/initPointWayline.js
+++ b/src/views/TaskManage/TaskIntermediateContent/initPointWayline.js
@@ -21,22 +21,29 @@
  * 
  * @param { 单点航线 相关功能} url 
  */
-export const initPointWayline = (url) => {
+export const initPointWayline = () => {
   
-  let viewer = window.$viewer;
+  let viewer = null;
+  
 
   // 解析kmz文件
-  const parsingFiles = async (url) => {
-    const { fileInfoObj } = analyzeKmzFile(`${url}?_t=${new Date().getTime()}`);
-    const xmlStr = fileInfoObj['wpmz/template.kml']
-    const xmlJson = XMLToJSON(xmlStr)?.['Document']
+  const parsingFiles = async (url,viewer) => {
+    viewer = viewer;
+    console.log('initPointWayline', viewer);
+    const res = await analyzeKmzFile(`${url}?_t=${new Date().getTime()}`)
+		const waylinesXML = await res.fileInfoObj['wpmz/waylines.wpml']
+		const xmlJson = XMLToJSON(waylinesXML)?.['Document'];
     if (xmlJson.Folder.Placemark.length) return;
     drawWayline(xmlJson)
   };
   // 在地图上画线
   const drawWayline = (xmlJson) => {
-    const points = xmlJson?.['Folder']?.['Placemark'];
+    let positions = [];
+    // 获取点的位置
+    const points = xmlJson.Folder.Placemark;
+    console.log('points', points);
     getPositionsHeight(points, viewer, 100).then((result) => {
+      console.log(result);
       positions = result.map((item) => {
         return Cesium.Cartesian3.fromDegrees(
           Number(item.longitude),
@@ -46,7 +53,29 @@
       });
       result.forEach((item, index) => {
         let setting = {};
+        setting = {
+          id: 'route_point_' + index,
+          position: positions[index],
+
+          label: {
+            text: `${index + 1}`,
+            font: 'bold 14px serif',
+            style: globalCesium.LabelStyle.FILL,
+            verticalOrigin: globalCesium.VerticalOrigin.CENTER, // 垂直居中
+            horizontalOrigin: globalCesium.HorizontalOrigin.CENTER, // 水平居中
+            pixelOffset: new globalCesium.Cartesian2(0, 0), // 根据需要调整偏移量
+            eyeOffset: new globalCesium.Cartesian3(0, 0, -10) // 使标签在点的上方
+          },
+
+          point: {
+            pixelSize: 24,
+            color: new globalCesium.Color.fromBytes(255, 186, 0, 255),
+          },
+        }
+        viewer.entities.add(setting)
       });
     });
   };
+
+  return { parsingFiles };
 };
\ No newline at end of file

--
Gitblit v1.9.3