From 241a37c30386c6ceb2188a2c562de354ac232cb0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 28 九月 2021 14:58:21 +0800 Subject: [PATCH] 2021-09-28 --- src/templates/zshare/editcomponent/index.jsx | 29 ++++++++++++++++++++++++----- 1 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index dd89e6d..cbc5832 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -117,16 +117,35 @@ } pasteSubmit = () => { - const { options, config } = this.props + const { options, config, type } = this.props let _config = fromJS(this.props.config).toJS() this.pasteFormRef.handleConfirm().then(res => { - if (res.copyType === 'action' && options.includes('action')) { + if (!options.includes(res.copyType)) { + notification.warning({ + top: 92, + message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', + duration: 5 + }) + return + } else if (res.copyType === 'action') { res.uuid = Utils.getuuid() MKEmitter.emit('pasteButton', config.uuid, res) - } else if (options.includes('search') && res.copyType === 'search') { + } else if (res.copyType === 'search' || (type === 'table' && res.copyType === 'form')) { res.uuid = Utils.getuuid() let keys = _config.search.map(item => item.field ? item.field.toLowerCase() : '') + + if (type === 'table') { + if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { + res.type = 'text' + } else if (res.type === 'radio') { + res.type = 'select' + } else if (res.type === 'checkbox') { + res.type = 'multiselect' + } else if (res.type === 'datetime') { + res.type = 'date' + } + } if (res.field && keys.includes(res.field.toLowerCase())) { notification.warning({ @@ -137,12 +156,12 @@ return } MKEmitter.emit('plusSearch', config.uuid, res, 'simple') - } else if (options.includes('columns') && res.copyType === 'columns') { + } else if (res.copyType === 'columns') { let keys = _config.columns.map(item => item.field ? item.field.toLowerCase() : '') let items = res.columns.filter(col => col.field && !keys.includes(col.field.toLowerCase())) MKEmitter.emit('plusColumns', config.uuid, items) - } else if (options.includes('form') && res.copyType === 'form') { + } else if (res.copyType === 'form') { let keys = _config.fields.map(item => item.field ? item.field.toLowerCase() : '') res.uuid = Utils.getuuid() -- Gitblit v1.8.0