Browse Source

🚑 去抖动

master
wangxiang 3 years ago
parent
commit
b8de827b09
  1. 6
      src/components/AMap/src/AMapDesigner/index.vue

6
src/components/AMap/src/AMapDesigner/index.vue

@ -121,6 +121,7 @@ @@ -121,6 +121,7 @@
import { MapLogisticPoint } from '/@/api/platform/common/entity/mapLogisticPoint';
import { isArray, isString } from '/@/utils/is';
import { useI18n } from '/@/hooks/web/useI18n';
import { useDebounceFn } from '@vueuse/core';
/** 类型规范统一声明定义区域 */
interface MapState {
@ -234,6 +235,7 @@ @@ -234,6 +235,7 @@
const ASelect = Select;
const ASelectOption = Select.Option;
const formElRef = ref();
const debouncedDrawMapNavigate = useDebounceFn(drawMapNavigate,200, { maxWait: 600 });
const [registerTable, { setTableData }] = useTable({
title: '任务列表',
columns: operatePanelColumns,
@ -707,7 +709,7 @@ @@ -707,7 +709,7 @@
}
});
setTableData(mapState.mapData.mapTask);
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint));
debouncedDrawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint));
});
}
@ -799,7 +801,7 @@ @@ -799,7 +801,7 @@
pointData.forEach((item, index)=> item.sort = add(index, 1));
mapState.mapData.mapLogisticPoint = pointData;
mapState.mapData.courierUserId && (mapState.mapData.mapTaskPresetLogisticPoint = await getTaskPresetPointByCourierUserId(mapState.mapData.courierUserId));
drawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint));
debouncedDrawMapNavigate(concat(mapState.mapData.mapLogisticPoint, mapState.mapData.mapTaskPresetLogisticPoint));
}
}

Loading…
Cancel
Save