anytrek-front-public-component 1.13.2 → 1.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -753,9 +753,6 @@ const saveFunctionLandmark = async (
753
753
  :haveMap="haveMap"
754
754
  :needPath="needPath"
755
755
  :mapJson="mapJson"
756
- :childImages="childImages"
757
- :isMutiple="isMutiple"
758
- :carouselInterval="1000"
759
756
  :google-map-key="googleMapKey"
760
757
  :on-get-history-trail="fetchHistoryTrail"
761
758
  :on-get-history-trail-point="fetchHistoryTrailPoint"
@@ -763,7 +760,6 @@ const saveFunctionLandmark = async (
763
760
  @handle-close="onClose"
764
761
  @handle-download="onDownload"
765
762
  @update-cur-img="onUpdateCurImg"
766
- @updateChildUrl="onUpdateChildUrl"
767
763
  @changeCurPicWH="changeCurPicWH"
768
764
  @to-history="onToHistory"
769
765
  />
@@ -776,8 +772,6 @@ const visible = ref(false)
776
772
  const imageData = ref<any>({})
777
773
  const previewItem = ref<any>({})//当前设备
778
774
  const imgList = ref<any[]>([]);
779
- const childImages = ref<any[]>([]);
780
- const isMutiple = ref(false);
781
775
 
782
776
  /* 图片宽高 */
783
777
  const curPicWH = ref<any>({
@@ -786,18 +780,23 @@ const curPicWH = ref<any>({
786
780
  });
787
781
  const showImageDisplay = () => {
788
782
  imageDisplayParams.value.curImg = {};
789
- imageDisplayParams.value.isMutiple = false;
790
- imageDisplayParams.value.childImages = [];
791
783
  imageDisplayRef.value?.loadImageListFun();
792
784
 
793
785
  visible.value = true;
794
786
  }
795
- /* CargoHandling 相同 uuid并且index相同 归为一项,新增 imageList 字段存所有帧按 takeTime 最新排序 */
796
- const groupCargoHandlingImages = (list: any[]): any[] => {
787
+ /* 2310图片轮播,triggerType为CargoHandling或者eventType为9且uuid,index相同归为一项,新增 imageList 字段存,按 takeTime 最新排序 */
788
+ // 2310视频,uuid一样,含有media字段
789
+ export const groupCargoHandlingImages = (list: any[]): any[] => {
797
790
  const groupMap = new Map<string, any[]>();
791
+ const needMergeVideo = true;//
798
792
  list.forEach((item: any) => {
799
- if (item.triggerType === 'CargoHandling' && item.uuid) {
800
- const key = `${item.uuid}-${item.index}`;
793
+ if ((item.triggerType === 'CargoHandling' || item.eventType === 9) && item.uuid) {
794
+ const key = `picture-${item.uuid}-${item.index}`;
795
+ if (!groupMap.has(key)) groupMap.set(key, []);
796
+ groupMap.get(key)!.push(item);
797
+ }
798
+ if (item.media && item.uuid && needMergeVideo) {
799
+ const key = `media-${item.uuid}`;
801
800
  if (!groupMap.has(key)) groupMap.set(key, []);
802
801
  groupMap.get(key)!.push(item);
803
802
  }
@@ -807,11 +806,21 @@ const groupCargoHandlingImages = (list: any[]): any[] => {
807
806
  groupMap.forEach((items) => {
808
807
  items.sort((a: any, b: any) => new Date(a.takeTime).getTime() - new Date(b.takeTime).getTime());
809
808
  const timeStampGap = new Date(items[items.length - 1].takeTime).getTime() - new Date(items[0].takeTime).getTime();
810
- const timeGap = formatDuration(timeStampGap, { d: true, h: true, m: true });
811
- result.push({ ...items[0], imageList: [...items], timeGap });
809
+ const timeGap = formatDuration(timeStampGap, { d: true, h: true, m: true, s: true });
810
+ if (items[0].media) {
811
+ result.push({ ...items[0], videoList: [...items], timeGap });
812
+ } else {
813
+ result.push({ ...items[0], imageList: [...items], timeGap });
814
+ }
815
+
812
816
  });
813
817
  list.forEach((item: any) => {
814
- if (!(item.triggerType === 'CargoHandling' && item.uuid && groupedUuids.has(`${item.uuid}-${item.index}`))) {
818
+ // if (!(item.triggerType === 'CargoHandling' && item.uuid && groupedUuids.has(`picture-${item.uuid}-${item.index}`))) {
819
+ // result.push(item);
820
+ // }
821
+ const isNotMutiplePicture = item.triggerType !== 'CargoHandling' && item.eventType !== 9;
822
+ const isNotMedia = !needMergeVideo || !item.media;
823
+ if (isNotMutiplePicture && isNotMedia) {
815
824
  result.push(item);
816
825
  }
817
826
  });
@@ -864,8 +873,6 @@ const fetchImgList = async (successFun: Function) => {
864
873
  if (list[0]) {
865
874
  imageData.value = { ...list[0] };
866
875
  }
867
- isMutiple.value = imageData.value.imageList?.length > 1;
868
- childImages.value = imageData.value.imageList?.map((i: any) => i.url) || [];
869
876
  imgList.value = list;
870
877
  successFun();
871
878
  }
@@ -882,25 +889,9 @@ const onDownload = async(data: any) => {
882
889
 
883
890
  const onUpdateCurImg = (index: number) => {
884
891
  const img = { ...imgList.value[index] };
885
- delete img._mainUrl;
886
892
  imageData.value = img;
887
- isMutiple.value = img?.imageList?.length > 1;
888
- childImages.value = img?.imageList?.map((i: any) => i.url) || [];
889
893
  }
890
894
 
891
- const onUpdateChildUrl = (url: string) => {
892
- const img = imageData.value;
893
- if (!img._mainUrl) {
894
- img._mainUrl = img.url;
895
- }
896
- if (img.imageList) {
897
- const child = img.imageList.find((i: any) => i.url === url);
898
- if (child) {
899
- Object.assign(img, child);
900
- img.url = url;
901
- }
902
- }
903
- }
904
895
 
905
896
  const changeCurPicWH = (data: any) => {
906
897
  if (curPicWH.value.imgW !== data.imgW || curPicWH.value.imgH !== data.imgH) {
@@ -961,9 +952,6 @@ const onToHistory = (data: any) => {
961
952
  | `onGetHistoryTrail` | 获取历史轨迹 | `Function` | — |
962
953
  | `onGetHistoryTrailPoint` | 获取轨迹点详情 | `Function` | — |
963
954
  | `getImgList` | 获取图片列表(弹窗打开且列表为空时调用) | `Function` | — |
964
- | `isMutiple` | 是否开启多帧图片轮播模式 | `Boolean` | `false` |
965
- | `childImages` | 子图 URL 列表(多帧轮播时使用) | `String[]` | `[]` |
966
- | `carouselInterval` | 图片轮播的时间间隙(毫秒) | `Number` | 1000 |
967
955
 
968
956
 
969
957
 
@@ -975,7 +963,6 @@ const onToHistory = (data: any) => {
975
963
  | `handleDownload` | 下载图片,始终返回数组,父组件通过数组长度判断下载方式 | `data: Object[]` |
976
964
  | `updateCurImg` | 切换图片 | `index: Number` |
977
965
  | `toHistory` | 跳转轨迹历史 | `params: Object` |
978
- | `updateChildUrl` | 多帧轮播切换子图时触发 | `url: String` |
979
966
  | `changeCurPicWH` | 图片加载后会返回原图宽高 | `params: Object` |
980
967
 
981
968
  ### 📋 Methods Reference (通过 ref 调用)