From b5c32333ac9cebee515171f4ad68e6e5e73ebf1f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 02 八月 2023 14:37:15 +0800
Subject: [PATCH] 2023-08-02

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   47 +++++++++++++++++++----------------------------
 1 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 93bf150..fbbaa99 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -7,8 +7,6 @@
 import Api from '@/api'
 import Utils from '@/utils/utils.js'
 import options from '@/store/options.js'
-import zhCN from '@/locales/zh-CN/main.js'
-import enUS from '@/locales/en-US/main.js'
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import { updateForm } from '@/utils/utils-update.js'
 import MKEmitter from '@/utils/events.js'
@@ -32,7 +30,6 @@
   }
 
   state = {
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     visible: false,
     formdata: null,
     selines: null,
@@ -161,7 +158,7 @@
       // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹�
       notification.warning({
         top: 92,
-        message: this.state.dict['main.action.confirm.selectline'],
+        message: '璇烽�夋嫨琛岋紒',
         duration: 5
       })
       return
@@ -169,7 +166,7 @@
       // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁
       notification.warning({
         top: 92,
-        message: this.state.dict['main.action.confirm.selectSingleLine'],
+        message: '璇烽�夋嫨鍗曡鏁版嵁锛�',
         duration: 5
       })
       return
@@ -212,7 +209,7 @@
     } else if (btn.execMode === 'prompt') {
       this.setState({ loading: true })
       confirm({
-        title: this.state.dict['main.action.confirm.tip'],
+        title: '纭畾瑕佹墽琛屽悧?',
         onOk() {
           _this.triggerPrint(data)
         },
@@ -576,7 +573,6 @@
     this.execSuccess({
       ErrCode: '-1',
       message: '',
-      ErrMesg: '',
       status: true
     })
 
@@ -1614,7 +1610,7 @@
     Api.postekPrint(param).then(res => {
       if (res.retval === '0') {
         if (params.length === 0) {
-          this.execSuccess({ ErrCode: 'S', message: '', ErrMesg: '鎵撳嵃璇锋眰宸插彂鍑恒��', status: true })
+          this.execSuccess({ ErrCode: 'S', message: '鎵撳嵃璇锋眰宸插彂鍑恒��', status: true })
         } else {
           setTimeout(() => {
             this.loopRFIDPrint(params)
@@ -1733,14 +1729,12 @@
         this.execSuccess({
           ErrCode: '-1',
           message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
-          ErrMesg: '',
           status: true
         })
       } else {
         this.execError({
           ErrCode: 'N',
           message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
-          ErrMesg: '',
           status: false
         })
       }
@@ -1770,7 +1764,6 @@
       this.execError({
         ErrCode: 'N',
         message: msg.join(' ; ') + ' !',
-        ErrMesg: '',
         status: false
       })
       return
@@ -1783,8 +1776,7 @@
 
       this.execSuccess({
         ErrCode: 'S',
-        message: '',
-        ErrMesg: '鎵撳嵃璇锋眰宸插彂鍑恒��',
+        message: '鎵撳嵃璇锋眰宸插彂鍑恒��',
         status: true
       })
     }
@@ -1795,8 +1787,7 @@
 
       this.execSuccess({
         ErrCode: 'S',
-        message: '',
-        ErrMesg: '鎵撳嵃璇锋眰宸插彂鍑恒��',
+        message: '鎵撳嵃璇锋眰宸插彂鍑恒��',
         status: true
       })
     }
@@ -1811,7 +1802,6 @@
           this.execError({
             ErrCode: 'N',
             message: event.data,
-            ErrMesg: '',
             status: false
           })
 
@@ -1831,8 +1821,7 @@
 
       //   this.execSuccess({
       //     ErrCode: 'S',
-      //     message: '',
-      //     ErrMesg: '鎵撳嵃璇锋眰宸插彂鍑恒��',
+      //     message: '鎵撳嵃璇锋眰宸插彂鍑恒��',
       //     status: true
       //   })
       // } else if (data && data.message && !data.status) {
@@ -1840,7 +1829,6 @@
         this.execError({
           ErrCode: 'N',
           message: data.message,
-          ErrMesg: '',
           status: false
         })
       }
@@ -1850,7 +1838,6 @@
       this.execError({
         ErrCode: 'N',
         message: '鏃犳硶杩炴帴鍒�:' + btn.verify.linkUrl,
-        ErrMesg: '',
         status: false
       })
     }
@@ -1875,19 +1862,19 @@
    * 4銆佹ā鎬佹鎵ц鎴愬姛鍚庢槸鍚﹀叧闂�
    * 5銆侀�氱煡涓诲垪琛ㄥ埛鏂�
    */
-  execSuccess = (res) => {
+  execSuccess = (res = {}) => {
     const { btn } = this.props
     const { autoMatic, btnconfig } = this.state
 
     if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 鎵ц鎴愬姛
       notification.success({
         top: 92,
-        message: res.ErrMesg || this.state.dict['main.action.confirm.success'],
+        message: res.message || '鎵ц鎴愬姛锛�',
         duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2
       })
     } else if (res.ErrCode === 'Y') { // 鎵ц鎴愬姛
       Modal.success({
-        title: res.ErrMesg || this.state.dict['main.action.confirm.success']
+        title: res.message || '鎵ц鎴愬姛锛�'
       })
     } else if (res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず
 
@@ -1928,25 +1915,29 @@
     const { btn } = this.props
     const { btnconfig, autoMatic } = this.state
 
+    if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) {
+      res.ErrCode = 'E'
+    }
+
     if (res.ErrCode === 'E' && !autoMatic) {
       Modal.error({
-        title: res.message || res.ErrMesg,
+        title: res.message || '鎵ц澶辫触锛�',
       })
     } else if (res.ErrCode === 'N' || autoMatic) {
       notification.error({
         top: 92,
-        message: res.message || res.ErrMesg,
+        message: res.message || '鎵ц澶辫触锛�',
         duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10
       })
     } else if (res.ErrCode === 'F') {
       notification.error({
         className: 'notification-custom-error',
         top: 92,
-        message: res.message || res.ErrMesg,
+        message: res.message || '鎵ц澶辫触锛�',
         duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10
       })
     } else if (res.ErrCode === 'NM') {
-      message.error(res.message || res.ErrMesg)
+      message.error(res.message || '鎵ц澶辫触锛�')
     }
     
     this.setState({
@@ -2220,7 +2211,7 @@
       this.execSubmit(selines, () => {}, result)
     } else {
       confirm({
-        title: this.state.dict['main.action.confirm.tip'],
+        title: '纭畾瑕佹墽琛屽悧?',
         onOk() {
           _this.triggerPrint(selines, result)
         },

--
Gitblit v1.8.0