| | |
| | | res.tbStyle = res.tbStyle.join(' ') |
| | | } |
| | | |
| | | if (res.loads) { |
| | | if (res.loads.includes('preload')) { |
| | | res.preload = 'true' |
| | | } |
| | | if (res.loads.includes('loaded')) { |
| | | res.loaded = 'true' |
| | | } |
| | | |
| | | delete res.loads |
| | | } |
| | | |
| | | delete res.splitLine |
| | | |
| | | let _card = {...card, wrap: res} |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content"><span>富文本<span>字符替换:$blank_space_**$(空格,其中**代表空格数)。 </span></span></p>' : card.html}/> |
| | | {/* <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content"><span>富文本<span>字符替换:$blank_space_**$(空格,其中**代表空格数)。 </span></span></p>' : card.html}/> */} |
| | | <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content"><span>富文本</span></p>' : card.html}/> |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | |
| | | tbStyle = tbStyle.filter(n => n !== 'deep-split') |
| | | splitLine = 'true' |
| | | } |
| | | let loads = [] |
| | | if (wrap.loaded === 'true') { |
| | | loads.push('loaded') |
| | | } |
| | | if (wrap.preload === 'true') { |
| | | loads.push('preload') |
| | | } |
| | | |
| | | const cardWrapForm = [ |
| | | { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'loaded', |
| | | type: 'checkbox', |
| | | field: 'loads', |
| | | label: '布局调整', |
| | | initval: wrap.loaded || 'false', |
| | | initval: loads, |
| | | required: false, |
| | | tooltip: '预处理入参html、data,返回修改后的html;后处理入参为html,可通过页面元素的样式调整并返回处理后的html。', |
| | | options: [ |
| | | {value: 'false', label: '关闭'}, |
| | | {value: 'true', label: '开启'}, |
| | | {value: 'preload', label: '预处理'}, |
| | | {value: 'loaded', label: '后处理'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'loadedfunc', values: ['true']}, |
| | | {field: 'prefunc', values: ['preload']}, |
| | | {field: 'loadedfunc', values: ['loaded']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | field: 'prefunc', |
| | | label: '预处理脚本', |
| | | initval: wrap.prefunc || '', |
| | | required: true, |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | field: 'loadedfunc', |
| | | label: '处理脚本', |
| | | label: '后处理脚本', |
| | | initval: wrap.loadedfunc || '', |
| | | required: true, |
| | | span: 24 |
| | |
| | | _data = [_data] |
| | | } |
| | | } else if (_config.html) { |
| | | if (/\$blank_space_\d+\$/ig.test(_config.html)) { |
| | | _config.html = _config.html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | let n = +w.replace(/blank_space_|\$/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | } |
| | | if (_config.wrap.prefunc) { |
| | | let _html = '' |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('html', 'data', _config.wrap.prefunc) |
| | | _html = func(_config.html, {}) |
| | | } catch (e) { |
| | | _html = '' |
| | | console.warn(e) |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | _config.html = _html || _config.html |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | if (/\$blank_space_\d+\$/ig.test(item.$html)) { |
| | | item.$html = item.$html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | let n = +w.replace(/blank_space_|\$/ig, '') |
| | | if (n) { |
| | | return new Array(n).fill(' ').join('') |
| | | } |
| | | if (wrap.prefunc) { |
| | | let _html = '' |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('html', 'data', wrap.prefunc) |
| | | _html = func(item.$html, item) |
| | | } catch (e) { |
| | | _html = '' |
| | | console.warn(e) |
| | | } |
| | | |
| | | return w |
| | | }) |
| | | item.$html = _html || item.$html |
| | | } |
| | | // if (/\$blank_space_\d+\$/ig.test(item.$html)) { |
| | | // item.$html = item.$html.replace(/\$blank_space_\d+\$/ig, (w) => { |
| | | // let n = +w.replace(/blank_space_|\$/ig, '') |
| | | // if (n) { |
| | | // return new Array(n).fill(' ').join('') |
| | | // } |
| | | |
| | | // return w |
| | | // }) |
| | | // } |
| | | } |
| | | }) |
| | | |
| | |
| | | /> : data.map((item, index) => <BraftContent |
| | | key={index} |
| | | value={item.$html} |
| | | script={config.wrap.loaded === 'true' ? config.wrap.loadedfunc : ''} |
| | | script={config.wrap.loadedfunc || ''} |
| | | />)} |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | .anticon-fullscreen-exit { |
| | | position: fixed; |
| | | z-index: 11; |
| | | z-index: 13; |
| | | right: 10px; |
| | | top: 5px; |
| | | font-size: 20px; |
| | |
| | | .CodeMirror-fullscreen.CodeMirror { |
| | | border-radius: 0; |
| | | position: fixed; |
| | | z-index: 10; |
| | | z-index: 12; |
| | | } |
| | | .CodeMirror-linenumber { |
| | | font-size: 14px; |
| | |
| | | .anticon-fullscreen-exit { |
| | | display: inline-block; |
| | | } |
| | | .anticon-font-size { |
| | | z-index: 13; |
| | | } |
| | | .anticon-fullscreen { |
| | | display: none; |
| | | } |