YM
2024-07-26 fe85e4208e502c78e3494a460617ae8753f51341
src/pages/territory/territory.vue
@@ -301,7 +301,7 @@
            "
            :style="{
              marginRight: index === dynasty1.length - 1 ? '0' : '0.03rem',
              background: dynasty1Color == item.id ? '#244A7B' : '#597AA5',
              background: dynasty1Color == item.id ? '#244A7B' : '#597AA5'
            }"
          >
            {{ item.dynastyChs }}
@@ -321,7 +321,7 @@
  getRetrieval,
  getDynasty,
  getPreCount,
  getDynastyData,
  getDynastyData
} from "@/api/index.js";
export default {
@@ -334,175 +334,95 @@
      isEchTrue: false,
      isLeft: 0,
      isTop: 0,
      // 用户信息
      information: [
        {
          label: "姓名",
          content: "李时珍",
        },
        {
          label: "别名",
          content: "东丽先生",
        },
        {
          label: "籍贯",
          content: "湖北",
        },
        {
          label: "医学分科",
          content: "中药,针灸",
        },
        {
          label: "小传",
          content:
            "李时珍(约1518年~1593 年), 字东璧, 晚年自号濒湖山人, 湖广黄州府薪州(今湖北省薪春县) 人, 明代著名医药学家。 与“ 医圣” 万密斋齐名, 古有“ 万密斋的方, 李时珍的药” 之说。 后为楚干府...",
        },
      ],
      // 下面的朝代1
      dynasty1Color: "",
      dynasty1: [
        {
          name: "夏朝",
          coord: "2070BC",
          id: 1,
          id: 1
        },
        {
          name: "商朝",
          id: 2,
          coord: "1600BC",
          coord: "1600BC"
        },
        {
          name: "西周",
          id: 3,
          coord: "1600BC",
          coord: "1600BC"
        },
        {
          name: "春秋战国",
          id: 4,
          coord: "770BC",
          coord: "770BC"
        },
        {
          name: "秦朝",
          id: 5,
          coord: "221BC",
          coord: "221BC"
        },
        {
          name: "汉朝",
          id: 6,
          coord: "202BC",
          coord: "202BC"
        },
        {
          name: "三国两晋南北朝",
          id: 7,
          coord: "184",
          coord: "184"
        },
        {
          name: "隋朝",
          id: 8,
          coord: "581",
          coord: "581"
        },
        {
          name: "唐朝",
          id: 9,
          coord: "618",
          coord: "618"
        },
        {
          name: "五代十国",
          id: 10,
          coord: "907",
          coord: "907"
        },
        {
          name: "辽夏金",
          id: 11,
          coord: "907",
          coord: "907"
        },
        {
          name: "宋朝",
          id: 12,
          coord: "960",
          coord: "960"
        },
        {
          name: "元朝",
          id: 13,
          coord: "1271",
          coord: "1271"
        },
        {
          name: "明朝",
          id: 14,
          coord: "1368",
          coord: "1368"
        },
        {
          name: "清朝",
          id: 15,
          coord: "1636",
        },
          coord: "1636"
        }
      ],
      // 标题顶部栏需要的东西
      idIndex: 0,
      // 朝代
      dynasty: [
        {
          name: "夏",
          color: "#90BBD8",
          id: 1,
        },
        {
          name: "商",
          color: "#EDD28B",
          id: 2,
        },
        {
          name: "西周",
          color: "#CF746D",
          id: 3,
        },
        {
          name: "秦",
          color: "#9CC27A",
          id: 4,
        },
        {
          name: "汉",
          color: "#5B6CB9",
          id: 5,
        },
        {
          name: "隋",
          color: "#8860A8",
          id: 6,
        },
        {
          name: "唐",
          color: "#DE8E66",
          id: 7,
        },
        {
          name: "明",
          color: "#DE8E66",
          id: 8,
        },
      ],
      // 搜索后是否显示弹框
      isSearch: false,
      currentMark: null,
      SearchArr: [
        {
          id: 1,
          name: "李时珍",
          birthAndDeath: "1518-1593",
          source: "国图规范档,CBDB,上图古籍数据库 籍贯:湖北",
        },
        {
          id: 2,
          name: "李时珍",
          birthAndDeath: "1518-1593",
          source: "国图规范档,CBDB,上图古籍数据库 籍贯:湖北",
        },
      ],
      SearchArr: [],
      zoomLevel: 5,
      oldMarkList: [],
      aggregatedData: [],
      openData: null,
      openData: null
    };
  },
  onLoad(options) {
@@ -539,7 +459,7 @@
      let times = 0;
      getPreCount({
        keyword: this.keyword,
        dynasty: this.dynasty1Color,
        dynasty: this.dynasty1Color
      }).then(async (res) => {
        const totalCount = res.object;
        if (totalCount % 200 == 0) {
@@ -573,7 +493,7 @@
              name: item?.NAME[0]?.content1,
              source: "-",
              nativPlace: item?.NATIVE_PLACE[0].content1,
              id: item.id,
              id: item.id
            }));
            this.loading = false;
            this.markerList = markerList;
@@ -588,7 +508,7 @@
        keyword: this.keyword,
        dynasty: this.dynasty1Color,
        page: count,
        pageSize: 200,
        pageSize: 200
      });
      if (res.object) {
        let markerList = [];
@@ -631,7 +551,7 @@
      }
      var map = L.map("map", {
        preferCanvas: true,
        attributionControl: false,
        attributionControl: false
      }).setView([34.3227, 108.5525], this.zoomLevel);
      map.on("moveend", this.onMapMoveEnd);
      map.on("zoomend", () => {
@@ -645,14 +565,14 @@
        .chinaProvider("TianDiTu.Normal.Map", {
          key: "76bc34ead7e30e663a4eded8aeaf5860",
          maxZoom: 18,
          minZoom: 3,
          minZoom: 3
        })
        .addTo(map);
      L.tileLayer
        .chinaProvider("TianDiTu.Normal.Annotion", {
          key: "76bc34ead7e30e663a4eded8aeaf5860",
          maxZoom: 18,
          minZoom: 3,
          minZoom: 3
        })
        .addTo(map);
      this.map = map;
@@ -689,7 +609,7 @@
        17: 4513.997733376551,
        18: 2256.9988666882755,
        19: 1128.4994333441377,
        20: 564.24971667206887,
        20: 564.24971667206887
      };
      // 根据比例尺计算当前地图1厘米的经纬度差值
      const cmData = scale[this.zoomLevel] / 100; // 将厘米转换为米
@@ -718,7 +638,7 @@
            contentY: "",
            xList: [],
            yList: [],
            data: [],
            data: []
          };
          obj.xList.push(item.xCoord);
          obj.yList.push(item.yCoord);
@@ -751,12 +671,12 @@
              : "99+"
          }</div>`,
          iconSize: [30, 30],
          className: "map-circle",
          className: "map-circle"
        });
        const temp_mark = L.marker(
          [aggregatedItem.contentY, aggregatedItem.contentX],
          {
            icon: icon,
            icon: icon
          }
        );
        this.oldMarkList.push(temp_mark);
@@ -771,7 +691,7 @@
                nativePlace: item?.content1,
                barnch: item?.MEDICAL_BRANCH[0]?.content1,
                medical: item?.BIOGRAPHY,
                id: item.id,
                id: item.id
              };
            });
            this.isTop = e.containerPoint.y - 435 + "px";
@@ -801,7 +721,7 @@
                nativePlace: item?.content1,
                barnch: item?.MEDICAL_BRANCH[0]?.content1,
                medical: item?.BIOGRAPHY,
                id: item.id,
                id: item.id
              };
            });
            this.isEchTrue = true;
@@ -835,10 +755,10 @@
    // 查看更多>>
    viewMoreClick(data) {
      uni.navigateTo({
        url: "/pages/character/detail?id=" + data.id,
        url: "/pages/character/detail?id=" + data.id
      });
    },
  },
    }
  }
};
</script>