From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/menu/components/share/pasteforms/index.jsx | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/menu/components/share/pasteforms/index.jsx b/src/menu/components/share/pasteforms/index.jsx index ff09638..c096113 100644 --- a/src/menu/components/share/pasteforms/index.jsx +++ b/src/menu/components/share/pasteforms/index.jsx @@ -10,7 +10,7 @@ const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) -class PasteController extends Component { +class PasteForms extends Component { static propTpyes = { config: PropTypes.object, // 缁勪欢閰嶇疆 update: PropTypes.func @@ -26,6 +26,10 @@ const { config } = this.props this.pasteFormRef.handleConfirm().then(res => { + if (res.copyType === 'search' && ['text', 'select', 'multiselect', 'link', 'checkcard', 'date', 'datemonth'].includes(res.type)) { + res.copyType = 'form' + } + if (!['form', 'forms', 'formgroup', 'simpleform'].includes(res.copyType)) { notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 }) return @@ -34,6 +38,8 @@ if (res.copyType === 'form') { delete res.copyType res = {fields: [res]} + } else if (res.copyType === 'simpleform') { + res = {fields: res.subcards[0].fields} } res.fields = res.fields || [] @@ -81,6 +87,7 @@ let forms = fromJS(config.fields).toJS() let fields = fromJS(result.fields).toJS() let repeats = [] + let lastId = '' forms = forms.map(item => { if (!item.field) return item @@ -88,11 +95,16 @@ let cell = fields.filter(m => m.field && m.field.toLowerCase() === item.field.toLowerCase())[0] if (cell) { repeats.push(cell.field) + lastId = cell.uuid return cell } return item }) + + if (lastId) { + window.GLOB.formId = lastId + } fields = fields.filter(m => !m.field || !repeats.includes(m.field)) @@ -171,4 +183,4 @@ } } -export default PasteController \ No newline at end of file +export default PasteForms \ No newline at end of file -- Gitblit v1.8.0