From 7e5200a09b2c6282382ec8725220f5561de139f6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 二月 2024 18:05:53 +0800 Subject: [PATCH] Merge branch 'develop' --- src/components/normalform/modalform/index.jsx | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index a277d8a..776c225 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -18,7 +18,8 @@ const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) const StyleInput = asyncComponent(() => import('./styleInput')) const MKFileUpload = asyncComponent(() => import('@/tabviews/zshare/fileupload')) -const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) +const MKColor = asyncComponent(() => import('@/mob/colorsketch')) +// const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) @@ -110,7 +111,7 @@ let supItem = fieldMap.get(key) let supval = supItem.initval - if (supItem.initval && supItem.type !== 'checkbox' && supItem.type !== 'multiselect' && JSON.stringify(supItem.initval) === '[]') { + if (supval && JSON.stringify(supval) === '[]') { supval = '' } @@ -126,13 +127,13 @@ } else if (supItem.hidden) { cell.hidden = true + } else if (item.notNull) { + cell.hidden = !supval } else if (supItem.type === 'checkbox' || supItem.type === 'multiselect') { - let vals = [...supval, ...item.values] + let vals = [...(supval || []), ...item.values] if (vals.length === new Set(vals).size) { cell.hidden = true } - } else if (item.notNull) { - cell.hidden = !supval } else if (!item.values.includes(supval)) { cell.hidden = true } @@ -196,7 +197,7 @@ let reset = (current) => { let val = this.record[current.field] - if (val && current.type !== 'checkbox' && current.type !== 'multiselect' && JSON.stringify(val) === '[]') { + if (val && JSON.stringify(val) === '[]') { val = '' } @@ -205,15 +206,15 @@ if (current.hidden) { m.hidden = true + } else if (cell.notNull) { + m.hidden = !val } else if (current.type === 'checkbox' || current.type === 'multiselect') { - let vals = [...val, ...cell.values] + let vals = [...(val || []), ...cell.values] if (vals.length !== new Set(vals).size) { m.hidden = false } else { m.hidden = true } - } else if (cell.notNull) { - m.hidden = !val } else { m.hidden = !cell.values.includes(val) } @@ -281,13 +282,13 @@ let label = item.tooltip ? <Tooltip placement="topLeft" title={item.tooltip}><QuestionCircleOutlined className="mk-form-tip" />{item.label}</Tooltip> : item.label if (item.type === 'text') { - content = (<MKEInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />) + content = (<MKEInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val}, item)} onSubmit={this.props.inputSubmit} />) } else if (item.type === 'number') { - content = (<MKNumberInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit} />) + content = (<MKNumberInput config={item} onChange={(val, defer) => !defer && this.recordChange({[item.field]: val}, item)} onSubmit={this.props.inputSubmit} />) } else if (item.type === 'select' || item.type === 'multiselect') { content = (<MKSelect config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} />) } else if (item.type === 'color') { - content = (<MKColor config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) + content = (<MKColor config={item} allowClear={item.allowClear} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'styleInput') { content = (<StyleInput config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'radio') { @@ -305,7 +306,7 @@ } else if (item.type === 'source') { content = (<SourceComponent type="" placement="right"/>) } else if (item.type === 'table') { - content = (<MKTable tip={item.tip || ''} fixed={item.fixed === true} columns={item.columns || []} actions={item.actions || []}/>) + content = (<MKTable tip={item.tip || ''} columns={item.columns || []} actions={item.actions || []}/>) } else if (item.type === 'hint') { fields.push( <Col span={24} key={index}> -- Gitblit v1.8.0