From 4614a540b53edbd83a0a9a483414cfdec0f5d321 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 02 四月 2020 14:52:58 +0800 Subject: [PATCH] 2020-04-02 --- src/templates/formtabconfig/index.jsx | 70 ++++++++++++++++++++++++++++++++++ 1 files changed, 69 insertions(+), 1 deletions(-) diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index d3cb943..6ad7d4f 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -15,6 +15,7 @@ import { queryTableSql } from '@/utils/option.js' import ModalForm from '@/templates/zshare/modalform' +import PasteForm from '@/templates/zshare/pasteform' import ActionForm from './actionform' import SettingForm from './settingform' import DragElement from './dragelement' @@ -67,7 +68,8 @@ editgroup: null, // 褰撳墠缂栬緫缁� groupVisible: false, // 缂栬緫缁勬ā鎬佹 optionLibs: null, // 鑷畾涔変笅鎷夐�夐」搴� - activeKey: '0' // 榛樿灞曞紑鍩烘湰淇℃伅 + activeKey: '0', // 榛樿灞曞紑鍩烘湰淇℃伅 + pasteVisible: false // 绮樿创妯℃�佹 } /** @@ -1864,6 +1866,56 @@ }) } + pasteSubmit = () => { + let _config = JSON.parse(JSON.stringify(this.state.config)) + + this.pasteFormRef.handleConfirm().then(res => { + if (res.copyType === 'form') { + let repeat = false + + _config.groups.forEach(group => { + let item = group.sublist.filter(cell => cell.field === res.field)[0] + if (item) { + repeat = true + } + + if (group.isDefault) { + group.sublist.push(res) + } + }) + + if (res.type === 'linkMain') { + notification.warning({ + top: 92, + message: '涓嶆敮鎸佹琛ㄥ崟绫诲瀷锛�', + duration: 10 + }) + return + } else if (repeat) { + notification.warning({ + top: 92, + message: '姝よ〃鍗曞瓧娈靛凡瀛樺湪锛�', + duration: 10 + }) + return + } + + this.setState({ + config: _config, + pasteVisible: null + }, () => { + this.handleSearch(res) + }) + } else { + notification.warning({ + top: 92, + message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', + duration: 10 + }) + } + }) + } + render () { const { config, modaltype, activeKey } = this.state let _length = config.groups.length @@ -1986,6 +2038,7 @@ </div> } style={{ width: '100%' }}> <Icon type="setting" onClick={this.changeSetting} /> + <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> <Tooltip placement="bottomLeft" overlayClassName="middle" title="鍦ㄥ乏渚у伐鍏锋爮銆婃悳绱€�嬩腑锛岄�夋嫨瀵瑰簲鎼滅储妗嗘嫋鑷虫澶勬坊鍔狅紱鎴栫偣鍑绘寜閽�婃坊鍔犳悳绱㈡潯浠躲�嬫壒閲忔坊鍔狅紝閫夋嫨鎵归噺娣诲姞鏃讹紝闇�鎻愬墠閫夋嫨浣跨敤琛ㄣ��"> <Icon type="question-circle" /> </Tooltip> @@ -2232,6 +2285,21 @@ wrappedComponentRef={(inst) => this.groupRef = inst} /> </Modal> + {/* 鎸夐挳閰嶇疆淇℃伅绮樿创澶嶅埗 */} + <Modal + title={this.state.dict['header.form.paste']} + visible={this.state.pasteVisible} + width={600} + maskClosable={false} + onOk={this.pasteSubmit} + onCancel={() => {this.setState({pasteVisible: null})}} + destroyOnClose + > + <PasteForm + dict={this.state.dict} + wrappedComponentRef={(inst) => this.pasteFormRef = inst} + /> + </Modal> {this.state.loading && <Spin size="large" />} </div> ) -- Gitblit v1.8.0