From f3167f8371d19d0ea8fe7d0e7af5517ff0b08cd2 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 07 四月 2021 23:25:29 +0800
Subject: [PATCH] 2021-04-07

---
 src/tabviews/zshare/actionList/exceloutbutton/index.jsx |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx b/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
index f2a67e7..121fc6f 100644
--- a/src/tabviews/zshare/actionList/exceloutbutton/index.jsx
+++ b/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,14 +452,29 @@
 
       table.push(_topRow)
 
-      data && data.forEach(item => {
-        let _row = {}
-        _header.forEach(field => {
-          _row[field] = item[field]
+      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)
         })
-
-        table.push(_row)
-      })
+      } else if (data) {
+        data.forEach(item => {
+          let _row = {}
+          _header.forEach(field => {
+            _row[field] = item[field]
+          })
+  
+          table.push(_row)
+        })
+      }
 
       const ws = XLSX.utils.json_to_sheet(table, {header: _header, skipHeader: true})
 
@@ -594,6 +614,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') || ''
@@ -608,6 +629,9 @@
       })
 
       regoptions.push({
+        reg: new RegExp('@login_city@', 'ig'),
+        value: city
+      }, {
         reg: new RegExp('@userName@', 'ig'),
         value: userName
       }, {

--
Gitblit v1.8.0