riku
2024-12-24 105119f987e6e16d3a152649394f6052e5936b8f
调整动画速率
已修改4个文件
63 ■■■■ 文件已修改
src/components.d.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/satellite-grid.js 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/map/grid-animation.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/map/grid.js 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts
@@ -40,6 +40,7 @@
    ElTable: typeof import('element-plus/es')['ElTable']
    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
    ElText: typeof import('element-plus/es')['ElText']
    ElUpload: typeof import('element-plus/es')['ElUpload']
    FactorCheckbox: typeof import('./components/monitor/FactorCheckbox.vue')['default']
    FactorLegend: typeof import('./components/monitor/FactorLegend.vue')['default']
    FactorRadio: typeof import('./components/monitor/FactorRadio.vue')['default']
src/stores/satellite-grid.js
@@ -5,14 +5,39 @@
// 卫星遥测网格
export const usesatelliteGridStore = defineStore('satelliteGrid', () => {
  const gridGropiList = ref([]);
  const { loading, fetchData } = useFetchData();
  // 网格信息
  const gridInfo = ref([]);
  // 网格数据组
  const gridDataList = ref([]);
  function fetchGridGroup(area) {
    return fetchData((page, pageSize) => {
      return gridApi.fetchGridGroup(area, page, pageSize).then((res) => {
        return res;
      });
  // 获取网格信息
  function fetchGridCell(groupId) {
    return gridApi.fetchGridCell(groupId).then((res) => {
      gridInfo.value = res.data;
    });
  }
  // 获取遥测单日数据信息
  function fetchGridData(groupId) {
    return gridApi.fetchGridData(groupId).then((res) => {
      gridDataList.value = res.data;
    });
  }
  // 获取遥测单日具体网格监测数据
  function fetchGridDataDetail(gridData) {
    return gridApi
      .fetchGridDataDetail(gridData.id, gridData.groupId)
      .then((res) => {
        gridData.dataDetail = res.data;
      });
  }
  return {
    gridInfo,
    gridDataList,
    fetchGridCell,
    fetchGridData,
    fetchGridDataDetail
  };
});
src/utils/map/grid-animation.js
@@ -6,7 +6,8 @@
function GridAnimation() {
  // 帧动画控制工具
  this.frameAnimation = new FrameAnimation();
  this.frameAnimation.fps = 6;
  this.frameAnimation.fps = 4;
  this.frameAnimation.timeout = 1000;
  // 地图绘制图形缓存
  this.mapViews = {};
  // 两天之间的卫星遥测动画播放时间
src/utils/map/grid.js
@@ -185,6 +185,26 @@
  },
  drawGridColor(gridViews, texts, factorName) {
    // new Promise((resolve, reject) => {
    //   gridViews.forEach((g, i) => {
    //     const data = parseFloat(texts[i]);
    //     const { color, nextColor, range, nextRange } =
    //       Legend.getStandardColorAndNext(factorName, data);
    //     const ratio = (data - range) / (nextRange - range);
    //     const _color = getColorBetweenTwoColors(
    //       color.map((v) => v * 255),
    //       nextColor.map((v) => v * 255),
    //       ratio
    //     );
    //     resolve({ g, _color, color });
    //   });
    // }).then((res) => {
    //   const { g, _color, color } = res;
    //   g.setOptions({
    //     fillColor: _color,
    //     fillOpacity: color[3]
    //   });
    // });
    gridViews.forEach((g, i) => {
      const data = parseFloat(texts[i]);
      const { color, nextColor, range, nextRange } =