杨磊
3 天以前 dd511658a80514fef129800129ba24a5ceb9c878
src/views/achievements/index.vue
@@ -227,7 +227,9 @@
                <p>{{ item.name }}</p>
                <p>
                  <el-button @click="goPage(item.id)">详情</el-button>
                  <el-button>AI智能阅读</el-button>
                  <el-button @click="openAiReading(item.AIReading, item.name)"
                    >AI智能阅读</el-button
                  >
                </p>
              </li>
              <li class="main-sources">
@@ -286,6 +288,30 @@
              >
              </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>
              </div>
            </el-dialog>
            <el-empty v-if="!loading && !resultList.length"></el-empty>
          </div>
        </div>
@@ -308,6 +334,9 @@
  },
  data() {
    return {
      dialogVisible: false,
      aIName: "",
      AIReading: "",
      relatedList: [],
      // 输入框的内容
      inputValue: "",
@@ -562,6 +591,9 @@
    };
  },
  mounted() {
    console.log(this.$route.query, "query");
    this.inputType = this.$route.query.type;
    this.inputValue = this.$route.query.value;
    this.getSelectData();
  },
@@ -713,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") {
@@ -725,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) {
@@ -741,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({
@@ -861,6 +904,12 @@
        default:
          return "other-color";
      }
    },
    openAiReading(text, name) {
      this.AIReading = text;
      this.aIName = name;
      this.dialogVisible = true;
    },
  },
};
@@ -1287,18 +1336,23 @@
      .journal-color {
        background-color: #87a8b9;
      }
      .books-color {
        background-color: #c48787;
      }
      .video-color {
        background-color: #6f8f5a;
      }
      .audio-color {
        background-color: #937950;
      }
      .newspaper-color {
        background-color: #8d77b3;
      }
      .other-color {
        background-color: #009f9f;
      }
@@ -1399,6 +1453,23 @@
  }
}
.AIReadingBox {
  height: 85vh;
  min-height: 600px;
  padding: 20px 10px;
}
.richTextInitBox {
  height: 100%;
  overflow: auto;
}
.richTextInitError {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination {
  display: flex;
  justify-content: center;
@@ -1446,6 +1517,18 @@
:deep.el-pagination.is-background .el-pager li:not(.disabled):hover {
  color: #937950;
}
:deep.el-button--primary {
  background-color: #937950;
  color: #937950;
  border: 1px solid #937950;
  cursor: pointer;
  &:hover {
    background-color: #937950;
    color: #fffdf8;
  }
}
</style>
<style>