From 1a176e4bdba485301385caac1a29102e598d25cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 13 五月 2025 11:32:02 +0800
Subject: [PATCH] 2025-05-13

---
 src/views/appmanage/index.jsx |   95 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 33 deletions(-)

diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx
index 92426bc..da7e730 100644
--- a/src/views/appmanage/index.jsx
+++ b/src/views/appmanage/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import { fromJS } from 'immutable'
 import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd'
-import { QuestionCircleOutlined } from '@ant-design/icons'
+import { QuestionCircleOutlined, LinkOutlined } from '@ant-design/icons'
 import moment from 'moment'
 import md5 from 'md5'
 
@@ -32,12 +32,12 @@
   bg_black_style_yellow_green: {name: '榛勭豢鑹�', color: '#a0d911'},
   bg_black_style_green: {name: '缁胯壊', color: '#52c41a'},
   bg_black_style_cyan: {name: '闈掕壊', color: '#13c2c2'},
-  bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#2f54eb'},
+  bg_black_style_blue_purple: {name: '钃濈传鑹�', color: '#3860f4'},
   bg_black_style_purple: {name: '绱壊', color: '#722ed1'},
   bg_black_style_magenta: {name: '娲嬬孩鑹�', color: '#eb2f96'},
   bg_black_style_grass_green: {name: '鑽夌豢鑹�', color: '#aeb303'},
   bg_black_style_deep_red: {name: '娣辩孩鑹�', color: '#c32539'},
-  bg_black_style_deep_blue: {name: '娣辩孩鑹�', color: '#1d3661'}
+  bg_black_style_deep_blue: {name: '娣辫摑鑹�', color: '#1d3661'}
 }
 
 class AppManage extends Component {
@@ -377,7 +377,7 @@
   }
 
   deleteTran = (record) => {
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_sVersion_del',
@@ -395,7 +395,7 @@
                 message: '鎿嶄綔鎴愬姛锛�',
                 duration: 3
               })
-              _this.getTransList()
+              that.getTransList()
             } else {
               notification.warning({
                 top: 92,
@@ -414,7 +414,7 @@
   }
 
   enableTran = (record) => {
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_sVersion_sub',
@@ -432,7 +432,7 @@
                 message: '鎿嶄綔鎴愬姛锛�',
                 duration: 3
               })
-              _this.getTransList()
+              that.getTransList()
             } else {
               Modal.error({
                 title: result.message,
@@ -495,7 +495,6 @@
               }
 
               cell.userbind = _param.userbind || ''
-              cell.instantMessage = _param.instantMessage || ''
             }
 
             if (cell.user_binding !== 'true') {
@@ -601,7 +600,7 @@
   }
 
   deleteApp = (record) => {
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾鍒犻櫎銆�' + record.remark + '銆嬪悧锛�',
@@ -621,12 +620,12 @@
                 duration: 5
               })
 
-              _this.setState({
+              that.setState({
                 selectApp: null,
                 selectSubApp: null,
                 loading: true
               })
-              _this.getAppList()
+              that.getAppList()
             } else {
               if (result.message.indexOf('kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�') > -1) {
                 result.message = 'kei_no宸茶鑿滃崟浣跨敤锛屼笉鍙垹闄�'
@@ -649,7 +648,7 @@
   
   deleteSubApp = (record) => {
     const { selectApp } = this.state
-    const _this = this
+    const that = this
 
     let param = {
       func: 's_kei_addupt',
@@ -670,7 +669,6 @@
     sublist = sublist.map(item => {
       if (item.typename !== 'pc') {
         item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-        item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
       }
       return item
     })
@@ -679,7 +677,7 @@
     param.LText = sublist.map(item => {
       let _par = this.getCusParam(item)
 
-      return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+      return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
     })
     param.LText = param.LText.join(' union all ')
     param.LText = Utils.formatOptions(param.LText, 'x')
@@ -696,11 +694,11 @@
                 duration: 5
               })
       
-              _this.setState({
+              that.setState({
                 selectSubApp: null,
                 loading: true
               })
-              _this.getAppList()
+              that.getAppList()
             } else {
               notification.warning({
                 top: 92,
@@ -748,7 +746,6 @@
       })
     }
     if (applangList.length) {
-      applangList.unshift('zh-CN')
       applangList = JSON.stringify(applangList)
     } else {
       applangList = ''
@@ -771,7 +768,6 @@
       })
     }
     if (applangList.length) {
-      applangList.unshift('zh-CN')
       applangList = JSON.stringify(applangList)
     } else {
       applangList = ''
@@ -821,7 +817,7 @@
       }
     })
 
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾瑕佹墽琛屽悧锛�',
@@ -857,10 +853,10 @@
                 message: '鎵ц鎴愬姛銆�',
                 duration: 3
               })
