From c8804ceb1fe2dea76f9949c5ea04423876ee2c81 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 28 六月 2024 14:02:47 +0800
Subject: [PATCH] 2024-06-28

---
 src/views/appmanage/submutilform/index.jsx |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx
index de2a0a2..0467a7c 100644
--- a/src/views/appmanage/submutilform/index.jsx
+++ b/src/views/appmanage/submutilform/index.jsx
@@ -20,7 +20,8 @@
   state = {
     typename: 'mob',
     adapters: [],
-    exts: []
+    exts: [],
+    WXApps: null
   }
 
   UNSAFE_componentWillMount() {
@@ -47,7 +48,16 @@
       }
     }
 
-    this.setState({typename, adapters, exts, langs: _langs})
+    let apps = null
+    if (window.GLOB.WXApps) {
+      apps = window.GLOB.WXApps.filter(app => app.appType === 'public')
+
+      if (apps.length === 0) {
+        apps = null
+      }
+    }
+
+    this.setState({typename, adapters, exts, langs: _langs, WXApps: apps})
   }
 
   /**
@@ -63,6 +73,10 @@
             values.user_binding = values.exts.includes('user_binding') ? 'true' : 'false'
             values.share = values.exts.includes('share') ? 'true' : 'false'
             delete values.exts
+          }
+          if (values.wxAppId) {
+            let app = window.GLOB.WXApps.filter(app => app.appType === 'public' && values.wxAppId === app.appId)[0]
+            values.wxAppName = app ? app.appName : values.wxAppId
           }
 
           resolve(values)
@@ -89,7 +103,7 @@
   render() {
     const { card, type } = this.props
     const { getFieldDecorator } = this.props.form
-    const { typename, adapters, exts, langs } = this.state
+    const { typename, adapters, exts, langs, WXApps } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -178,6 +192,22 @@
               )}
             </Form.Item>
           </Col> : null}
+          {WXApps ? <Col span={12}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="鐢ㄦ埛鍙�氳繃姝ゅ叕浼楀彿杩涜鏀粯鍙婇��娆俱��">
+                <QuestionCircleOutlined className="mk-form-tip" />
+                鍏宠仈鍏紬鍙�
+              </Tooltip>
+            }>
+              {getFieldDecorator('wxAppId', {
+                initialValue: card ? card.wxAppId : ''
+              })(
+                <Select allowClear>
+                  {WXApps.map(item => <Select.Option key={item.appId} value={item.appId}>{item.appName}</Select.Option>)}
+                </Select>
+              )}
+            </Form.Item>
+          </Col> : null}
           {typename !== 'pc' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鍦ㄥ叕浼楀彿鎴栧皬绋嬪簭涓紝鍙坊鍔犵粦瀹氱郴缁熺敤鎴枫�佽嚜瀹氫箟鍒嗕韩绛夊姛鑳斤紝鑷畾涔夊垎浜缃悗锛屽綋鍓嶅瓙搴旂敤灏嗛粯璁や娇鐢ㄦ鍒嗕韩閾炬帴銆�">

--
Gitblit v1.8.0