From e543372cc70a19ff2630c79d8421c2c593e54e5f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 02 六月 2021 17:15:21 +0800
Subject: [PATCH] 2021-06-02

---
 src/menu/components/form/normal-form/index.jsx |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/menu/components/form/normal-form/index.jsx b/src/menu/components/form/normal-form/index.jsx
index 7da0e9e..7ccde07 100644
--- a/src/menu/components/form/normal-form/index.jsx
+++ b/src/menu/components/form/normal-form/index.jsx
@@ -8,6 +8,7 @@
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
 import { getModalForm } from '@/templates/zshare/formconfig'
+import { resetStyle } from '@/utils/utils-custom.js'
 import ModalForm from '@/templates/zshare/modalform'
 import MKEmitter from '@/utils/events.js'
 import Utils from '@/utils/utils.js'
@@ -364,7 +365,7 @@
     })
   }
 
-  handleList = (list) => {
+  handleList = (list, newcard) => {
     let group = fromJS(this.state.group).toJS()
     let card = fromJS(this.state.card).toJS()
 
@@ -377,7 +378,11 @@
       return item
     })
 
-    this.setState({card, group})
+    this.setState({card, group}, () => {
+      if (newcard) {
+        this.handleForm(newcard)
+      }
+    })
     this.props.updateConfig(card)
   }
 
@@ -451,7 +456,7 @@
    * @description 琛ㄥ崟缂栬緫
    */
   handleForm = (_item) => {
-    const { card, group } = this.state
+    const { card, group, appType } = this.state
     let _form = fromJS(_item).toJS()
     let _inputfields = []
     let _tabfields = []
@@ -463,7 +468,11 @@
     let standardform = null
 
     _inputfields = group.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color')
-    _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
+    if (appType === 'mob') {
+      _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number'].includes(item.type))
+    } else {
+      _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type))
+    }
     _tabfields.unshift({field: '', text: '鍘熻〃鍗�'})
 
     let uniq = new Map()
@@ -511,7 +520,7 @@
       _form.linkSubField = _form.linkSubField.filter(item => fields.includes(item))
     }
 
-    if (!_form.span && standardform && standardform.span) {
+    if (appType !== 'mob' && !_form.span && standardform && standardform.span) {
       _form.span = standardform.span
       _form.labelwidth = standardform.labelwidth
     }
@@ -624,7 +633,7 @@
     const { card, dict, group, appType } = this.state
 
     return (
-      <div className="menu-normal-form-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
+      <div className="menu-normal-form-edit-box" style={resetStyle(card.style)} onClick={this.clickComponent} id={card.uuid}>
         <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
           <div className="mk-popover-control">
             <Icon className="plus" title="娣诲姞鍒嗙粍" onClick={this.addCard} type="plus" />
@@ -669,7 +678,6 @@
             list={group.fields}
             setting={group.setting}
             showField={this.state.showField}
-            placeholder={dict['header.form.modal.placeholder']}
             handleList={this.handleList}
             handleForm={this.handleForm}
             closeForm={this.closeForm}

--
Gitblit v1.8.0