king
2024-12-05 4a356e81b1a456f0cb16f61f548c46171c26c1b6
src/tabviews/custom/components/module/voucher/resetAttach/documents/index.jsx
@@ -1,4 +1,5 @@
import React, {Component} from 'react'
import { fromJS } from 'immutable'
class Documents extends Component {
  state = {
@@ -7,9 +8,16 @@
  }
  UNSAFE_componentWillMount() {
    const { documents } = this.props
    const { documents, list } = this.props
    let actFolder = documents[0] || null
    let actFolder = null
    if (documents[0]) {
      actFolder = fromJS(documents[0]).toJS()
      let ids = list.map(item => item.id)
      actFolder.attachments = actFolder.attachments.filter(doc => !ids.includes(doc.id))
    }
    this.setState({selectKey: [], actFolder: actFolder})
  }
@@ -31,15 +39,17 @@
  }
  checkfolder = (id) => {
    const { documents } = this.props
    const { documents, list } = this.props
    const { actFolder } = this.state
    if (!actFolder || actFolder.id === id) return
    let _actFolder = null
    let ids = list.map(item => item.id)
    documents.forEach(item => {
      if (item.id === id) {
        _actFolder = item
        _actFolder = fromJS(item).toJS()
        _actFolder.attachments = _actFolder.attachments.filter(doc => !ids.includes(doc.id))
      }
    })