king
2023-04-25 9ecbd8f279f6e0a1037e282418e8f9bfc0250769
src/tabviews/custom/components/module/account/index.jsx
@@ -25,6 +25,7 @@
  componentDidMount () {
    this.loadData()
    MKEmitter.addListener('reloadData', this.reloadData)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -37,6 +38,20 @@
  componentWillUnmount () {
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('reloadData', this.reloadData)
  }
  reloadData = (menuId) => {
    const { config } = this.props
    const { activeItem } = this.state
    if (config.uuid !== menuId) return
    if (activeItem) {
      MKEmitter.emit('resetSelectLine', config.uuid, activeItem.id, activeItem)
    } else {
      this.loadData()
    }
  }
@@ -181,11 +196,11 @@
          </div>
        )}>
          {books.map(item => (
            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
            <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option>
          ))}
        </Select> : <Select showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="请选择账套" onChange={this.changeBook}>
          {books.map(item => (
            <Option disabled={!item.months} key={item.id}>{item.account_name}</Option>
            <Option disabled={!item.months} title={item.account_name} key={item.id}>{item.account_name}</Option>
          ))}
        </Select>}
        {activeItem ? <span className="date">{activeItem.date}</span> : null}