1
QYF-GitLab1
2024-07-18 f95688c0f922375acd2f6f3c44b7db9aaeceaa7e
1
1个文件已修改
89 ■■■■ 已修改文件
src/pages/academicSchools/index.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/academicSchools/index.vue
@@ -483,54 +483,24 @@
        animationDurationUpdate: 1500,
        animationEasingUpdate: "quinticInOut",
        series: [
          {
            type: "graph",
            layout: "force",
            roam: true,
            symbolSize: SymbolSize, // 调整节点大小
            label: {
              show: true,
              color: "black", // 设置节点文字颜色为黑色
              fontSize: FontSize, // 设置文字大小
            },
            edgeSymbol: ["circle", "arrow"],
            edgeSymbolSize: [4, 10],
            data: nodeData,
            links: links,
            categories: this.categories,
            lineStyle: {
              opacity: 0.9,
              width: 2,
              curveness: 0.3,
            },
            emphasis: {
              focus: "adjacency",
              lineStyle: {
                width: 10,
              },
            },
            force: {
              // layoutAnimation: false,
              // friction: 1,
              repulsion: 800,
              edgeLength: 400,
            },
          },
          // {
          //   name: "Les Miserables",
          //   type: "graph",
          //   legendHoverLink: false,
          //   layout: "none",
          //   data: nodeData,
          //   links: links,
          //   categories: this.categories,
          //   layout: "force",
          //   roam: true,
          //   symbolSize: SymbolSize, // 调整节点大小
          //   label: {
          //     position: "right",
          //     formatter: "{b}",
          //     show: true,
          //     color: "black", // 设置节点文字颜色为黑色
          //     fontSize: FontSize, // 设置文字大小
          //   },
          //   edgeSymbol: ["circle", "arrow"],
          //   edgeSymbolSize: [4, 10],
          //   data: nodeData,
          //   links,
          //   categories: this.categories,
          //   lineStyle: {
          //     color: "source",
          //     opacity: 0.9,
          //     width: 2,
          //     curveness: 0.3,
          //   },
          //   emphasis: {
@@ -539,11 +509,41 @@
          //       width: 10,
          //     },
          //   },
          //   force: {
          //     // layoutAnimation: false,
          //     // friction: 1,
          //     repulsion: 800,
          //     edgeLength: 400,
          // },
          // },
          {
            name: "Les Miserables",
            type: "graph",
            legendHoverLink: false,
            layout: "none",
            data: nodeData,
            links: links,
            categories: this.categories,
            roam: true,
            label: {
              position: "right",
              formatter: "{b}",
            },
            lineStyle: {
              color: "source",
              curveness: 0.3,
            },
            emphasis: {
              focus: "adjacency",
              lineStyle: {
                width: 10,
              },
            },
          },
        ],
      };
      // 将生成的连接线添加到echarts图表的option中
      option.series[0].links = links;
      // option.series[0].links = links;
      // 设置点击事件监听
      myChart.off("click");
      myChart.on("click", (params) => {
@@ -551,7 +551,8 @@
          this.spaceTimeArr(params.data.id);
        }
      });
      option && myChart.setOption(option);
      console.log(option,'option')
      myChart.setOption(option);
    },
    // 基础搜索
    onSearch(val, index) {