From ef49d73fe0407b914b700f3fc7c9f48ab2b36655 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 10 七月 2024 17:34:29 +0800
Subject: [PATCH] Merge branch 'master' into positec

---
 src/views/rolemanage/index.jsx |    9 +++-
 src/views/pcdesign/index.jsx   |   42 ++++++++++++++++++--
 src/views/mobdesign/index.jsx  |   42 ++++++++++++++++++--
 3 files changed, 80 insertions(+), 13 deletions(-)

diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index d73400e..253c551 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -74,7 +74,9 @@
     viewType: 'menu',
     view: '',
     eyeopen: false,
-    needUpdate: false
+    needUpdate: false,
+    appLoginId: '',
+    appHomeId: ''
   }
 
   UNSAFE_componentWillMount() {
@@ -139,10 +141,29 @@
           adapters = []
         }
 
+        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({
           adapters,
           MenuId: param.MenuID,
-          viewType: /^userbind/.test(param.MenuID) ? 'userbind' : 'menu'
+          viewType: /^userbind/.test(param.MenuID) ? 'userbind' : 'menu',
+          appLoginId: appLoginId,
+          appHomeId: appHomeId
         }, () => {
           this.getMenuParam(param)
         })
@@ -1942,6 +1963,8 @@
     param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
     param.secretkey = Utils.encrypt('', param.timestamp)
 
+    const that = this
+
     confirm({
       title: '纭畾璁剧疆鏈〉闈负棣栭〉鍚楋紵',
       content: '',
@@ -1955,6 +1978,10 @@
             })
           } else {
             sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
+
+            that.setState({
+              appHomeId: config.MenuID
+            })
           }
         })
       },
@@ -2002,6 +2029,7 @@
     param.secretkey = Utils.encrypt('', param.timestamp)
 
     let hasLogin = config.components.findIndex(item => item.type === 'login') > -1
+    const that = this
 
     confirm({
       title: '纭畾璁剧疆鏈〉闈负鐧诲綍椤靛悧锛�',
@@ -2016,6 +2044,10 @@
             })
           } else {
             sessionStorage.setItem('appViewList', JSON.stringify(appViewList))
+
+            that.setState({
+              appLoginId: config.MenuID
+            })
           }
         })
       },
@@ -2080,7 +2112,7 @@
 
 
   render () {
-    const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate } = this.state
+    const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate, appLoginId, appHomeId } = this.state
 
     return (
       <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view">
@@ -2148,8 +2180,8 @@
               <PictureController/>
               <Quotecomponent config={config} updateConfig={this.updateConfig}/>
               <StyleCombControlButton menu={config} />
-              <Button className="mk-border-green set-home" onClick={this.setHomeView}><HomeOutlined /> 璁句负棣栭〉</Button>
-              <Button className="mk-border-purple set-login" onClick={this.setLoginView}><LoginOutlined /> 璁句负鐧诲綍椤�</Button>
+              <Button className="mk-border-green set-home" disabled={MenuId === appHomeId} onClick={this.setHomeView}><HomeOutlined /> 璁句负棣栭〉</Button>
+              <Button className="mk-border-purple set-login" 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}
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}
diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx
index e030560..83168c8 100644
--- a/src/views/rolemanage/index.jsx
+++ b/src/views/rolemanage/index.jsx
@@ -26,7 +26,7 @@
     columns: [
       {
         title: '鑿滃崟鍚嶇О', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => {
-          if (record.extra) {
+          if (record.extra || this.state.appKeys.includes(record.MenuID)) {
             return <span style={{color: '#1890ff'}}>{text}</span>
           } else if (record.interfaces === 'true') {
             return <span><ApiOutlined style={{color: 'orange', marginRight: '5px'}} title="鑿滃崟涓娇鐢ㄤ簡澶栭儴鎺ュ彛" />{text}</span>
@@ -74,7 +74,8 @@
     trees: null,
     expandedKeys: [],
     searchkey: '',
-    appViewList: []
+    appViewList: [],
+    appKeys: []
   }
 
   oriTrees = null
@@ -118,7 +119,9 @@
         })
         return
       }
-      this.setState({appViewList: result.data || []})
+
+      let data = result.data || []
+      this.setState({appViewList: data, appKeys: data.map(item => item.keys_id)})
     })
   }
 

--
Gitblit v1.8.0