From a9a5211f48607fa7ac5bae91233f3a5e6df43587 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 20 一月 2022 14:09:04 +0800
Subject: [PATCH] 2022-01-20

---
 src/views/appmanage/submutilform/index.jsx |   67 ++++++++++++++++-----------------
 1 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx
index 0579e45..bc52f1f 100644
--- a/src/views/appmanage/submutilform/index.jsx
+++ b/src/views/appmanage/submutilform/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Select, Radio, Input, Tooltip, notification, InputNumber, Checkbox } from 'antd'
+import { Form, Row, Col, Select, Radio, Input, Tooltip, InputNumber, Checkbox } from 'antd'
 import { QuestionCircleOutlined } from '@ant-design/icons'
 
 import asyncComponent from '@/utils/asyncComponent'
@@ -16,26 +16,19 @@
     inputSubmit: PropTypes.func  // input鍥炶溅鎻愪氦
   }
 
-  state = {msgs: [], typename: 'mob', user_binding: [], adapters: []}
+  state = {typename: 'mob', adapters: []}
 
   UNSAFE_componentWillMount() {
     const { card } = this.props
-    let msgs = sessionStorage.getItem('msgTemplate')
-    let user_binding = []
     let adapters = []
     let typename = 'mob'
 
     if (card) {
       typename = card.typename || 'mob'
-      user_binding = card.user_binding ? card.user_binding.split(',') : []
       adapters = card.adapter ? card.adapter.split(',') : []
-
-      if (!adapters.includes('weixin') && !adapters.includes('wxmini')) {
-        user_binding = []
-      }
     }
 
-    this.setState({msgs: JSON.parse(msgs), typename, user_binding, adapters})
+    this.setState({typename, adapters})
   }
 
   /**
@@ -45,31 +38,31 @@
     return new Promise(resolve => {
       this.props.form.validateFieldsAndScroll((err, values) => {
         if (!err) {
-          values.user_binding = values.user_binding ? values.user_binding.join(',') : ''
+          // values.user_binding = values.user_binding ? values.user_binding.join(',') : ''
           values.adapter = values.adapter ? values.adapter.join(',') : ''
-          if (values.user_binding.indexOf('sms_vcode') > -1 && !values.sms_id) {
-            notification.warning({
-              top: 92,
-              message: '鎵嬫満鍙风粦瀹氭椂锛岄渶瑕佺煭淇℃ā鏉匡紒',
-              duration: 5
-            })
-            return
-          }
+          // if (values.user_binding.indexOf('sms_vcode') > -1 && !values.sms_id) {
+          //   notification.warning({
+          //     top: 92,
+          //     message: '鎵嬫満鍙风粦瀹氭椂锛岄渶瑕佺煭淇℃ā鏉匡紒',
+          //     duration: 5
+          //   })
+          //   return
+          // }
           resolve(values)
         }
       })
     })
   }
 
-  onChange = (vals) => {
-    this.setState({user_binding: vals})
-  }
+  // onChange = (vals) => {
+  //   this.setState({user_binding: vals})
+  // }
 
   onAdapterChange = (vals) => {
     this.setState({adapters: vals})
-    if (!vals.includes('weixin') && !vals.includes('wxmini')) {
-      this.setState({user_binding: []})
-    }
+    // if (!vals.includes('weixin') && !vals.includes('wxmini')) {
+    //   this.setState({user_binding: []})
+    // }
   }
 
   /**
@@ -83,7 +76,7 @@
   render() {
     const { card, type } = this.props
     const { getFieldDecorator } = this.props.form
-    const { msgs, typename, user_binding, adapters } = this.state
+    const { typename, adapters } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -175,16 +168,20 @@
           {typename !== 'pc' && (adapters.includes('weixin') || adapters.includes('wxmini')) ? <Col span={12}>
             <Form.Item label="鐢ㄦ埛缁戝畾">
               {getFieldDecorator('user_binding', {
-                initialValue: user_binding
+                initialValue: card ? card.user_binding : 'false'
               })(
-                <Checkbox.Group onChange={this.onChange}>
-                  <Checkbox value="uname_pwd">璐﹀彿</Checkbox>
-                  <Checkbox value="sms_vcode">鎵嬫満鐭俊</Checkbox>
-                </Checkbox.Group>
+                <Radio.Group>
+                  <Radio value="true">闇�瑕�</Radio>
+                  <Radio value="false">涓嶉渶瑕�</Radio>
+                </Radio.Group>
+                // <Checkbox.Group onChange={this.onChange}>
+                //   <Checkbox value="uname_pwd">璐﹀彿</Checkbox>
+                //   <Checkbox value="sms_vcode">鎵嬫満鐭俊</Checkbox>
+                // </Checkbox.Group>
               )}
             </Form.Item>
           </Col> : null}
-          {typename !== 'pc' && user_binding.includes('sms_vcode') ? <Col span={12}>
+          {/* {typename !== 'pc' && user_binding.includes('sms_vcode') ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鐭俊妯℃澘鍙湪 浜戠郴缁�->搴旂敤鏈嶅姟->寮�鍙戣�呬腑蹇�->鐭俊妯℃澘 澶勬坊鍔犮��">
                 <QuestionCircleOutlined className="mk-form-tip" />
@@ -205,7 +202,7 @@
                 </Select>
               )}
             </Form.Item>
-          </Col> : null}
+          </Col> : null} */}
           <Col span={12}>
             <Form.Item label="鏍囬">
               {getFieldDecorator('title', {
@@ -222,7 +219,7 @@
               )}
             </Form.Item>
           </Col>
-          {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}>
+          {/* {typename !== 'pc' && user_binding.length > 0 ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="浣跨敤寰俊鎺堟潈鐧诲綍鏃讹紝缁戝畾鐢ㄦ埛椤甸潰鐨勭増鏉冨0鏄庯紝娉細鍙坊鍔爃tml鏍囩銆�">
                 <QuestionCircleOutlined className="mk-form-tip" />
@@ -247,7 +244,7 @@
                 <SourceComponent type="picture" placement="right"/>
               )}
             </Form.Item>
-          </Col> : null}
+          </Col> : null} */}
           {typename !== 'pc' && adapters.includes('app') ? <Col span={12}>
             <Form.Item label={
               <Tooltip placement="topLeft" title="鍦ㄤ娇鐢ㄦ槑绉戜簯APP鏃讹紝椤甸潰鐨勫垏鎹㈡ā寮�">

--
Gitblit v1.8.0