zhongshujie
13 小时以前 daa13602cd5c0c272bb303bdf4ca01709a2bb4aa
bug修改
4个文件已修改
42 ■■■■ 已修改文件
src/views/achievements/details.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/achievements/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/directory/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/honors/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/achievements/details.vue
@@ -78,14 +78,17 @@
        </li>
      </ul>
    </div>
    <el-dialog v-model="dialogVisible" :title="pdfName" width="60vw" top="2vh" bottom="2vh"
    <el-empty v-if="!loading && details == ''"></el-empty>
    <el-dialog v-model="dialogVisible" :title="pdfName" width="60vw" top="3vh" bottom="2vh"
      :visible.sync="dialogVisible" class="custom-dialog">
      <div class="pdfInfoBox">
      <div class="pdfInfoBox" v-loading="pdfLoading" element-loading-text="图片加载中"
        element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0)">
        <div v-for="(item, index) in pdfList" :key="index" class="pdfItem" :page="index + 1">
          <img :src="item.showSrc" alt="" style="min-height: 550px" loading="lazy" />
          <el-divider content-position="center"> 第 {{ index + 1 }} 页 </el-divider>
        </div>
      </div>
      <el-empty v-if="!pdfLoading && !pdfList.length"></el-empty>
    </el-dialog>
  </div>
</template>
@@ -152,13 +155,12 @@
      // 查询结果
      resultList: [],
      loading: false,
      pdfLoading: false,
    };
  },
  async mounted() {
    await this.getContent(this.$route.query.id);
    await this.getSelectData();
    console.log(this.details, "请求出来的数据");
    // 查找关键词相匹配的文章
    if (this.details.keyWords && this.details.keyWords.length) {
      for (let i = 0; i < this.details.keyWords.length; i++) {
@@ -167,6 +169,7 @@
        this.inputType = "keyWords"
        await this.getItemListOne()
      }
      this.loading = false;
      console.log(this.resultList, "处理好的");
    } else {
      this.getItemList()
@@ -174,6 +177,7 @@
    if (this.resultList.length == 0) {
      this.getItemList()
    }
    //处理文件
    if (this.details.cmsItemType == "video" || this.details.cmsItemType == "audio") {
      if (this.details.file != "") {
@@ -193,6 +197,7 @@
  methods: {
    // 根据id请求该页面数据
    async getContent(id) {
      this.loading = true;
      const res = await MG.resource
        .getItem({
          path: "*",
@@ -219,14 +224,13 @@
          // 设置一个默认值或者进行其他错误处理
          item.keyWords = [];
        }
        if(item.author && item.author.length>0){
        if (item.author && item.author.length > 0) {
          item.author = item.author.split(";");
        }
        const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType);
        item.resourceTypeName = foundItem ? foundItem.name : '';
      })
      this.details = res.datas[0]
      this.loading = false;
    },
    // 在此点击详情
@@ -248,6 +252,7 @@
      if (this.resultList.length == 0) {
        this.getItemList()
      }
      //处理文件
      if (this.details.cmsItemType == "video" || this.details.cmsItemType == "audio") {
        if (this.details.file != "") {
@@ -308,6 +313,7 @@
          showSrc: ''
        })
      }
      this.pdfLoading = false;
      // 启动页码观察
      setTimeout(() => {
        this.initObservation()
@@ -355,7 +361,6 @@
    //获取下拉选择框的内容
    async getSelectData() {
      this.loading = true;
      try {
        // 同时发起两个异步请求,并等待它们的结果
        const [resourceListResult] = await Promise.all([
@@ -450,22 +455,10 @@
          this.resultList.push(item);
        }
      });
      // 排除自身且去重
      // const relatedList = res.datas.filter((item) => {
      //   return item.id !== this.details.id;
      // });
      // this.resultList.push(...relatedList)
      // // 根据id去重
      // this.resultList = this.uniqueById(this.resultList);
      // //最多显示10条
      // if (this.resultList.length > 10) {
      //   this.resultList = this.resultList.slice(0, 10);
      // }
      this.loading = false;
    },
    async openPdf(name) {
      this.pdfLoading = true;
      this.pdfList = []
      this.pdfName = name;
      this.dialogVisible = true;
@@ -923,7 +916,7 @@
          }
          .keyWord {
            cursor: pointer;
            padding: 5px 10px;
            color: #937950;
            border: 1px solid #937950;
src/views/achievements/index.vue
@@ -175,7 +175,7 @@
              </el-pagination>
            </div>
          </div>
          <el-empty v-if="!loading && !resultList.length"></el-empty>
        </div>
      </div>
    </div>
@@ -666,7 +666,7 @@
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 1250px;
  min-width: 1200px;
  overflow: auto;
  padding-top: 1%;
  padding-bottom: 2%;
src/views/directory/index.vue
@@ -209,6 +209,7 @@
            </table>
          </div>
        </div>
        <!-- <el-empty v-if="!resultList.length"></el-empty> -->
      </div>
    </div>
  </div>
@@ -593,6 +594,7 @@
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 1200px;
  overflow: auto;
  padding-top: 2%;
  padding-bottom: 2%;
src/views/honors/index.vue
@@ -141,6 +141,7 @@
  flex: 1;
  width: 100%;
  height: 100%;
  min-width: 1200px;
  overflow: auto;
  padding-top: 2%;
  padding-bottom: 2%;