From b9a0e8541f0959db5d848f7b893c8838851ce411 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 四月 2020 13:29:49 +0800
Subject: [PATCH] 2020-04-09

---
 src/templates/subtableconfig/index.jsx |   95 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 83 insertions(+), 12 deletions(-)

diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx
index 1d4e75b..e5fcada 100644
--- a/src/templates/subtableconfig/index.jsx
+++ b/src/templates/subtableconfig/index.jsx
@@ -8,6 +8,7 @@
 import moment from 'moment'
 
 import Api from '@/api'
+import options from '@/store/options.js'
 import zhCN from '@/locales/zh-CN/comtable.js'
 import enUS from '@/locales/en-US/comtable.js'
 import Utils from '@/utils/utils.js'
@@ -449,11 +450,76 @@
     const { menu } = this.props
 
     if (card.type !== 'colspan') {
-      this.setState({
-        modaltype: 'columns',
-        card: card,
-        formlist: getColumnForm(card, menu.roleList)
+      let menulist = menu.fstMenuList.map(item => {
+        return {
+          value: item.MenuID,
+          label: item.text,
+          isLeaf: false
+        }
       })
+
+      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.systemType,
+          debug: 'Y'
+        }
+
+        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
+                      }
+                    })
+                  }
+
+                  return submenu
+                })
+              }
+              return item
+            })
+          } else {
+            notification.warning({
+              top: 92,
+              message: result.message,
+              duration: 10
+            })
+          }
+
+          this.setState({
+            loading: false,
+            modaltype: 'columns',
+            card: card,
+            formlist: getColumnForm(card, menu.roleList, menulist)
+          })
+        })
+      } else {
+        this.setState({
+          modaltype: 'columns',
+          card: card,
+          formlist: getColumnForm(card, menu.roleList, menulist)
+        })
+      }
     } else {
       this.setState({
         modaltype: 'colspan',
@@ -500,10 +566,12 @@
         let labelrepet = false // 鎻愮ず鏂囧瓧閲嶅
 
         let _search = config.search.map(item => {
-          if (item.uuid !== res.uuid && item.field === res.field) {
-            fieldrepet = true
-          } else if (item.uuid !== res.uuid && item.field && item.label === res.label) {
-            labelrepet = true
+          if (item.uuid !== res.uuid && res.field && item.field) {
+            if (item.field === res.field) {
+              fieldrepet = true
+            } else if (item.label === res.label) {
+              labelrepet = true
+            }
           }
 
           if (item.uuid === res.uuid) {
@@ -640,10 +708,12 @@
         let labelrepet = false // 鎻愮ず鏂囧瓧閲嶅
 
         let _columns = config.columns.map(item => {
-          if (item.uuid !== res.uuid && item.field === res.field) {
-            fieldrepet = true
-          } else if (item.uuid !== res.uuid && item.field && item.label === res.label) {
-            labelrepet = true
+          if (item.uuid !== res.uuid && res.field && item.field) {
+            if (item.field === res.field) {
+              fieldrepet = true
+            } else if (item.label === res.label) {
+              labelrepet = true
+            }
           }
 
           if (item.uuid === res.uuid) {
@@ -2393,6 +2463,7 @@
           <ColumnForm
             dict={this.state.dict}
             card={this.state.card}
+            MenuID={this.props.menu.MenuID}
             inputSubmit={this.handleSubmit}
             formlist={this.state.formlist}
             wrappedComponentRef={(inst) => this.columnFormRef = inst}

--
Gitblit v1.8.0