From ccac5187bd5f7e0a868a69d00b9672bec155bea6 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 24 十二月 2023 23:17:50 +0800 Subject: [PATCH] 2023-12-24 --- src/views/menudesign/popview/index.jsx | 6 src/mob/components/tabs/antv-tabs/index.jsx | 4 src/views/pcdesign/index.jsx | 6 src/utils/utils-custom.js | 19 -- src/views/mobdesign/popview/index.jsx | 6 src/menu/pastecontroller/index.jsx | 342 ++++++++++++++++++++++++++++++++++++++++-- /dev/null | 0 src/menu/debug/index.jsx | 8 src/views/mobdesign/index.jsx | 39 ---- src/menu/components/tabs/antv-tabs/index.jsx | 4 src/menu/components/group/normal-group/index.jsx | 4 src/views/menudesign/index.jsx | 6 src/menu/components/form/dragtitle/card.jsx | 2 13 files changed, 334 insertions(+), 112 deletions(-) diff --git a/src/menu/components/form/dragtitle/card.jsx b/src/menu/components/form/dragtitle/card.jsx index a2eb77d..7413512 100644 --- a/src/menu/components/form/dragtitle/card.jsx +++ b/src/menu/components/form/dragtitle/card.jsx @@ -90,7 +90,7 @@ <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="formgroup" card={card}/> - <PasteForms config={card} updateConfig={(res) => pasteForm(res, id)} /> + <PasteForms config={card} update={(res) => pasteForm(res, id)} /> <CloseOutlined className="close" type="close" onClick={close} /> </div> } trigger="hover"> diff --git a/src/menu/components/group/normal-group/index.jsx b/src/menu/components/group/normal-group/index.jsx index 997c799..e26fb57 100644 --- a/src/menu/components/group/normal-group/index.jsx +++ b/src/menu/components/group/normal-group/index.jsx @@ -15,7 +15,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) -const PasteComponent = asyncIconComponent(() => import('@/menu/components/tabs/paste')) +const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) const GroupComponents = asyncComponent(() => import('../groupcomponents')) class NormalGroup extends Component { @@ -180,7 +180,7 @@ </NormalForm> <CopyComponent type="group" card={group}/> <UngroupOutlined title="閲婃斁" style={group.components.length > 0 ? {color: '#32c5d2'} : {color: '#eeeeee', cursor: 'not-allowed'}} onClick={this.unGroup}/> - <PasteComponent type="group" insert={this.insert} /> + <PasteController type="group" tab={group} insert={this.insert} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <DeleteOutlined className="close" title="delete" onClick={() => this.props.deletecomponent(group.uuid)} /> </div> diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx index 8574c89..eaa3206 100644 --- a/src/menu/components/tabs/antv-tabs/index.jsx +++ b/src/menu/components/tabs/antv-tabs/index.jsx @@ -16,7 +16,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const PasteComponent = asyncIconComponent(() => import('../paste')) +const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) const TabComponents = asyncComponent(() => import('../tabcomponents')) const { TabPane } = Tabs @@ -308,7 +308,7 @@ <NormalForm title="鏍囩缂栬緫" width={800} update={this.updateTab} getForms={() => this.getTabForms(tab)}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - <PasteComponent insert={(item) => this.insert(item, tab.uuid)} /> + <PasteController type="tabs" tab={tab} insert={(item) => this.insert(item, tab.uuid)} /> <CloseOutlined className="close" onClick={() => this.delTab(tab)} /> </div> } trigger="hover"> diff --git a/src/menu/components/tabs/paste/index.jsx b/src/menu/components/tabs/paste/index.jsx deleted file mode 100644 index 8886c7e..0000000 --- a/src/menu/components/tabs/paste/index.jsx +++ /dev/null @@ -1,146 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Modal, notification } from 'antd' -import { SnippetsOutlined } from '@ant-design/icons' - -import MenuUtils from '@/utils/utils-custom.js' -import asyncComponent from '@/utils/asyncComponent' -// import './index.scss' - -const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) - -class PasteGroup extends Component { - static propTpyes = { - insert: PropTypes.func - } - - state = { - visible: false - } - - resetconfig = (item, appType) => { - if (item.type === 'tabs') { - item.uuid = MenuUtils.getuuid() - item.setting.name = item.setting.name + MenuUtils.getSignName() - item.name = item.setting.name - - item.subtabs.forEach(tab => { - tab.uuid = MenuUtils.getuuid() - - tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell, appType) - return cell - }) - }) - } else if (item.type === 'group') { - item.uuid = MenuUtils.getuuid() - item.setting.name = item.setting.name + MenuUtils.getSignName() - item.name = item.setting.name - - item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell, appType) - - return cell - }) - } else { - item = MenuUtils.resetComponentConfig(item, appType) - } - - return item - } - - pasteSubmit = () => { - const { type } = this.props - - let appType = sessionStorage.getItem('appType') - // ['calendar', 'balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'dashboard', 'antvG6', 'pie', 'scatter', 'antvX6', 'chart', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'group', 'iframe', 'mainsearch', 'basetable', 'editable', 'normaltable', 'tabs', 'timeline', 'tree', 'menubar', 'singleSearch', 'topbar'] - let options = [] - let types = { - topbar: '瀵艰埅鏍�', - singleSearch: '鎼滅储', - iframe: 'iframe' - } - - if (appType === 'mob') { - options = ['balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'pie', 'scatter', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'basetable', 'normaltable', 'timeline'] - - if (type !== 'group') { - options.push('tabs', 'group', 'menubar') - } else { - types.tabs = '鏍囩椤�' - types.group = '鍒嗙粍' - types.menubar = '鑿滃崟鏍�' - } - } else { - options = ['calendar', 'balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'dashboard', 'antvG6', 'pie', 'scatter', 'antvX6', 'chart', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'basetable', 'editable', 'normaltable', 'timeline', 'tree'] - - if (type !== 'group') { - options.push('tabs', 'group', 'mainsearch') - } else { - types.tabs = '鏍囩椤�' - types.group = '鍒嗙粍' - types.mainsearch = '鎼滅储' - } - } - - this.pasteFormRef.handleConfirm().then(res => { - if (res.copyType && types[res.copyType]) { - notification.warning({ - top: 92, - message: (type === 'group' ? '鍒嗙粍涓�' : '鏍囩椤典腑') + '涓嶅彲娣诲姞銆�' + types[res.copyType] + '銆嬬粍浠讹紒', - duration: 5 - }) - return - } else if (!options.includes(res.copyType)) { - notification.warning({ - top: 92, - message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', - duration: 5 - }) - return - } - - if (res.copyType === 'basetable') { - res.copyType = 'normaltable' - res.subtype = 'normaltable' - } - - res = this.resetconfig(res, appType) - - delete res.copyType - - this.props.insert(res) - - this.setState({visible: false}) - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) - }) - } - - render() { - const { visible } = this.state - - return ( - <div style={{display: 'inline-block'}}> - <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} /> - <Modal - title="绮樿创" - visible={visible} - width={600} - maskClosable={false} - onOk={this.pasteSubmit} - onCancel={() => {this.setState({visible: false})}} - destroyOnClose - > - <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/> - </Modal> - </div> - ) - } -} - -export default PasteGroup \ No newline at end of file diff --git a/src/menu/components/tabs/paste/index.scss b/src/menu/components/tabs/paste/index.scss deleted file mode 100644 index e69de29..0000000 --- a/src/menu/components/tabs/paste/index.scss +++ /dev/null diff --git a/src/menu/debug/index.jsx b/src/menu/debug/index.jsx index 99ff975..afaf6ae 100644 --- a/src/menu/debug/index.jsx +++ b/src/menu/debug/index.jsx @@ -1033,15 +1033,13 @@ item.field.split(',').forEach((_field, index) => { let _key = _field.toLowerCase() let _val = '' - let _fval = `'${_val}'` + arr.push(_key) if (_key === 'bid') { // 琛ㄥ崟涓病鏈塨id鍒欎娇鐢ㄧ郴缁焍id鍙橀噺 - _fval = '@BID@' + _val = BID } - arr.push(_key) - _fieldValue.push(`${_key}=${_fval}`) - + _fieldValue.push(`${_key}='${_val}'`) _value.push(`${_labels[index] || ''}锛�${_val || ''}`) }) diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index cb38cb5..1ef0452 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -1,7 +1,9 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' +import { fromJS } from 'immutable' import { Modal, Button, notification } from 'antd' import { SnippetsOutlined } from '@ant-design/icons' +import md5 from 'md5' import MenuUtils from '@/utils/utils-custom.js' import asyncComponent from '@/utils/asyncComponent' @@ -18,60 +20,264 @@ visible: false } - resetconfig = (item, appType) => { + resetconfig = (item, appType, commonId) => { if (item.type === 'tabs') { - item.uuid = MenuUtils.getuuid() + item.uuid = md5(commonId + item.uuid) item.setting.name = (item.setting.name || '') + MenuUtils.getSignName() item.name = item.setting.name item.subtabs.forEach(tab => { - tab.uuid = MenuUtils.getuuid() + tab.uuid = md5(commonId + tab.uuid) if (appType !== 'mob') { tab.components = tab.components.filter(cell => cell.type !== 'menubar') } tab.components = tab.components.map(cell => { - cell = this.resetconfig(cell, appType) + cell = this.resetconfig(cell, appType, commonId) return cell }) }) } else if (item.type === 'group') { - item.uuid = MenuUtils.getuuid() + item.uuid = md5(commonId + item.uuid) item.setting.name = (item.setting.name || '') + MenuUtils.getSignName() item.name = item.setting.name item.components = item.components.map(cell => { - cell = MenuUtils.resetComponentConfig(cell, appType) + cell.uuid = md5(commonId + cell.uuid) + + cell = MenuUtils.resetComponentConfig(cell, appType, commonId) return cell }) } else { - item = MenuUtils.resetComponentConfig(item, appType) + item.uuid = md5(commonId + item.uuid) + + item = MenuUtils.resetComponentConfig(item, appType, commonId) } return item } + resetlink = (item, commonId) => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + tab.components.forEach(cell => { + this.resetlink(cell, commonId) + }) + }) + } else if (item.type === 'group') { + item.components.forEach(cell => { + this.resetlink(cell, commonId) + }) + } else { + if (['card', 'carousel', 'timeline'].includes(item.type)) { + item.subcards.forEach(card => { + card.elements && card.elements.forEach(cell => { + if (cell.eleType === 'button') { + this.resetBtn(cell, commonId) + } + }) + card.backElements && card.backElements.forEach(cell => { + if (cell.eleType === 'button') { + this.resetBtn(cell, commonId) + } + }) + }) + } else if (item.type === 'balcony') { + item.elements && item.elements.forEach(cell => { + if (cell.eleType === 'button') { + this.resetBtn(cell, commonId) + } + }) + } else if (item.type === 'table' && item.cols) { + let loopCol = (cols) => { + cols.forEach(col => { + if (col.type === 'colspan' && col.subcols) { + loopCol(col.subcols) + } else if (col.type === 'custom' && col.elements) { + col.elements.forEach(cell => { + if (cell.eleType === 'button') { + this.resetBtn(cell, commonId) + } + }) + } + }) + } + + loopCol(item.cols) + } else if (item.type === 'form') { + item.subcards.forEach(cell => { + if (cell.subButton) { + this.resetBtn(cell.subButton, commonId) + } + }) + } + + item.action && item.action.forEach(cell => { + this.resetBtn(cell, commonId) + }) + + if (item.wrap && item.wrap.supType === 'multi') { + if (item.setting && item.setting.supModule) { + item.setting.supModule = '' + } + + if (item.supNodes) { + item.supNodes = item.supNodes.map(cell => { + let id = cell.nodes[cell.nodes.length - 1] + let _id = md5(commonId + id) + + if (this.modules[id] || this.modules[_id]) { + cell.nodes = this.modules[id] || this.modules[_id] + cell.componentId = cell.nodes[cell.nodes.length - 1] + + return cell + } + + return null + }) + + item.supNodes = item.supNodes.filter(Boolean) + } + + if (!item.supNodes || item.supNodes.length === 0) { + item.wrap.supType = 'single' + delete item.supNodes + } + } + if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { + let id = item.setting.supModule[item.setting.supModule.length - 1] + let _id = md5(commonId + id) + + item.setting.supModule = this.modules[id] || this.modules[_id] || '' + } + + if (item.wrap && item.wrap.supModule && item.wrap.supModule[0]) { + let id = item.wrap.supModule[item.wrap.supModule.length - 1] + let _id = md5(commonId + id) + + item.wrap.supModule = this.modules[id] || this.modules[_id] || '' + } + } + } + + resetBtn (btn, commonId) { + if (btn.switchTab && btn.switchTab.length > 0) { + let id = btn.switchTab[btn.switchTab.length - 1] + let _id = md5(commonId + id) + + btn.switchTab = this.modules[id] || this.modules[_id] || null + } + if (btn.anchors && btn.anchors.length > 0) { + let id = btn.anchors[btn.anchors.length - 1] + let _id = md5(commonId + id) + + btn.anchors = this.modules[id] || this.modules[_id] || null + } + if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { + btn.syncComponents = btn.syncComponents.map(m => { + let id = m.syncComId[m.syncComId.length - 1] + let _id = md5(commonId + id) + + return this.modules[id] || this.modules[_id] || null + }) + btn.syncComponents = btn.syncComponents.filter(Boolean) + + if (btn.syncComponents.length === 0) { + btn.syncComponent = null + btn.syncComponents = null + } + } else if (btn.syncComponent && btn.syncComponent.length > 0) { + let id = btn.syncComponent[btn.syncComponent.length - 1] + let _id = md5(commonId + id) + + btn.syncComponent = this.modules[id] || this.modules[_id] || null + } + } + + resetmenu = (components, componentId, res) => { + components.forEach(item => { + if (item.type === 'tabs') { + item.subtabs.forEach(tab => { + if (tab.uuid === componentId) { + tab.components.push(res) + } else { + this.resetmenu(tab.components, componentId, res) + } + }) + } else if (item.type === 'group' && item.uuid === componentId) { + item.components.push(res) + } + }) + } + + getModules = (components, interfaces, sups = []) => { + components.forEach(item => { + this.modules[item.uuid] = [...sups, item.uuid] + if (item.type === 'tabs') { + item.subtabs.forEach(f_tab => { + this.getModules(f_tab.components, null, [...sups, item.uuid, f_tab.uuid]) + }) + } else if (item.type === 'group') { + item.components.forEach(cell => { + this.modules[cell.uuid] = [...sups, item.uuid, cell.uuid] + }) + } + }) + + if (interfaces && interfaces.length > 0) { + interfaces.forEach(item => { + this.modules[item.uuid] = [item.uuid] + }) + } + } + pasteSubmit = () => { + const { type, tab } = this.props + let appType = sessionStorage.getItem('appType') // ['calendar', 'balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'dashboard', 'antvG6', 'pie', 'scatter', 'antvX6', 'chart', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'group', 'iframe', 'mainsearch', 'basetable', 'editable', 'normaltable', 'tabs', 'timeline', 'tree', 'menubar', 'singleSearch', 'topbar'] - let options = ['tabs', 'timeline', 'datacard', 'doublecard', 'propcard', 'cardatacard', 'carpropcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'editor', 'pie', 'scatter', 'iframe', 'sandbox'] + let options = [] - if (appType === 'mob') { - options.push('menubar', 'singleSearch') - if (sessionStorage.getItem('editMenuType') !== 'popview') { - options.push('topbar') + let types = { + topbar: '瀵艰埅鏍�', + singleSearch: '鎼滅储', + iframe: 'iframe', + tabs: '鏍囩椤�', + group: '鍒嗙粍', + menubar: '鑿滃崟鏍�', + mainsearch: '鎼滅储' + } + + if (!type) { + options = ['tabs', 'timeline', 'datacard', 'doublecard', 'propcard', 'cardatacard', 'carpropcard', 'simpleform', 'stepform', 'tabform', 'balcony', 'group', 'normaltable', 'tablecard', 'line', 'editor', 'pie', 'scatter', 'iframe', 'sandbox'] + + if (appType === 'mob') { + options.push('menubar', 'singleSearch') + if (sessionStorage.getItem('editMenuType') !== 'popview') { + options.push('topbar') + } + } else { + options.push('editable', 'mainsearch', 'antvG6', 'antvX6', 'calendar', 'tree', 'dashboard', 'chart') } } else { - options.push('editable', 'mainsearch', 'antvG6', 'antvX6', 'calendar', 'tree', 'dashboard', 'chart') + if (appType === 'mob') { + options = ['balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'pie', 'scatter', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'normaltable', 'timeline'] + + if (type === 'tabs') { + options.push('tabs', 'group', 'menubar') + } + } else { + options = ['calendar', 'balcony', 'datacard', 'doublecard', 'propcard', 'tablecard', 'cardatacard', 'carpropcard', 'line', 'dashboard', 'antvG6', 'pie', 'scatter', 'antvX6', 'chart', 'sandbox', 'editor', 'simpleform', 'stepform', 'tabform', 'editable', 'normaltable', 'timeline', 'tree'] + + if (type === 'tabs') { + options.push('tabs', 'group', 'mainsearch') + } + } } this.pasteFormRef.handleConfirm().then(res => { - if (res.copyType === 'basetable') { - res.copyType = 'normaltable' - res.subtype = 'normaltable' - } - if (!options.includes(res.copyType)) { + if (!res.copyType) { notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', @@ -80,22 +286,116 @@ return } - res = this.resetconfig(res, appType) + if (res.copyType === 'basetable') { + res.copyType = 'normaltable' + res.subtype = 'normaltable' + } - // delete res.copyType + let menu = fromJS(window.GLOB.customMenu).toJS() + + if (!options.includes(res.copyType)) { + if (type && types[res.copyType]) { + notification.warning({ + top: 92, + message: (type === 'group' ? '鍒嗙粍涓�' : '鏍囩椤典腑') + '涓嶅彲娣诲姞銆�' + types[res.copyType] + '銆嬬粍浠讹紒', + duration: 5 + }) + return + } else { + notification.warning({ + top: 92, + message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', + duration: 5 + }) + } + return + } else if (appType === 'mob') { + if (res.type === 'search') { + if (menu.components.filter(card => card.type === 'topbar' && card.wrap.type !== 'navbar').length > 0) { + notification.warning({ + top: 92, + message: '瀵艰埅鏍忎娇鐢ㄤ簡鎼滅储锛屼笉鍙坊鍔犳悳绱㈢粍浠讹紒', + duration: 5 + }) + return + } + if (menu.components.filter(card => card.type === 'search').length > 0) { + notification.warning({ + top: 92, + message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', + duration: 5 + }) + return + } + } else if (res.type === 'topbar') { + if (menu.components.findIndex(m => m.type === 'topbar') > -1) { + notification.warning({ + top: 92, + message: '瀵艰埅鏍忎笉鍙噸澶嶆坊鍔狅紒', + duration: 5 + }) + return + } + } + } else if (res.type === 'search') { + if (tab) { + if (tab.components.findIndex(card => card.type === 'search') > -1) { + notification.warning({ + top: 92, + message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', + duration: 5 + }) + return + } + } else { + if (menu.components.findIndex(m => m.type === 'search') > -1) { + notification.warning({ + top: 92, + message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', + duration: 5 + }) + return + } + } + } + delete res.copyType + + let commonId = MenuUtils.getuuid() + + res = this.resetconfig(res, appType, commonId) + + if (tab) { + this.resetmenu(menu.components, tab.uuid, res) + } else { + menu.components.push(res) + } + + this.modules = {} + + this.getModules(menu.components, menu.interfaces) + + this.resetlink(res, commonId) this.props.insert(res) this.setState({visible: false}) + + notification.success({ + top: 92, + message: '绮樿创鎴愬姛锛�', + duration: 2 + }) }) } render() { + const { type } = this.props const { visible } = this.state return ( <> - <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => {this.setState({visible: true})}}><SnippetsOutlined />绮樿创</Button> + {type ? <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} /> : + <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => {this.setState({visible: true})}}><SnippetsOutlined />绮樿创</Button>} <Modal title="绮樿创" visible={visible} diff --git a/src/mob/components/tabs/antv-tabs/index.jsx b/src/mob/components/tabs/antv-tabs/index.jsx index fe8ad94..9653b81 100644 --- a/src/mob/components/tabs/antv-tabs/index.jsx +++ b/src/mob/components/tabs/antv-tabs/index.jsx @@ -16,7 +16,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) -const PasteComponent = asyncIconComponent(() => import('@/menu/components/tabs/paste')) +const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller')) const TabComponents = asyncComponent(() => import('../tabcomponents')) const { TabPane } = Tabs @@ -323,7 +323,7 @@ <NormalForm title="鏍囩缂栬緫" width={800} update={this.updateTab} getForms={() => this.getTabForms(tab)}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - <PasteComponent insert={(item) => this.insert(item, tab.uuid)} /> + <PasteController type="tabs" tab={tab} insert={(item) => this.insert(item, tab.uuid)} /> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeTabStyle}/> <CloseOutlined className="close" onClick={() => this.delTab(tab)} /> </div> diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index 8f7fa33..d08226b 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -728,7 +728,7 @@ * @description 閲嶇疆缁勪欢閰嶇疆 * @return {String} item 缁勪欢淇℃伅 */ - static resetComponentConfig = (item, appType) => { + static resetComponentConfig = (item, appType, commonId) => { if (item.type === 'navbar') { return item } @@ -736,9 +736,6 @@ if (item.subtype === 'tablecard') { // 鍏煎 item.type = 'card' } - - item.uuid = this.getuuid() - let commonId = this.getuuid() // 閲嶇疆缁勪欢鍚嶇О let sign = this.getSignName() @@ -961,20 +958,6 @@ cell.uuid = this.getuuid() return cell }) - } - - if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { - item.setting.supModule = '' - } - - if (item.wrap && item.wrap.supType === 'multi') { - item.wrap.supType = 'single' - - delete item.supNodes - } - - if (item.wrap && item.wrap.supModule) { - item.wrap.supModule = '' } if (item.wrap && item.wrap.doubleClick) { diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index a2ffa00..b271577 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -1135,12 +1135,6 @@ this.setState({config}) window.GLOB.customMenu = config - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } changeSetting = () => { diff --git a/src/views/menudesign/popview/index.jsx b/src/views/menudesign/popview/index.jsx index d5eccea..1cf34b5 100644 --- a/src/views/menudesign/popview/index.jsx +++ b/src/views/menudesign/popview/index.jsx @@ -246,12 +246,6 @@ this.setState({config}) window.GLOB.customMenu = config - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } render () { diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index b3dca30..4c6417c 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -1858,49 +1858,14 @@ insert = (item) => { let config = fromJS(this.state.config).toJS() - if (item.type === 'search') { - if (config.components.filter(card => card.type === 'topbar' && card.wrap.type !== 'navbar').length > 0) { - notification.warning({ - top: 92, - message: '瀵艰埅鏍忎娇鐢ㄤ簡鎼滅储锛屼笉鍙坊鍔犳悳绱㈢粍浠讹紒', - duration: 5 - }) - return - } - if (config.components.filter(card => card.type === 'search').length > 0) { - notification.warning({ - top: 92, - message: '鎼滅储鏉′欢涓嶅彲閲嶅娣诲姞锛�', - duration: 5 - }) - return - } - } - - if (item.type === 'topbar') { - if (config.components.findIndex(m => m.type === 'topbar') > -1) { - notification.warning({ - top: 92, - message: '瀵艰埅鏍忎笉鍙噸澶嶆坊鍔狅紒', - duration: 5 - }) - return - } - if (!config.style.paddingTop) { - config.style.paddingTop = '50px' - } + if (item.type === 'topbar' && !config.style.paddingTop) { + config.style.paddingTop = '50px' } config.components.push(item) this.setState({config}) window.GLOB.customMenu = config - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } setHomeView = () => { diff --git a/src/views/mobdesign/popview/index.jsx b/src/views/mobdesign/popview/index.jsx index eeaa4c7..bfd1bf1 100644 --- a/src/views/mobdesign/popview/index.jsx +++ b/src/views/mobdesign/popview/index.jsx @@ -248,12 +248,6 @@ this.setState({config}) window.GLOB.customMenu = config - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } render () { diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index bc099f8..7ace0bb 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -1550,12 +1550,6 @@ this.setState({config}) window.GLOB.customMenu = config - - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) } setHomeView = () => { -- Gitblit v1.8.0