From 2bccb9ec7bdefe23292a22bc153463cfa1479a49 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 21 六月 2024 16:25:42 +0800
Subject: [PATCH] 2024-06-21

---
 src/tabviews/zshare/actionList/newpagebutton/index.jsx |   83 +++++++++++++++++------------------------
 1 files changed, 35 insertions(+), 48 deletions(-)

diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
index 5d3bd93..55bdf19 100644
--- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx
+++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx
@@ -100,16 +100,13 @@
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
-  actionTrigger = (triggerId, record, type) => {
-    const { btn, selectedData, BID } = this.props
+  actionTrigger = (triggerId, record, type, lid) => {
+    const { btn, selectedData, BID, LID } = this.props
     const { disabled } = this.state
 
     if (disabled) return
     if (triggerId && btn.uuid !== triggerId) return
-
-    if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) {
-      return
-    }
+    if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return
 
     let data = record || selectedData || []
 
@@ -117,7 +114,7 @@
       // 闇�瑕侀�夋嫨琛屾椂锛屾牎楠屾暟鎹�
       notification.warning({
         top: 92,
-        message: '璇烽�夋嫨琛岋紒',
+        message: window.GLOB.dict['select_row'] || '璇烽�夋嫨琛岋紒',
         duration: 5
       })
       return
@@ -125,14 +122,14 @@
       // 闇�瑕侀�夋嫨鍗曡鏃讹紝鏍¢獙鏁版嵁
       notification.warning({
         top: 92,
-        message: '璇烽�夋嫨鍗曡鏁版嵁锛�',
+        message: window.GLOB.dict['select_single_row'] || '璇烽�夋嫨鍗曡鏁版嵁锛�',
         duration: 5
       })
       return
     } else if (btn.pageTemplate === 'custom' && window.GLOB.systemType === 'production' && !btn.proUrl) {
       notification.warning({
         top: 92,
-        message: '灏氭湭璁剧疆姝e紡绯荤粺閾炬帴鍦板潃锛�',
+        message: window.GLOB.dict['no_prod_link'] || '灏氭湭璁剧疆姝e紡绯荤粺閾炬帴鍦板潃锛�',
         duration: 5
       })
       return
@@ -148,12 +145,12 @@
     let Id = ''
     let name = ''
     let MenuNo = ''
-    let Remark = ''
+    let lang = ''
     if (btn.Ot === 'requiredSgl' && data[0]) {
       Id = data[0].$$uuid || ''
       name = data[0].PrintTempName || ''
       MenuNo = data[0].PrintTempNO || ''
-      Remark = data[0].Remark || ''
+      lang = data[0].lang_s || ''
     }
 
     let _name = '鏂伴〉闈�'
@@ -231,12 +228,10 @@
         }
       }
     } else if (btn.pageTemplate === 'billprintTemp') {
-      let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '鎵撳嵃', Remark: Remark })))
+      let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '鎵撳嵃', lang })))
       window.open(src)
     } else if (btn.pageTemplate === 'print') {
-      let cloudmsg = '&cuid=' + (sessionStorage.getItem('CloudUserID') || '') + '&clid=' + (sessionStorage.getItem('CloudLoginUID') || '') + '&cun=' + (sessionStorage.getItem('CloudUserName') || '')
-      let msg = '&uid=' + sessionStorage.getItem('UserID') + '&lid=' + sessionStorage.getItem('LoginUID') + '&un=' + sessionStorage.getItem('User_Name')
-      let src = '#/print/' + window.btoa('ID=' + Id + msg + cloudmsg)
+      let src = '#/print/' + window.btoa(window.encodeURIComponent(JSON.stringify({ ID: Id, lang })))
       window.open(src)
     } else if (btn.pageTemplate === 'pay') {
       let _p = `ID=${Id}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID')}&logo=${window.GLOB.doclogo}&name=${sessionStorage.getItem('Full_Name')}&icp=${window.GLOB.ICP}&copyRight=${window.GLOB.copyRight}`
@@ -270,10 +265,7 @@
       
       if (/#\/iframe\//.test(url)) {
         url = url.replace(/@loginuid@/ig, sessionStorage.getItem('LoginUID'))
-
-        if (btn.joint === 'true' && Id) {
-          url = url + '/' + Id
-        }
+        url = url + '/' + Id
 
         let menu = {
           MenuID: btn.uuid,
@@ -287,16 +279,26 @@
         return
       }
       
-      let con = '?'
-
-      if (/\?/ig.test(url)) {
-        con = '&'
-      }
-
       if (btn.joint === 'true') {
+        let con = '?'
+  
+        if (/\?/ig.test(url)) {
+          con = '&'
+        }
         url = url + `${con}id=${Id}&appkey=${window.GLOB.appkey}&userid=${sessionStorage.getItem('UserID')}&LoginUID=${sessionStorage.getItem('LoginUID') || ''}`
-      } else if (Id) {
-        url = url + `${con}id=${Id}`
+      } else if (/@/.test(url)) {
+        url = url.replace(/@id@/ig, Id)
+        url = url.replace(/@appkey@/ig, window.GLOB.appkey)
+        url = url.replace(/@userid@/ig, sessionStorage.getItem('UserID'))
+        url = url.replace(/@LoginUID@/ig, sessionStorage.getItem('LoginUID'))
+
+        if (btn.Ot === 'requiredSgl' && data[0]) {
+          Object.keys(data[0]).forEach(key => {
+            if (/^\$/.test(key)) return
+            let reg = new RegExp('@' + key + '@', 'ig')
+            url = url.replace(reg, data[0][key])
+          })
+        }
       }
 
       window.open(url)
@@ -314,38 +316,23 @@
     if (hidden) return null
 
     let label = ''
-    let icon = ''
-    let type = 'link'
-    let className = ''
 
-    if (btn.show === 'button') {
-      label = name || btn.label
-      icon = btn.icon || ''
-    } else if (btn.show === 'link') {
-      label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span>
-      icon = ''
+    if (btn.show === 'link') {
+      label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon} /> : ''}</span>
     } else if (btn.show === 'icon') {
-      icon = btn.icon || ''
-    } else if (!btn.$toolbtn) {
-      icon = btn.icon || ''
-      label = btn.label
-      className = 'mk-btn mk-' + btn.class
+      label = <MkIcon type={btn.icon} />
     } else {
-      type = ''
-      icon = btn.icon || ''
-      label = btn.label
-      className = 'mk-btn mk-' + btn.class
+      label = <span>{btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{name || btn.label}</span>
     }
 
     return (
       <Button
-        type={type}
+        type="link"
         id={'button' + btn.uuid}
         title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')}
         style={btn.style || null}
         disabled={disabled}
-        icon={icon}
-        className={className}
+        className={btn.hover || ''}
         onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
       >{label}</Button>
     )

--
Gitblit v1.8.0