当前位置:首页>Excel>Vue预览Excel文件的完整指南:从零开始实现

Vue预览Excel文件的完整指南:从零开始实现

  • 2026-04-06 22:07:13
Vue预览Excel文件的完整指南:从零开始实现

大家好,今天我们来聊聊一个让无数前端开发者头疼的问题——Vue中如何预览Excel文件

你是否也遇到过这些场景:

  • 产品经理说:"用户上传Excel文件后,要在页面上直接预览,不要下载"
  • 用户抱怨:"我上传的Excel文件怎么看不到内容?"
  • 后端同事问:"前端能不能直接展示Excel,我返回二进制流就行"
  • 老板质疑:"为什么别人家的系统能预览Excel,我们的不行?"

别急,今天我就把这套Vue预览Excel文件的完整实现方案全掏出来,手把手教你从零开始实现Excel文件预览功能!

为什么Excel预览这么难搞?

在开始正题之前,先聊聊为什么Excel预览这么复杂:

  1. 格式多样:.xls、.xlsx、.csv等多种格式
  2. 功能复杂:合并单元格、公式计算、样式渲染
  3. 兼容性差:不同版本的Excel文件格式差异大
  4. 性能要求高:大文件预览不能卡顿
  5. 浏览器限制:原生不支持Excel格式解析

实现方案对比

方案一:使用第三方库(推荐)

优点:

  • 功能强大,支持多种Excel特性
  • 社区活跃,文档完善
  • 开箱即用,开发效率高

缺点:

  • 包体积较大
  • 需要学习成本

方案二:服务端转换

优点:

  • 前端实现简单
  • 兼容性好

缺点:

  • 增加服务端压力
  • 需要网络传输
  • 实时性差

方案三:纯前端实现

优点:

  • 无服务端依赖
  • 响应速度快

缺点:

  • 实现复杂
  • 功能有限

今天我们就重点介绍方案一:使用第三方库的实现方式。

核心实现:基于xlsx.js的Excel预览组件

1. 安装依赖

npm install xlsx# 如果需要公式计算功能npm install hot-formula-parser

2. 核心组件实现

