king
2022-10-17 e8edfdadb561cd83bf6e1c3e00d55b8cc2aee6d5
src/menu/components/table/edit-table/index.jsx
@@ -6,12 +6,10 @@
import asyncComponent from '@/utils/asyncComponent'
import asyncIconComponent from '@/utils/asyncIconComponent'
import { resetStyle } from '@/utils/utils-custom.js'
import { resetStyle, getTables } from '@/utils/utils-custom.js'
import MKEmitter from '@/utils/events.js'
import getWrapForm from './options'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import './index.scss'
@@ -33,7 +31,6 @@
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    appType: sessionStorage.getItem('appType'),
    card: null,
    back: false
@@ -51,7 +48,6 @@
        format: 'array',    // 组件属性 - 数据格式
        pageable: true,     // 组件属性 - 是否可分页
        switchable: false,  // 组件属性 - 数据是否可切换
        dataName: card.dataName || '',
        width: card.width || 24,
        search: [],
        action: [],
@@ -68,7 +64,6 @@
          { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label3', field: '', Hide: 'false', IsSort: 'true', type: 'text', Width: 120 },
        ],
        scripts: [],
        btnlog: [],
        submit: {intertype: 'system', default: 'true', innerFunc: '', execSuccess: 'grid', execError: 'never', scripts: [], uniques: []},
        isNew: true
      }
@@ -167,14 +162,8 @@
    if (!window.GLOB.styling || !card.errors) { // 样式修改时不做筛查
      card.errors = []
      // 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: '未设置数据源!'})
@@ -187,19 +176,15 @@
      } else if (!card.setting.supModule) {
        card.errors.push({ level: 0, detail: '未设置上级组件!'})
      }
      if (card.errors.length === 0) {
        card.$tables = getTables(card)
      }
  
      card.action.forEach(cell => {
        if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
          if (!cell.modal || cell.modal.fields.length === 0) {
            card.errors.push({ level: 1, detail: `按钮“${cell.label}”中表单尚未添加`})
          // } else {
          //   cell.modal.fields.forEach(m => {
          //     if (m.type === 'linkMain' && !supModule) {
          //       card.errors.push({ level: 1, detail: `按钮“${cell.label}”中关联主表表单“${m.label}”无效`})
          //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
          //       card.errors.push({ level: 1, detail: `按钮“${cell.label}”中表单“${m.label}”大小写与字段集不一致`})
          //     }
          //   })
          }
        }
      })
@@ -210,14 +195,6 @@
            if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
              if (!cell.modal || cell.modal.fields.length === 0) {
                card.errors.push({ level: 1, detail: `按钮“${cell.label}”中表单尚未添加`})
              // } else {
              //   cell.modal.fields.forEach(m => {
              //     if (m.type === 'linkMain' && !supModule) {
              //       card.errors.push({ level: 1, detail: `按钮“${cell.label}”中关联主表表单“${m.label}”无效`})
              //     } else if (m.field && !columns.includes(m.field) && lowcols.includes(m.field.toLowerCase())) {
              //       card.errors.push({ level: 1, detail: `按钮“${cell.label}”中表单“${m.label}”大小写与字段集不一致`})
              //     }
              //   })
              }
            }
          })
@@ -423,7 +400,7 @@
          <ToolOutlined />
        </Popover>
        <SearchComponent config={card} updatesearch={this.updateComponent}/>
        <ActionComponent type="editable" config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
        <ActionComponent config={card} setSubConfig={this.setSubConfig} updateaction={this.updateComponent}/>
        <ColumnComponent config={card} updatecolumn={this.updateComponent}/>
        <div className="component-name">
          <div className="center">