From dbf2f8a85f8218e9e570aa1d91bf4f17ac120353 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 18 十二月 2023 14:54:20 +0800 Subject: [PATCH] 2023-12-18 --- src/tabviews/zshare/mutilform/index.jsx | 4 +- src/tabviews/zshare/mutilform/mkCheck/index.jsx | 17 ++++++++ src/templates/zshare/modalform/index.jsx | 7 ++- src/menu/components/share/pastecomponent/index.jsx | 38 ++++++++++-------- src/tabviews/zshare/mutilform/mkSwitch/index.jsx | 15 +++++++ src/templates/zshare/formconfig.jsx | 2 6 files changed, 61 insertions(+), 22 deletions(-) diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index d809808..7f0b88c 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -168,24 +168,28 @@ } else if (type === 'cols') { config.cols = config.cols.filter(col => !col.origin) - let keys = config.cols.map(col => (col.field || '$empty')) - - let cols = [] - res.cols.forEach(col => { - if (!col.field || !keys.includes(col.field)) { - cols.push(col) - } - }) - - if (cols.length === 0) { - notification.warning({ - top: 92, - message: '鏄剧ず鍒楀凡瀛樺湪锛�', - duration: 5 - }) - return + if (config.subtype === 'normaltable' && res.cols.length === 1) { + config.cols.push(...res.cols) } else { - config.cols.push(...cols) + let keys = config.cols.map(col => (col.field || '$empty')) + + let cols = [] + res.cols.forEach(col => { + if (!col.field || !keys.includes(col.field)) { + cols.push(col) + } + }) + + if (cols.length === 0) { + notification.warning({ + top: 92, + message: '鏄剧ず鍒楀凡瀛樺湪锛�', + duration: 5 + }) + return + } else { + config.cols.push(...cols) + } } } diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 970a9c0..61dbda9 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -1232,9 +1232,9 @@ className = 'checkcard' content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) } else if (item.type === 'switch') { - content = (<MKSwitch config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) + content = (<MKSwitch config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)} onSubmit={this.props.inputSubmit}/>) } else if (item.type === 'check') { - content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) + content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)} onSubmit={this.props.inputSubmit}/>) } else if (item.type === 'checkbox') { content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) } else if (item.type === 'radio') { diff --git a/src/tabviews/zshare/mutilform/mkCheck/index.jsx b/src/tabviews/zshare/mutilform/mkCheck/index.jsx index aea3f25..b6c3195 100644 --- a/src/tabviews/zshare/mutilform/mkCheck/index.jsx +++ b/src/tabviews/zshare/mutilform/mkCheck/index.jsx @@ -2,6 +2,8 @@ import PropTypes from 'prop-types' import { Checkbox } from 'antd' +import MKEmitter from '@/utils/events.js' + class MKCheck extends Component { static propTpyes = { config: PropTypes.object, @@ -20,6 +22,21 @@ } else { this.props.onChange(config.closeVal) } + + this.setState({}, () => { + if (config.enter === 'tab') { + MKEmitter.emit('mkFC', 'focus', config.tabUuid) + } else if (config.enter === 'sub') { + config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) + if (config.linkFields || config.subFields || config.controlFields) { + setTimeout(() => { + this.props.onSubmit(config.tabUuid) + }, 1000) + } else { + this.props.onSubmit(config.tabUuid) + } + } + }) } componentWillUnmount () { diff --git a/src/tabviews/zshare/mutilform/mkSwitch/index.jsx b/src/tabviews/zshare/mutilform/mkSwitch/index.jsx index 62f8822..7cea5b9 100644 --- a/src/tabviews/zshare/mutilform/mkSwitch/index.jsx +++ b/src/tabviews/zshare/mutilform/mkSwitch/index.jsx @@ -33,6 +33,21 @@ } else { this.props.onChange(config.closeVal, other) } + + this.setState({}, () => { + if (config.enter === 'tab') { + MKEmitter.emit('mkFC', 'focus', config.tabUuid) + } else if (config.enter === 'sub') { + config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) + if (config.linkFields || config.subFields || config.controlFields) { + setTimeout(() => { + this.props.onSubmit(config.tabUuid) + }, 1000) + } else { + this.props.onSubmit(config.tabUuid) + } + } + }) } componentWillUnmount () { diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 16eda0b..cf8f7f5 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2535,7 +2535,7 @@ key: 'enter', label: '鍥炶溅浜嬩欢', initVal: (card.type === 'text' || card.type === 'number') ? (card.enter || 'sub') : (card.enter || 'false'), - tooltip: '鐐瑰嚮Enter閿紝鎴栨枃鏈被琛ㄥ崟杈撳叆鍥炶溅绗︺��', + tooltip: '1銆佺偣鍑籈nter閿垨鏂囨湰绫昏〃鍗曡緭鍏ュ洖杞︾锛�2銆佷笅鎷夐�夋嫨鎴栧紑鍏崇殑閫夐」鍒囨崲銆�', options: [{ value: 'sub', text: '鎻愪氦' diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index ffe236a..3bd73fc 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -29,8 +29,8 @@ multiselect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'fieldlength', 'span', 'labelwidth', 'tooltip', 'extra', 'marginTop', 'marginBottom', 'dropdown'], link: ['initval', 'readonly', 'required', 'hidden', 'readin', 'resourceType', 'declare', 'linkField', 'linkSubField', 'span', 'place', 'labelwidth', 'tooltip', 'extra', 'enter', 'splitline', 'dropdown', 'marginTop', 'marginBottom', 'pickerMode'], fileupload: ['readonly', 'required', 'hidden', 'readin', 'fieldlength', 'maxfile', 'fileType', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'compress', 'miniSet', 'splitline', 'marginTop', 'marginBottom', 'maxSize'], - switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom'], - check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], + switch: ['initval', 'openVal', 'closeVal', 'openText', 'closeText', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'linkSubField', 'tooltip', 'extra', 'enter', 'splitline', 'marginTop', 'marginBottom'], + check: ['initval', 'openVal', 'closeVal', 'readonly', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'enter', 'splitline', 'marginTop', 'marginBottom', 'checkTip'], date: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'place', 'marginTop', 'marginBottom', 'minDate', 'maxDate', 'precision'], datemonth: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'splitline', 'place', 'marginTop', 'marginBottom'], // datetime: ['initval', 'readonly', 'required', 'hidden', 'readin', 'span', 'labelwidth', 'tooltip', 'extra', 'declareType', 'mode', 'splitline', 'marginTop', 'marginBottom', 'minDate', 'maxDate'], @@ -254,6 +254,9 @@ } } } else if (type === 'switch' || type === 'check') { + if (this.record.enter === 'tab' || this.record.enter === 'sub') { + shows.push('tabField') + } reOptions.initval = [ {value: true, text: '寮�'}, {value: false, text: '鍏�'} -- Gitblit v1.8.0