fei
2025-11-16 f371d3ffa56f5cc279d1f9079a909665ccd13b1f
详细
1个文件已修改
42 ■■■■ 已修改文件
src/views/archiveManager/index.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/archiveManager/index.vue
@@ -420,7 +420,7 @@
              <div class="option-label">选择注解:</div>
              <div class="annotation-options">
              <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="annotation">
                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
                              <span>{{ annotation }}
                              </span>
              </label>
@@ -433,7 +433,7 @@
              <div class="signature-options">
                <div class="signature-checkboxes">
                 <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="signature">
                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
                                 <span>{{ signature }}</span>
                  </label>
@@ -1349,6 +1349,8 @@
    /** 查看并打印Excel文件 */
    viewAndPrintExcel(row) {
      const id = row.id || this.ids;
     // alert(id)
      this.recordId = id;
      this.$modal.loading('正在获取Excel文件,请稍候...');
      // 从后端获取Excel文件
@@ -1392,7 +1394,23 @@
    handlePreviewClick() {
      this.showExcelPreview = true;
      this.excelRenderError = '';
      var id = this.recordId ;
      this.$modal.loading('正在获取Excel文件,请稍候...');
      alert(id)
      // 从后端获取Excel文件
      this.getExcelFile(id).then(blob => {
        this.$modal.closeLoading();
        // 保存文件信息并显示静态弹窗
        this.currentExcelUrl = URL.createObjectURL(blob);
        this.currentExcelBlob = blob;
        this.currentExcelId = id;
        this.excelDialogVisible = true;
        this.excelLoading = false;
      }).catch(error => {
        this.$modal.closeLoading();
        console.error('获取Excel文件失败:', error);
        this.$modal.msgError('获取Excel文件失败,请稍后重试');
      });
      // 重置vue-office-excel组件
      if (this.currentExcelUrl) {
        const tempUrl = this.currentExcelUrl;
@@ -1616,6 +1634,20 @@
    /** 从后端获取Excel文件 */
    getExcelFile(id) {
      var includeQrCode = this.excelOptions.includeQrCode;
      var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
      if(this.excelOptions.subselectedSignatures.length!=0)
      {
        var selectedSignatures = this.excelOptions.subselectedSignatures
        urls = urls +'/'+ selectedSignatures
        }
      if(this.excelOptions.subselectedAnnotations.length!=0)
      {
        var selectedAnnotations = this.excelOptions.subselectedAnnotations
        urls = urls+"/"+selectedAnnotations
        }
      return new Promise((resolve, reject) => {
        // 首先尝试使用axios(项目已有的HTTP客户端)
        try {
@@ -1627,10 +1659,10 @@
            recordId: id,
          };
alert(355)
          axios({
            method: 'Post',
            url: `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode,
            url: urls,
            params: params,
            responseType: 'blob',
            headers: { 'Authorization': 'Bearer ' + getToken() }