Browse Source

对接告警信息

李富豪 1 year ago
parent
commit
1f3a683a29

+ 18 - 0
Web/src/api/custom/index.ts

@@ -23,6 +23,16 @@ export type CreateDeviceFeedbackApiParams = {
     }[],
 };
 
+export type FetchDeviceHmsListApiParams = Partial<{
+    begin_time: number,
+    end_time: number,
+    level: number,
+    language: string,
+    message: string,
+    page: number,
+    page_size: number,
+}>;
+
 export type SignLoginApiParams = {
     username: string,
     client_id: string,
@@ -106,6 +116,7 @@ export type FetchDeviceLogListApi = (sn: string, params: { domain_list: string }
 export type FetchDeviceFeedbackRecordListApi = (sn: string, params: FetchDeviceFeedbackRecordListApiParams) => Promise<any>;
 export type FetchDeviceLogDetailApi = (params: { logsId: string }) => Promise<any>;
 export type CreateDeviceFeedbackApi = (sn: string, data: CreateDeviceFeedbackApiParams) => Promise<any>;
+export type FetchDeviceHmsListApi = (data: FetchDeviceHmsListApiParams) => Promise<any>;
 export type SignLoginApi = (data: SignLoginApiParams) => Promise<any>;
 export type FetchDeviceModelApi = (params?: { flg: boolean }) => Promise<any>;
 export type FetchDeviceStatusApi = (params: { snList: string }) => Promise<any>;
@@ -155,6 +166,12 @@ const createDeviceFeedbackApi: CreateDeviceFeedbackApi = async (sn, data) => {
     return res.data;
 };
 
+// 获取设备告警信息
+const fetchDeviceHmsListApi: FetchDeviceHmsListApi = async (data) => {
+    const res = await request.get(`/manage/api/v1/devices/${getWorkspaceId()}/devices/hms`, { params: data });
+    return res.data;
+};
+
 // 密钥登录
 const signLoginApi: SignLoginApi = async (data) => {
     const res = await request.post('/manage/api/v1/signLogin', data);
@@ -293,6 +310,7 @@ export const apis = {
     fetchDeviceFeedbackRecordList: fetchDeviceFeedbackRecordListApi,
     fetchDeviceLogDetail: fetchDeviceLogDetailApi,
     createDeviceFeedback: createDeviceFeedbackApi,
+    fetchDeviceHmsList: fetchDeviceHmsListApi,
     signLogin: signLoginApi,
     fetchDeviceModel: fetchDeviceModelApi,
     fetchDeviceStatus: fetchDeviceStatusApi,

+ 0 - 2
Web/src/components/airport/components/InfoModal.vue

@@ -631,10 +631,8 @@ const onStart = async () => {
   }
   const videoId = `${props.osdInfo.sn}/${cameraValue}/${videoValue || 'normal-0'}`;
   state.videoId = videoId;
-  const liveURL = config.rtmpURL;
   try {
     const res = await startLivestream({
-      url: liveURL,
       video_id: videoId,
       url_type: 1,// RTMP 
       video_quality: state.clarityValue

+ 2 - 2
Web/src/components/devices/changeRecord/components/Search.vue

@@ -16,7 +16,7 @@
           <a-input style="width: 200px;" placeholder="项目名称、设备SN" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -82,7 +82,7 @@ onMounted(async () => {
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   const data = {
     ...values,

+ 1 - 1
Web/src/components/devices/changeRecord/index.vue

@@ -2,7 +2,7 @@
   <div class="changeRecord">
     <Search :onClickSearch="onClickSearch" :onClickReset="onClickReset" />
     <div class="changeRecord-table">
-      <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="device_sn"
+      <a-table :scroll="{ x: '100%', y: 500 }"  rowKey="device_sn"
         :loading="state.listLoading" :columns="columns" @change="refreshData" :rowClassName="rowClassName"
         :dataSource="state.list" :pagination="paginationConfig">
         <!-- 设备型号 -->

+ 101 - 181
Web/src/components/devices/device-hms/DeviceHmsDrawer.vue

@@ -1,71 +1,40 @@
 <template>
   <a-drawer title="设备告警信息" placement="right" v-model:visible="sVisible" @update:visible="onVisibleChange"
     :destroyOnClose="true" :width="800">
-    <div class="flex-row flex-align-center" style="margin-bottom: 20px;">
-      <div style="width: 240px;">
-        <a-range-picker v-model:value="time" format="YYYY-MM-DD" @change="onTimeChange" />
-      </div>
-      <div class="ml5">
-        <a-select style="width: 150px" v-model:value="param.level" @select="onLevelSelect">
-          <a-select-option v-for="item in levels" :key="item.label" :value="item.value">
-            {{ item.label }}
-          </a-select-option>
-        </a-select>
-      </div>
-      <div class="ml5">
-        <a-select v-model:value="param.domain" :disabled="!param.children_sn || !param.device_sn" style="width: 150px"
-          @select="onDeviceTypeSelect">
-          <a-select-option v-for="item in deviceTypes" :key="item.label" :value="item.value">
-            {{ item.label }}
-          </a-select-option>
-        </a-select>
-      </div>
-      <div class="ml5">
-        <a-input-search v-model:value="param.message" placeholder="搜索告警信息" style="width: 200px" @search="getHms" />
-      </div>
-    </div>
-    <div>
-      <a-table :columns="hmsColumns" :scroll="{ x: '100%', y: 600 }" :data-source="hmsData.data"
-        :pagination="hmsPaginationProp" @change="refreshHmsData" row-key="hms_id" :rowClassName="rowClassName"
-        :loading="loading">
-        <template #time="{ record }">
-          <div>{{ record.create_time }}</div>
-          <div :style="record.update_time ? '' : record.level === EHmsLevel.CAUTION ? 'color: orange;' :
-            record.level === EHmsLevel.WARN ? 'color: red;' : 'color: #28d445;'">
-            {{ record.update_time ?? 'It is happening...' }}</div>
-        </template>
-        <template #level="{ text }">
-          <div class="flex-row flex-align-center">
-            <div :class="text === EHmsLevel.CAUTION ? 'caution' : text === EHmsLevel.WARN ? 'warn' : 'notice'"
-              style="width: 10px; height: 10px; border-radius: 50%;"></div>
-            <div style="margin-left: 3px;">{{ EHmsLevel[text] }}</div>
-          </div>
-        </template>
-        <template v-for="col in ['code', 'message']" #[col]="{ text }" :key="col">
-          <a-tooltip :title="text">
-            <div>{{ text }}</div>
-          </a-tooltip>
-        </template>
-        <template #domain="{ text }">
-          <a-tooltip :title="EDeviceTypeName[text]">
-            <div>{{ EDeviceTypeName[text] }}</div>
-          </a-tooltip>
-        </template>
-      </a-table>
-    </div>
+    <Search :onClickSearch="onClickSearch" :onClickReset="onClickReset" />
+    <a-table :scroll="{ x: '100%', y: 500 }" rowKey="hms_id" :loading="state.listLoading" :columns="columns"
+      @change="refreshData" :rowClassName="rowClassName" :dataSource="state.list" :pagination="paginationConfig">
+      <template #time="{ record }">
+        <div>{{ record.create_time }}</div>
+        <div :style="record.update_time ? '' : record.level === 1 ? 'color: orange;' :
+          record.level === 2 ? 'color: red;' : 'color: #28d445;'">
+          {{ record.update_time ?? '它正在发生……' }}</div>
+      </template>
+      <template #level="{ text }">
+        <a-tag color="success" v-if="text === 0">
+          正常
+        </a-tag>
+        <a-tag color="warning" v-else-if="text === 1">
+          警告
+        </a-tag>
+        <a-tag color="error" v-else-if="text === 2">
+          危险
+        </a-tag>
+      </template>
+      <template v-for="col in ['code', 'message']" #[col]="{ text }" :key="col">
+        <a-tooltip :title="text">
+          {{ text }}
+        </a-tooltip>
+      </template>
+    </a-table>
   </a-drawer>
 </template>
 
-<!-- 暂时只抽取该组件 -->
 <script lang="ts" setup>
 import { reactive, ref, defineProps, defineEmits, watch } from 'vue'
-import { getDeviceHms, HmsQueryBody } from '/@/api/manage'
-import { ColumnProps, TableState } from 'ant-design-vue/lib/table/interface'
+import Search from './components/Search.vue'
 import { Device, DeviceHms } from '/@/types/device'
-import { IPage } from '/@/api/http/type'
-import { EDeviceTypeName, EHmsLevel } from '/@/types'
-import { getWorkspaceId } from '/@/utils/index'
-import moment from 'moment'
+import { apis } from '/@/api/custom'
 
 const props = defineProps<{
   visible: boolean,
@@ -94,101 +63,84 @@ function setVisible(v: boolean, e?: Event) {
   emit('update:visible', v, e)
 }
 
-const loading = ref(false)
+interface State {
+  query: any,
+  listLoading: boolean,
+  list: DeviceHms[],
+};
 
-const hmsColumns: ColumnProps[] = [
-  { title: '告警开始|结束时间', dataIndex: 'create_time', width: '25%', className: 'titleStyle', slots: { customRender: 'time' } },
-  { title: '告警等级', dataIndex: 'level', width: '120px', className: 'titleStyle', slots: { customRender: 'level' } },
-  { title: '设备', dataIndex: 'domain', width: '12%', className: 'titleStyle', slots: { customRender: 'domain' } },
-  { title: '错误码', dataIndex: 'key', width: '20%', className: 'titleStyle', ellipsis: true, slots: { customRender: 'code' } },
-  { title: '告警内容', dataIndex: 'message_en', className: 'titleStyle', ellipsis: true, slots: { customRender: 'message' } },
-  { title: '解决方案', dataIndex: 'message_zh', className: 'titleStyle', ellipsis: true, slots: { customRender: 'message' } },
-]
-
-interface DeviceHmsData {
-  data: DeviceHms[]
-}
-
-const hmsData = reactive<DeviceHmsData>({
-  data: []
-})
-
-type Pagination = TableState['pagination']
+const state: State = reactive({
+  query: undefined,
+  listLoading: false,
+  list: [],
+});
 
-const hmsPaginationProp = reactive({
+const paginationConfig = reactive({
   pageSizeOptions: ['20', '50', '100'],
   showQuickJumper: true,
   showSizeChanger: true,
-  pageSize: 50,
+  pageSize: 20,
   current: 1,
   total: 0
 })
 
-// 获取分页信息
-function getPaginationBody() {
-  return {
-    page: hmsPaginationProp.current,
-    page_size: hmsPaginationProp.pageSize
-  } as IPage
+const fetchList = async () => {
+  state.listLoading = true;
+  try {
+    const res = await apis.fetchDeviceHmsList({
+      ...state.query,
+      language: 'zh',
+      page: paginationConfig.current,
+      page_size: paginationConfig.pageSize
+    });
+    if (res.code === 0) {
+      paginationConfig.total = res.data.pagination.total
+      paginationConfig.current = res.data.pagination.page
+      paginationConfig.pageSize = res.data.pagination.page_size
+    }
+    state.list = res.data.list;
+  } catch (e) {
+    console.error(e);
+  } finally {
+    state.listLoading = false;
+  }
 }
 
-function showHms() {
+const showHms = async () => {
   const dock = props.device
   if (!dock) return
-  // 先注释掉,这里机场与飞机合并在一起了
-  // if (dock.domain === EDeviceTypeName.Dock) {
-  //   getDeviceHmsBySn(dock.device_sn, dock.children?.[0].device_sn ?? '')
-  // }
-  // if (dock.domain === EDeviceTypeName.Aircraft) {
-  //   param.domain = EDeviceTypeName.Aircraft
-  //   getDeviceHmsBySn('', dock.device_sn)
-  // }
-}
-
-function refreshHmsData(page: Pagination) {
-  hmsPaginationProp.current = page?.current!
-  hmsPaginationProp.pageSize = page?.pageSize!
-  getHms()
+  await fetchList()
 }
 
-const param = reactive<HmsQueryBody>({
-  sns: [],
-  device_sn: '',
-  children_sn: '',
-  language: 'en',
-  begin_time: new Date(new Date().setDate(new Date().getDate() - 7)).setHours(0, 0, 0, 0),
-  end_time: new Date().setHours(23, 59, 59, 999),
-  domain: -1,
-  level: '',
-  message: ''
-})
-
-const levels = [
+const columns = [
   {
-    label: '全部告警等级',
-    value: ''
-  }, {
-    label: EHmsLevel[0],
-    value: EHmsLevel.NOTICE
-  }, {
-    label: EHmsLevel[1],
-    value: EHmsLevel.CAUTION
-  }, {
-    label: EHmsLevel[2],
-    value: EHmsLevel.WARN
-  }
-]
-
-const deviceTypes = [
+    title: '发生时间',
+    dataIndex: 'create_time',
+    width: 180,
+    slots: { customRender: 'time' }
+  },
+  {
+    title: '告警等级',
+    dataIndex: 'level',
+    width: 100,
+    slots: { customRender: 'level' }
+  },
   {
-    label: '全部设备',
-    value: -1
-  }, {
-    label: EDeviceTypeName[EDeviceTypeName.Aircraft],
-    value: EDeviceTypeName.Aircraft
-  }, {
-    label: EDeviceTypeName[EDeviceTypeName.Dock],
-    value: EDeviceTypeName.Dock
+    title: '设备SN',
+    dataIndex: 'sn',
+    width: 150,
+  },
+  {
+    title: '错误码',
+    dataIndex: 'key',
+    ellipsis: true,
+    slots: { customRender: 'code' }
+  },
+  {
+    title: '告警内容',
+    dataIndex: 'message_zh',
+    ellipsis: true,
+    slots: { customRender: 'message' }
   }
 ]
 
@@ -197,57 +149,25 @@ const rowClassName = (record: any, index: number) => {
   if ((index & 1) === 0) {
     className.push('table-striped')
   }
-  if (record.domain !== EDeviceTypeName.Dock) {
-    className.push('child-row')
-  }
   return className.toString().replaceAll(',', ' ')
 }
 
-const time = ref([moment(param.begin_time), moment(param.end_time)])
-
-function getHms() {
-  loading.value = true
-  getDeviceHms(param, getWorkspaceId(), getPaginationBody())
-    .then(res => {
-      hmsPaginationProp.total = res.data.pagination.total
-      hmsPaginationProp.current = res.data.pagination.page
-      hmsData.data = res.data.list
-      hmsData.data.forEach(hms => {
-        hms.domain = hms.sn === param.children_sn ? EDeviceTypeName.Aircraft : EDeviceTypeName.Dock
-      })
-      loading.value = false
-    }).catch(_err => {
-      loading.value = false
-    })
+const refreshData = async (page: any) => {
+  paginationConfig.current = page?.current!
+  paginationConfig.pageSize = page?.pageSize!
+  await fetchList();
 }
 
-function getDeviceHmsBySn(sn: string, childSn: string) {
-  param.device_sn = sn
-  param.children_sn = childSn
-  param.sns = [param.device_sn, param.children_sn]
-  getHms()
-}
-
-function onTimeChange(newTime: any[]) {
-  param.begin_time = newTime[0].valueOf()
-  param.end_time = newTime[1].valueOf()
-  getHms()
-}
-
-function onDeviceTypeSelect(val: number) {
-  param.sns = [param.device_sn, param.children_sn]
-  if (val === EDeviceTypeName.Dock) {
-    param.sns = [param.device_sn, '']
-  }
-  if (val === EDeviceTypeName.Aircraft) {
-    param.sns = ['', param.children_sn]
-  }
-  getHms()
+// 点击搜索
+const onClickSearch = async (query: any) => {
+  state.query = query;
+  await fetchList();
 }
 
-function onLevelSelect(val: number) {
-  param.level = val
-  getHms()
+// 点击重置
+const onClickReset = async (query: any) => {
+  state.query = query;
+  await fetchList();
 }
 </script>
 

+ 82 - 0
Web/src/components/devices/device-hms/components/Search.vue

@@ -0,0 +1,82 @@
+<template>
+  <a-form style="margin-bottom: 20px;" ref="formRef" layout="inline" :model="formModel" :colon="false">
+    <a-form-item name="rangeDate">
+      <a-range-picker style="width: 360px;" showTime valueFormat="YYYY-MM-DD HH:mm:ss" :placeholder="['开始时间', '结束时间']"
+        v-model:value="formModel.rangeDate" />
+    </a-form-item>
+    <a-form-item name="level">
+      <a-select style="width: 120px;" placeholder="告警等级" v-model:value="formModel.level">
+        <a-select-option :value="0">
+          正常
+        </a-select-option>
+        <a-select-option :value="1">
+          警告
+        </a-select-option>
+        <a-select-option :value="2">
+          危险
+        </a-select-option>
+      </a-select>
+    </a-form-item>
+    <a-form-item name="message">
+      <a-input style="width: 100px;" placeholder="告警内容" v-model:value="formModel.message" />
+    </a-form-item>
+    <a-form-item>
+      <a-button style="margin-right: 10px;" @click="handleClickSearch">
+        <template #icon>
+          <SearchOutlined />
+        </template>
+      </a-button>
+      <a-button @click="handleClickReset">
+        <template #icon>
+          <ReloadOutlined />
+        </template>
+      </a-button>
+    </a-form-item>
+  </a-form>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive } from 'vue';
+import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue';
+import moment from 'moment';
+
+interface Props {
+  onClickSearch: (query: any) => Promise<any>,
+  onClickReset: (query: any) => Promise<any>,
+};
+
+const props = withDefaults(defineProps<Props>(), {
+
+});
+
+const formRef = ref();
+
+const formModel = reactive({
+  rangeDate: undefined,
+  level: undefined,
+  message: undefined,
+});
+
+// 点击查询
+const handleClickSearch = async () => {
+  const values: any = formRef.value?.getFieldsValue();
+  const data = { ...values };
+  delete data.rangeDate;
+  if (values.rangeDate?.length === 2) {
+    data.begin_time = moment(values.rangeDate[0]).valueOf();
+    data.end_time = moment(values.rangeDate[1]).valueOf();
+  }
+  await props.onClickSearch(data);
+};
+
+// 点击重置
+const handleClickReset = async () => {
+  formRef.value?.resetFields();
+  const values: any = formRef.value?.getFieldsValue();
+  const data = { ...values };
+  delete data.rangeDate;
+  await props.onClickReset(data);
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 2 - 2
Web/src/components/devices/deviceList/components/FeedbackDrawer.vue

@@ -18,7 +18,7 @@
                             v-model:value="formModel.search_info" />
                     </a-form-item>
                     <a-form-item>
-                        <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+                        <a-button style="margin-right: 10px;" @click="handleClickSearch">
                             <template #icon>
                                 <SearchOutlined />
                             </template>
@@ -218,7 +218,7 @@ const columns = [
 ]
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
     const values = formRef.value?.getFieldsValue();
     const data = { ...values };
     delete data.rangeDate;

+ 2 - 2
Web/src/components/devices/deviceList/components/Search.vue

@@ -59,7 +59,7 @@
           <a-input style="width: 200px;" placeholder="设备SN、设备名称" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -156,7 +156,7 @@ onMounted(async () => {
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   await props.onClickSearch(values);
 }

+ 3 - 3
Web/src/components/devices/deviceList/index.vue

@@ -3,7 +3,7 @@
     <Search :selectedRowKeys="state.selectedRowKeys" :onClickDelete="onClickBatchDelete" :onClickSearch="onClickSearch"
       :onClickReset="onClickReset" />
     <div class="deviceList-table">
-      <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="device_sn"
+      <a-table :scroll="{ x: '100%', y: 500 }"  rowKey="device_sn"
         :loading="state.listLoading" :columns="columns" :dataSource="state.list" @change="refreshData"
         :rowClassName="rowClassName" :pagination="paginationConfig" :rowSelection="rowSelection">
         <!-- 设备型号 -->
@@ -67,9 +67,9 @@
                   <a-menu-item @click="onClickDeviceHms(record)">
                     告警信息
                   </a-menu-item>
-                  <a-menu-item>
+                  <!-- <a-menu-item>
                     设备运维
-                  </a-menu-item>
+                  </a-menu-item> -->
                 </a-menu>
               </template>
             </a-dropdown>

+ 2 - 2
Web/src/components/devices/feedbackRecord/components/Search.vue

@@ -28,7 +28,7 @@
           <a-input style="width: 200px;" placeholder="设备SN、设备异常描述" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -68,7 +68,7 @@ const formModel = reactive({
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   const data = { ...values };
   delete data.date;

+ 0 - 2
Web/src/components/onLineDevice/components/InfoModal.vue

@@ -465,10 +465,8 @@ const onStart = async () => {
   }
   const videoId = `${props.osdInfo.sn}/${cameraValue}/${videoValue || 'normal-0'}`;
   state.videoId = videoId;
-  const liveURL = config.rtmpURL;
   try {
     const res = await startLivestream({
-      url: liveURL,
       video_id: videoId,
       url_type: 1,// RTMP 
       video_quality: state.clarityValue

+ 19 - 70
Web/src/hooks/use-g-map-trajectory.ts

@@ -7,12 +7,8 @@ import rootStore from '/@/store'
 export function useGMapTrajectory() {
   const root = getRoot();
   let AMap = root.$aMap;
-  const store = rootStore
-  const coverMap = store.state.coverMap
-
-  // 删除
-  // coverMap[id].forEach(cover => root.$map.remove(cover))
-  // coverMap[id] = []
+  const store = rootStore;
+  const coverMap = store.state.coverMap;
 
   // 绘制轨迹
   const drawTrajectory = (list: any[]) => {
@@ -115,53 +111,6 @@ export function useGMapTrajectory() {
       strokeWeight: 6,//线宽
       strokeStyle: 'solid',
     })
-    // const serialList = list.filter((item) => item.type === 1);
-    // // 序号
-    // const text = serialList.map((item, index) => {
-    //   return new AMap.Text({
-    //     position: new AMap.LngLat(item.paths[0], item.paths[1]),
-    //     offset: new AMap.Pixel(-8, -30),
-    //     text: index + 1,
-    //     style: {
-    //       backgroundColor: 'transparent',
-    //       borderColor: 'transparent',
-    //     }
-    //   })
-    // })
-    // // 序号下方圆形标记
-    // const circles = serialList.map((item, index) => {
-    //   return new AMap.Circle({
-    //     center: new AMap.LngLat(item.paths[0], item.paths[1]),
-    //     radius: 0.5, // 半径
-    //     // strokeColor: 'white',
-    //     fillColor: 'white',
-    //     fillOpacity: 1,
-    //     strokeWeight: 2,
-    //   });
-    // })
-    // // 计算并显示每段线的距离
-    // const distances = [];
-    // const serialPaths = serialList.map(item => item.paths)
-    // for (let i = 0; i < serialPaths.length - 1; i++) {
-    //   const distance = AMap.GeometryUtil.distance(new AMap.LngLat(serialPaths[i][0], serialPaths[i][1]), new AMap.LngLat(serialPaths[i + 1][0], serialPaths[i + 1][1]));
-    //   // 计算两个点之间的中点坐标
-    //   const midLng = (serialPaths[i][0] + serialPaths[i + 1][0]) / 2;
-    //   const midLat = (serialPaths[i][1] + serialPaths[i + 1][1]) / 2;
-    //   const midPoint = new AMap.LngLat(midLng, midLat);
-    //   // 在中点位置放置文本以显示距离
-    //   const distanceText = new AMap.Text({
-    //     position: midPoint,
-    //     offset: new AMap.Pixel(-16, 10),
-    //     text: `${distance.toFixed(1)} m`,// 距离
-    //     style: {
-    //       fontSize: '10px',
-    //       color: '#FFFFFF',
-    //       backgroundColor: 'rgba(0, 0, 0, 0.75)',
-    //       borderColor: 'transparent',
-    //     },
-    //   });
-    //   distances.push(distanceText);
-    // }
     const other = [polyline]
     // 获取起飞点
     const homeList = list.filter(item => item.type === 0);
@@ -179,23 +128,23 @@ export function useGMapTrajectory() {
       })
       other.push(startMarker);
     }
-    // // 绘制小飞机图标
-    // if (list.length) {
-    //   const path = list[list.length - 1].paths;
-    //   const angle = deviceInfo.attitude_head;// 角度
-    //   const startIcon = new AMap.Icon({
-    //     size: new AMap.Size(40, 40),
-    //     image: droneIcon,
-    //     imageSize: new AMap.Size(40, 40)
-    //   })
-    //   const endMarker = new AMap.Marker({
-    //     position: new AMap.LngLat(path[0], path[path.length - 1]),
-    //     icon: startIcon,
-    //     offset: new AMap.Pixel(-20, -20),// 位置偏移
-    //     angle: angle,// 旋转角度
-    //   })
-    //   other.push(endMarker);
-    // }
+    // 绘制小飞机图标
+    if (list.length) {
+      const path = list[list.length - 1].paths;
+      const angle = deviceInfo.attitude_head;// 角度
+      const startIcon = new AMap.Icon({
+        size: new AMap.Size(40, 40),
+        image: droneIcon,
+        imageSize: new AMap.Size(40, 40)
+      })
+      const endMarker = new AMap.Marker({
+        position: new AMap.LngLat(path[0], path[path.length - 1]),
+        icon: startIcon,
+        offset: new AMap.Pixel(-20, -20),// 位置偏移
+        angle: angle,// 旋转角度
+      })
+      other.push(endMarker);
+    }
     root.$map.add(other)
     coverMap[sn] = [other]
   }

+ 9 - 7
Web/src/hooks/use-g-map-tsa.ts

@@ -47,13 +47,15 @@ export function deviceTsaUpdate() {
       return
     }
     AMap = root.$aMap
-    markers[sn] = new AMap.Marker({
-      position: new AMap.LngLat(lng || 113.943225499, lat || 22.577673716),
-      icon: initIcon(type),
-      title: name,
-      anchor: 'top-center',
-      offset: [0, -20],
-    })
+    if (type !== EDeviceTypeName.Aircraft) {// 加入判断屏蔽小飞机图标
+      markers[sn] = new AMap.Marker({
+        position: new AMap.LngLat(lng || 113.943225499, lat || 22.577673716),
+        icon: initIcon(type),
+        title: name,
+        anchor: 'top-center',
+        offset: [0, -20],
+      })
+    }
     root.$map.add(markers[sn])
   }
 

+ 2 - 2
Web/src/pages/page-web/projects/media/detail/components/Search.vue

@@ -46,7 +46,7 @@
           <a-input style="width: 200px;" placeholder="文件名称" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -119,7 +119,7 @@ const handleChangeUploadFile = async (info: any) => {
 }
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   const data = {
     ...values,

+ 1 - 1
Web/src/pages/page-web/projects/media/detail/index.vue

@@ -27,7 +27,7 @@
             </div>
           </div>
         </div>
-        <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="file_id"
+        <a-table :scroll="{ x: '100%', y: 500 }"  rowKey="file_id"
           :loading="state.listLoading" :columns="columns" :dataSource="state.list" :rowClassName="rowClassName"
           :pagination="paginationConfig"
           :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">

+ 2 - 2
Web/src/pages/page-web/projects/media/index/components/Search.vue

@@ -40,7 +40,7 @@
           <a-input style="width: 200px;" placeholder="文件夹名称" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -110,7 +110,7 @@ onMounted(async () => {
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   const data = {
     ...values,

+ 1 - 1
Web/src/pages/page-web/projects/media/index/index.vue

@@ -28,7 +28,7 @@
           </div>
         </div>
         <div class="mediaList-table" v-if="state.mode === 'table'">
-          <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="id" :loading="state.listLoading"
+          <a-table :scroll="{ x: '100%', y: 500 }"  rowKey="id" :loading="state.listLoading"
             :columns="columns" :dataSource="state.list" :rowClassName="rowClassName" :pagination="paginationConfig"
             :rowSelection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
             <!-- 文件夹名称 -->

+ 2 - 2
Web/src/pages/page-web/projects/member/components/Search.vue

@@ -11,7 +11,7 @@
           <a-input style="width: 200px;" placeholder="用户名称" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -48,7 +48,7 @@ const formModel = reactive({
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   await props.onClickSearch(values);
 }

+ 2 - 2
Web/src/pages/page-web/projects/trajectory/components/Search.vue

@@ -35,7 +35,7 @@
           <a-input style="width: 200px;" placeholder="计划名称" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
-          <a-button style="margin-right: 10px;" @click="handleClicSekarch">
+          <a-button style="margin-right: 10px;" @click="handleClickSearch">
             <template #icon>
               <SearchOutlined />
             </template>
@@ -102,7 +102,7 @@ onMounted(async () => {
 })
 
 // 点击查询
-const handleClicSekarch = async () => {
+const handleClickSearch = async () => {
   const values = formRef.value?.getFieldsValue();
   const data = {
     ...values,

+ 1 - 1
Web/src/pages/page-web/projects/trajectory/index.vue

@@ -2,7 +2,7 @@
   <div class="trajectory">
     <Search :onClickSearch="onClickSearch" :onClickReset="onClickReset" />
     <div class="trajectory-table">
-      <a-table :scroll="{ x: '100%', y: 500 }" :childrenColumnName="null" rowKey="id" :loading="state.listLoading"
+      <a-table :scroll="{ x: '100%', y: 500 }"  rowKey="id" :loading="state.listLoading"
         :columns="columns" @change="refreshData" :rowClassName="rowClassName" :dataSource="state.list"
         :pagination="paginationConfig">
         <!-- 操作 -->