From a8507cc8c42d17d4fb854594dbf1e084d61912ac Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 18 十月 2022 12:44:22 +0800
Subject: [PATCH] 2022-10-18

---
 src/views/mobdesign/index.jsx |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index 7d19e54..384ca4e 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -10,8 +10,6 @@
 
 import Api from '@/api'
 import Utils, { setGLOBFuncs } from '@/utils/utils.js'
-import zhCN from '@/locales/zh-CN/mob.js'
-import enUS from '@/locales/en-US/mob.js'
 import antdZhCN from 'antd/es/locale/zh_CN'
 import MKEmitter from '@/utils/events.js'
 import MenuUtils from '@/utils/utils-custom.js'
@@ -62,7 +60,6 @@
 
 class MobDesign extends Component {
   state = {
-    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
     loading: true,
     MenuId: '',
     MenuName: '',
@@ -98,9 +95,6 @@
         sessionStorage.setItem('userbind', param.userbind || '')
         sessionStorage.setItem('instantMessage', param.instantMessage || '')
 
-        this.setState({
-          dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
-        })
         this.getAppMessage(param.MenuID)
       } else if (param.type === 'view') {
         window.GLOB.winWidth = 420
@@ -665,7 +659,7 @@
         headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false,
         wrap: {name: 'logo', width: 24, datatype: 'static', cardType: '', blacklist: []},
         name: 'logo', floor: 1, switchable: true,
-        setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
+        setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
       })
 
       config.components.push({
@@ -674,7 +668,6 @@
         floor: 1,
         tabId: '',
         parentId: '',
-        dataName: '',
         width: 24,
         name: '鐢ㄦ埛缁戝畾',
         subtype: 'bindlogin',
@@ -697,7 +690,7 @@
         headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false,
         wrap: {name: 'Power', width: 24, datatype: 'static', cardType: '', blacklist: []},
         name: 'Power', floor: 1, switchable: true,
-        setting:{interType: 'system'}, tabId: '', style:{}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
+        setting:{interType: 'system'}, tabId: '', style:{}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
       })
     }
     
@@ -811,7 +804,16 @@
           }
         }
       } else {
-        config.components = MenuUtils.resetConfig(config.components, {}, urlParam.clearMenu)
+        let uuids = {} // 閲嶇疆鍏叡鏁版嵁婧�
+        if (config.interfaces && config.interfaces.length > 0) {
+          config.interfaces = config.interfaces.map(inter => {
+            uuids[inter.uuid] = this.getuuid()
+            inter.uuid = uuids[inter.uuid]
+            return inter
+          })
+        }
+
+        config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu)
         config.enabled = false
         message.success('澶嶅埗鎴愬姛锛屼繚瀛樺悗鐢熸晥銆�')
       }
@@ -1966,7 +1968,7 @@
 
 
   render () {
-    const { viewType, comloading, loading, settingshow, controlshow, activeKey, dict, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state
+    const { viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state
 
     return (
       <ConfigProvider locale={antdZhCN}>
@@ -1985,7 +1987,6 @@
                   <Panel header="鍩烘湰淇℃伅" forceRender className="basedata" key="basedata">
                     {/* 鑿滃崟淇℃伅 */}
                     {config ? <MenuForm
-                      dict={dict}
                       config={config}
                       MenuId={MenuId}
                       adapters={adapters}
@@ -1997,7 +1998,7 @@
                     {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>鑿滃崟ID</Paragraph> : null}
                   </Panel>
                   {/* 缁勪欢娣诲姞 */}
-                  <Panel header={dict['mob.component']} className="component" key="component">
+                  <Panel header="缁勪欢" className="component" key="component">
                     <SourceWrap />
                   </Panel>
                   <Panel header="鍏冪礌" key="element">
@@ -2018,8 +2019,8 @@
                 {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null}
               </div>
               <div className="wrap">
-                <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>{dict['mob.save']}</Button>
-                <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} />
+                <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>淇濆瓨</Button>
+                <Switch className="big" checkedChildren="鍚�" unCheckedChildren="鍋�" checked={config && config.enabled} onChange={this.onEnabledChange} />
                 <ArrowLeftOutlined title="鍚庨��" className="back-view" onClick={this.backView}/>
                 <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 缁勪欢鍚�</Button>
                 <CreateView resetmenu={this.getAppMenus} />

--
Gitblit v1.8.0