From 3f85ff9067b806df7848ce7b852ff357a7bac7f5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 29 六月 2021 17:25:43 +0800
Subject: [PATCH] 2021-06-29

---
 src/templates/modalconfig/settingform/index.jsx |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/src/templates/modalconfig/settingform/index.jsx b/src/templates/modalconfig/settingform/index.jsx
index ae109a6..6428e40 100644
--- a/src/templates/modalconfig/settingform/index.jsx
+++ b/src/templates/modalconfig/settingform/index.jsx
@@ -1,6 +1,6 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
-import { Form, Row, Col, Input, Radio, InputNumber, Select } from 'antd'
+import { Form, Row, Col, Input, Radio, InputNumber, Select, Tooltip, Icon } from 'antd'
 import { formRule } from '@/utils/option.js'
 import './index.scss'
 
@@ -20,6 +20,7 @@
 
   UNSAFE_componentWillMount () {
     const { config } = this.props
+    const { appType, display } = this.state
     let fields = []
 
     config.fields.forEach(f => {
@@ -28,8 +29,14 @@
       }
     })
 
+    let _display = display 
+    if (appType === 'mob' && display !== 'prompt' && display !== 'drawer') {
+      _display = 'drawer'
+    }
+
     this.setState({
-      fields: fields
+      fields: fields,
+      display: _display
     })
   }
 
@@ -87,13 +94,25 @@
               })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)}
             </Form.Item>
           </Col>
-          <Col span={12}>
+          {appType !== 'mob' ? <Col span={12}>
             <Form.Item label="瀹藉害锛�%锛�">
               {getFieldDecorator('width', {
                 initialValue: config.setting.width
               })(<InputNumber min={10} max={90} precision={0} onPressEnter={this.handleSubmit}/>)}
             </Form.Item>
-          </Col>
+          </Col> : null}
+          {appType === 'mob' ? <Col span={12}>
+            <Form.Item label={
+              <Tooltip placement="topLeft" title="瀹藉害灏忎簬100鏃朵负鐧惧垎鐜囷紝澶т簬100鏃朵负缁濆鍊笺��">
+                <Icon type="question-circle" />
+                瀹藉害
+              </Tooltip>
+            }>
+              {getFieldDecorator('width', {
+                initialValue: config.setting.width
+              })(<InputNumber min={10} max={2000} precision={0} onPressEnter={this.handleSubmit}/>)}
+            </Form.Item>
+          </Col> : null}
           <Col span={12}>
             <Form.Item label="鐒︾偣">
               {getFieldDecorator('focus', {
@@ -115,7 +134,7 @@
               )}
             </Form.Item>
           </Col>
-          <Col span={12}>
+          {appType !== 'mob' ? <Col span={12}>
             <Form.Item label="琛ㄥ崟鎺掑垪">
               {getFieldDecorator('align', {
                 initialValue: config.setting.align || 'left_right'
@@ -126,7 +145,7 @@
                 </Radio.Group>
               )}
             </Form.Item>
-          </Col>
+          </Col> : null}
           <Col span={12}>
             <Form.Item label="瀹屾垚鍚�">
               {getFieldDecorator('finish', {
@@ -154,17 +173,17 @@
           <Col span={12}>
             <Form.Item label="鏄剧ず鏂瑰紡">
               {getFieldDecorator('display', {
-                initialValue: config.setting.display || 'modal'
+                initialValue: display || 'modal'
               })(
                 <Radio.Group style={{whiteSpace: 'nowrap'}} onChange={(e) => this.setState({display: e.target.value})}>
-                  <Radio value="modal">妯℃�佹</Radio>
+                  {appType !== 'mob' ? <Radio value="modal">妯℃�佹</Radio> : null}
                   <Radio value="prompt">鏄惁妗�</Radio>
                   <Radio value="drawer">鎶藉眽</Radio>
                 </Radio.Group>
               )}
             </Form.Item>
           </Col>
-          {!this.props.isSubTab && appType !== 'pc' && display === 'modal' ? <Col span={12}>
+          {!this.props.isSubTab && !appType && display === 'modal' ? <Col span={12}>
             <Form.Item label="鎸傝浇瀵硅薄">
               {getFieldDecorator('container', {
                 initialValue: config.setting.container || 'tab'

--
Gitblit v1.8.0