From fdce913ce7b9d55c34a2abd7a94ee377a4869b9a Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 21 三月 2025 19:57:24 +0800 Subject: [PATCH] 2025-03-21 --- src/menu/components/share/pastecomponent/index.jsx | 59 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 49 insertions(+), 10 deletions(-) diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx index f0e89a1..4bb09c2 100644 --- a/src/menu/components/share/pastecomponent/index.jsx +++ b/src/menu/components/share/pastecomponent/index.jsx @@ -10,6 +10,7 @@ import asyncComponent from '@/utils/asyncComponent' // import './index.scss' +const { confirm } = Modal const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) class PasteController extends Component { @@ -120,9 +121,44 @@ return item } + extra = (res) => { + let config = fromJS(this.props.config).toJS() + + if (res.copyType === 'mk_actions') { + config.action = res.action + this.props.updateConfig(config) + + setTimeout(() => { + MKEmitter.emit('revertBtn', config.uuid) + }, 30) + } else if (res.copyType === 'mk_searches') { + config.search = res.search + this.props.updateConfig(config) + + setTimeout(() => { + MKEmitter.emit('revert', config.uuid, 'search') + }, 30) + } else if (res.copyType === 'mk_fields') { + config.columns = res.columns + this.props.updateConfig(config) + } else if (res.copyType === 'mk_cols') { + config.cols = res.cols + this.props.updateConfig(config) + } else if (res.copyType === 'mk_setting') { + config.setting = res.setting + this.props.updateConfig(config) + } + console.log(config) + this.setState({visible: false}) + } + pasteSubmit = () => { const { options } = this.props this.pasteFormRef.handleConfirm().then(res => { + if (/^mk_/.test(res.copyType)) { // dms-trans + this.extra(res) + return + } if (!options.includes(res.copyType)) { notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 }) return @@ -173,17 +209,20 @@ } } - if (res.field && keys.includes(res.field.toLowerCase())) { - notification.warning({ - top: 92, - message: '鎼滅储瀛楁宸插瓨鍦紒', - duration: 5 - }) - return - } - - MKEmitter.emit('plusSearch', config.uuid, res, 'simple') this.setState({visible: false}) + if (res.field && keys.includes(res.field.toLowerCase())) { + confirm({ + title: '鎼滅储瀛楁宸插瓨鍦紒', + okText: '鐭ラ亾浜�', + cancelText: '鏇挎崲', + onOk() {}, + onCancel() { + MKEmitter.emit('plusSearch', config.uuid, res, 'replace') + } + }) + } else { + MKEmitter.emit('plusSearch', config.uuid, res, 'simple') + } return } else if (type === 'cardcell') { config.subcards.push(res) -- Gitblit v1.8.0