From 3b374cffff6272f2cfaa9f0ed9ce9a16d162657c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 24 十二月 2024 22:58:26 +0800
Subject: [PATCH] Merge branch 'develop'

---
 public/options.json                      |    1 
 src/index.js                             |    4 ++
 src/api/index.js                         |   26 +++++++++++++
 src/components/header/index.jsx          |   18 +++++++++
 public/README.txt                        |    3 +
 src/utils/utils-custom.js                |    2 
 src/menu/datasource/verifycard/index.jsx |   17 +++++++-
 7 files changed, 67 insertions(+), 4 deletions(-)

diff --git a/public/README.txt b/public/README.txt
index 50a4e1b..e678fa0 100644
--- a/public/README.txt
+++ b/public/README.txt
@@ -24,4 +24,5 @@
 execType          -- 鑴氭湰浼犺緭鏂瑰紡锛屽�间负x鏃讹紝鍚敤AES鍔犲瘑
 SysNotice         -- 鏄惁寮�鍚郴缁熸秷鎭�
 updateStatus      -- 鏄惁鏇存柊寮�鍙戠姸鎬侊紝榛樿寮�鍚紝褰撳�间负 false 鏃剁鐢�
-forcedUpdate      -- 浼犺緭鍙峰崌绾ф椂锛屾槸鍚﹁嚜鍔ㄩ��鍑猴紝鏍煎紡涓猴紙YYYY-MM-DD锛夛紝鐢ㄤ簬鍗囩骇鍚庡埛鏂扮敤鎴锋湰鍦伴厤缃�
\ No newline at end of file
+forcedUpdate      -- 浼犺緭鍙峰崌绾ф椂锛屾槸鍚﹁嚜鍔ㄩ��鍑猴紝鏍煎紡涓猴紙YYYY-MM-DD锛夛紝鐢ㄤ簬鍗囩骇鍚庡埛鏂扮敤鎴锋湰鍦伴厤缃�
+errorLog          -- 璁板綍500銆�504鏃剁殑鎶ラ敊鏃ュ織锛屽�间负 true 鏃跺紑鍚紝涓氬姟绯荤粺鏈夋晥
\ No newline at end of file
diff --git a/public/options.json b/public/options.json
index 5535fcb..4d657a5 100644
--- a/public/options.json
+++ b/public/options.json
@@ -21,6 +21,7 @@
   "keepPwd": "true",
   "execType": "x",
   "SysNotice": "false",
+  "errorLog": "false",
   "host": "http://qingqiumarket.cn",
   "service": "MKWMS/"
 }
\ No newline at end of file
diff --git a/src/api/index.js b/src/api/index.js
index 2f9193c..62fa85f 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -74,6 +74,32 @@
       placement: 'bottomRight',
       duration: 15
     })
+    if ([500, 504].includes(response.status) && error.config && error.config.url && error.config.data) {
+      window.mkInfo(error.config.url)
+      window.mkInfo(error.config.data)
+      if (window.GLOB.errorLog && !sessionStorage.getItem('local_error')) {
+        let urlReg = new RegExp('^(' + window.GLOB.baseurl + '|/)webapi/(exstars|dostars)', 'ig')
+        if (urlReg.test(error.config.url) && !/s_special_error_note_log/.test(error.config.url)) {
+          let res = null
+          try {
+            let data = JSON.parse(error.config.data)
+            if (!data.rduri) {
+              res = {
+                api_url: error.config.url,
+                error_code: response.status,
+                error_time: moment().format('YYYY-MM-DD HH:mm:ss'),
+                api_param: error.config.data
+              }
+            }
+          } catch (e) {
+            res = null
+          }
+          if (res) {
+            sessionStorage.setItem('local_error', JSON.stringify(res))
+          }
+        }
+      }
+    }
   }
 
   return Promise.reject(response)
diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index 19d7238..4dac666 100644
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -83,6 +83,24 @@
         }
       }
     })
+
+    if (sessionStorage.getItem('local_error')) {
+      try {
+        let param = JSON.parse(sessionStorage.getItem('local_error'))
+        setTimeout(() => {
+          Api.genericInterface({
+            func: 's_special_error_note_log',
+            ...param
+          }).then(res => {
+            if (res.status) {
+              sessionStorage.removeItem('local_error')
+            }
+          })
+        }, 3000)
+      } catch (e) {
+        sessionStorage.removeItem('local_error')
+      }
+    }
   }
 
   shouldComponentUpdate (nextProps, nextState) {
diff --git a/src/index.js b/src/index.js
index 6fd215a..969f8b0 100644
--- a/src/index.js
+++ b/src/index.js
@@ -166,6 +166,10 @@
       
         GLOB.mainSystemApi = systemApi
       }
+
+      if (config.errorLog === 'true' && /#\/(login|main|billprint|docprint|tab|iframe|view|ssologin)/.test(window.location.href)) {
+        GLOB.errorLog = true
+      }
     }
 
     if (/#\/hs$/.test(window.location.href)) { // hs涓嬩笉鎵撳嵃鑴氭湰
diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx
index 3490f83..5a09d3b 100644
--- a/src/menu/datasource/verifycard/index.jsx
+++ b/src/menu/datasource/verifycard/index.jsx
@@ -719,11 +719,24 @@
 
       if (r.custompage && setting.laypage === 'true' && _columns.findIndex(col => col.field === 'mk_total') === -1) {
         if (config.subtype !== 'basetable') {
-          Modal.warning({
-            title: `鏁版嵁婧愭垨鑷畾涔夎剼鏈腑浣跨敤鑷畾涔夊垎椤垫帓搴忔椂锛岃鍦ㄥ瓧娈甸泦涓坊鍔� mk_total銆俙,
+          const that = this
+          Modal.confirm({
+            title: `鏁版嵁婧愭垨鑷畾涔夎剼鏈腑浣跨敤鑷畾涔夊垎椤垫帓搴忔椂锛屽瓧娈甸泦涓渶瑕佹坊鍔� mk_total銆俙,
             okText: '鐭ラ亾浜�',
+            cancelText: '娣诲姞',
             onOk: () => {
               reject()
+            },
+            onCancel() {
+              let item = {
+                field: 'mk_total',
+                label: 'mk_total',
+                datatype: 'Int',
+                uuid: Utils.getuuid()
+              }
+
+              that.setState({ columns: [item, ...columns] })
+              reject()
             }
           })
           return
diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js
index 188585a..00e48a7 100644
--- a/src/utils/utils-custom.js
+++ b/src/utils/utils-custom.js
@@ -4707,7 +4707,7 @@
         } else if (['mk_address'].includes(s)) {
           decSql.push(`@mk_address nvarchar(100)`)
         } else if (['mk_deleted'].includes(s)) {
-          secSql.push(`@mk_deleted int`)
+          decSql.push(`@mk_deleted int`)
         } else {
           decSql.push(`@${s} nvarchar(50)`)
         }

--
Gitblit v1.8.0