From f8c3c53f9e29541f8c0e3fcbf682c301fd17e06a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 23 十一月 2020 17:49:23 +0800
Subject: [PATCH] 2020-11-23

---
 src/templates/sharecomponent/columncomponent/index.jsx |   88 +++++++++++--------------------------------
 1 files changed, 23 insertions(+), 65 deletions(-)

diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx
index 8afc68f..a1e0242 100644
--- a/src/templates/sharecomponent/columncomponent/index.jsx
+++ b/src/templates/sharecomponent/columncomponent/index.jsx
@@ -3,8 +3,6 @@
 import { is, fromJS } from 'immutable'
 import { Icon, Tooltip, Modal, notification, Switch, message, Spin } from 'antd'
 
-import Api from '@/api'
-import options from '@/store/options.js'
 import zhCN from '@/locales/zh-CN/model.js'
 import enUS from '@/locales/en-US/model.js'
 import { getColumnForm } from '@/templates/zshare/formconfig'
@@ -91,76 +89,36 @@
     const { menu } = this.props
 
     if (card.type !== 'colspan') {
-      let menulist = menu.fstMenuList.map(item => {
-        return {
-          value: item.MenuID,
-          label: item.text,
-          isLeaf: false
-        }
-      })
+      let menulist = []
 
-      if ((card.type === 'text' || card.type === 'number') && card.linkmenu && card.linkmenu.length > 0) {
-        let _param = {
-          func: 'sPC_Get_FunMenu',
-          ParentID: card.linkmenu[0],
-          systemType: options.sysType,
-          debug: 'Y'
-        }
+      if (menu.fstMenuList) {
+        let trees = fromJS(menu.fstMenuList).toJS()
 
-        this.setState({
-          loading: true
-        })
-    
-        Api.getSystemConfig(_param).then(result => {
-          if (result.status) {
-            menulist = menulist.map(item => {
-              if (item.value === card.linkmenu[0]) {
-                item.children = result.data.map(item => {
-                  let submenu = {
-                    value: item.ParentID,
-                    label: item.MenuNameP,
-                    children: item.FunMenu.map(cell => {
-                      return {
-                        value: cell.MenuID,
-                        label: cell.MenuName,
-                        MenuID: cell.MenuID,
-                        MenuName: cell.MenuName,
-                        MenuNo: cell.MenuNo,
-                        Ot: cell.Ot,
-                        PageParam: cell.PageParam,
-                        LinkUrl: cell.LinkUrl,
-                        disabled: cell.MenuID === menu.MenuID
-                      }
-                    })
-                  }
+        menulist = trees.map(fst => {
+          fst.value = fst.MenuID
+          fst.label = fst.MenuName
+          fst.isLeaf = false
+          fst.children = fst.children.map(snd => {
+            snd.value = snd.MenuID
+            snd.label = snd.MenuName
 
-                  return submenu
-                })
-              }
-              return item
+            snd.children = snd.children.map(thd => {
+              thd.value = thd.MenuID
+              thd.label = thd.MenuName
+              thd.disabled = thd.MenuID === menu.MenuID
+              return thd
             })
-          } else {
-            notification.warning({
-              top: 92,
-              message: result.message,
-              duration: 5
-            })
-          }
-
-          this.setState({
-            loading: false,
-            modaltype: 'columns',
-            card: card,
-            formlist: getColumnForm(card, this.props.sysRoles, menulist)
+            return snd
           })
-        })
-      } else {
-        this.setState({
-          modaltype: 'columns',
-          card: card,
-          formlist: getColumnForm(card, this.props.sysRoles, menulist)
+          return fst
         })
       }
+      
+      this.setState({
+        modaltype: 'columns',
+        card: card,
+        formlist: getColumnForm(card, this.props.sysRoles, menulist)
+      })
     } else {
       this.setState({
         modaltype: 'colspan',

--
Gitblit v1.8.0