From b1725ffebe2166c2997d4943046307e5f87eaeb9 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 03 九月 2021 11:13:35 +0800
Subject: [PATCH] 2021-09-03

---
 src/views/rolemanage/index.jsx                      |    4 +
 src/menu/components/tabs/tabcomponents/index.jsx    |    3 +
 src/mob/components/tabs/tabcomponents/index.jsx     |    3 +
 src/menu/components/group/groupcomponents/index.jsx |    2 
 src/views/pcdesign/index.jsx                        |   23 +------
 src/tabviews/zshare/fileupload/index.jsx            |    1 
 src/components/editor/index.jsx                     |    1 
 src/menu/components/table/normal-table/index.jsx    |   54 ++++++++---------
 src/views/mobdesign/index.jsx                       |   23 +------
 src/views/menudesign/index.jsx                      |   19 ------
 10 files changed, 46 insertions(+), 87 deletions(-)

diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx
index e18f2b8..dae66f6 100644
--- a/src/components/editor/index.jsx
+++ b/src/components/editor/index.jsx
@@ -94,6 +94,7 @@
     form.append('shardingCnt', _param.chunks)
     form.append('shardingNo', _param.chunk)
     form.append('LoginUID', sessionStorage.getItem('LoginUID') || '')
+    form.append('UserID', sessionStorage.getItem('UserID') || '')
 
     Api.getLargeFileUpload(form).then(res => {
       if (res.status) {
diff --git a/src/menu/components/group/groupcomponents/index.jsx b/src/menu/components/group/groupcomponents/index.jsx
index 52d00b5..2c3213c 100644
--- a/src/menu/components/group/groupcomponents/index.jsx
+++ b/src/menu/components/group/groupcomponents/index.jsx
@@ -59,7 +59,7 @@
     drop(item) {
       if (item.hasOwnProperty('originalIndex') || item.added) {
         return
-      } else if (item.component === 'tabs' || item.component === 'search' || item.component === 'group') { // 鍒嗙粍涓笉鍙坊鍔犳爣绛鹃〉鎴栨悳绱�
+      } else if (['login', 'navbar', 'topbar', 'tabs', 'search', 'group'].includes(item.component)) {
         return
       }
 
diff --git a/src/menu/components/table/normal-table/index.jsx b/src/menu/components/table/normal-table/index.jsx
index f7b5e07..fe7b530 100644
--- a/src/menu/components/table/normal-table/index.jsx
+++ b/src/menu/components/table/normal-table/index.jsx
@@ -1,7 +1,7 @@
 import React, {Component} from 'react'
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
-import { Icon, Popover, Modal, notification } from 'antd'
+import { Icon, Popover, notification } from 'antd'
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -23,8 +23,6 @@
 const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
 const ColumnComponent = asyncComponent(() => import('./columns'))
 const WrapComponent = asyncIconComponent(() => import('./wrapsetting'))
-
-const { confirm } = Modal
 
 class TableCardEditComponent extends Component {
   static propTpyes = {
@@ -79,6 +77,7 @@
         ],
         scripts: [],
         btnlog: [],
+        isNew: true
       }
 
       if (card.config) {
@@ -126,7 +125,8 @@
       this.setState({
         card: _card
       })
-      this.props.updateConfig(_card)
+
+      this.filterOrigin(_card)
     } else {
       this.setState({
         card: fromJS(card).toJS()
@@ -173,6 +173,21 @@
     return col
   }
 
+  filterOrigin = (component) => {
+    if (component.isNew) {
+      let item = fromJS(component).toJS()
+      item.search = item.search.filter(a => !a.origin)
+      item.action = item.action.filter(a => !a.origin)
+      item.cols = item.cols.filter(a => !a.origin)
+
+      delete item.isNew
+
+      this.props.updateConfig(item)
+    } else {
+      this.props.updateConfig(component)
+    }
+  }
+
   /**
    * @description 鍗$墖琛屽灞備俊鎭洿鏂帮紙鏁版嵁婧愶紝鏍峰紡绛夛級
    */
@@ -184,7 +199,7 @@
     component.width = component.wrap.width
     component.name = component.wrap.name
 
-    this.props.updateConfig(component)
+    this.filterOrigin(component)
   }
 
   logButton = (id, item) => {
@@ -198,24 +213,7 @@
     this.setState({
       card: {...card, btnlog}
     })
-    this.props.updateConfig({...card, btnlog})
-  }
-
-  /**
-   * @description 鍗曚釜鍗$墖淇℃伅鏇存柊
-   */
-  deleteCard = () => {
-    let card = fromJS(this.state.card).toJS()
-    let _this = this
-
-    confirm({
-      content: '纭畾鍒犻櫎鍗$墖鍚楋紵',
-      onOk() {
-        _this.setState({card})
-        _this.props.updateConfig(card)
-      },
-      onCancel() {}
-    })
+    this.filterOrigin({...card, btnlog})
   }
 
   changeStyle = () => {
@@ -240,7 +238,7 @@
       card: _card
     })
     
-    this.props.updateConfig(_card)
+    this.filterOrigin(_card)
   }
 
   addColumns = () => {
@@ -294,7 +292,7 @@
     this.setState({
       card: config
     })
-    this.props.updateConfig(config)
+    this.filterOrigin(config)
   }
 
   setSubConfig = (item) => {
@@ -334,7 +332,7 @@
     })
 
     this.setState({card})
-    this.props.updateConfig(card)
+    this.filterOrigin(card)
   }
 
   handleLog = (type, logs, item) => {
@@ -359,7 +357,7 @@
       card.btnlog = logs
 
       this.setState({ card })
-      this.props.updateConfig(card)
+      this.filterOrigin(card)
       notification.success({
         top: 92,
         message: '鎭㈠鎴愬姛锛�',
@@ -368,7 +366,7 @@
     } else {
       card.btnlog = logs
       this.setState({ card })
-      this.props.updateConfig(card)
+      this.filterOrigin(card)
       notification.success({
         top: 92,
         message: '娓呴櫎鎴愬姛锛�',
diff --git a/src/menu/components/tabs/tabcomponents/index.jsx b/src/menu/components/tabs/tabcomponents/index.jsx
index 657c5d9..4632448 100644
--- a/src/menu/components/tabs/tabcomponents/index.jsx
+++ b/src/menu/components/tabs/tabcomponents/index.jsx
@@ -69,7 +69,10 @@
     drop(item) {
       if (item.hasOwnProperty('originalIndex') || item.added) {
         return
+      } else if (['login', 'navbar', 'topbar'].includes(item.component)) {
+        return
       }
+      
       item.added = true
 
       if (item.component === 'search') { // 鎼滅储缁勪欢涓嶅彲閲嶅娣诲姞
diff --git a/src/mob/components/tabs/tabcomponents/index.jsx b/src/mob/components/tabs/tabcomponents/index.jsx
index 7bac2ee..986fa11 100644
--- a/src/mob/components/tabs/tabcomponents/index.jsx
+++ b/src/mob/components/tabs/tabcomponents/index.jsx
@@ -69,7 +69,10 @@
     drop(item) {
       if (item.hasOwnProperty('originalIndex') || item.added) {
         return
+      } else if (['login', 'navbar', 'topbar'].includes(item.component)) {
+        return
       }
+      
       item.added = true
 
       if (item.component === 'search') { // 鎼滅储缁勪欢涓嶅彲閲嶅娣诲姞
diff --git a/src/tabviews/zshare/fileupload/index.jsx b/src/tabviews/zshare/fileupload/index.jsx
index 8ae0028..a10dbd5 100644
--- a/src/tabviews/zshare/fileupload/index.jsx
+++ b/src/tabviews/zshare/fileupload/index.jsx
@@ -171,6 +171,7 @@
     form.append('shardingCnt', param.chunks)
     form.append('shardingNo', param.chunk)
     form.append('LoginUID', sessionStorage.getItem('LoginUID') || '')
+    form.append('UserID', sessionStorage.getItem('UserID') || '')
 
     Api.getLargeFileUpload(form).then(res => {
       if (res.status) {
diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx
index a058167..b85d9b6 100644
--- a/src/views/menudesign/index.jsx
+++ b/src/views/menudesign/index.jsx
@@ -473,23 +473,6 @@
     }
   }
 
-  filterConfig = (components) => {
-    return components.map(item => {
-      if (item.type === 'tabs') {
-        item.subtabs.forEach(tab => {
-          tab.components = this.filterConfig(tab.components)
-        })
-      } else if (item.type === 'group') {
-        item.components = this.filterConfig(item.components)
-      } else if (item.type === 'table' && item.subtype === 'normaltable') {
-        item.search = item.search.filter(a => !a.origin)
-        item.action = item.action.filter(a => !a.origin)
-        item.cols = item.cols.filter(a => !a.origin)
-      }
-      return item
-    })
-  }
-
   submitConfig = () => {
     const { MenuType, delButtons, copyButtons, thawButtons } = this.state
     let config = fromJS(this.state.config).toJS()
@@ -522,8 +505,6 @@
     })
 
     setTimeout(() => {
-      config.components = this.filterConfig(config.components)
-
       if (config.enabled && this.verifyConfig()) {
         config.enabled = false
       }
diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx
index b981866..99729f1 100644
--- a/src/views/mobdesign/index.jsx
+++ b/src/views/mobdesign/index.jsx
@@ -830,23 +830,6 @@
     }
   }
 
-  filterConfig = (components) => {
-    return components.map(item => {
-      if (item.type === 'tabs') {
-        item.subtabs.forEach(tab => {
-          tab.components = this.filterConfig(tab.components)
-        })
-      } else if (item.type === 'group') {
-        item.components = this.filterConfig(item.components)
-      } else if (item.type === 'table' && item.subtype === 'normaltable') {
-        item.search = item.search.filter(a => !a.origin)
-        item.action = item.action.filter(a => !a.origin)
-        item.cols = item.cols.filter(a => !a.origin)
-      }
-      return item
-    })
-  }
-
   submitConfig = () => {
     let config = fromJS(this.state.config).toJS()
 
@@ -868,8 +851,6 @@
     })
 
     setTimeout(() => {
-      config.components = this.filterConfig(config.components)
-
       if (config.enabled && this.verifyConfig()) {
         config.enabled = false
       }
@@ -877,6 +858,10 @@
       let roleParam = {type: 'view', key: config.uuid, title: config.MenuName, children: []}
       roleParam.children = this.getMenuMessage()
 
+      if (config.components.findIndex(item => item.type === 'login') > -1) {
+        roleParam.login = true
+      }
+
       let param = {
         func: 'sPC_TrdMenu_AddUpt',
         FstID: 'mk_app',
diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx
index 463841e..e03ebc8 100644
--- a/src/views/pcdesign/index.jsx
+++ b/src/views/pcdesign/index.jsx
@@ -903,6 +903,10 @@
     nodes.children = trees
     nodes.popviews = popviews
 
+    if (config.components.findIndex(item => item.type === 'login') > -1) {
+      nodes.login = true
+    }
+
     return nodes
   }
 
@@ -924,23 +928,6 @@
         })
       }
     }
-  }
-
-  filterConfig = (components) => {
-    return components.map(item => {
-      if (item.type === 'tabs') {
-        item.subtabs.forEach(tab => {
-          tab.components = this.filterConfig(tab.components)
-        })
-      } else if (item.type === 'group') {
-        item.components = this.filterConfig(item.components)
-      } else if (item.type === 'table' && item.subtype === 'normaltable') {
-        item.search = item.search.filter(a => !a.origin)
-        item.action = item.action.filter(a => !a.origin)
-        item.cols = item.cols.filter(a => !a.origin)
-      }
-      return item
-    })
   }
 
   submitConfig = () => {
@@ -966,8 +953,6 @@
     })
 
     setTimeout(() => {
-      config.components = this.filterConfig(config.components)
-
       if (config.enabled && this.verifyConfig()) {
         config.enabled = false
       }
diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx
index 26dd053..6fb2b09 100644
--- a/src/views/rolemanage/index.jsx
+++ b/src/views/rolemanage/index.jsx
@@ -98,7 +98,9 @@
               try {
                 let pageParam = JSON.parse(window.decodeURIComponent(window.atob(item.menus_rolelist)))
                 item.nodes = pageParam
-                if (pageParam.type === 'navbar') {
+                if (pageParam.login) {
+                  item.nodes = ''
+                } else if (pageParam.type === 'navbar') {
                   item.type = 'navbar'
                 }
               } catch (e) {

--
Gitblit v1.8.0