杨磊
昨天 dd511658a80514fef129800129ba24a5ceb9c878
首页搜索
2个文件已修改
102 ■■■■ 已修改文件
src/views/achievements/index.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/achievements/index.vue
@@ -227,7 +227,9 @@
                <p>{{ item.name }}</p>
                <p>
                  <el-button @click="goPage(item.id)">详情</el-button>
                  <el-button @click="openAiReading(item.AIReading, item.name)">AI智能阅读</el-button>
                  <el-button @click="openAiReading(item.AIReading, item.name)"
                    >AI智能阅读</el-button
                  >
                </p>
              </li>
              <li class="main-sources">
@@ -247,7 +249,10 @@
                v-if="item.abstract"
              >
                <span>摘要: </span>
                <span class="page-main-abstract" v-html="item.cleanAbstract"></span>
                <span
                  class="page-main-abstract"
                  v-html="item.cleanAbstract"
                ></span>
              </li>
              <li
                class="main-keyword"
@@ -283,12 +288,28 @@
              >
              </el-pagination>
            </div>
            <el-dialog v-model="dialogVisible" :title="aIName" width="60vw" top="3vh" bottom="2vh"
              :visible.sync="dialogVisible" class="custom-dialog">
              <div class="AIReadingBox" element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0)">
                <div class="richTextInitBox" v-if="AIReading" v-html="AIReading"></div>
                <div class="richTextInitError" v-else>网络繁忙,请稍后再试。</div>
            <el-dialog
              v-model="dialogVisible"
              :title="aIName"
              width="60vw"
              top="3vh"
              bottom="2vh"
              :visible.sync="dialogVisible"
              class="custom-dialog"
            >
              <div
                class="AIReadingBox"
                element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0)"
              >
                <div
                  class="richTextInitBox"
                  v-if="AIReading"
                  v-html="AIReading"
                ></div>
                <div class="richTextInitError" v-else>
                  网络繁忙,请稍后再试。
                </div>
              </div>
            </el-dialog>
            <el-empty v-if="!loading && !resultList.length"></el-empty>
@@ -570,6 +591,9 @@
    };
  },
  mounted() {
    console.log(this.$route.query, "query");
    this.inputType = this.$route.query.type;
    this.inputValue = this.$route.query.value;
    this.getSelectData();
  },
@@ -721,7 +745,10 @@
    // 请求数据
    getItemList() {
      this.loading = true;
      console.log(this.inputValue, " inputValue");
      console.log(this.inputType, " inputType");
      let searchData = {}; // 初始化一个空对象来存储搜索数据
      debugger;
      if (this.inputValue) {
        // 如果输入值存在
        if (this.inputType != "all") {
@@ -733,6 +760,8 @@
          // 遍历输入选项
          for (let index = 0; index < this.inputOptions.length; index++) {
            const item = this.inputOptions[index]; // 获取当前选项
            debugger;
            if (item.value !== "all") {
              // 如果当前选项的值不是"all"
              if (!Object.keys(searchData).length) {
@@ -749,20 +778,26 @@
          }
        }
      }
      console.log(this.associationList, "searchData11111");
      if (this.associationList && this.associationList.length) {
        this.associationList.forEach((item) => {
          if (item.value == "year") {
            const endDate = item.content.split("/")[0] + "/12/31 23:59:59";
            const startDate = item.content.split("/")[0] + "/01/01 00:00:00";
            searchData[item.value + ">="] = startDate;
            searchData[item.value + "<="] = endDate;
          } else if (item.value) {
            searchData[item.value + "*"] = item.content;
          } else {
            searchData["||" + item.value + "*"] = item.content;
          if (item.value !== "all") {
            if (item.value == "year") {
              const endDate = item.content.split("/")[0] + "/12/31 23:59:59";
              const startDate = item.content.split("/")[0] + "/01/01 00:00:00";
              searchData[item.value + ">="] = startDate;
              searchData[item.value + "<="] = endDate;
            } else if (item.value) {
              searchData[item.value + "*"] = item.content;
            } else {
              searchData["||" + item.value + "*"] = item.content;
            }
          }
        });
      }
      console.log(searchData, "searchData");
      MG.resource
        .getItem({
@@ -872,10 +907,10 @@
    },
    openAiReading(text, name) {
        this.AIReading = text;
        this.aIName = name;
        this.dialogVisible = true;
    }
      this.AIReading = text;
      this.aIName = name;
      this.dialogVisible = true;
    },
  },
};
</script>
@@ -1428,11 +1463,11 @@
  height: 100%;
  overflow: auto;
}
.richTextInitError{
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
.richTextInitError {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination {
src/views/home/index.vue
@@ -7,7 +7,7 @@
          <p>学术思想传承多维度数据库</p>
        </div>
        <div class="searchBox">
          <SearchBox @searchFun="handleSearch" />
          <SearchBox @search="handleSearch" />
        </div>
      </div>
      <div class="menuBox">
@@ -23,7 +23,9 @@
            </div>
            <div class="menuTitle">{{ item.title }}</div>
            <div class="menuSubTitle">{{ item.subTitle }}</div>
            <div class="menuLine"><img class="autoImg" :src="arrow" alt="" /></div>
            <div class="menuLine">
              <img class="autoImg" :src="arrow" alt="" />
            </div>
          </div>
        </div>
      </div>
@@ -96,8 +98,13 @@
      this.$router.push(row.path);
    },
    handleSearch(type, value) {
      console.log(type, value);
    handleSearch(type) {
      if (type.text != "") {
        this.$router.push({
          name: "achievements",
          query: { type: type.type, value: type.text },
        });
      }
    },
    //获取人物介绍
    getPersonInfo() {