-              _this.setState({
+              that.setState({
                 scriptIndex: 1
               }, () => {
-                _this.getScriptList()
+                that.getScriptList()
               })
             }
             resolve()
@@ -951,7 +947,6 @@
         selectApp.sublist = selectApp.sublist.map(item => {
           if (item.typename !== 'pc') {
             item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-            item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
           }
           return item
         })
@@ -959,7 +954,7 @@
         param.LText = selectApp.sublist.map(item => {
           let _par = this.getCusParam(item)
     
-          return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+          return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
         })
         param.LText = param.LText.join(' union all ')
         param.LText = Utils.formatOptions(param.LText, 'x')
@@ -1005,9 +1000,6 @@
     }
     if (item.userbind) {
       _par.userbind = item.userbind
-    }
-    if (item.instantMessage) {
-      _par.instantMessage = item.instantMessage
     }
     if (item.apptype) {
       _par.apptype = item.apptype
@@ -1098,7 +1090,6 @@
       sublist = sublist.map(item => {
         if (item.typename !== 'pc') {
           item.userbind = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{8}/, 'userbind')
-          item.instantMessage = md5(selectApp.kei_no + item.typename + item.lang).replace(/^.{14}/, 'instantmessage')
         }
         return item
       })
@@ -1106,7 +1097,7 @@
       param.LText = sublist.map(item => {
         let _par = this.getCusParam(item)
 
-        return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}'`
+        return `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 || 'false'}','','${window.btoa(window.encodeURIComponent(JSON.stringify(_par)))}','${item.app_name || selectApp.remark || ''}','${item.app_icon || ''}','${item.allow_subscribe || ''}','${item.link_remark || ''}'`
       })
       param.LText = param.LText.join(' union all ')
       param.LText = Utils.formatOptions(param.LText, 'x')
@@ -1141,6 +1132,43 @@
           confirmloading: false
         })
       })
+    })
+  }
+
+  updateLink = (item) => {
+    let link = `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}`
+
+    let param = {
+      func: 's_miniapp_kei_linkurl_upt',
+      id: item.ID,
+      linkurl: link
+    }
+
+    confirm({
+      content: '纭畾鏇存柊搴旂敤閾炬帴鍦板潃鍚楋紵',
+      onOk() {
+        return new Promise(resolve => {
+          Api.getCloudConfig(param).then(result => {
+            if (result.status) {
+              notification.success({
+                top: 92,
+                message: '鎿嶄綔鎴愬姛锛�',
+                duration: 3
+              })
+            } else {
+              notification.warning({
+                top: 92,
+                message: result.message,
+                duration: 5
+              })
+            }
+            resolve()
+          }, () => {
+            resolve()
+          })
+        })
+      },
+      onCancel() {}
     })
   }
 
@@ -1285,14 +1313,14 @@
                     </Col>
                     <Col span={12}>
                       <div className="app-item">
-                        <div className="label">鏍囬:</div>
-                        <div className="content">{item.title || '鏃�'}</div>
+                        <div className="label">搴旂敤鍚嶇О:</div>
+                        <div className="content">{item.app_name || ''}</div>
                       </div>
                     </Col>
                     <Col span={12}>
                       <div className="app-item">
-                        <div className="label">缃戠珯澶村儚:</div>
-                        <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.favicon} alt="" /> : '鏃�'}</div>
+                        <div className="label">LOGO:</div>
+                        <div className="content">{item.app_icon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.app_icon} alt="" /> : '鏃�'}</div>
                       </div>
                     </Col>
                   </Row>
@@ -1302,6 +1330,7 @@
                     <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>淇敼</Button>
                     <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button>
                     <Button type="link" onClick={() => this.jumpApp(item)}>缂栬緫搴旂敤</Button>
+                    <Button type="link" onClick={() => this.updateLink(item)}><LinkOutlined style={{color: 'orange'}}/></Button>
                     <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}${item.wxAppId ? '/' + item.wxAppId : ''}` }}></Paragraph>
                   </div>
                 </div>
@@ -1363,7 +1392,7 @@
           okText="纭畾"
           destroyOnClose
         >
-          <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} />
+          <SubMutilForm type={subVisible} selectApp={selectApp} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} />
         </Modal>
       </div>
     )

--
Gitblit v1.8.0