From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 14 六月 2023 09:55:50 +0800 Subject: [PATCH] 2023-06-14 --- src/menu/components/editor/braft-editor/index.jsx | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx index 444a206..3dfb6b3 100644 --- a/src/menu/components/editor/braft-editor/index.jsx +++ b/src/menu/components/editor/braft-editor/index.jsx @@ -6,7 +6,7 @@ import asyncComponent from '@/utils/asyncComponent' import asyncIconComponent from '@/utils/asyncIconComponent' -import { getTables } from '@/utils/utils-custom.js' +import { getTables, checkComponent } from '@/utils/utils-custom.js' import getWrapForm from './options' import MKEmitter from '@/utils/events.js' @@ -117,20 +117,9 @@ card.errors = [] - let columns = card.columns.map(c => c.field) - if (card.wrap.datatype !== 'static') { - if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { - card.errors.push({ level: 0, detail: '鏈缃暟鎹簮锛�'}) - } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { - card.errors.push({ level: 0, detail: '鏁版嵁婧愪腑鏃犲彲鐢ㄨ剼鏈紒'}) - } else if (!card.setting.primaryKey) { - card.errors.push({ level: 0, detail: '鏈缃富閿紒'}) - } else if (!columns.includes(card.setting.primaryKey)) { - card.errors.push({ level: 0, detail: '涓婚敭宸插け鏁堬紒'}) - } else if (!card.setting.supModule) { - card.errors.push({ level: 0, detail: '鏈缃笂绾х粍浠讹紒'}) - } + card.$c_ds = true + card.errors = checkComponent(card) if (card.errors.length === 0) { card.$tables = getTables(card) @@ -199,14 +188,14 @@ let style = {...card.style} return ( - <div className="menu-normal-editor-box" style={style} onClick={this.clickComponent} id={card.uuid}> + <div className={'menu-normal-editor-box ' + (card.wrap.firstTr || '')} 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}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> - <CopyComponent type="normaltable" card={card}/> + <CopyComponent type="editor" card={card}/> <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/> <UserComponent config={card}/> <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} /> -- Gitblit v1.8.0