y505174330
2024-05-18 906da13b74826f590de443b035778b4be5b67973
Merge branch 'master' of http://182.92.203.7:2001/r/TCM_CharacterLibrary
4个文件已修改
108 ■■■■ 已修改文件
src/api/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/character/detail.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/fileDetail/index.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/inherit/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -296,6 +296,14 @@
  });
};
export const getPersonDataOutput = (Obj) => {
  return req1({
    url: "/person/dataOutput",
    method: "post",
    params: Obj
  });
};
// -----------
// 中国医学人物知识库
src/pages/character/detail.vue
@@ -20,7 +20,8 @@
          class="flex"
          style="line-height: 1.2; margin: 0.15rem 0"
        >
          <li style="
          <li
            style="
              background-color: #fff;
              padding: 0 0.08rem;
              border: 0.01rem solid #000;
@@ -28,10 +29,13 @@
              font-size: 0.12rem;
              text-align: center;
              margin-right: 0.15rem;
            ">
            "
            @click="openFileClick(1)"
          >
            RDF
          </li>
          <li style="
          <li
            style="
              background-color: #fff;
              padding: 0 0.08rem;
              border: 0.01rem solid #000;
@@ -39,10 +43,14 @@
              font-size: 0.12rem;
              text-align: center;
              margin-right: 0.15rem;
            ">
              cursor: pointer;
            "
            @click="openFileClick(2)"
          >
            NT
          </li>
          <li style="
          <li
            style="
              background-color: #fff;
              padding: 0 0.08rem;
              border: 0.01rem solid #000;
@@ -50,10 +58,14 @@
              font-size: 0.12rem;
              text-align: center;
              margin-right: 0.15rem;
            ">
              cursor: pointer;
            "
            @click="openFileClick(3)"
          >
            XML
          </li>
          <li style="
          <li
            style="
              background-color: #fff;
              padding: 0 0.08rem;
              border: 0.01rem solid #000;
@@ -61,7 +73,10 @@
              font-size: 0.12rem;
              text-align: center;
              margin-right: 0.15rem;
            ">
              cursor: pointer;
            "
            @click="openFileClick(4)"
          >
            JSON
          </li>
        </ul>
@@ -73,6 +88,7 @@
            font-weight: normal;
            line-height: 0.2rem;
            letter-spacing: 0.03rem;
            cursor: pointer;
          "
        >
          {{ biogData.length ? biogData[0].content : "-" }}
@@ -826,6 +842,32 @@
        behavior: "smooth", // 使用平滑滚动
      });
    },
    openFileClick(index) {
      let obj = {
        id: this.detailId,
        type: "Person",
      };
      switch (index) {
        case 1:
          obj.outputType = "RDF";
          break;
        case 2:
          obj.outputType = "NT";
          break;
        case 3:
          obj.outputType = "XML";
          break;
        case 4:
          obj.outputType = "JSON";
          break;
      }
      let queryString = Object.keys(obj)
        .map(
          (key) => `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`
        )
        .join("&");
      window.open(`#/pages/fileDetail/index?${queryString}`);
    },
    handleClick(tab) {
      let index = tab.$attrs["data-id"] - 1;
      this.$nextTick(() => {
src/pages/fileDetail/index.vue
@@ -1,38 +1,51 @@
<template>
  <view id="box">
    <!-- RDF对应的参数 -->
    {{data}}
    <pre v-if="options.outputType == 'XML' || options.outputType == 'JSON'">
      <code>
        {{ data }}
      </code>
    </pre>
    <div v-else v-html="data"></div>
  </view>
</template>
<script>
import { getMedicalDataOutput } from "@/api/index.js";
import { getMedicalDataOutput, getPersonDataOutput } from "@/api/index.js";
export default {
  data() {
    return {
      Obj: {},
      options: {},
      data: ""
    };
  },
  onLoad(options) {
    this.Obj = options;
  },
  mounted() {
    this.options = options;
    this.innt();
  },
  methods: {
    innt() {
      getMedicalDataOutput(this.Obj).then((res) => {
        console.log(res);
        this.data = res;
      });
      if (this.options.type == "Person") {
        getPersonDataOutput({
          personId: this.options.id,
          dataTypeEO: this.options.outputType
        }).then((res) => {
          console.log(res);
          this.data = res;
        });
      } else {
        getMedicalDataOutput(this.options).then((res) => {
          console.log(res);
          this.data = res;
        });
      }
    }
  }
};
</script>
<style>
  #box{
    font-size: 14px;
  }
#box {
  font-size: 14px;
}
</style>
src/pages/inherit/index.vue
@@ -131,7 +131,6 @@
        searchType: this.searchType,
        path: this.conditionId,
      }).then((res) => {
        console.log(res);
        for (let i = 0; i < res.object.nodeList.length; i++) {
          const node = res.object.nodeList[i];
          if (