From 876a5e6657d67df66bb525d02dd6d147ba81cae5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 05 一月 2023 09:53:37 +0800
Subject: [PATCH] 2023-01-05

---
 src/views/mobdesign/index.jsx |   52 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index b2df487..a3f934b 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -68,7 +68,6 @@
     menuloading: false,
     oriConfig: null,
     config: null,
-    direction: 'vertical',
     settingshow: true,
     controlshow: true,
     comloading: false,
@@ -91,6 +90,7 @@
         sessionStorage.setItem('typename', param.typename || 'mob')
         sessionStorage.setItem('adapter', param.adapter || '')
         sessionStorage.setItem('sysBgColor', param.sysBgColor || '#ffffff')
+        sessionStorage.setItem('direction', param.direction || 'vertical')
         sessionStorage.setItem('userbind', param.userbind || '')
         sessionStorage.setItem('instantMessage', param.instantMessage || '')
 
@@ -100,13 +100,6 @@
         window.GLOB.winHeight = 738
         window.GLOB.shellWidth = 376
         window.GLOB.shellHeight = 680
-
-        if (sessionStorage.getItem('typename') === 'pad') {
-          window.GLOB.winWidth = 736
-          window.GLOB.winHeight = 945
-          window.GLOB.shellWidth = 640
-          window.GLOB.shellHeight = 853
-        }
 
         let adapters = sessionStorage.getItem('adapter')
         if (adapters) {
@@ -498,7 +491,22 @@
         config.uuid = MenuId
         config.MenuID = MenuId
         config.open_edition = result.open_edition || ''
+        config.direction = config.direction || sessionStorage.getItem('direction') || 'vertical'
         window.GLOB.urlFields = config.urlFields || []
+
+        if (sessionStorage.getItem('typename') === 'pad') {
+          if (config.direction !== 'vertical') {
+            window.GLOB.winWidth = 992
+            window.GLOB.winHeight = 690
+            window.GLOB.shellWidth = 853
+            window.GLOB.shellHeight = 640
+          } else {
+            window.GLOB.winWidth = 736
+            window.GLOB.winHeight = 945
+            window.GLOB.shellWidth = 640
+            window.GLOB.shellHeight = 853
+          }
+        }
 
         if (config.version !== 2.0) {
           config.components = this.collectTB(config.components)
@@ -739,6 +747,21 @@
       config.MenuName = urlParam.MenuName || ''
       // config.MenuNo = urlParam.MenuNo || ''
       config.MenuNo = ''
+      config.direction = config.direction || sessionStorage.getItem('direction') || 'vertical'
+
+      if (sessionStorage.getItem('typename') === 'pad') {
+        if (config.direction !== 'vertical') {
+          window.GLOB.winWidth = 992
+          window.GLOB.winHeight = 690
+          window.GLOB.shellWidth = 853
+          window.GLOB.shellHeight = 640
+        } else {
+          window.GLOB.winWidth = 736
+          window.GLOB.winHeight = 945
+          window.GLOB.shellWidth = 640
+          window.GLOB.shellHeight = 853
+        }
+      }
 
       let navItem = null
       config.components.forEach(item => {
@@ -1809,6 +1832,8 @@
   }
 
   changeView = (val) => {
+    if (sessionStorage.getItem('typename') !== 'pad') return
+    
     if (val !== 'vertical') {
       window.GLOB.winWidth = 992
       window.GLOB.winHeight = 690
@@ -1822,7 +1847,6 @@
     }
 
     this.setState({
-      direction: val,
       comloading: true
     }, () => {
       this.setState({ comloading: false })
@@ -1849,7 +1873,7 @@
     return (
       <ConfigProvider locale={antdZhCN}>
         <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view">
-          <Header changeView={this.changeView}/>
+          <Header/>
           {loading ? <Spin className="view-spin" size="large" /> : null}
           <DndProvider backend={HTML5Backend}>
             <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}>
@@ -1866,12 +1890,18 @@
                       config={config}
                       MenuId={MenuId}
                       adapters={adapters}
-                      updateConfig={this.updateConfig}
+                      updateConfig={(con) => {
+                        this.updateConfig(con)
+                        if (con.direction !== config.direction) {
+                          this.changeView(con.direction)
+                        }
+                      }}
                     /> : null}
                     {config ? <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> : null}
                     {/* 琛ㄥ悕娣诲姞 */}
                     {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                     {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> : null}
+                    {config ? <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text:  `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>鑿滃崟閾炬帴</Paragraph> : null}
                   </Panel>
                   {/* 缁勪欢娣诲姞 */}
                   <Panel header="缁勪欢" className="component" key="component">

--
Gitblit v1.8.0