king
2022-08-15 704f82b06befe96e5f739b2dce419f76f5683a6f
src/menu/components/card/prop-card/index.jsx
@@ -238,22 +238,24 @@
        }
      })
    } else {
      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 (!card.setting.supModule) {
        card.errors.push({ level: 0, detail: '未设置上级组件!'})
      }
      let supModule = card.setting.supModule ? card.setting.supModule[card.setting.supModule.length - 1] || '' : ''
      if (supModule === 'empty') {
        supModule = ''
      }
      let columns = card.columns.map(c => c.field)
      let lowcols = card.columns.map(c => c.field.toLowerCase())
      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.subcards.forEach((item, i) => {
        let linkbtn = item.setting.linkbtn || ''
@@ -574,7 +576,9 @@
  }
  updateWrap = (res) => {
    let _card = {...this.state.card, wrap: res}
    const { card } = this.state
    let _card = {...card, wrap: res}
    if (res.datatype === 'static') {
      if (res.supModule && res.supModule.length > 0) {
@@ -587,7 +591,26 @@
      _card.wrap.pagestyle = 'page'
    }
    this.updateComponent(_card)
    if (res.selStyle === 'tabs' && card.wrap.selStyle !== 'tabs') {
      Object.keys(_card.style).forEach(key => {
        if (/^border/.test(key)) {
          delete _card.style[key]
        }
      })
      _card.style.borderBottomColor = '#eeeeee'
      _card.style.borderBottomWidth = '1px'
      _card.style.paddingBottom = '0px'
      _card.subcards.forEach(item => {
        delete item.style.marginBottom
      })
      this.setState({card: {..._card, subcards: []}}, () => {
        this.updateComponent(_card)
      })
    } else {
      this.updateComponent(_card)
    }
  }
  clickComponent = (e) => {
@@ -624,7 +647,7 @@
        } trigger="hover">
          <ToolOutlined />
        </Popover>
        <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left')}>
        <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left') + ' select-' + card.wrap.selStyle}>
          {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))}
        </div>
        <div className="component-name">