king
2024-08-25 ae170a9d58b4f91a225eada1dc83ed4a116b8d50
src/menu/components/table/edit-table/columns/index.jsx
@@ -22,12 +22,12 @@
class HeaderCol extends Component {
  deleteCol = () => {
    const _this = this
    const that = this
    confirm({
      content: '确定删除显示列吗?',
      onOk() {
        _this.props.deleteCol(_this.props.column)
        that.props.deleteCol(that.props.column)
      },
      onCancel() {}
    })
@@ -47,7 +47,7 @@
      cols: [column]
    }
    let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
    let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId')
    if (srcid) {
      val.$srcId = srcid
    }
@@ -195,10 +195,10 @@
        val = '$Index'
      } else if (column.type === 'formula') {
        val = column.formula
        if (column.eval === 'false') {
          val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, '&nbsp;')
          val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span>
        }
        // if (column.eval === 'false') {
        //   val = val.replace(/\n/ig, '<br/>').replace(/\s/ig, '&nbsp;')
        //   val = <span style={{fontWeight: 'inherit'}} dangerouslySetInnerHTML={{__html: val}}></span>
        // }
      }
      return (
        <td style={style} className={className}>
@@ -553,7 +553,7 @@
      cols: columns.filter(col => !col.origin)
    }
    let srcid = localStorage.getItem(window.location.href.split('#')[0] + 'srcId')
    let srcid = localStorage.getItem(window.GLOB.sysSign + 'srcId')
    if (srcid) {
      val.$srcId = srcid
    }
@@ -597,13 +597,13 @@
      columns.push(cell)
    })
    const _this = this
    const that = this
    confirm({
      content: '确定同步字段集吗?',
      onOk() {
        _this.setState({columns}, () => {
          _this.props.updatecolumn({..._this.props.config, cols: columns})
        that.setState({columns}, () => {
          that.props.updatecolumn({...that.props.config, cols: columns})
        })
      },
      onCancel() {}
@@ -611,13 +611,13 @@
  }
  clear = () => {
    const _this = this
    const that = this
    confirm({
      content: '确定清空显示列吗?',
      onOk() {
        _this.setState({columns: []}, () => {
          _this.props.updatecolumn({..._this.props.config, cols: []})
        that.setState({columns: []}, () => {
          that.props.updatecolumn({...that.props.config, cols: []})
        })
      },
      onCancel() {}
@@ -637,10 +637,6 @@
    })
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
@@ -648,7 +644,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
  }
  handlecolumns = (columns, fields, config, pId) => {