From b91c28df2f734b680198e755b7828666e238cea0 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 六月 2024 16:43:44 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/tabviews/zshare/actionList/printbutton/index.jsx |   88 +++++++++++++++++++++----------------------
 1 files changed, 43 insertions(+), 45 deletions(-)

diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx
index 8373813..6d2e96c 100644
--- a/src/tabviews/zshare/actionList/printbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -37,7 +37,8 @@
     loading: false,
     disabled: false,
     hidden: false,
-    autoMatic: false
+    autoMatic: false,
+    dict: window.GLOB.dict
   }
 
   UNSAFE_componentWillMount () {
@@ -132,7 +133,7 @@
    */
   actionTrigger = (triggerId, record, type, lid) => {
     const { BID, btn, selectedData, setting, LID } = this.props
-    const { loading, disabled } = this.state
+    const { loading, disabled, dict } = this.state
 
     if (loading || disabled) return
     if (triggerId && btn.uuid !== triggerId) return
@@ -141,7 +142,7 @@
     if (setting.supModule && !BID) {
       notification.warning({
         top: 92,
-        message: '闇�瑕佷笂绾т富閿�硷紒',
+        message: dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒',
         duration: 5
       })
       return
@@ -156,7 +157,7 @@
       // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹�
       notification.warning({
         top: 92,
-        message: '璇烽�夋嫨琛岋紒',
+        message: dict['select_row'] || '璇烽�夋嫨琛岋紒',
         duration: 5
       })
       return
@@ -164,21 +165,7 @@
       // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁
       notification.warning({
         top: 92,
-        message: '璇烽�夋嫨鍗曡鏁版嵁锛�',
-        duration: 5
-      })
-      return
-    } else if (!btn.verify || !btn.verify.printMode) {
-      notification.warning({
-        top: 92,
-        message: '璇峰畬鍠勬墦鍗伴獙璇佷俊鎭紒',
-        duration: 5
-      })
-      return
-    } else if (btn.intertype === 'system' && btn.verify.dataType === 'custom' && (!btn.verify.setting || btn.verify.columns.length === 0)) {
-      notification.warning({
-        top: 92,
-        message: '鑷畾涔夋墦鍗版暟鎹璁剧疆鏁版嵁婧愶紒',
+        message: dict['select_single_row'] || '璇烽�夋嫨鍗曡鏁版嵁锛�',
         duration: 5
       })
       return
@@ -203,7 +190,9 @@
     } else if (btn.execMode === 'prompt') {
       this.setState({ loading: true })
       confirm({
-        title: '纭畾瑕佹墽琛屽悧?',
+        title: dict['exec_sure'] || '纭畾瑕佹墽琛屽悧?',
+        okText: dict['ok'] || '纭畾',
+        cancelText: dict['cancel'] || '鍙栨秷',
         onOk() {
           _this.triggerPrint(data)
         },
@@ -507,7 +496,7 @@
       if (list.length === 0) {
         notification.warning({
           top: 92,
-          message: '鏈幏鍙栧埌鎵撳嵃鏁版嵁锛�',
+          message: window.GLOB.dict['no_data'] || '鏈幏鍙栧埌鎵撳嵃鏁版嵁锛�',
           duration: 5
         })
         return false
@@ -534,7 +523,7 @@
       if (!result.ConfigParam) {
         notification.warning({
           top: 92,
-          message: '鏈幏鍙栧埌鎵撳嵃妯℃澘淇℃伅锛�',
+          message: window.GLOB.dict['no_print_temp'] || '鏈幏鍙栧埌鎵撳嵃妯℃澘淇℃伅锛�',
           duration: 5
         })
         this.setState({ loading: false })
@@ -785,7 +774,7 @@
 
       notification.warning({
         top: 92,
-        message: '鑷畾涔夊嚱鏁版墽琛岄敊璇紒',
+        message: window.GLOB.dict['func_error'] || '鑷畾涔夊嚱鏁版墽琛岄敊璇紒',
         duration: 5
       })
     }
@@ -1009,7 +998,7 @@
     }
 
     let isDataM = sessionStorage.getItem('dataM') === 'true'
-    let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript + _tailScript)
+    let custompage = /@pageSize@|@orderBy@|@mk_total/i.test(_dataresource + _customScript + _tailScript)
     let regoptions = [
       { reg: /@orderBy@/ig, value: btn.verify.setting.order },
       { reg: /@pageSize@/ig, value: '9999' },
@@ -1020,6 +1009,7 @@
       { reg: /@SessionUid@/ig, value: `'${localStorage.getItem('SessionUid') || ''}'`},
       { reg: /@UserID@/ig, value: `'${sessionStorage.getItem('UserID') || ''}'`},
       { reg: /@Appkey@/ig, value: `'${window.GLOB.appkey || ''}'`},
+      { reg: /@lang@/ig, value: `'${sessionStorage.getItem('lang')}'`},
       { reg: /@typename@/ig, value: `'admin'`},
       { reg: /\$@/ig, value: isDataM ? '/*' : ''},
       { reg: /@\$/ig, value: isDataM ? '*/' : ''},
@@ -1344,7 +1334,7 @@
     let imgs = []
 
     if (!res.ConfigParam) {
-      error = '鏈幏鍙栧埌鎵撳嵃妯℃澘淇℃伅锛�'
+      error = window.GLOB.dict['no_print_temp'] || '鏈幏鍙栧埌鎵撳嵃妯℃澘淇℃伅锛�'
     } else {
       try {
         configParam = JSON.parse(window.decodeURIComponent(window.atob(res.ConfigParam)))
@@ -1501,7 +1491,7 @@
     if (list.length === 0) {
       notification.warning({
         top: 92,
-        message: '鏈幏鍙栧埌鎵撳嵃鏁版嵁锛�',
+        message: window.GLOB.dict['no_data'] || '鏈幏鍙栧埌鎵撳嵃鏁版嵁锛�',
         duration: 5
       })
       this.setState({ loading: false })
@@ -1620,7 +1610,7 @@
     Api.postekPrint(param).then(res => {
       if (res.retval === '0') {
         if (params.length === 0) {
-          this.execSuccess({ ErrCode: 'S', message: '鎵撳嵃璇锋眰宸插彂鍑恒��', status: true })
+          this.execSuccess({ ErrCode: 'S', message: window.GLOB.dict['print_out'] || '鎵撳嵃璇锋眰宸插彂鍑恒��', status: true })
         } else {
           setTimeout(() => {
             this.loopRFIDPrint(params)
@@ -1638,6 +1628,8 @@
 
   execPrint = (list, template) => {
     const { btn } = this.props
+    const { dict } = this.state
+
     let _errors = []
 
     let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter'
@@ -1738,13 +1730,13 @@
       if (btn.verify.emptyTip === 'false') {
         this.execSuccess({
           ErrCode: '-1',
-          message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
+          message: dict['no_data'] || '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
           status: true
         })
       } else {
         this.execError({
           ErrCode: 'N',
-          message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
+          message: dict['no_data'] || '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
           status: false
         })
       }
@@ -1758,7 +1750,7 @@
           lackerror.push(`鏁版嵁涓湭鑾峰彇鍒版ā鏉匡紙${err.title}锛�${err.lacks.join('銆�')} 瀛楁`)
         }
         if (err.emptys.length > 0) {
-          emptyerror.push(`鏁版嵁涓ā鏉匡紙${err.title}锛� ${err.emptys.join('銆�')} 瀛楁涓嶅彲涓虹┖`)
+          emptyerror.push(dict['not_empty'] ? `${err.title}: ${err.emptys.join('銆�')} ${dict['not_empty']}` : `鏁版嵁涓ā鏉匡紙${err.title}锛� ${err.emptys.join('銆�')} 瀛楁涓嶅彲涓虹┖`)
         }
       })
 
@@ -1782,7 +1774,7 @@
     if (printerList.length === 0) {
       this.execSuccess({
         ErrCode: '-1',
-        message: '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
+        message: dict['no_data'] || '鏈幏鍙栧埌鎵撳嵃淇℃伅锛�',
         status: true
       })
       return
@@ -1794,7 +1786,7 @@
       this.syncMessageSend(printerList, () => {
         this.execSuccess({
           ErrCode: 'S',
-          message: '鎵撳嵃璇锋眰宸插彂鍑恒��',
+          message: dict['print_out'] || '鎵撳嵃璇锋眰宸插彂鍑恒��',
           status: true
         })
       })
@@ -1805,7 +1797,7 @@
       this.syncMessageSend(printerList, () => {
         this.execSuccess({
           ErrCode: 'S',
-          message: '鎵撳嵃璇锋眰宸插彂鍑恒��',
+          message: dict['print_out'] || '鎵撳嵃璇锋眰宸插彂鍑恒��',
           status: true
         })
       })
@@ -1856,7 +1848,7 @@
     socket.onerror = () => {
       this.execError({
         ErrCode: 'N',
-        message: '鏃犳硶杩炴帴鍒�:' + btn.verify.linkUrl,
+        message: (dict['un_connect'] || '鏃犳硶杩炴帴鍒�') + ':' + btn.verify.linkUrl,
         status: false
       })
     }
@@ -1892,17 +1884,18 @@
    */
   execSuccess = (res = {}) => {
     const { btn } = this.props
-    const { autoMatic, btnconfig } = this.state
+    const { autoMatic, btnconfig, dict } = this.state
 
     if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 鎵ц鎴愬姛
       notification.success({
         top: 92,
-        message: res.message || '鎵ц鎴愬姛锛�',
+        message: res.message || dict['exc_success'] || '鎵ц鎴愬姛锛�',
         duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2
       })
     } else if (res.ErrCode === 'Y') { // 鎵ц鎴愬姛
       Modal.success({
-        title: res.message || '鎵ц鎴愬姛锛�'
+        title: res.message || dict['exc_success'] || '鎵ц鎴愬姛锛�',
+        okText: dict['got_it'] || '鐭ラ亾浜�'
       })
     } else if (res.ErrCode === '-1') { // 瀹屾垚鍚庝笉鎻愮ず
 
@@ -1941,7 +1934,7 @@
    */
   execError = (res) => {
     const { btn } = this.props
-    const { btnconfig, autoMatic } = this.state
+    const { btnconfig, autoMatic, dict } = this.state
 
     if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) {
       res.ErrCode = 'E'
@@ -1949,23 +1942,24 @@
 
     if (res.ErrCode === 'E' && !autoMatic) {
       Modal.error({
-        title: res.message || '鎵ц澶辫触锛�',
+        title: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�',
+        okText: dict['got_it'] || '鐭ラ亾浜�'
       })
     } else if (res.ErrCode === 'N' || autoMatic) {
       notification.error({
         top: 92,
-        message: res.message || '鎵ц澶辫触锛�',
+        message: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�',
         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 || '鎵ц澶辫触锛�',
+        message: res.message || dict['exc_fail'] || '鎵ц澶辫触锛�',
         duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10
       })
     } else if (res.ErrCode === 'NM') {
-      message.error(res.message || '鎵ц澶辫触锛�')
+      message.error(res.message || dict['exc_fail'] || '鎵ц澶辫触锛�')
     }
     
     this.setState({
@@ -2113,7 +2107,7 @@
   }
 
   modelconfirm = () => {
-    const { btnconfig, selines } = this.state
+    const { btnconfig, selines, dict } = this.state
     let _this = this
     let result = []
     let _data = {}
@@ -2256,7 +2250,9 @@
       this.execSubmit(selines, () => {}, result)
     } else {
       confirm({
-        title: '纭畾瑕佹墽琛屽悧?',
+        title: dict['exec_sure'] || '纭畾瑕佹墽琛屽悧?',
+        okText: dict['ok'] || '纭畾',
+        cancelText: dict['cancel'] || '鍙栨秷',
         onOk() {
           _this.triggerPrint(selines, result)
         },
@@ -2272,7 +2268,7 @@
    */
   getModels = () => {
     const { BID, btn } = this.props
-    const { btnconfig } = this.state
+    const { btnconfig, dict } = this.state
 
     if (!this.state.visible || !btnconfig || !btnconfig.setting) return null
 
@@ -2306,6 +2302,8 @@
         visible={this.state.visible}
         confirmLoading={this.state.confirmLoading}
         width={width}
+        okText={dict['ok'] || '纭畾'}
+        cancelText={dict['cancel'] || '鍙栨秷'}
         maskStyle={btnconfig.setting.moveable === 'true' ?  {backgroundColor: 'rgba(0, 0, 0, 0.15)'} : null}
         onOk={this.handleOk}
         onCancel={this.handleCancel}

--
Gitblit v1.8.0