king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
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)} />