From 1da6506bf58270bacc2a4345002c6b082835580e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 21 十月 2021 23:17:08 +0800
Subject: [PATCH] 2021-10-21

---
 src/views/appmanage/index.jsx |   74 +++++++++++++++++++++++++++++-------
 1 files changed, 59 insertions(+), 15 deletions(-)

diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx
index 8deb437..be63af1 100644
--- a/src/views/appmanage/index.jsx
+++ b/src/views/appmanage/index.jsx
@@ -313,8 +313,8 @@
       })
 
       let kei_no = res.appId.split(',')[1]
-      let lang = res.subAppId.split(',')[1]
-      let kei_no_detail = res.subAppId.split(',')[2]
+      let lang = res.subAppId ? res.subAppId.split(',')[1] : ''
+      let kei_no_detail = res.subAppId ? res.subAppId.split(',')[2] : ''
       
       let param = {
         func: 's_sVersionDetail_CloudAdd',
@@ -458,6 +458,20 @@
           item.sublist = item.data_detail || []
           item.sublist = item.sublist.map(cell => {
             cell.ID = cell.d_id
+
+            if (cell.customize_param) {
+              let _param = {}
+              try {
+                _param = JSON.parse(window.decodeURIComponent(window.atob(cell.customize_param)))
+              } catch (e) {
+                _param = {}
+              }
+              cell.copyright = _param.copyright || ''
+              cell.logo = _param.logo || ''
+              cell.apptype = _param.apptype || ''
+              cell.delay = _param.delay || 0
+            }
+
             return cell
           })
 
@@ -471,13 +485,12 @@
         if (!selectApp && applist[0]) {
           selectApp = applist[0]
         }
-        
+
         this.setState({
           loading: false,
           applist: applist,
           selectApp
         })
-
       } else {
         this.setState({
           loading: false
@@ -578,6 +591,7 @@
       exec_type: 'y',
       remark: selectApp.remark,
       kei_no: selectApp.kei_no,
+      cus_param_type: 'A',
       LText: ''
     }
 
@@ -588,7 +602,7 @@
     sublist = sublist.filter(item => item.ID !== record.ID)
 
     // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`)
-    param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`)
+    param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`)
     param.LText = param.LText.join(' union all ')
     param.LText = Utils.formatOptions(param.LText)
     
@@ -767,19 +781,35 @@
   }
   
   submitCard = () => {
-    const { selectApp, visible } = this.state
+    const { selectApp, visible, applist } = this.state
 
     this.mobcardRef.handleConfirm().then(res => {
-      this.setState({
-        confirmloading: true
-      })
-
       let ID = ''
       if (visible === 'edit') {
         ID = selectApp.ID
       } else {
+        let lowerKei = res.kei_no.toLowerCase()
+        if (lowerKei === 'mob') {
+          notification.warning({
+            top: 92,
+            message: '搴旂敤缂栫爜涓嶅厑璁镐娇鐢╩ob锛�',
+            duration: 3
+          })
+          return
+        } else if (applist.filter(app => app.kei_no.toLowerCase() === lowerKei).length > 0) {
+          notification.warning({
+            top: 92,
+            message: '搴旂敤缂栫爜宸插瓨鍦紒',
+            duration: 3
+          })
+          return
+        }
         ID = md5(window.GLOB.appkey + res.kei_no)
       }
+
+      this.setState({
+        confirmloading: true
+      })
 
       let param = {
         func: 's_kei_addupt',
@@ -787,6 +817,7 @@
         exec_type: 'y',
         remark: res.remark,
         kei_no: res.kei_no,
+        cus_param_type: 'A',
         LText: ''
       }
 
@@ -795,7 +826,7 @@
 
       if (visible === 'edit') {
         // param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`)
-        param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`)
+        param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`)
         param.LText = param.LText.join(' union all ')
         param.LText = Utils.formatOptions(param.LText)
       }
@@ -856,6 +887,7 @@
         exec_type: 'y',
         remark: selectApp.remark,
         kei_no: selectApp.kei_no,
+        cus_param_type: 'A',
         LText: ''
       }
 
@@ -880,7 +912,7 @@
       }
 
       // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`)
-      param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}'`)
+      param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`)
       param.LText = param.LText.join(' union all ')
       param.LText = Utils.formatOptions(param.LText)
 
@@ -1029,8 +1061,8 @@
                       </Col>
                       <Col span={12}>
                         <div className="app-item">
-                          {/* <div className="label">鐧诲綍:</div>
-                          <div className="content">{item.login_types === 'false' ? '涓嶉渶瑕�' : '闇�瑕�'}</div> */}
+                          {/* <div className="label">鐨偆:</div>
+                          <div className="content" style={{color: color}}>{css}</div> */}
                         </div>
                       </Col>
                       <Col span={12}>
@@ -1058,10 +1090,22 @@
                       </Col>
                       <Col span={12}>
                         <div className="app-item">
-                          <div className="label">缃戠珯鍥炬爣:</div>
+                          <div className="label">缃戠珯澶村儚:</div>
                           <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px'}} src={item.favicon} alt="" /> : '鏃�'}</div>
                         </div>
                       </Col>
+                      <Col span={12}>
+                        <div className="app-item">
+                          <div className="label">鐗堟潈:</div>
+                          <div className="content">{item.copyright || '鏃�'}</div>
+                        </div>
+                      </Col>
+                      <Col span={12}>
+                        <div className="app-item">
+                          <div className="label">LOGO:</div>
+                          <div className="content">{item.logo ? <img style={{height: '18px'}} src={item.logo} alt="" /> : '鏃�'}</div>
+                        </div>
+                      </Col>
                     </Row>
                     <div className="action">
                       <Button type="link" onClick={() => this.jumpMenu(item)} style={{color: 'rgba(30, 228, 224, 1)'}}>鑿滃崟&鏉冮檺</Button>

--
Gitblit v1.8.0