From f07fcb9f65ce2468439452755663870e7afc15c4 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 五月 2021 20:25:31 +0800
Subject: [PATCH] 2021-05-18

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

diff --git a/src/menu/components/form/normal-form/index.jsx b/src/menu/components/form/normal-form/index.jsx
index 1610711..7da0e9e 100644
--- a/src/menu/components/form/normal-form/index.jsx
+++ b/src/menu/components/form/normal-form/index.jsx
@@ -18,6 +18,7 @@
 const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
 const WrapComponent = asyncIconComponent(() => import('@/menu/components/form/wrapsetting'))
 const CardComponent = asyncComponent(() => import('@/templates/modalconfig/dragelement'))
+const MobCardComponent = asyncComponent(() => import('@/mob/components/formdragelement'))
 const FormTitle = asyncComponent(() => import('../dragtitle'))
 const GroupForm = asyncComponent(() => import('./groupform'))
 const FormAction = asyncComponent(() => import('../formaction'))
@@ -37,6 +38,7 @@
 
   state = {
     dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    appType: sessionStorage.getItem('appType'),
     card: null,
     back: false,
     group: null,
@@ -404,9 +406,13 @@
   }
 
   addForm = () => {
+    const { appType } = this.state
     let group = fromJS(this.state.group).toJS()
     let lastItem = group.fields[group.fields.length - 1]
-    let span = lastItem ? lastItem.span : 12
+    let span = appType === 'mob' ? 24 : 12
+    if (lastItem && lastItem.span) {
+      span = lastItem.span
+    }
 
     let newcard = {
       uuid: Utils.getuuid(),
@@ -615,7 +621,7 @@
   }
 
   render() {
-    const { card, dict, group } = this.state
+    const { card, dict, group, appType } = this.state
 
     return (
       <div className="menu-normal-form-edit-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
@@ -646,12 +652,12 @@
           <Icon className="plus" title="娣诲姞琛ㄥ崟" onClick={this.addForm} type="plus" />
           <FieldsComponent config={group} type="form" updatefield={this.updateGroup} />
           <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
-          <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1鍒�</Button>
-          <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button>
-          <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button>
-          <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4鍒�</Button>
+          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(1)}>1鍒�</Button> : null}
+          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2鍒�</Button> : null}
+          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3鍒�</Button> : null}
+          {appType !== 'mob' ? <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4鍒�</Button> : null}
           <div style={{clear: 'both'}}></div>
-          <CardComponent
+          {appType !== 'mob' ? <CardComponent
             list={group.fields}
             setting={group.setting}
             showField={this.state.showField}
@@ -659,7 +665,15 @@
             handleList={this.handleList}
             handleForm={this.handleForm}
             closeForm={this.closeForm}
-          />
+          /> : <MobCardComponent
+            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}
+          />}
           <FormAction config={card} group={group} updateconfig={this.updateGroup}/>
         </div> : null}
         <Modal

--
Gitblit v1.8.0