fei
2025-11-17 3a597ff321125e83de645f034f43655539999e21
src/views/archiveManager/index.vue
@@ -300,7 +300,7 @@
                  icon="el-icon-edit"
                  @click="handleInfo(scope.row)"
                  v-hasPermi="['system:records:edit']"
                >案卷详细信息</el-button>
                >编辑卷内目录</el-button>
                <el-button
                  size="mini"
@@ -446,9 +446,8 @@
          </div>
        </div>
    <!-- 优化的Excel预览组件 -->
     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%">
    <div  >
     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%" :show-close="true" @click="closeExcelPreviewDialog">
    <div  @click.stop>
      <!-- 主要预览组件 -->
      <vue-office-excel
        v-if="currentExcelUrl"
@@ -808,6 +807,7 @@
  name: "Records",
  data() {
    return {
      showExcelPreview: false,
                  excel: 'http://localhost:8080/profile/upload/12.xls', //设置文档网络地址,可以是相对地址
      open_check: false,
@@ -1379,6 +1379,7 @@
    /** 关闭Excel弹窗并清理资源 */
    closeExcelDialog() {
      this.excelDialogVisible = false;
    //  alert(this.excelDialogVisible)
      if (this.excelPreviewTimeout) {
        clearTimeout(this.excelPreviewTimeout);
        this.excelPreviewTimeout = null;
@@ -1389,14 +1390,18 @@
      }
      this.currentExcelBlob = null;
    },
closeExcelPreviewDialog()
{
  this.showExcelPreview = false;
},
    /** 处理预览按钮点击 */
    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();
@@ -1580,9 +1585,9 @@
        // 构建文件名,包含选项信息
        let filename = `record_${this.currentExcelId}`;
        if (includeQrCode) filename += '_qr';
        if (selectedAnnotations.length > 0) {
          filename += `_anno${selectedAnnotations.join('')}`;
        }
        // if (selectedAnnotations.length > 0) {
        //   filename += `_anno${selectedAnnotations.join('')}`;
        // }
        filename += `_${new Date().getTime()}.xlsx`;
        link.download = filename;
@@ -1618,7 +1623,7 @@
      });
    },
    /** 清理Excel预览相关资源 */
    /** 清理Excel预览相关资源并关闭对话框 */
    cleanupExcelPreview(iframe, url) {
      setTimeout(() => {
        if (iframe && iframe.parentNode) {
@@ -1628,6 +1633,7 @@
          URL.revokeObjectURL(url);
        }
        this.excelRenderError = '';
        this.showExcelPreview = false; // 关闭预览对话框
      }, 1000);
    },