From 7050261ffdf7e533a8bc61356615d7f464074286 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 10 七月 2024 17:15:24 +0800
Subject: [PATCH] 2024-07-10

---
 src/views/pcdesign/index.jsx |   42 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index d998c92..658b6bc 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -68,7 +68,9 @@
     eyeopen: false,
     view: '',
     popConfig: null,
-    needUpdate: false
+    needUpdate: false,
+    appLoginId: '',
+    appHomeId: ''
   }
 
   UNSAFE_componentWillMount() {
@@ -121,8 +123,27 @@
 
         this.getAppMessage(param.MenuID)
       } else if (param.type === 'view') {
+        let appLoginId = ''
+        let appHomeId = ''
+        if (sessionStorage.getItem('appViewList')) {
+          try {
+            let appMenus = JSON.parse(sessionStorage.getItem('appViewList'))
+            appMenus.forEach(item => {
+              if (item.keys_type === 'login') {
+                appLoginId = item.keys_id
+              } else if (item.keys_type === 'index') {
+                appHomeId = item.keys_id
+              }
+            })
+          } catch (e) {
+
+          }
+        }
+
         this.setState({
-          MenuId: param.MenuID
+          MenuId: param.MenuID,
+          appLoginId: appLoginId,
+          appHomeId: appHomeId
         }, () => {
           this.getMenuParam(param)
         })
@@ -1625,6 +1646,8 @@
     param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
     param.secretkey = Utils.encrypt('', param.timestamp)
 
+    const that = this
+
     confirm({
       title: '纭畾璁剧疆鏈〉闈负棣栭〉鍚楋紵',
       content: '',
@@ -1638,6 +1661,10 @@
             })
           } else {
             sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
+
+            that.setState({
+              appHomeId: config.MenuID
+            })
           }
         })
       },
@@ -1685,6 +1712,7 @@
     param.secretkey = Utils.encrypt('', param.timestamp)
 
     let hasLogin = config.components.findIndex(item => item.type === 'login') > -1
+    const that = this
 
     confirm({
       title: '纭畾璁剧疆鏈〉闈负鐧诲綍椤靛悧锛�',
@@ -1699,6 +1727,10 @@
             })
           } else {
             sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
+
+            that.setState({
+              appLoginId: config.MenuID
+            })
           }
         })
       },
@@ -1727,7 +1759,7 @@
   }
 
   render () {
-    const { view, loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, eyeopen, needUpdate } = this.state
+    const { view, loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, eyeopen, needUpdate, appLoginId, appHomeId } = this.state
 
     return (
       <>
@@ -1788,8 +1820,8 @@
                 <PictureController/>
                 <Quotecomponent config={config} updateConfig={this.updateConfig}/>
                 <StyleCombControlButton menu={config} />
-                <Button className="mk-border-green" onClick={this.setHomeView}><HomeOutlined /> 璁句负棣栭〉</Button>
-                <Button className="mk-border-purple" onClick={this.setLoginView}><LoginOutlined/> 璁句负鐧诲綍椤�</Button>
+                <Button className="mk-border-green" disabled={MenuId === appHomeId} onClick={this.setHomeView}><HomeOutlined /> 璁句负棣栭〉</Button>
+                <Button className="mk-border-purple" disabled={MenuId === appLoginId} onClick={this.setLoginView}><LoginOutlined/> 璁句负鐧诲綍椤�</Button>
                 <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/>
                 <Transfer MenuID={MenuId} />
                 {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null}

--
Gitblit v1.8.0