From 73b2dc5000b03cd150d91e0f6f1d1e3ba82cc97f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 05 七月 2024 23:14:39 +0800 Subject: [PATCH] 2024-07-05 --- src/templates/zshare/modalform/index.jsx | 2 src/mob/components/navbar/normal-navbar/index.jsx | 2 src/components/editor/index.scss | 8 + src/tabviews/zshare/mutilform/index.scss | 5 - src/templates/zshare/formconfig.jsx | 12 +++ src/components/editor/index.jsx | 11 ++ src/menu/components/editor/braft-editor/editorcontent/index.scss | 3 src/mob/searchconfig/index.scss | 4 - src/menu/pastecontroller/index.jsx | 64 +++++++++++++-- src/templates/modalconfig/dragelement/index.scss | 4 - src/menu/modalconfig/index.scss | 4 - src/menu/components/share/copycomponent/index.jsx | 60 +++++++++----- src/mob/modalconfig/index.scss | 4 - src/templates/modalconfig/dragelement/card.jsx | 2 14 files changed, 124 insertions(+), 61 deletions(-) diff --git a/src/components/editor/index.jsx b/src/components/editor/index.jsx index ede20dc..05a82fa 100644 --- a/src/components/editor/index.jsx +++ b/src/components/editor/index.jsx @@ -21,7 +21,7 @@ state = { editorState: '', - encryption: 'false', + encryption: 'false' } UNSAFE_componentWillMount () { @@ -51,6 +51,7 @@ encryption }) } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.props), fromJS(nextProps)) } @@ -213,10 +214,16 @@ } render() { + const { config } = this.props const { editorState } = this.state + let style = null + if (config && config.contHeidht) { + style = {'--editor-height': config.contHeidht < 100 ? config.contHeidht + 'vh' : config.contHeidht + 'px'} + } + return ( - <div className="normal-braft-editor"> + <div className="normal-braft-editor" style={style}> <BraftEditor value={editorState} onChange={this.handleEditorChange} diff --git a/src/components/editor/index.scss b/src/components/editor/index.scss index 44e33dc..856400d 100644 --- a/src/components/editor/index.scss +++ b/src/components/editor/index.scss @@ -1,9 +1,13 @@ .normal-braft-editor { + overflow: hidden; + border: 1px solid #d9d9d9; + border-radius: 4px; + .bf-content { overflow-x: hidden; overflow-y: auto; - height: auto; - min-height: 500px; + height: var(--editor-height, auto); + min-height: var(--editor-height, 500px); padding-bottom: 0px; .public-DraftEditor-content { padding-bottom: 0; diff --git a/src/menu/components/editor/braft-editor/editorcontent/index.scss b/src/menu/components/editor/braft-editor/editorcontent/index.scss index 25414a8..a8e2f42 100644 --- a/src/menu/components/editor/braft-editor/editorcontent/index.scss +++ b/src/menu/components/editor/braft-editor/editorcontent/index.scss @@ -7,9 +7,6 @@ } .model-menu-edit-content-form { .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - overflow-x: hidden; .bf-container .DraftEditor-root, .bf-container .public-DraftEditor-content { min-height: 500px; } diff --git a/src/menu/components/share/copycomponent/index.jsx b/src/menu/components/share/copycomponent/index.jsx index 5450110..3cebc71 100644 --- a/src/menu/components/share/copycomponent/index.jsx +++ b/src/menu/components/share/copycomponent/index.jsx @@ -11,10 +11,48 @@ card: PropTypes.object } + transConfig = (config, type) => { + if (type === 'menucell') { + config.setting.type = 'linkmenu' + config.setting.linkMenuId = '' + config.setting.copyMenuId = '' + } else if (type === 'mobnavbar') { + delete config.open_edition + delete config.dataName + + config.menus.forEach(item => { + item.property = 'menu' + item.open = 'self' + + delete item.copyMenuId + delete item.clearMenu + delete item.linkMenuId + }) + } else if (config.type === 'menubar' && config.subtype === 'menubar') { + let cell = config.subMenus[0] + config.subMenus = [] + + if (cell) { + cell.setting.type = 'menu' + cell.setting.linkMenuId = '' + cell.setting.copyMenuId = '' + + config.subMenus.push(cell) + } + } else if (['normaltable', 'editable', 'basetable'].includes(type)) { + config.action = config.action.filter(item => !item.origin) + config.cols = config.cols.filter(item => !item.origin) + config.search = config.search.filter(item => !item.origin) + delete config.isNew + } + } + trigger = () => { const { card, type } = this.props let _val = fromJS(card).toJS() _val.copyType = type + + this.transConfig(_val, type) try { delete _val.$srcId @@ -22,28 +60,6 @@ let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId') if (srcid) { _val.$srcId = srcid - } - - if (type === 'menucell') { - _val.setting.type = 'linkmenu' - _val.setting.linkMenuId = '' - _val.setting.copyMenuId = '' - } else if (_val.type === 'menubar' && _val.subtype === 'menubar') { - let cell = _val.subMenus[0] - _val.subMenus = [] - - if (cell) { - cell.setting.type = 'menu' - cell.setting.linkMenuId = '' - cell.setting.copyMenuId = '' - - _val.subMenus.push(cell) - } - } else if (['normaltable', 'editable', 'basetable'].includes(type)) { - _val.action = _val.action.filter(item => !item.origin) - _val.cols = _val.cols.filter(item => !item.origin) - _val.search = _val.search.filter(item => !item.origin) - delete _val.isNew } _val = window.btoa(window.encodeURIComponent(JSON.stringify(_val))) diff --git a/src/menu/modalconfig/index.scss b/src/menu/modalconfig/index.scss index ce93e36..1ddd864 100644 --- a/src/menu/modalconfig/index.scss +++ b/src/menu/modalconfig/index.scss @@ -223,10 +223,6 @@ .ant-input-number { margin-top: 4px; } - .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - } } .ant-form-item-control-wrapper::after { content: ''; diff --git a/src/menu/pastecontroller/index.jsx b/src/menu/pastecontroller/index.jsx index 1ef0452..fda2eb1 100644 --- a/src/menu/pastecontroller/index.jsx +++ b/src/menu/pastecontroller/index.jsx @@ -9,6 +9,8 @@ import asyncComponent from '@/utils/asyncComponent' // import './index.scss' +const { confirm } = Modal + const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) class PasteController extends Component { @@ -21,7 +23,12 @@ } resetconfig = (item, appType, commonId) => { - if (item.type === 'tabs') { + if (item.type === 'navbar') { + item.uuid = MenuUtils.getuuid() + item.menus.forEach(menu => { + menu.MenuID = MenuUtils.getuuid() + }) + } else if (item.type === 'tabs') { item.uuid = md5(commonId + item.uuid) item.setting.name = (item.setting.name || '') + MenuUtils.getSignName() item.name = item.setting.name @@ -253,7 +260,7 @@ 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') + options.push('menubar', 'singleSearch', 'mobnavbar') if (sessionStorage.getItem('editMenuType') !== 'popview') { options.push('topbar') } @@ -336,6 +343,15 @@ }) return } + } else if (res.type === 'navbar') { + if (menu.components.findIndex(m => m.type === 'navbar') > -1) { + notification.warning({ + top: 92, + message: '鑿滃崟鏍忎笉鍙噸澶嶆坊鍔狅紒', + duration: 5 + }) + return + } } } else if (res.type === 'search') { if (tab) { @@ -376,15 +392,45 @@ this.resetlink(res, commonId) - this.props.insert(res) - this.setState({visible: false}) - notification.success({ - top: 92, - message: '绮樿创鎴愬姛锛�', - duration: 2 - }) + let skip = true + if (appType === 'mob' && res.type === 'navbar') { + let appMenus = sessionStorage.getItem('appViewList') + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + appMenus = appMenus.filter(item => item.keys_type === 'navbar') + } catch (e) { + appMenus = [] + } + } else { + appMenus = [] + } + + if (appMenus.length) { + const that = this + skip = false + + confirm({ + title: '濡傞渶浣跨敤褰撳墠搴旂敤涓凡鏈夌殑鑿滃崟鏍忥紝璇风偣鍑诲彸渚у叧鑱旇彍鍗曟爮锛屽闇�娣诲姞璇风偣纭畾銆�', + onOk() { + that.props.insert(res) + }, + onCancel() {} + }) + } + } + + if (skip) { + this.props.insert(res) + + notification.success({ + top: 92, + message: '绮樿创鎴愬姛锛�', + duration: 2 + }) + } }) } diff --git a/src/mob/components/navbar/normal-navbar/index.jsx b/src/mob/components/navbar/normal-navbar/index.jsx index e33ea48..48a06f5 100644 --- a/src/mob/components/navbar/normal-navbar/index.jsx +++ b/src/mob/components/navbar/normal-navbar/index.jsx @@ -12,6 +12,7 @@ const NormalForm = asyncIconComponent(() => import('@/components/normalform')) const MenuComponent = asyncIconComponent(() => import('./menus')) const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) +const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) class NormalNavbar extends Component { static propTpyes = { @@ -130,6 +131,7 @@ <NormalForm title="鑿滃崟鏍忚缃�" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> + <CopyComponent type="mobnavbar" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} /> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null} diff --git a/src/mob/modalconfig/index.scss b/src/mob/modalconfig/index.scss index 67a0528..f2a6cef 100644 --- a/src/mob/modalconfig/index.scss +++ b/src/mob/modalconfig/index.scss @@ -218,10 +218,6 @@ .ant-input-number { margin-top: 4px; } - .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - } } .ant-form-item-control-wrapper::after { content: ''; diff --git a/src/mob/searchconfig/index.scss b/src/mob/searchconfig/index.scss index 659c627..8148739 100644 --- a/src/mob/searchconfig/index.scss +++ b/src/mob/searchconfig/index.scss @@ -243,10 +243,6 @@ .ant-input-number { margin-top: 4px; } - .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - } } .ant-form-item-control-wrapper::after { content: ''; diff --git a/src/tabviews/zshare/mutilform/index.scss b/src/tabviews/zshare/mutilform/index.scss index baebc0a..0f49c85 100644 --- a/src/tabviews/zshare/mutilform/index.scss +++ b/src/tabviews/zshare/mutilform/index.scss @@ -104,11 +104,6 @@ min-width: 100px; } } - .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - overflow-x: hidden; - } p { color: #1890ff; font-size: 15px; diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index da672eb..7e46955 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -101,7 +101,7 @@ } else if (card.type === 'textarea') { formItem = (<TextArea value={card.initval} placeholder={card.placeholder || ''} autoSize={{ minRows: 2, maxRows: 6 }} />) } else if (card.type === 'brafteditor') { - formItem = (<Editor />) + formItem = (<Editor config={{contHeidht: card.contHeidht}}/>) } else if (card.type === 'fileupload') { formItem = (<Button style={{marginTop: '3px'}}><UploadOutlined /> 鐐瑰嚮涓婁紶 </Button>) } else if (card.type === 'funcvar') { diff --git a/src/templates/modalconfig/dragelement/index.scss b/src/templates/modalconfig/dragelement/index.scss index e19cce3..3106857 100644 --- a/src/templates/modalconfig/dragelement/index.scss +++ b/src/templates/modalconfig/dragelement/index.scss @@ -113,10 +113,6 @@ min-width: 100px; } } - .normal-braft-editor { - border: 1px solid #d9d9d9; - border-radius: 4px; - } } .ant-form-item-control-wrapper::after { content: ''; diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 286fddb..1e41bb9 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2523,6 +2523,18 @@ }, { type: 'number', + key: 'contHeidht', + label: '楂樺害', + min: 1, + max: 2000, + precision: 1, + initVal: card.contHeidht, + tooltip: '瀵屾枃鏈紪杈戝尯鐨勯珮搴︼紝灏忎簬100鏃朵负绐楀彛鐨勭櫨鍒嗘瘮銆�', + required: false, + forbid: appType === 'mob' + }, + { + type: 'number', key: 'labelwidth', min: 1, max: 100, diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 8fe2851..8867247 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -41,7 +41,7 @@ hint: ['label', 'field', 'type', 'blacklist', 'supField', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'splitctrl', 'supField', 'opacity'], formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], - brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom'], + brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'], funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'], popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'], -- Gitblit v1.8.0