From 8d065b358a4b1b6df704d62c28eefc80d8bc3826 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 03 七月 2024 16:16:14 +0800
Subject: [PATCH] 2024-07-03

---
 src/tabviews/custom/components/table/edit-table/index.jsx      |    2 
 src/tabviews/custom/components/table/base-table/index.jsx      |    2 
 src/tabviews/custom/components/card/double-data-card/index.jsx |   10 ++
 src/mob/mobshell/index.jsx                                     |   44 +++++++++++++-
 src/tabviews/custom/components/table/normal-table/index.jsx    |    4 
 src/pc/menushell/index.jsx                                     |   44 +++++++++++++-
 src/tabviews/custom/components/card/data-card/index.jsx        |   20 +++---
 7 files changed, 103 insertions(+), 23 deletions(-)

diff --git a/src/mob/mobshell/index.jsx b/src/mob/mobshell/index.jsx
index 257a3d7..cada1ef 100644
--- a/src/mob/mobshell/index.jsx
+++ b/src/mob/mobshell/index.jsx
@@ -217,12 +217,48 @@
         _cards.push(Navbar)
       }
 
-      if (style) {
-        handleList({...menu, style, components: _cards})
+      if (item.component === 'navbar') {
+        let appMenus = sessionStorage.getItem('appViewList')
+        if (appMenus) {
+          try {
+            appMenus = JSON.parse(appMenus)
+            appMenus = appMenus.filter(item => item.keys_type === 'navbar')
+          } catch (e) {
+            appMenus = []
+          }
+        } else {
+          appMenus = []
+        }
+
+        if (appMenus.length) {
+          confirm({
+            title: '濡傞渶浣跨敤褰撳墠搴旂敤涓凡鏈夌殑鑿滃崟鏍忥紝璇风偣鍑诲彸渚у叧鑱旇彍鍗曟爮锛屽闇�鏂板璇风偣纭畾銆�',
+            onOk() {
+              if (style) {
+                handleList({...menu, style, components: _cards})
+              } else {
+                handleList({...menu, components: _cards})
+              }
+              setCards(_cards)
+            },
+            onCancel() {}
+          })
+        } else {
+          if (style) {
+            handleList({...menu, style, components: _cards})
+          } else {
+            handleList({...menu, components: _cards})
+          }
+          setCards(_cards)
+        }
       } else {
-        handleList({...menu, components: _cards})
+        if (style) {
+          handleList({...menu, style, components: _cards})
+        } else {
+          handleList({...menu, components: _cards})
+        }
+        setCards(_cards)
       }
-      setCards(_cards)
     }
   })
 
diff --git a/src/pc/menushell/index.jsx b/src/pc/menushell/index.jsx
index 32b17b4..756d8ce 100644
--- a/src/pc/menushell/index.jsx
+++ b/src/pc/menushell/index.jsx
@@ -169,12 +169,48 @@
       const { index: overIndex } = findCard(`${targetId}`)
       const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
 
-      if (style) {
-        handleList({...menu, style, components: _cards})
+      if (item.component === 'navbar') {
+        let appMenus = sessionStorage.getItem('appViewList')
+        if (appMenus) {
+          try {
+            appMenus = JSON.parse(appMenus)
+            appMenus = appMenus.filter(item => item.keys_type === 'navbar')
+          } catch (e) {
+            appMenus = []
+          }
+        } else {
+          appMenus = []
+        }
+
+        if (appMenus.length) {
+          confirm({
+            title: '濡傞渶浣跨敤褰撳墠搴旂敤涓凡鏈夌殑鑿滃崟鏍忥紝璇风偣鍑诲彸渚у叧鑱旇彍鍗曟爮锛屽闇�鏂板璇风偣纭畾銆�',
+            onOk() {
+              if (style) {
+                handleList({...menu, style, components: _cards})
+              } else {
+                handleList({...menu, components: _cards})
+              }
+              setCards(_cards)
+            },
+            onCancel() {}
+          })
+        } else {
+          if (style) {
+            handleList({...menu, style, components: _cards})
+          } else {
+            handleList({...menu, components: _cards})
+          }
+          setCards(_cards)
+        }
       } else {
-        handleList({...menu, components: _cards})
+        if (style) {
+          handleList({...menu, style, components: _cards})
+        } else {
+          handleList({...menu, components: _cards})
+        }
+        setCards(_cards)
       }
-      setCards(_cards)
     }
   })
 
diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx
index b442a83..3550b7d 100644
--- a/src/tabviews/custom/components/card/data-card/index.jsx
+++ b/src/tabviews/custom/components/card/data-card/index.jsx
@@ -439,13 +439,9 @@
           }, i * 10)
         })
       } else {
-        if (position === 'line' || position === 'line_grid') {
-          if (lines && lines.length === 1) {
-            this.loadLinedata(lines[0].$$uuid, position)
-          } else {
-            this.loadData(id)
-          }
-        } else if (!btn || btn.resetPageIndex !== 'false') {
+        if ((position === 'line' || position === 'line_grid') && lines && lines.length === 1 && !config.forbidLine) {
+          this.loadLinedata(lines[0].$$uuid, position)
+        } else if (btn.resetPageIndex !== 'false') {
           this.setState({
             pageIndex: 1
           }, () => {
@@ -459,14 +455,20 @@
       let supModule = config.setting.supModule
 
       if (position === 'line' || position === 'line_grid') {
-        if (lines && lines.length === 1) {
+        if (lines && lines.length === 1 && !config.forbidLine) {
           this.loadLinedata(lines[0].$$uuid, position)
+        } else if (btn.resetPageIndex !== 'false') {
+          this.setState({
+            pageIndex: 1
+          }, () => {
+            this.loadData(id)
+          })
         } else {
           this.loadData(id)
         }
       } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) {
         MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID)
-      } else if (!btn || btn.resetPageIndex !== 'false') {
+      } else if (btn.resetPageIndex !== 'false') {
         this.setState({
           pageIndex: 1
         }, () => {
diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx
index a5fd92e..a3c0682 100644
--- a/src/tabviews/custom/components/card/double-data-card/index.jsx
+++ b/src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -374,14 +374,20 @@
     let supModule = config.setting.supModule
 
     if (position === 'line' || position === 'line_grid') {
-      if (lines && lines.length === 1) {
+      if (lines && lines.length === 1 && !config.forbidLine) {
         this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position)
+      } else if (btn.resetPageIndex !== 'false') {
+        this.setState({
+          pageIndex: 1
+        }, () => {
+          this.loadData(id)
+        })
       } else {
         this.loadData(id)
       }
     } else if (['mainline', 'maingrid', 'popclose'].includes(position) && supModule) {
       MKEmitter.emit('reloadData', supModule, position === 'maingrid' ? '' : BID)
-    } else if (!btn || btn.resetPageIndex !== 'false') {
+    } else if (btn.resetPageIndex !== 'false') {
       this.setState({
         pageIndex: 1
       }, () => {
diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx
index 10d0453..27b2f35 100644
--- a/src/tabviews/custom/components/table/base-table/index.jsx
+++ b/src/tabviews/custom/components/table/base-table/index.jsx
@@ -568,7 +568,7 @@
     if (config.uuid !== menuId) return
 
     if (position === 'line' || position === 'line_grid') {
-      if (lines && lines.length === 1) {
+      if (lines && lines.length === 1 && !config.forbidLine) {
         this.loadLinedata(lines[0].$$uuid, position)
       } else {
         this.reloadtable(btn, id)
diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx
index fcb0aa5..2b3560d 100644
--- a/src/tabviews/custom/components/table/edit-table/index.jsx
+++ b/src/tabviews/custom/components/table/edit-table/index.jsx
@@ -749,7 +749,7 @@
     if (config.uuid !== menuId) return
 
     if (position === 'line' || position === 'line_grid') {
-      if (lines && lines.length === 1) {
+      if (lines && lines.length === 1 && !config.forbidLine) {
         this.loadLinedata(lines[0].$$uuid, position)
       } else {
         this.reloadtable(btn)
diff --git a/src/tabviews/custom/components/table/normal-table/index.jsx b/src/tabviews/custom/components/table/normal-table/index.jsx
index a5e10c5..b689a85 100644
--- a/src/tabviews/custom/components/table/normal-table/index.jsx
+++ b/src/tabviews/custom/components/table/normal-table/index.jsx
@@ -960,7 +960,7 @@
         })
       } else {
         if (position === 'line' || position === 'line_grid') {
-          if (lines && lines.length === 1) {
+          if (lines && lines.length === 1 && !config.forbidLine) {
             this.loadLinedata(lines[0].$$uuid, position)
           } else {
             this.reloadtable(btn, id)
@@ -971,7 +971,7 @@
       }
     } else {
       if (position === 'line' || position === 'line_grid') {
-        if (lines && lines.length === 1) {
+        if (lines && lines.length === 1 && !config.forbidLine) {
           this.loadLinedata(lines[0].$$uuid, position)
         } else {
           this.reloadtable(btn, id)

--
Gitblit v1.8.0