king
2025-01-16 325aa13d3b61d1c066f8fcab107003ef36713df3
src/menu/datasource/verifycard/excelout/index.jsx
@@ -23,6 +23,9 @@
    }
    let columns = [{
      Column: 'tb',
      Text: '表名'
    }, {
      Column: 'label',
      Text: '名称'
    }, {
@@ -37,6 +40,11 @@
    let _header = []
    let _topRow = {}
    let colwidth = []
    let tbName = setting.tableName || ''
    if (window.GLOB.externalDatabase !== null) {
      tbName = tbName.replace(/@db@/ig, window.GLOB.externalDatabase)
    }
    columns.forEach(col => {
      _header.push(col.Column)
@@ -50,8 +58,11 @@
      let _row = {}
      columns.forEach((col) => {
        let val = item[col.Column]
        _row[col.Column] = val
        if (col.Column === 'tb') {
          _row[col.Column] = tbName
        } else {
          _row[col.Column] = item[col.Column]
        }
      })
      table.push(_row)
@@ -65,7 +76,7 @@
    const wb = XLSX.utils.book_new()
    XLSX.utils.book_append_sheet(wb, ws, 'Sheet1')
    XLSX.writeFile(wb, `${setting.tableName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`)
    XLSX.writeFile(wb, `${tbName}${moment().format('YYYYMMDDHHmmss')}.xlsx`)
  }
  render() {