king
2021-03-23 decf1f6555b6e003860401a692faea259cc565af
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -433,12 +433,17 @@
      let _header = []
      let _topRow = {}
      let colwidth = []
      let abses = []
      btn.verify.columns.forEach(col => {
        if (_topRow[col.Column]) return
        _header.push(col.Column)
        _topRow[col.Column] = col.Text
        if (col.abs === 'true') {
          abses.push(col.Column)
        }
        colwidth.push({width: col.Width || 20})
      })
@@ -447,7 +452,21 @@
      table.push(_topRow)
      data && data.forEach(item => {
      if (data && abses.length > 0) {
        data.forEach(item => {
          let _row = {}
          _header.forEach(field => {
            if (item[field] && abses.includes(field)) {
              _row[field] = Math.abs(item[field])
            } else {
              _row[field] = item[field]
            }
          })
          table.push(_row)
        })
      } else if (data) {
        data.forEach(item => {
        let _row = {}
        _header.forEach(field => {
          _row[field] = item[field]
@@ -455,6 +474,7 @@
        table.push(_row)
      })
      }
      const ws = XLSX.utils.json_to_sheet(table, {header: _header, skipHeader: true})