From b69b5f6329ca5f87932436b7a6c1ddfc3377e10f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 16 五月 2024 10:56:41 +0800
Subject: [PATCH] 2024-05-16

---
 src/menu/components/table/edit-table/columns/editColumn/index.jsx |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
index c531a1f..716a8c8 100644
--- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx
@@ -318,6 +318,14 @@
       let content = null
       let extra = null
       let initVal = item.initVal || ''
+      let label = item.label
+      if (item.tooltip) {
+        if (item.toolWidth) {
+          label = <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.toolWidth}} title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip>
+        } else {
+          label = <Tooltip placement="topLeft" title={<div onClick={(e) => e.stopPropagation()}>{item.tooltip}</div>}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip>
+        }
+      }
 
       if (item.type === 'text') {
         rules = [
@@ -392,12 +400,7 @@
         if (item.key === 'formula') {
           fields.push(
             <Col span={span} key={index}>
-              <Form.Item className={className} extra={extra} label={item.tooltip ?
-                <Tooltip placement="topLeft" title={item.tooltip}>
-                  <QuestionCircleOutlined className="mk-form-tip" />
-                  {item.label}
-                </Tooltip> : item.label
-              }>
+              <Form.Item className={className} extra={extra} label={label}>
                 {getFieldDecorator(item.key, {
                   initialValue: initVal,
                   rules: rules
@@ -454,12 +457,7 @@
 
       fields.push(
         <Col span={span} key={index}>
-          <Form.Item className={className} extra={extra} label={item.tooltip ?
-            <Tooltip placement="topLeft" title={item.tooltip}>
-              <QuestionCircleOutlined className="mk-form-tip" />
-              {item.label}
-            </Tooltip> : item.label
-          }>
+          <Form.Item className={className} extra={extra} label={label}>
             {getFieldDecorator(item.key, {
               initialValue: initVal,
               rules: rules

--
Gitblit v1.8.0