sinake
5 天以前 d3f66f66a0fa684bdc80bca582adb726b102966f
src/views/project/donationdetails/index.vue
@@ -2511,6 +2511,7 @@
      :title="pdftitle"
      :visible.sync="pdfVisible"
      width="68%"
      custom-class="pdf-resize-dialog"
    >
      <!-- <el-tabs style="margin-top: 20px;" v-model="activeName" type="card">
        <el-tab-pane :label="activetele" name="1"> </el-tab-pane>
@@ -4282,14 +4283,8 @@
    },
    // 获取请求头
    Getnetworkheader() {
      let string = window.location.href;
      if (string.includes("9091")) {
        const index = string.indexOf("9091");
        this.Networkheader = string.slice(0, index + 4); // 截取9091及其前部字符
      } else {
        const index = string.indexOf("8032");
        this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符
      }
      // 以当前页面 origin 为准,兼容 80/8032/9091 及后续端口调整
      this.Networkheader = window.location.origin;
    },
    // 获取附件数据并分类二级列
@@ -4337,7 +4332,7 @@
      const config = {
        headers: { Authorization: "Bearer " + this.ICDtoken }
      };
      const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
      const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName;
      console.log(this.Networkheader);
      //获取票据信息位置
      if (response.code == 200) {
@@ -4398,7 +4393,7 @@
      this.pdfVisible = true;
      if (this.annexfilesList.length) {
        this.annexfilesList.forEach((value, indexson) => {
          const pdfimg = this.Networkheader + "/prod-api" + value.annexurl;
          const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.annexurl;
          fetch(pdfimg, config)
            .then(response => response.blob())
            .then(blob => {
@@ -4433,18 +4428,13 @@
      console.log(item, "点击文件拿item");
      this.pdftitle =
        "共" + this.donatelist.length + "项,当前选中" + item.annexname;
      let name = item.annexname.split(".");
      if (name[1] == "pdf") {
        this.$modal.msgWarning("当前文件暂不支持预览");
        this.previewpdf = false;
        this.hintitle = "当前文件暂不支持预览";
      } else if (name[1] == "jpg" || "png") {
        this.previewpdf = true;
        if (item.annexurl) {
          this.pdfimg = item.annexurl;
        } else {
          this.pdfimg = "";
        }
      const ext = String(item.annexname || "pdf").toLowerCase().split(".").pop();
      if (ext === "pdf") {
        this.$previewFile([{ name: item.annexname, url: item.annexurl }]);
        return;
      } else if (["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(ext)) {
        this.$previewFile([{ name: item.annexname, url: item.annexurl }]);
        return;
      } else {
        this.hintitle = "当前文件暂不支持预览";
        this.$modal.msgWarning("当前文件暂不支持预览");