<template>  <div class="excel-preview-container">    <!-- 文件上传区域 -->    <div v-if="!fileData" class="upload-area">      <el-upload        class="upload-demo"        drag        action=""        :http-request="handleFileUpload"        :auto-upload="true"        accept=".xls,.xlsx,.csv"      >        <el-icon class="el-icon--upload">          <upload-filled />        </el-icon>        <div class="el-upload__text">          将文件拖到此处,或<em>点击上传</em>        </div>        <template #tip>          <div class="el-upload__tip">            只能上传 xls/xlsx/csv 文件,且不超过 10MB          </div>        </template>      </el-upload>    </div>    <!-- Excel预览区域 -->    <div v-else class="preview-area">      <!-- 工具栏 -->      <div class="toolbar">        <el-button @click="resetPreview">重新选择</el-button>        <el-checkbox           v-model="showFormulas"           @change="refreshPreview"        >          显示公式        </el-checkbox>        <el-select           v-model="currentSheet"           @change="switchSheet"          placeholder="选择工作表"        >          <el-option            v-for="sheet in sheetNames"            :key="sheet"            :label="sheet"            :value="sheet"          />        </el-select>      </div>      <!-- 表格预览 -->      <div class="table-container" ref="tableContainer">        <table class="excel-table" v-if="tableData.length > 0">          <tbody>            <tr v-for="(row, rowIndex) in tableData" :key="rowIndex">              <template v-for="(cell, colIndex) in row" :key="colIndex">                <td                  v-if="!isCellMerged(rowIndex, colIndex)"                  :colspan="getColspan(rowIndex, colIndex)"                  :rowspan="getRowspan(rowIndex, colIndex)"                  :class="getCellClass(rowIndex, colIndex, cell)"                >                  <div class="cell-content">                    <div                      v-if="cellFormulas[`${rowIndex},${colIndex}`] && showFormulas"                      class="formula-display"                    >                      <span class="formula-icon">ƒ</span>                      <span class="formula-text">                        {{ cellFormulas[`${rowIndex},${colIndex}`] }}                      </span>                    </div>                    <span v-else>                      {{ formatCellValue(cell, rowIndex, colIndex) }}                    </span>                  </div>                </td>              </template>            </tr>          </tbody>        </table>        <!-- 空数据提示 -->        <div v-else class="empty-data">          <el-empty description="暂无数据" />        </div>      </div>    </div>    <!-- 加载状态 -->    <div v-if="loading" class="loading-overlay">      <el-spinner />      <p>正在解析文件...</p>    </div>  </div></template><script>import * as XLSX from 'xlsx';import { Parser } from 'hot-formula-parser';export default {  name: 'ExcelPreview',  props: {    // 支持传入文件对象或ArrayBuffer    file: {      type: [File, ArrayBuffer, Blob],      default: null    },    // 是否显示公式    showFormulas: {      type: Boolean,      default: false    }  },  data() {    return {      fileData: null, // 文件数据      tableData: [], // 表格数据      sheetNames: [], // 工作表名称列表      currentSheet: '', // 当前工作表      mergedCells: {}, // 合并单元格信息      cellFormulas: {}, // 单元格公式      cellFormats: {}, // 单元格格式      loading: false, // 加载状态      workbook: null // 工作簿对象    };  },  watch: {    // 监听外部传入的文件    file: {      immediate: true,      handler(newFile) {        if (newFile) {          this.processFile(newFile);        }      }    },    // 监听显示公式选项变化    showFormulas() {      this.refreshPreview();    }  },  methods: {    // 处理文件上传    async handleFileUpload({ file }) {      try {        this.loading = true;        await this.processFile(file);        this.$emit('file-loaded', file);      } catch (error) {        this.$message.error('文件解析失败:' + error.message);      } finally {        this.loading = false;      }    },    // 处理文件数据    async processFile(file) {      try {        let arrayBuffer;        // 根据文件类型处理        if (file instanceof ArrayBuffer) {          arrayBuffer = file;        } else if (file instanceof Blob) {          arrayBuffer = await this.blobToArrayBuffer(file);        } else {          // File对象          arrayBuffer = await this.fileToArrayBuffer(file);        }        // 解析Excel文件        this.parseExcelFile(arrayBuffer);      } catch (error) {        throw new Error('文件处理失败:' + error.message);      }    },    // File转ArrayBuffer    fileToArrayBuffer(file) {      return new Promise((resolve, reject) => {        const reader = new FileReader();        reader.onload = event => resolve(event.target.result);        reader.onerror = error => reject(error);        reader.readAsArrayBuffer(file);      });    },    // Blob转ArrayBuffer    blobToArrayBuffer(blob) {      return new Promise((resolve, reject) => {        const reader = new FileReader();        reader.onload = event => resolve(event.target.result);        reader.onerror = error => reject(error);        reader.readAsArrayBuffer(blob);      });    },    // 解析Excel文件    parseExcelFile(arrayBuffer) {      try {        // 读取工作簿        const workbook = XLSX.read(arrayBuffer, {          type: 'array',          cellFormula: true, // 读取公式          cellHTML: false,   // 不读取HTML          cellDates: true,   // 日期格式化          sheetStubs: true,  // 读取空单元格          WTF: false         // 不显示警告        });        this.workbook = workbook;        this.sheetNames = workbook.SheetNames;        // 默认显示第一个工作表        if (this.sheetNames.length > 0) {          this.currentSheet = this.sheetNames[0];          this.renderSheet(this.currentSheet);        }        this.fileData = arrayBuffer;      } catch (error) {        throw new Error('Excel文件解析失败:' + error.message);      }    },    // 渲染工作表    renderSheet(sheetName) {      try {        const worksheet = this.workbook.Sheets[sheetName];        if (!worksheet) {          throw new Error('工作表不存在');        }        // 获取工作表范围        const range = worksheet['!ref'] ? XLSX.utils.decode_range(worksheet['!ref']) : { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };        // 解析合并单元格        this.parseMergedCells(worksheet);        // 解析公式        this.parseFormulas(worksheet);        // 解析单元格格式        this.parseCellFormats(worksheet);        // 转换为表格数据        this.convertToTableData(worksheet, range);      } catch (error) {        this.$message.error('工作表渲染失败:' + error.message);      }    },    // 解析合并单元格    parseMergedCells(worksheet) {      this.mergedCells = {};      if (worksheet['!merges']) {        worksheet['!merges'].forEach(merge => {          const startRow = merge.s.r;          const startCol = merge.s.c;          const endRow = merge.e.r;          const endCol = merge.e.c;          // 记录合并单元格的起始位置和跨度          this.mergedCells[`${startRow},${startCol}`] = {            rowspan: endRow - startRow + 1,            colspan: endCol - startCol + 1          };          // 标记被合并的单元格          for (let r = startRow; r <= endRow; r++) {            for (let c = startCol; c <= endCol; c++) {              if (r !== startRow || c !== startCol) {                this.mergedCells[`${r},${c}`] = { hidden: true };              }            }          }        });      }    },    // 解析公式    parseFormulas(worksheet) {      this.cellFormulas = {};      // 遍历所有单元格      for (const cellRef in worksheet) {        if (cellRef[0] === '!') continue; // 跳过特殊属性        const cell = worksheet[cellRef];        if (cell && cell.f) { // 有公式          const { r: row, c: col } = XLSX.utils.decode_cell(cellRef);          this.cellFormulas[`${row},${col}`] = cell.f;        }      }    },    // 解析单元格格式    parseCellFormats(worksheet) {      this.cellFormats = {};      for (const cellRef in worksheet) {        if (cellRef[0] === '!') continue;        const cell = worksheet[cellRef];        if (cell && cell.z) { // 有格式          const { r: row, c: col } = XLSX.utils.decode_cell(cellRef);          this.cellFormats[`${row},${col}`] = cell.z;        }      }    },    // 转换为表格数据    convertToTableData(worksheet, range) {      const data = [];      // 遍历行      for (let r = range.s.r; r <= range.e.r; r++) {        const row = [];        // 遍历列        for (let c = range.s.c; c <= range.e.c; c++) {          const cellRef = XLSX.utils.encode_cell({ r, c });          const cell = worksheet[cellRef];          if (cell && cell.v !== undefined) {            row.push(cell.v);          } else {            row.push('');          }        }        data.push(row);      }      this.tableData = data;    },    // 判断是否为合并单元格    isCellMerged(row, col) {      const key = `${row},${col}`;      return this.mergedCells[key] && this.mergedCells[key].hidden;    },    // 获取colspan    getColspan(row, col) {      const key = `${row},${col}`;      return this.mergedCells[key] ? this.mergedCells[key].colspan || 1 : 1;    },    // 获取rowspan    getRowspan(row, col) {      const key = `${row},${col}`;      return this.mergedCells[key] ? this.mergedCells[key].rowspan || 1 : 1;    },    // 获取单元格样式类    getCellClass(row, col, cell) {      const classes = [];      // 表头样式      if (row === 0) {        classes.push('header-cell');      }      // 隔行变色      if (row % 2 === 1) {        classes.push('odd-row');      }      // 公式单元格      if (this.cellFormulas[`${row},${col}`]) {        classes.push('formula-cell');      }      // 空单元格      if (cell === '' || cell === null || cell === undefined) {        classes.push('empty-cell');      }      return classes.join(' ');    },    // 格式化单元格值    formatCellValue(value, row, col) {      if (value === null || value === undefined) {        return '';      }      // 处理日期      if (value instanceof Date) {        return value.toLocaleDateString();      }      // 处理数字格式      const format = this.cellFormats[`${row},${col}`];      if (format) {        try {          return XLSX.SSF.format(format, value);        } catch (e) {          // 格式化失败,返回原始值        }      }      return String(value);    },    // 切换工作表    switchSheet(sheetName) {      this.renderSheet(sheetName);    },    // 刷新预览    refreshPreview() {      if (this.currentSheet) {        this.renderSheet(this.currentSheet);      }    },    // 重置预览    resetPreview() {      this.fileData = null;      this.tableData = [];      this.sheetNames = [];      this.currentSheet = '';      this.mergedCells = {};      this.cellFormulas = {};      this.cellFormats = {};      this.workbook = null;      this.$emit('reset');    }  }};</script><style scoped>.excel-preview-container {  position: relative;  width: 100%;  height: 100%;}.upload-area {  padding: 20px;  text-align: center;}.preview-area {  padding: 20px;}.toolbar {  margin-bottom: 20px;  display: flex;  align-items: center;  gap: 15px;}.table-container {  overflow: auto;  max-height: 600px;  border: 1px solid #ebeef5;  border-radius: 4px;}.excel-table {  width: 100%;  border-collapse: collapse;  font-size: 14px;}.excel-table td {  border: 1px solid #ebeef5;  padding: 8px 12px;  min-width: 80px;  vertical-align: middle;  position: relative;}.header-cell {  background-color: #f5f7fa;  font-weight: bold;}.odd-row {  background-color: #fafafa;}.formula-cell {  background-color: #fff7e6;}.empty-cell {  color: #c0c4cc;}.formula-display {  display: flex;  align-items: center;  gap: 4px;}.formula-icon {  color: #409eff;  font-weight: bold;}.formula-text {  color: #606266;  font-family: monospace;}.cell-content {  word-break: break-all;  line-height: 1.4;}.empty-data {  text-align: center;  padding: 40px 0;}.loading-overlay {  position: absolute;  top: 0;  left: 0;  right: 0;  bottom: 0;  background: rgba(255, 255, 255, 0.8);  display: flex;  flex-direction: column;  align-items: center;  justify-content: center;  z-index: 1000;}.loading-overlay p {  margin-top: 10px;  color: #606266;}</style>

