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/normal-table/columns/editColumn/index.jsx | 61 ++++++++++-------------------- 1 files changed, 20 insertions(+), 41 deletions(-) diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx index afa1f03..5f3d09c 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx @@ -12,7 +12,7 @@ const columnTypeOptions = { text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'blacklist', 'perspective', 'rowspan'], number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'], - link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'], + link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'nameField'], textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'], picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span', 'lostTip'], video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'blacklist', 'aspectRatio'], @@ -92,7 +92,7 @@ if (this.record.perspective === 'linkmenu') { _options.push('linkmenu', 'open') } else if (this.record.perspective === 'linkurl') { - _options.push('linkurl', 'linkfields', 'open') + _options.push('linkurl', 'open') } } else if (this.record.type === 'formula' && this.record.eval === 'true') { _options.push('decimal') @@ -217,6 +217,15 @@ formlist.forEach((item, index) => { if (item.hidden || item.forbid) return + 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') { let rules = item.rules || [] if (item.key !== 'linkurl') { @@ -227,12 +236,7 @@ } fields.push( <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || '', rules: [ @@ -249,12 +253,7 @@ } else if (item.type === 'number') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal, rules: [ @@ -271,7 +270,7 @@ } else if (item.type === 'select') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || '', rules: [ @@ -300,12 +299,7 @@ } else if (item.type === 'radio') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal, rules: [ @@ -327,12 +321,7 @@ } else if (item.type === 'checkbox') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal })( @@ -346,7 +335,7 @@ } else if (item.type === 'multiselect') { // 澶氶�� fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || [] })( @@ -366,7 +355,7 @@ } else if (item.type === 'cascader') { fields.push( <Col span={12} key={index}> - <Form.Item label={item.label}> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || [], rules: [ @@ -389,12 +378,7 @@ if (item.key === 'formula') { fields.push( <Col span={24} className="textarea" key={index}> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || '', rules: [ @@ -413,12 +397,7 @@ } else { fields.push( <Col span={24} key={index} className="textarea"> - <Form.Item label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> + <Form.Item label={label}> {getFieldDecorator(item.key, { initialValue: item.initVal || '', rules: [ -- Gitblit v1.8.0