From f0bf8c399c354c22227f8f1a76ed806098db59c0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 21 五月 2024 16:51:02 +0800 Subject: [PATCH] 2024-05-21 --- src/components/normalform/modalform/index.jsx | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index 776c225..8a7599f 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -18,6 +18,7 @@ const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) const StyleInput = asyncComponent(() => import('./styleInput')) const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) +const MkPrintTemps = asyncComponent(() => import('@/menu/components/share/actioncomponent/actionform/mkPrintTemps')) const MKColor = asyncComponent(() => import('@/mob/colorsketch')) // const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) @@ -279,7 +280,14 @@ if (item.hidden || item.forbid) return let content = null - let label = item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> : item.label + 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') { content = (<MKEInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val}, item)} onSubmit={this.props.inputSubmit} />) @@ -314,14 +322,22 @@ </Col> ) return + } else if (item.type === 'printTemps') { + content = <MkPrintTemps onChange={(val) => this.recordChange({[item.field]: val})}/> } if (!content) return if (item.help) { + let help = null + if (typeof(item.help) === 'function') { + help = item.help(this.record) + } else { + help = <span style={{fontSize: '12px'}}>{item.help}</span> + } fields.push( <Col span={item.span || 12} key={index}> - <Form.Item label={label} help={<span style={{fontSize: '12px'}}>{item.help}</span>}> + <Form.Item label={label} help={help}> {getFieldDecorator(item.field, { initialValue: item.initval, rules: item.rules -- Gitblit v1.8.0