From 151d3aee0218a3eb6b928b0b327be6cd9ac7652c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 01 七月 2021 16:02:07 +0800
Subject: [PATCH] 2021-07-01

---
 src/api/index.js                                      |   13 +++
 src/menu/modalconfig/index.jsx                        |   35 ++---------
 src/views/appmanage/index.jsx                         |    2 
 src/menu/components/card/cardcellcomponent/index.jsx  |    3 
 src/views/pcdesign/index.jsx                          |   15 +++--
 src/mob/modalconfig/index.jsx                         |   38 +++---------
 src/templates/zshare/formconfig.jsx                   |    4 
 src/mob/modalconfig/index.scss                        |    3 
 src/menu/components/table/normal-table/index.jsx      |    4 
 src/tabviews/zshare/actionList/normalbutton/index.jsx |    9 +-
 src/views/mobdesign/index.jsx                         |   18 +++--
 src/menu/components/card/data-card/index.jsx          |    4 
 12 files changed, 63 insertions(+), 85 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index a27978d..f9a4af4 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -297,9 +297,14 @@
       return new Promise((resolve, reject) => {
         CacheUtils.getWebSqlVersion().then(msg => {
           appVersion.oldVersion = msg.version || ''
+          let modifydate = msg.createDate || curTime
+          if (modifydate.indexOf('Invalid date') > -1) {
+            modifydate = curTime
+          }
+
           let param = {
             func: 's_get_app_version',
-            modifydate: msg.createDate || curTime,
+            modifydate
           }
   
           this.getSystemConfig(param).then(res => {
@@ -343,9 +348,13 @@
       return new Promise((resolve, reject) => {
         CacheUtils.getIndexDBVersion().then(msg => {
           appVersion.oldVersion = msg.version || ''
+          let modifydate = msg.createDate || curTime
+          if (modifydate.indexOf('Invalid date') > -1) {
+            modifydate = curTime
+          }
           let param = {
             func: 's_get_app_version',
-            modifydate: msg.createDate || curTime,
+            modifydate
           }
 
           this.getSystemConfig(param).then(res => {
diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx
index 03b0d4e..a012409 100644
--- a/src/menu/components/card/cardcellcomponent/index.jsx
+++ b/src/menu/components/card/cardcellcomponent/index.jsx
@@ -478,6 +478,7 @@
 
   handleSubConfig = (item) => {
     const { cards } = this.props
+    const { appType } = this.state
     let btn = fromJS(item).toJS()
 
     if ((sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') === 'true')) return
@@ -486,7 +487,7 @@
       if (btn.OpenType === 'pop') {
         if (!btn.modal) {
           btn.modal = {
-            setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
+            setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
             tables: [],
             groups: [],
             fields: []
diff --git a/src/menu/components/card/data-card/index.jsx b/src/menu/components/card/data-card/index.jsx
index 9a7931d..38f568e 100644
--- a/src/menu/components/card/data-card/index.jsx
+++ b/src/menu/components/card/data-card/index.jsx
@@ -294,13 +294,13 @@
   }
 
   setSubConfig = (item) => {
-    const { card } = this.state
+    const { card, appType } = this.state
     let btn = fromJS(item).toJS()
 
     if (btn.OpenType === 'pop' || btn.execMode === 'pop') {
       if (!btn.modal) {
         btn.modal = {
-          setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
+          setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
           tables: [],
           groups: [],
           fields: []
diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index 4f47217..4bd4dd7 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -299,13 +299,13 @@
   }
 
   setSubConfig = (item) => {
-    const { card } = this.state
+    const { card, appType } = this.state
     let btn = fromJS(item).toJS()
 
     if (btn.OpenType === 'pop' || btn.execMode === 'pop') {
       if (!btn.modal) {
         btn.modal = {
-          setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
+          setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
           tables: [],
           groups: [],
           fields: []
diff --git a/src/menu/modalconfig/index.jsx b/src/menu/modalconfig/index.jsx
index caca6cd..f7c3ca0 100644
--- a/src/menu/modalconfig/index.jsx
+++ b/src/menu/modalconfig/index.jsx
@@ -37,20 +37,11 @@
     dict: CommonDict,      // 瀛楀吀
     config: null,          // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛�
     visible: false,        // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒�
-    tableVisible: false,   // 鏁版嵁琛ㄥ瓧娈靛垪琛ㄦā鎬佹锛屾樉绀烘帶鍒�
-    tableColumns: [],      // 琛ㄦ牸瀛楁鍚嶅垪琛�
-    fields: null,          // 琛ㄥ崟锛屽彲閫夊瓧娈碉紙鍘婚噸鍚庯級
     formlist: null,        // 琛ㄥ崟缂栬緫妯℃�佹锛屽彲缂栬緫瀛楁
     card: null,            // 缂栬緫鍏冪礌
-    closeloading: false,   // 鑿滃崟淇濆瓨涓�
     settingVisible: false, // 鍏ㄥ眬閰嶇疆妯℃�佹
-    closeVisible: false,   // 鍏抽棴妯℃�佹
-    tables: [],            // 鍙敤琛ㄥ悕
-    selectedTables: [],    // 宸查�夎〃鍚�
     originConfig: null,    // 鍘熷鑿滃崟
-    sources: null,         // 琛ㄥ崟绫诲瀷
     sqlVerifing: false,    // sql楠岃瘉
-    openEdition: '',       // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
     showField: false,      // 鏄剧ず琛ㄥ崟瀛楁鍊�
     standardform: null
   }
@@ -297,7 +288,7 @@
   submitConfig = () => {
     const { config } = this.state
 
-    this.setState({originConfig: fromJS(config).toJS(), closeVisible: false})
+    this.setState({originConfig: fromJS(config).toJS()})
     this.props.handleSave(config)
     notification.success({
       top: 92,
@@ -310,8 +301,13 @@
     const { config, originConfig } = this.state
 
     if (!is(fromJS(config), fromJS(originConfig))) {
-      this.setState({
-        closeVisible: true
+      let _this = this
+      confirm({
+        content: '閰嶇疆淇℃伅鏈繚瀛橈紝纭畾杩斿洖鍚楋紵',
+        onOk() {
+          _this.props.handleBack()
+        },
+        onCancel() {}
       })
     } else {
       this.props.handleBack()
@@ -505,21 +501,6 @@
             inputSubmit={this.settingSave}
             wrappedComponentRef={(inst) => this.settingRef = inst}
           />
-        </Modal>
-        <Modal
-          bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
-          closable={false}
-          maskClosable={false}
-          visible={this.state.closeVisible}
-          onCancel={() => { this.setState({closeVisible: false}) }}
-          footer={[
-            <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>,
-            <Button key="confirm" className="mk-btn mk-yellow" onClick={this.props.handleBack}>{this.state.dict['model.notsave']}</Button>,
-            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button>
-          ]}
-          destroyOnClose
-        >
-          {this.state.dict['header.menu.config.placeholder']}
         </Modal>
       </div>
     )
diff --git a/src/mob/modalconfig/index.jsx b/src/mob/modalconfig/index.jsx
index 3e39dc0..87ddbd4 100644
--- a/src/mob/modalconfig/index.jsx
+++ b/src/mob/modalconfig/index.jsx
@@ -37,20 +37,11 @@
     dict: CommonDict,      // 瀛楀吀
     config: null,          // 椤甸潰閰嶇疆锛屽寘鎷ā鏉跨被鍨嬨�佹ā鎬佹璁剧疆銆佹坊鍔犺〃鍚嶃�佽〃鍗曞垪琛�
     visible: false,        // 琛ㄥ崟缂栬緫妯℃�佹锛屾樉绀烘帶鍒�
-    tableVisible: false,   // 鏁版嵁琛ㄥ瓧娈靛垪琛ㄦā鎬佹锛屾樉绀烘帶鍒�
-    tableColumns: [],      // 琛ㄦ牸瀛楁鍚嶅垪琛�
-    fields: null,          // 琛ㄥ崟锛屽彲閫夊瓧娈碉紙鍘婚噸鍚庯級
     formlist: null,        // 琛ㄥ崟缂栬緫妯℃�佹锛屽彲缂栬緫瀛楁
     card: null,            // 缂栬緫鍏冪礌
-    closeloading: false,   // 鑿滃崟淇濆瓨涓�
     settingVisible: false, // 鍏ㄥ眬閰嶇疆妯℃�佹
-    closeVisible: false,   // 鍏抽棴妯℃�佹
-    tables: [],            // 鍙敤琛ㄥ悕
-    selectedTables: [],    // 宸查�夎〃鍚�
     originConfig: null,    // 鍘熷鑿滃崟
-    sources: null,         // 琛ㄥ崟绫诲瀷
     sqlVerifing: false,    // sql楠岃瘉
-    openEdition: '',       // 缂栬緫鐗堟湰鏍囪锛岄槻姝㈠浜烘搷浣�
     showField: false,      // 鏄剧ず琛ㄥ崟瀛楁鍊�
     standardform: null
   }
@@ -297,7 +288,7 @@
   submitConfig = () => {
     const { config } = this.state
 
-    this.setState({originConfig: fromJS(config).toJS(), closeVisible: false})
+    this.setState({originConfig: fromJS(config).toJS()})
     this.props.handleSave(config)
     notification.success({
       top: 92,
@@ -310,8 +301,13 @@
     const { config, originConfig } = this.state
 
     if (!is(fromJS(config), fromJS(originConfig))) {
-      this.setState({
-        closeVisible: true
+      let _this = this
+      confirm({
+        content: '閰嶇疆淇℃伅鏈繚瀛橈紝纭畾杩斿洖鍚楋紵',
+        onOk() {
+          _this.props.handleBack()
+        },
+        onCancel() {}
       })
     } else {
       this.props.handleBack()
@@ -370,7 +366,6 @@
   }
 
   render () {
-    const { btn } = this.props
     const { config, dict } = this.state
 
     return (
@@ -404,7 +399,7 @@
               <div className="mob-shell-inner">
                 <div className="am-navbar">
                   <Icon type="close" />
-                  <div className="am-navbar-title">{btn.label}</div>
+                  <div className="am-navbar-title">{config.setting.title}</div>
                 </div>
                 <DragElement
                   list={config.fields}
@@ -454,21 +449,6 @@
             inputSubmit={this.settingSave}
             wrappedComponentRef={(inst) => this.settingRef = inst}
           />
-        </Modal>
-        <Modal
-          bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}}
-          closable={false}
-          maskClosable={false}
-          visible={this.state.closeVisible}
-          onCancel={() => { this.setState({closeVisible: false}) }}
-          footer={[
-            <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>,
-            <Button key="confirm" className="mk-btn mk-yellow" onClick={this.props.handleBack}>{this.state.dict['model.notsave']}</Button>,
-            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button>
-          ]}
-          destroyOnClose
-        >
-          {this.state.dict['header.menu.config.placeholder']}
         </Modal>
       </div>
     )
diff --git a/src/mob/modalconfig/index.scss b/src/mob/modalconfig/index.scss
index c8c931d..02bdd82 100644
--- a/src/mob/modalconfig/index.scss
+++ b/src/mob/modalconfig/index.scss
@@ -160,7 +160,7 @@
           position: absolute;
           line-height: 45px;
           font-size: 18px;
-          left: 10px;
+          right: 10px;
         }
         .am-navbar-title {
           font-size: 16px;
@@ -178,6 +178,7 @@
 
       .modal-fields-row {
         min-height: calc(100% - 95px);
+        padding: 0 10px 35px;
       }
 
       .modal-form {
diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx
index b4811e5..ff40ea8 100644
--- a/src/tabviews/zshare/actionList/normalbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1709,6 +1709,7 @@
           visible={visible}
           placement={btnconfig.setting.placement || 'right'}
           bodyStyle={{ paddingBottom: 80 }}
+          destroyOnClose
         >
           <MutilForm
             BID={BID}
@@ -1770,7 +1771,7 @@
 
   render() {
     const { btn, show, style } = this.props
-    const { loadingNumber, loading, visible, disabled } = this.state
+    const { loadingNumber, loading, disabled } = this.state
 
     if (show === 'actionList') {
       return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
@@ -1782,7 +1783,7 @@
           className={'mk-btn mk-' + btn.class}
           onClick={() => {this.actionTrigger()}}
         >{(loadingNumber ? `(${loadingNumber})` : '') + btn.label}</Button>
-        {visible ? this.getModels() : null}
+        {this.getModels()}
       </div>
     } else if (show && show.indexOf('plus') > -1) {
       return <div className="mk-btn-wrap">
@@ -1793,7 +1794,7 @@
           style={{fontSize: show.substring(4) + 'px'}}
           onClick={() => {this.actionTrigger()}}
         ></Button>
-        {visible ? this.getModels() : null}
+        {this.getModels()}
       </div>
     } else { // icon銆乼ext銆� all 鍗$墖
       return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
@@ -1806,7 +1807,7 @@
           icon={show === 'text' ? '' : (btn.icon || '')}
           onClick={() => {this.actionTrigger()}}
         >{show === 'icon' && btn.icon ? '' : btn.label}</Button>
-        {visible ? this.getModels() : null}
+        {this.getModels()}
       </div>
     }
   }
diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index af18758..f73bb3e 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -2633,10 +2633,10 @@
         text: '绂佺敤'
       }, {
         value: 'simple',
-        text: '鍗曟鎵爜'
+        text: '鍗曟'
       }, {
         value: 'multi',
-        text: '杩炵画鎵爜'
+        text: '杩炵画'
       }],
       forbid: appType !== 'mob'
     },
diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx
index d2749f4..6857460 100644
--- a/src/views/appmanage/index.jsx
+++ b/src/views/appmanage/index.jsx
@@ -125,7 +125,7 @@
           <div>
             <Button type="link" onClick={() => this.deleteSubApp(record)} style={{color: '#ff4d4f'}}>鍒犻櫎</Button>
             <Button type="link" onClick={() => this.jumpApp(record)}>缂栬緫搴旂敤</Button>
-            <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${record.typename}/index.html#/index/${this.state.selectApp.kei_no}/${record.lang}` }}></Paragraph>
+            <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${record.typename === 'pad' ? 'mob' : record.typename}/index.html#/index/${this.state.selectApp.kei_no}/${record.lang}` }}></Paragraph>
           </div>
         )
       },
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 8082c53..9a637c2 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -373,10 +373,11 @@
     })
 
     this.setState({
-      config: {...config, components: []}
+      config: {...config, components},
+      comloading: true
     }, () => {
       this.setState({
-        config: {...config, components: components}
+        comloading: false
       })
     })
   }
@@ -1102,8 +1103,9 @@
 
         if (res.status) {
           config.open_edition = res.open_edition || ''
-
+          
           this.setState({
+            config,
             oriConfig: fromJS(config).toJS(),
           })
 
@@ -1222,10 +1224,10 @@
             copyButtons: [],
             thawButtons: [],
             menuloading: false,
-            config: {...config, components: []}
+            comloading: true
           }, () => {
             this.setState({
-              config: {...this.state.config, components: this.state.oriConfig.components}
+              comloading: false
             })
           })
           notification.success({
@@ -1520,9 +1522,9 @@
               <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
             </div>
             <div className={'menu-body ' + (menuloading ? 'saving' : '')}>
-              <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}>
-                {config && !comloading ? <MobShell menu={config} handleList={this.updateConfig} /> : null}
-              </div>
+              {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}>
+                <MobShell menu={config} handleList={this.updateConfig} />
+              </div> : null}
             </div>
           </DndProvider>
           <StyleController />
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 584f7b0..bc7ea8b 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -68,6 +68,7 @@
     customComponents: [],
     settingshow: sessionStorage.getItem('settingshow') !== 'false',
     controlshow: sessionStorage.getItem('controlshow') !== 'false',
+    comloading: false
   }
 
   UNSAFE_componentWillMount() {
@@ -379,10 +380,11 @@
     })
 
     this.setState({
-      config: {...config, components: []}
+      config: {...config, components},
+      comloading: true
     }, () => {
       this.setState({
-        config: {...config, components: components}
+        comloading: false
       })
     })
   }
@@ -1130,6 +1132,7 @@
           config.open_edition = res.open_edition || ''
 
           this.setState({
+            config,
             oriConfig: fromJS(config).toJS(),
           })
 
@@ -1248,10 +1251,10 @@
             copyButtons: [],
             thawButtons: [],
             menuloading: false,
-            config: {...config, components: []}
+            comloading: true
           }, () => {
             this.setState({
-              config: {...this.state.config, components: this.state.oriConfig.components}
+              comloading: false
             })
           })
           notification.success({
@@ -1465,7 +1468,7 @@
   }
 
   render () {
-    const { localedict, loading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state
+    const { localedict, loading, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state
 
     return (
       <ConfigProvider locale={localedict}>
@@ -1523,7 +1526,7 @@
               <Button type="default" onClick={this.closeView}>鍏抽棴</Button>
             </div>
             <div className={'menu-body ' + (menuloading ? 'saving' : '')}>
-              {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
+              {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null}
             </div>
           </DndProvider>
           <StyleController />

--
Gitblit v1.8.0