From 6afdec0062dacbded57e166230eb22cc55ced0c1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 08 五月 2021 14:30:21 +0800
Subject: [PATCH] 2021-05-08

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx |   40 ++++++++++++++++++----------------------
 1 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index ec8f827..ea6c15d 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -452,29 +452,21 @@
 
       table.push(_topRow)
 
-      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 => {
+      data && data.forEach((item, index) => {
+        let _row = {}
+
+        item.$Index = index + 1
+
+        _header.forEach(field => {
+          if (item[field] && abses.includes(field)) {
+            _row[field] = Math.abs(item[field])
+          } else {
             _row[field] = item[field]
-          })
-  
-          table.push(_row)
+          }
         })
-      }
+
+        table.push(_row)
+      })
 
       const ws = XLSX.utils.json_to_sheet(table, {header: _header, skipHeader: true})
 
@@ -614,6 +606,7 @@
       let allSearch = Utils.getAllSearchOptions(search)
       let userName = sessionStorage.getItem('User_Name') || ''
       let fullName = sessionStorage.getItem('Full_Name') || ''
+      let city = sessionStorage.getItem('city') || ''
 
       if (sessionStorage.getItem('isEditState') === 'true') {
         userName = sessionStorage.getItem('CloudUserName') || ''
@@ -628,6 +621,9 @@
       })
 
       regoptions.push({
+        reg: new RegExp('@login_city@', 'ig'),
+        value: city
+      }, {
         reg: new RegExp('@userName@', 'ig'),
         value: userName
       }, {
@@ -794,7 +790,7 @@
           type="link"
           title={show === 'icon' ? btn.label : ''}
           loading={loading}
-          style={btn.btnstyle}
+          style={btn.style}
           icon={show === 'text' ? '' : (show === 'icon' ? (btn.icon || 'download') : (btn.icon || ''))}
           onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
         >{show === 'icon' ? '' : btn.label}</Button>

--
Gitblit v1.8.0