From 21167ece56edd628e6f6546d1d642947cc3a048f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 12 八月 2024 22:17:33 +0800 Subject: [PATCH] 2024-08-12 --- src/tabviews/custom/components/editor/braft-editor/index.scss | 23 ++++++++++- src/menu/components/share/actioncomponent/actionform/index.jsx | 10 ++-- src/menu/components/editor/braft-editor/index.jsx | 17 +++++++- src/menu/components/editor/braft-editor/options.jsx | 26 +++++++++--- src/tabviews/custom/components/editor/braft-editor/index.jsx | 5 ++ src/menu/components/editor/braft-editor/index.scss | 23 ++++++++++- src/tabviews/custom/components/share/braftContent/index.scss | 10 ++++ 7 files changed, 93 insertions(+), 21 deletions(-) diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 6557e9c..ba933e2 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -55,8 +55,15 @@ this.updateComponent(_card) } else { + let _card = fromJS(card).toJS() + + if (_card.wrap.firstTr === 'light') { + _card.wrap.tbStyle = 'th-light' + delete _card.wrap.firstTr + } + this.setState({ - card: fromJS(card).toJS() + card: _card }) } } @@ -139,6 +146,10 @@ updateWrap = (res) => { const { card } = this.state + if (res.tbStyle) { + res.tbStyle = res.tbStyle.join(' ') + } + let _card = {...card, wrap: res} if (res.datatype === 'public') { @@ -173,11 +184,11 @@ let style = {...card.style} return ( - <div className={'menu-normal-editor-box ' + (card.wrap.firstTr || '')} style={style} onClick={this.clickComponent} id={card.uuid}> + <div className={'menu-normal-editor-box ' + (card.wrap.tbStyle || '')} style={style} onClick={this.clickComponent} id={card.uuid}> <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> - <NormalForm title="瀵屾枃鏈缃�" width={750} update={this.updateWrap} getForms={this.getWrapForms}> + <NormalForm title="瀵屾枃鏈缃�" width={850} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="editor" card={card}/> diff --git a/src/menu/components/editor/braft-editor/index.scss b/src/menu/components/editor/braft-editor/index.scss index aa55923..6e533e8 100644 --- a/src/menu/components/editor/braft-editor/index.scss +++ b/src/menu/components/editor/braft-editor/index.scss @@ -25,15 +25,34 @@ color: #bcbcbc; } } -.menu-normal-editor-box.light { +.menu-normal-editor-box.th-light { .braft-content { table { tr:first-child { - background-color:#ffffff; + background-color:transparent; } } } } +.menu-normal-editor-box.no-border { + .braft-content { + table { + td, th { + border: none!important; + } + tr td:first-child { + padding-left: 0px; + } + } + } +} +.menu-normal-editor-box.tb-flex { + .braft-content { + table { + table-layout: fixed; + } + } +} .menu-normal-editor-box::after { display: block; content: ' '; diff --git a/src/menu/components/editor/braft-editor/options.jsx b/src/menu/components/editor/braft-editor/options.jsx index e0bb4a2..9faed41 100644 --- a/src/menu/components/editor/braft-editor/options.jsx +++ b/src/menu/components/editor/braft-editor/options.jsx @@ -132,17 +132,29 @@ ], }, { - type: 'radio', - field: 'firstTr', - label: '琛ㄦ牸棣栬', - initval: wrap.firstTr || 'deep', - tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��', + type: 'checkbox', + field: 'tbStyle', + label: '琛ㄦ牸鏍峰紡', + initval: wrap.tbStyle ? wrap.tbStyle.split(' ') : [], required: false, options: [ - {value: 'deep', label: '娣辫壊'}, - {value: 'light', label: '娴呰壊'}, + {value: 'th-light', label: '琛ㄥご閫忔槑'}, + {value: 'no-border', label: '鏃犺竟妗�'}, + {value: 'tb-flex', label: '鍒楃瓑瀹�'}, ] }, + // { + // type: 'radio', + // field: 'firstTr', + // label: '琛ㄦ牸棣栬', + // initval: wrap.firstTr || 'deep', + // tooltip: '瀵屾枃鏈腑table鐨勯琛岃儗鏅鑹层��', + // required: false, + // options: [ + // {value: 'deep', label: '娣辫壊'}, + // {value: 'light', label: '娴呰壊'}, + // ] + // }, { type: 'radio', field: 'permission', diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index d730f6e..7c1103d 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -233,7 +233,7 @@ if (this.record.openmenu && this.record.openmenu !== 'goback') { shows.push('open') } - if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { + if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) { shows.push('resetPageIndex') } @@ -305,7 +305,7 @@ if (this.record.execSuccess === 'goback') { shows.push('reload') } - if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { + if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) { shows.push('resetPageIndex') } @@ -352,7 +352,7 @@ } else { shows.push('database') } - if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { + if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) { shows.push('resetPageIndex') } } else if (openType === 'excelOut') { @@ -389,7 +389,7 @@ } else { shows.push('database') } - if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { + if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) { shows.push('resetPageIndex') } if (this.record.Ot !== 'notRequired' && appType === 'mob') { @@ -485,7 +485,7 @@ shows.push('innerFunc', 'extraParam') reRequired.innerFunc = true } - if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { + if (['grid', 'line', 'line_grid'].includes(this.record.execSuccess) || ['grid', 'line', 'line_grid'].includes(this.record.execError)) { shows.push('resetPageIndex') } if (this.record.execMode === 'pop' || this.record.execMode === 'prompt') { diff --git a/src/tabviews/custom/components/editor/braft-editor/index.jsx b/src/tabviews/custom/components/editor/braft-editor/index.jsx index 5232a25..bac965b 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.jsx +++ b/src/tabviews/custom/components/editor/braft-editor/index.jsx @@ -61,6 +61,9 @@ if (_config.wrap.minHeight) { _config.style.minHeight = _config.wrap.minHeight } + if (_config.wrap.firstTr === 'light') { + _config.wrap.tbStyle = 'th-light' + } this.setState({ data: _data, @@ -231,7 +234,7 @@ if (config.wrap.empty === 'hidden' && (!data || data.$$empty)) return null return ( - <div className={'custom-braft-editor-box ' + (config.wrap.firstTr || '')} id={'anchor' + config.uuid} style={config.style}> + <div className={'custom-braft-editor-box ' + (config.wrap.tbStyle || '')} id={'anchor' + config.uuid} style={config.style}> {loading ? <div className="loading-mask"> <div className="ant-spin-blur"></div> diff --git a/src/tabviews/custom/components/editor/braft-editor/index.scss b/src/tabviews/custom/components/editor/braft-editor/index.scss index 1829c88..e9e62b4 100644 --- a/src/tabviews/custom/components/editor/braft-editor/index.scss +++ b/src/tabviews/custom/components/editor/braft-editor/index.scss @@ -28,15 +28,34 @@ } } -.custom-braft-editor-box.light { +.custom-braft-editor-box.th-light { .braft-content { table { tr:first-child { - background-color:#ffffff; + background-color: transparent; } } } } +.custom-braft-editor-box.no-border { + .braft-content { + table { + td, th { + border: none!important; + } + tr td:first-child { + padding-left: 0px; + } + } + } +} +.custom-braft-editor-box.tb-flex { + .braft-content { + table { + table-layout: fixed; + } + } +} .custom-braft-editor-box::after { content: ' '; diff --git a/src/tabviews/custom/components/share/braftContent/index.scss b/src/tabviews/custom/components/share/braftContent/index.scss index 8059211..bf6b2f9 100644 --- a/src/tabviews/custom/components/share/braftContent/index.scss +++ b/src/tabviews/custom/components/share/braftContent/index.scss @@ -7,7 +7,7 @@ max-width: 100%; } p { - margin-bottom: 0px; + margin-bottom: 0px!important; min-height: 18px; } br { @@ -15,10 +15,18 @@ display: block; height: 18px; } + hr { + height: 15px; + border-top: 1px solid rgba(0, 0, 0, 0.1); + margin-top: 15px; + } video { max-width: 100%; width: 100%; } + table + p, hr + p { + min-height: 0px; + } table { width: 100%; border-collapse: collapse; -- Gitblit v1.8.0