1
YM
2024-06-12 e7c088a46085ca75f64f32555296dd774b95461f
src/pages/academicGenres/chart.vue
@@ -3,7 +3,7 @@
    style="width: 100%; height: 100%; display: flex; flex-direction: column"
  >
    <!-- 顶部导航 -->
    <headNav :idIndex="3 + ''" text="历代学术流派" />
    <headNav :idIndex="3 + ''" text="中医学术流派" />
    <view class="Midde flex">
      <!-- <view class="MiddeBack">返回</view> -->
      <el-button class="MiddeBack flex flex-center" @click="goBack"
@@ -11,7 +11,6 @@
      >
      <view class="flex flex-center flex-column">
        <view
          class=""
          style="
            font-weight: 900;
            margin-bottom: 0.2rem;
@@ -51,7 +50,6 @@
            "
          >
            <view
              class=""
              :style="{ background: item.color }"
              style="
                margin-right: 0.07rem;
@@ -60,15 +58,24 @@
                border-radius: 50%;
              "
            ></view>
            <view class="" style="color: #2c2c2c; font-size: 0.12rem">{{
            <view style="color: #2c2c2c; font-size: 0.12rem">{{
              item.name
            }}</view>
          </view>
        </li>
      </ul>
    </view>
    <view class="contentBox">
      <view id="main" style="width: 100%; height: 100%"></view>
    <view class="contentBox" style="position: relative;">
      <div
          v-if="nodeData.length == 0"
          style="color: #666; text-align: center; font-size: 16px; position: absolute;top: 1rem;left: 0;right: 0;"
        >
          暂无数据
        </div>
      <view id="main" style="width: 100%; height: 100%">
      </view>
    </view>
  </view>
</template>
@@ -136,11 +143,15 @@
                return {
                  content: item.content,
                  source:
                    "出处:《" +
                    res.object.bookList &&
                    res.object.bookList.find((citem) => citem.id == item.bookId)
                      .name +
                    "》 P" +
                    item.pageNo
                      ? "出处:《" +
                        res.object.bookList.find(
                          (citem) => citem.id == item.bookId
                        ).name +
                        "》 P" +
                        item.pageNo
                      : ""
                };
              })
            : [],
@@ -149,11 +160,15 @@
                return {
                  content: item.content,
                  source:
                    "出处:《" +
                    res.object.bookList &&
                    res.object.bookList.find((citem) => citem.id == item.bookId)
                      .name +
                    "》 P" +
                    item.pageNo
                      ? "出处:《" +
                        res.object.bookList.find(
                          (citem) => citem.id == item.bookId
                        ).name +
                        "》 P" +
                        item.pageNo
                      : ""
                };
              })
            : [],
@@ -162,11 +177,15 @@
                return {
                  content: item.content,
                  source:
                    "出处:《" +
                    res.object.bookList &&
                    res.object.bookList.find((citem) => citem.id == item.bookId)
                      .name +
                    "》 P" +
                    item.pageNo
                      ? "出处:《" +
                        res.object.bookList.find(
                          (citem) => citem.id == item.bookId
                        ).name +
                        "》 P" +
                        item.pageNo
                      : ""
                };
              })
            : [],
@@ -175,11 +194,15 @@
                return {
                  content: item.content,
                  source:
                    "出处:《" +
                    res.object.bookList &&
                    res.object.bookList.find((citem) => citem.id == item.bookId)
                      .name +
                    "》 P" +
                    item.pageNo
                      ? "出处:《" +
                        res.object.bookList.find(
                          (citem) => citem.id == item.bookId
                        ).name +
                        "》 P" +
                        item.pageNo
                      : ""
                };
              })
            : []
@@ -209,31 +232,32 @@
        searchSchoolPerson({
          keyword: item
        }).then((res) => {
          console.log(res.list, i);
          for (let i = 0; i < res.list.length; i++) {
            const citem = res.list[i];
            // 节点
            this.nodeData.push({
              name: citem.name2,
              x: Math.random() * 1000,
              y: Math.random() * 600,
              itemStyle: {
                color: citem.relationType == "人物著作" ? "#eee" : "#FDEFE4",
                borderWidth: 4,
                borderColor:
                  citem.relationType == "人物著作" ? "#9e9e9e" : "#DA7A2B",
                borderRadius: 30
              },
              symbolSize: 100
            });
            // 关系
            this.links.push({
              source: item,
              target: citem.name2,
              label: {
                show: false
              }
            });
          if (res.list) {
            for (let i = 0; i < res.list.length; i++) {
              const citem = res.list[i];
              // 节点
              this.nodeData.push({
                name: citem.name2,
                x: Math.random() * 1000,
                y: Math.random() * 600,
                itemStyle: {
                  color: citem.relationType == "人物著作" ? "#eee" : "#FDEFE4",
                  borderWidth: 4,
                  borderColor:
                    citem.relationType == "人物著作" ? "#9e9e9e" : "#DA7A2B",
                  borderRadius: 30
                },
                symbolSize: 100
              });
              // 关系
              this.links.push({
                source: item,
                target: citem.name2,
                label: {
                  show: false
                }
              });
            }
          }
          this.init();
        });
@@ -355,6 +379,9 @@
    height: 0.24rem;
    font-size: 0.12rem;
    padding: 0;
    border-radius: 0;
    border: 1px solid #9e9e9e;
    color: #000;
  }
  .Lists {