king
2023-12-21 f9bc0059785cb1b1583e6f7a3a501f667338e672
src/components/normalform/modalform/mkTable/index.jsx
@@ -153,8 +153,9 @@
class EditTable extends Component {
  static propTpyes = {
    columns: PropTypes.array,       // 显示列
    onChange: PropTypes.func        // 数据变化
    actions: PropTypes.array,
    columns: PropTypes.array,
    onChange: PropTypes.func
  }
  state = {
@@ -166,7 +167,7 @@
  }
  UNSAFE_componentWillMount () {
    let actions = this.props.actions || []
    const { actions } = this.props
    let columns = fromJS(this.props.columns).toJS()
    let operation = {
@@ -189,16 +190,16 @@
          </div>
        ) : (
          <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}>
            <span className="primary" onClick={() => {editingKey === '' && this.edit(record)}}><EditOutlined /></span>
            {editingKey === '' ? <Popconfirm
            {actions.includes('edit') ? <span className="primary" onClick={() => {editingKey === '' && this.edit(record)}}><EditOutlined /></span> : null}
            {actions.includes('del') && editingKey === '' ? <Popconfirm
              overlayClassName="popover-confirm"
              title="确定删除吗?"
              onConfirm={() => this.handleDelete(record.uuid)
            }>
              <span className="danger"><DeleteOutlined /></span>
            </Popconfirm> : null}
            {editingKey !== '' ? <span className="danger"><DeleteOutlined /></span> : null}
            {actions.includes('view') ? <span className="copy" onClick={() => {editingKey === '' && this.changeMenu(record.menu)}}><ArrowRightOutlined /></span> : null}
            {actions.includes('del') && editingKey !== '' ? <span className="danger"><DeleteOutlined /></span> : null}
            {actions.includes('view') ? <span className="copy" onClick={() => {editingKey === '' && this.changeMenu(record)}}><ArrowRightOutlined /></span> : null}
          </div>
        )
      }
@@ -217,7 +218,8 @@
  //   return !is(fromJS(this.state), fromJS(nextState))
  // }
  changeMenu = (MenuId) => {
  changeMenu = (record) => {
    let MenuId = record.menu
    if (MenuId === 'IM') {
      if (!sessionStorage.getItem('instantMessage')) return
@@ -231,7 +233,7 @@
  
      MKEmitter.emit('changeEditMenu', {routerUrl: '/imdesign/' + param})
    } else {
      MKEmitter.emit('changeEditMenu', {MenuID: MenuId})
      MKEmitter.emit('changeEditMenu', { ...record, MenuID: MenuId})
    }
  }
@@ -392,7 +394,7 @@
  }
  render() {
    const { fixed } = this.props
    const { actions } = this.props
    let components = {
      body: {
        cell: EditableCell
@@ -401,8 +403,11 @@
    let moveprops = {}
    components.body.row = DragableBodyRow
    moveprops.moveAble = !this.state.editingKey
    moveprops.moveRow = this.moveRow
    if (actions.includes('move')) {
      moveprops.moveAble = !this.state.editingKey
      moveprops.moveRow = this.moveRow
    }
    
    let  columns = this.state.columns.map(col => {
      if (col.copy) {
@@ -437,7 +442,7 @@
    return (
      <EditableContext.Provider value={this.props.form}>
        <div className="modal-editable-table">
          {!fixed ? <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button> : null}
          {actions.includes('add') ? <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button> : null}
          <DndProvider>
            <Table
              bordered