3. 使用示例

<template>  <div class="app-container">    <h2>Excel文件预览示例</h2>    <!-- 基础使用 -->    <ExcelPreview       :file="selectedFile"       :show-formulas="showFormulas"      @file-loaded="onFileLoaded"      @reset="onReset"    />    <!-- 后端返回的二进制流处理 -->    <div class="backend-example">      <h3>后端文件预览示例</h3>      <el-button @click="loadBackendFile" :loading="loading">        加载后端Excel文件      </el-button>      <ExcelPreview         v-if="backendFileData"         :file="backendFileData"      />    </div>  </div></template><script>import ExcelPreview from './components/ExcelPreview.vue';import axios from 'axios';export default {  name: 'App',  components: {    ExcelPreview  },  data() {    return {      selectedFile: null,      showFormulas: false,      backendFileData: null,      loading: false    };  },  methods: {    // 处理文件加载完成    onFileLoaded(file) {      console.log('文件加载完成:', file);      this.$message.success('Excel文件加载成功');    },    // 处理重置    onReset() {      console.log('预览已重置');      this.selectedFile = null;    },    // 加载后端文件    async loadBackendFile() {      try {        this.loading = true;        // 模拟后端API调用        const response = await axios.get('/api/excel-file', {          responseType: 'arraybuffer'        });        // 直接将ArrayBuffer传递给组件        this.backendFileData = response.data;        this.$message.success('后端文件加载成功');      } catch (error) {        this.$message.error('文件加载失败:' + error.message);      } finally {        this.loading = false;      }    }  }};</script><style scoped>.app-container {  padding: 20px;  max-width: 1200px;  margin: 0 auto;}.backend-example {  margin-top: 40px;  padding-top: 20px;  border-top: 1px solid #ebeef5;}</style>

4. 高级功能扩展

公式计算支持

// 在ExcelPreview组件中添加公式计算功能import { Parser } from'hot-formula-parser';// 在data中添加data() {return {formulaParsernew Parser(),// ... 其他数据  };},// 初始化公式解析器mounted() {this.initFormulaParser();},methods: {  initFormulaParser() {// 设置单元格值获取回调this.formulaParser.on('callCellValue', (cellCoord, done) => {const sheet = cellCoord.sheet || this.currentSheet;const row = cellCoord.row.index;const col = cellCoord.column.index;// 从工作表数据中获取值const value = this.getCellValue(sheet, row, col);      done(value !== undefined ? value : null);    });// 设置范围值获取回调this.formulaParser.on('callRangeValue', (startCellCoord, endCellCoord, done) => {const sheet = startCellCoord.sheet || this.currentSheet;const startRow = startCellCoord.row.index;const endRow = endCellCoord.row.index;const startCol = startCellCoord.column.index;const endCol = endCellCoord.column.index;const values = [];for (let r = startRow; r <= endRow; r++) {const row = [];for (let c = startCol; c <= endCol; c++) {const value = this.getCellValue(sheet, r, c);          row.push(value !== undefined ? value : null);        }        values.push(row);      }      done(values);    });  },// 计算公式值  calculateFormula(formula, sheetName) {try {const result = this.formulaParser.parse(formula);return result.result;    } catch (error) {console.error('公式计算错误:', error);return'#ERROR!';    }  },// 获取单元格值  getCellValue(sheetName, row, col) {// 实现获取指定工作表中指定单元格值的逻辑// 这里需要根据实际的数据结构来实现  }}

样式美化增强

/* 增强的样式 */.excel-tabletd {border1px solid #ebeef5;padding8px12px;min-width80px;vertical-align: middle;position: relative;transition: all 0.2s ease;}.excel-tabletd:hover {background-color#f0f9eb;box-shadow: inset 0001px#67c23a;}.header-cell {backgroundlinear-gradient(180deg, #409eff, #337ecc);color: white;font-weight: bold;text-shadow01px2pxrgba(0000.2);}.odd-row {background-color#fafafa;}.even-row {background-color: white;}.formula-cell {backgroundlinear-gradient(180deg#fff7e6#ffe7ba);position: relative;}.formula-cell::before {content"ƒ";position: absolute;top2px;right2px;font-size10px;color#409eff;}.empty-cell {color#c0c4cc;background-color#f8f8f8;}.error-cell {background-color#fef0f0;color#f56c6c;border-color#fbc4c4;}.cell-content {word-break: break-all;line-height1.4;min-height20px;}/* 响应式设计 */@media (max-width:768px) {.excel-tabletd {padding6px8px;font-size12px;min-width60px;  }.toolbar {flex-direction: column;align-items: stretch;gap10px;  }.table-container {max-height400px;  }}

5个核心优化技巧

1. 大文件性能优化

// 虚拟滚动实现methods: {// 限制渲染的行数  limitRenderRows(data, maxRows = 1000) {if (data.length > maxRows) {this.$message.warning(`文件行数过多,仅显示前${maxRows}行`);return data.slice(0, maxRows);    }return data;  },// 分页渲染  renderWithPagination(data, pageSize = 100) {this.totalPages = Math.ceil(data.length / pageSize);this.currentPage = 1;this.paginatedData = data.slice(0, pageSize);  }}

2. 内存管理

// 及时释放资源beforeDestroy() {// 清理工作簿if (this.workbook) {this.workbook = null;  }// 清理文件数据if (this.fileData) {this.fileData = null;  }// 清理缓存数据this.tableData = [];this.sheetNames = [];this.mergedCells = {};this.cellFormulas = {};this.cellFormats = {};}

3. 错误处理

// 完善的错误处理methods: {async safeParseFile(file) {try {this.loading = true;awaitthis.processFile(file);this.$emit('success', file);    } catch (error) {this.$emit('error', error);this.handleError(error);    } finally {this.loading = false;    }  },  handleError(error) {const errorMessage = this.getErrorMessage(error);this.$message.error(errorMessage);// 记录错误日志console.error('Excel预览错误:', error);  },  getErrorMessage(error) {if (error.message.includes('password')) {return'文件已加密,请先解密';    }if (error.message.includes('format')) {return'文件格式不支持';    }if (error.message.includes('size')) {return'文件过大,请压缩后重试';    }return'文件解析失败,请检查文件是否损坏';  }}

4. 用户体验优化

// 加载进度提示methods: {  showProgress(percent) {this.$message.info(`文件解析中... ${percent}%`);  },// 拖拽上传优化  handleDragOver(event) {    event.preventDefault();    event.stopPropagation();this.isDragging = true;  },  handleDragLeave(event) {    event.preventDefault();    event.stopPropagation();this.isDragging = false;  }}

5. 兼容性处理

// 浏览器兼容性检查mounted() {this.checkBrowserCompatibility();},methods: {  checkBrowserCompatibility() {if (!window.FileReader) {this.$message.error('当前浏览器不支持文件读取功能');returnfalse;    }if (!window.ArrayBuffer) {this.$message.error('当前浏览器不支持ArrayBuffer');returnfalse;    }returntrue;  },// 文件类型检查  validateFileType(file) {const allowedTypes = ['application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','text/csv'    ];const allowedExtensions = ['.xls''.xlsx''.csv'];const isValidType = allowedTypes.includes(file.type);const isValidExtension = allowedExtensions.some(ext =>      file.name.toLowerCase().endsWith(ext)    );return isValidType || isValidExtension;  }}

实战案例:某企业管理系统Excel预览功能

需求分析

某企业管理系统需要支持员工上传Excel文件进行数据导入,要求:

  1. 支持.xls、.xlsx、.csv格式
  2. 预览前500行数据
  3. 显示工作表切换
  4. 支持公式显示
  5. 大文件提示优化

实现代码

<template>  <div class="enterprise-excel-preview">    <div class="preview-header">      <h3>数据预览</h3>      <div class="header-actions">        <el-tag v-if="fileInfo" type="info">          {{ fileInfo.name }} ({{ fileInfo.size }})        </el-tag>        <el-button @click="confirmImport" type="primary" size="small">          确认导入        </el-button>      </div>    </div>    <ExcelPreview      :file="excelFile"      :show-formulas="showFormulas"      @file-loaded="onFileLoaded"      @error="onError"    />    <div v-if="warningMessage" class="warning-message">      <el-alert        :title="warningMessage"        type="warning"        show-icon        :closable="false"      />    </div>  </div></template><script>import ExcelPreview from './ExcelPreview.vue';export default {  name: 'EnterpriseExcelPreview',  components: {    ExcelPreview  },  props: {    excelFile: {      type: [File, ArrayBuffer],      required: true    }  },  data() {    return {      showFormulas: false,      fileInfo: null,      warningMessage: '',      tableStats: {        rows: 0,        cols: 0,        sheets: 0      }    };  },  methods: {    onFileLoaded(file) {      this.fileInfo = {        name: file.name,        size: this.formatFileSize(file.size),        type: file.type      };      // 分析文件统计信息      this.analyzeFileStats(file);      this.$emit('loaded', file);    },    onError(error) {      this.$emit('error', error);    },    analyzeFileStats(file) {      // 这里可以添加文件统计分析逻辑      // 比如行数、列数、工作表数量等    },    formatFileSize(bytes) {      if (bytes === 0) return '0 Bytes';      const k = 1024;      const sizes = ['Bytes', 'KB', 'MB', 'GB'];      const i = Math.floor(Math.log(bytes) / Math.log(k));      return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];    },    confirmImport() {      this.$emit('confirm-import', {        fileInfo: this.fileInfo,        stats: this.tableStats      });    }  }};</script><style scoped>.enterprise-excel-preview {  border: 1px solid #ebeef5;  border-radius: 4px;  overflow: hidden;}.preview-header {  display: flex;  justify-content: space-between;  align-items: center;  padding: 15px 20px;  background-color: #f5f7fa;  border-bottom: 1px solid #ebeef5;}.preview-header h3 {  margin: 0;  color: #303133;}.header-actions {  display: flex;  align-items: center;  gap: 15px;}.warning-message {  padding: 15px 20px;  background-color: #fdf6ec;  border-top: 1px solid #ebeef5;}</style>

结语

通过今天的学习,我们掌握了Vue中实现Excel文件预览的完整方案:

  1. 核心技术:使用xlsx.js库解析Excel文件
  2. 核心功能:文件上传、表格渲染、公式显示、合并单元格处理
  3. 优化技巧:性能优化、内存管理、错误处理、用户体验优化
  4. 实战应用:企业级应用中的完整实现

记住这几个关键点:

  • 选择合适的第三方库是成功的一半
  • 合理处理大文件和性能问题是关键
  • 完善的错误处理提升用户体验
  • 样式美化让预览效果更专业

Excel预览功能虽然看似简单,但要做好却需要考虑很多细节。希望今天的分享能帮助大家在项目中轻松实现这个功能!

如果你觉得这篇文章对你有帮助,欢迎点赞、在看、转发三连,你的支持是我们持续创作的最大动力!


前端技术精选 | 专注分享实用的前端技术干货

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-07 18:13:05 HTTP/2.0 GET : https://h.sjds.net/a/466139.html
  2. 运行时间 : 0.188384s [ 吞吐率:5.31req/s ] 内存消耗:4,431.76kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=cc29a750cf4e5d3fbf734f88e11bf4b2
  1. /yingpanguazai/ssd/ssd1/www/h.sjds.net/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/h.sjds.net/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/h.sjds.net/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/h.sjds.net/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/h.sjds.net/runtime/temp/ad153693ed39fba6d1bda2fe72512cde.php ( 12.06 KB )
  140. /yingpanguazai/ssd/ssd1/www/h.sjds.net/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001124s ] mysql:host=127.0.0.1;port=3306;dbname=h_sjds;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001616s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.002843s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000722s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001385s ]
  6. SELECT * FROM `set` [ RunTime:0.000681s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001598s ]
  8. SELECT * FROM `article` WHERE `id` = 466139 LIMIT 1 [ RunTime:0.007278s ]
  9. UPDATE `article` SET `lasttime` = 1775556786 WHERE `id` = 466139 [ RunTime:0.072762s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.000878s ]
  11. SELECT * FROM `article` WHERE `id` < 466139 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001359s ]
  12. SELECT * FROM `article` WHERE `id` > 466139 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001078s ]
  13. SELECT * FROM `article` WHERE `id` < 466139 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002244s ]
  14. SELECT * FROM `article` WHERE `id` < 466139 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002288s ]
  15. SELECT * FROM `article` WHERE `id` < 466139 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002495s ]
0.192155s