From 9784e282d14f9a0438dd1f052e06dfb6552d02cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 04 七月 2023 00:13:51 +0800
Subject: [PATCH] 2023-07-04

---
 src/components/normalform/modalform/index.jsx         |    2 
 src/components/normalform/modalform/mkTable/index.jsx |    3 +
 src/menu/components/tabs/antv-tabs/index.jsx          |   22 +++++++++-
 src/menu/components/tabs/antv-tabs/options.jsx        |   52 ++++++++++++++++++++-----
 4 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx
index 7ce6bc5..2b9b80c 100644
--- a/src/components/normalform/modalform/index.jsx
+++ b/src/components/normalform/modalform/index.jsx
@@ -299,7 +299,7 @@
       } else if (item.type === 'source') {
         content = (<SourceComponent type="" placement="right"/>)
       } else if (item.type === 'table') {
-        content = (<MKTable tip={item.tip || ''} columns={item.columns || []} actions={item.actions || []}/>)
+        content = (<MKTable tip={item.tip || ''} fixed={item.fixed === true} columns={item.columns || []} actions={item.actions || []}/>)
       } else if (item.type === 'hint') {
         fields.push(
           <Col span={24} key={index}>
diff --git a/src/components/normalform/modalform/mkTable/index.jsx b/src/components/normalform/modalform/mkTable/index.jsx
index ae23f22..3fdd300 100644
--- a/src/components/normalform/modalform/mkTable/index.jsx
+++ b/src/components/normalform/modalform/mkTable/index.jsx
@@ -392,6 +392,7 @@
   }
 
   render() {
+    const { fixed } = this.props
     let components = {
       body: {
         cell: EditableCell
@@ -436,7 +437,7 @@
     return (
       <EditableContext.Provider value={this.props.form}>
         <div className="modal-editable-table">
-          <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button>
+          {!fixed ? <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button> : null}
           <DndProvider>
             <Table
               bordered
diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx
index 523c8b2..a43f81f 100644
--- a/src/menu/components/tabs/antv-tabs/index.jsx
+++ b/src/menu/components/tabs/antv-tabs/index.jsx
@@ -221,7 +221,7 @@
     editab.icon = res.icon
     editab.hide = res.hide || 'false'
     editab.backgroundColor = res.backgroundColor
-    editab.controlVal = res.controlVal || ''
+    // editab.controlVal = res.controlVal || ''
     editab.selectVal = res.selectVal || ''
     editab.blacklist = res.blacklist
 
@@ -249,11 +249,27 @@
   getTabsForms = () => {
     const { tabs } = this.state
 
-    return getTabsSetForm(tabs.setting, tabs.uuid)
+    return getTabsSetForm(tabs.setting, tabs.uuid, tabs.subtabs)
   }
 
   updateTabs = (res) => {
-    this.updateComponent({...this.state.tabs, setting: res})
+    let tabs = fromJS(this.state.tabs).toJS()
+
+    if (res.controlVals) {
+      let values = {}
+      res.controlVals.forEach(item => {
+        values[item.uuid] = item.value
+      })
+      tabs.subtabs.forEach(tab => {
+        tab.controlVal = values[tab.uuid]
+      })
+
+      delete res.controlVals
+    }
+
+    tabs.setting = res
+
+    this.updateComponent(tabs)
   }
 
   onChange = (key) => {
diff --git a/src/menu/components/tabs/antv-tabs/options.jsx b/src/menu/components/tabs/antv-tabs/options.jsx
index 8654b25..2b1e6cb 100644
--- a/src/menu/components/tabs/antv-tabs/options.jsx
+++ b/src/menu/components/tabs/antv-tabs/options.jsx
@@ -34,14 +34,14 @@
       required: false,
       allowClear: true,
     },
-    {
-      type: 'text',
-      field: 'controlVal',
-      label: '闅愯棌鏍囪',
-      initval: tab.controlVal || '',
-      tooltip: '褰撶鐢ㄥ瓧娈靛�间笌闅愯棌鏍囪鐩哥瓑鏃讹紝鏍囩椤典細闅愯棌銆傛敞锛�1銆佸涓�艰鐢ㄩ�楀彿鍒嗛殧锛�2銆丂pass@鍊艰〃绀哄拷鐣ユ璁剧疆锛堝缁堟樉绀猴級锛�2銆丂pass_empty@鍊艰〃绀哄拷鐣ョ┖鍊硷紝鍗虫湭鑾峰彇涓婄骇缁勪欢淇℃伅鏃舵樉绀猴紙鍙笌鍏朵粬鍊兼嫾鎺ワ級銆�',
-      required: false,
-    },
+    // {
+    //   type: 'text',
+    //   field: 'controlVal',
+    //   label: '闅愯棌鏍囪',
+    //   initval: tab.controlVal || '',
+    //   tooltip: '褰撶鐢ㄥ瓧娈靛�间笌闅愯棌鏍囪鐩哥瓑鏃讹紝鏍囩椤典細闅愯棌銆傛敞锛�1銆佸涓�艰鐢ㄩ�楀彿鍒嗛殧锛�2銆丂pass@鍊艰〃绀哄拷鐣ユ璁剧疆锛堝缁堟樉绀猴級锛�2銆丂pass_empty@鍊艰〃绀哄拷鐣ョ┖鍊硷紝鍗虫湭鑾峰彇涓婄骇缁勪欢淇℃伅鏃舵樉绀猴紙鍙笌鍏朵粬鍊兼嫾鎺ワ級銆�',
+    //   required: false,
+    // },
     {
       type: 'text',
       field: 'selectVal',
@@ -85,7 +85,7 @@
 /**
  * @description tabs琛ㄥ崟閰嶇疆淇℃伅
  */
-export function getTabsSetForm(setting, uuid) {
+export function getTabsSetForm(setting, uuid, subtabs) {
   let appType = sessionStorage.getItem('appType')
   let roleList = sessionStorage.getItem('sysRoles')
 
@@ -104,6 +104,8 @@
   } else {
     roleList = []
   }
+
+  let controlVals = subtabs.map(item => ({uuid: item.uuid, label: item.label, value: item.controlVal}))
 
   const tabForm = [
     {
@@ -202,6 +204,7 @@
       options: modules,
       controlFields: [
         {field: 'controlField', notNull: true},
+        {field: 'controlVals', notNull: true},
       ],
     },
     {
@@ -209,7 +212,7 @@
       field: 'controlField',
       label: '绂佺敤瀛楁',
       initval: setting.controlField || '',
-      tooltip: '鐢ㄤ簬鎺у埗鏍囩闅愯棌鐨勫瓧娈碉紝鍦ㄦ爣绛句腑濉叆闅愯棌鏍囪銆傛敞锛氭爲褰㈢粍浠朵腑涓嶅悓灞傜骇浼氳嚜鍔ㄧ敓鎴恗k_floor锛堝眰绾у瓧娈�1銆�2銆�3...锛夈��',
+      tooltip: '鐢ㄤ簬鎺у埗鏍囩闅愯棌鐨勫瓧娈点�傛敞锛氭爲褰㈢粍浠朵腑涓嶅悓灞傜骇浼氳嚜鍔ㄧ敓鎴恗k_floor锛堝眰绾у瓧娈�1銆�2銆�3...锛夈��',
       required: true,
     },
     {
@@ -217,7 +220,7 @@
       field: 'selectField',
       label: '閫変腑瀛楁',
       initval: setting.selectField || '',
-      tooltip: '鐢ㄤ簬鎺у埗鏍囩椤靛垵濮嬪寲閫変腑锛屽湪鏍囩涓~鍏ラ�変腑鏍囪锛屾敞锛氭暟鎹簮浜巙rl鍙傛暟銆�',
+      tooltip: '鐢ㄤ簬鎺у埗鏍囩椤靛垵濮嬪寲閫変腑锛屽湪鏍囩涓~鍏ラ�変腑鏍囪锛屾敞锛氭暟鎹潵婧愪簬url鍙傛暟銆�',
       required: false
     },
     {
@@ -248,6 +251,33 @@
       options: roleList,
       forbid: !!appType
     },
+    {
+      type: 'table',
+      field: 'controlVals',
+      label: '鏍囩缁�',
+      initval: controlVals,
+      tooltip: '褰撶鐢ㄥ瓧娈靛�间笌闅愯棌鏍囪鐩哥瓑鏃讹紝鏍囩椤典細闅愯棌銆傛敞锛�1銆佸涓�艰鐢ㄩ�楀彿鍒嗛殧锛�2銆丂pass@鍊艰〃绀哄拷鐣ユ璁剧疆锛堝缁堟樉绀猴級锛�2銆丂pass_empty@鍊艰〃绀哄拷鐣ョ┖鍊硷紝鍗虫湭鑾峰彇涓婄骇缁勪欢淇℃伅鏃舵樉绀猴紙鍙笌鍏朵粬鍊兼嫾鎺ワ級銆�',
+      required: false,
+      fixed: true,
+      span: 24,
+      columns: [
+        {
+          title: '鏍囩鍚嶇О',
+          dataIndex: 'label',
+          editable: false,
+          required: false,
+          width: '30%'
+        },
+        {
+          title: '闅愯棌鏍囪',
+          dataIndex: 'value',
+          inputType: 'input',
+          editable: true,
+          required: false,
+          width: '50%'
+        }
+      ]
+    }
   ]
 
   return tabForm

--
Gitblit v1.8.0