king
2022-05-05 4677982c003e357cff8f2544be44706bf31ea6de
src/tabviews/custom/components/share/normalTable/index.jsx
@@ -224,7 +224,12 @@
      let photos = ''
      if (record[col.field]) {
        photos = `${record[col.field]}`
        photos = photos.split(',')
      }
      if (/^data:image/.test(photos)) {
        photos = [photos]
      } else {
        photos = photos.split(',').filter(Boolean)
      }
      let cols = 24 / (col.picSort || 1)
@@ -382,7 +387,6 @@
    lineMarks: PropTypes.array,      // 行标记
    fields: PropTypes.array,         // 组件字段集
    ContainerId: PropTypes.any,      // 标签页外层Id
    BData: PropTypes.any,            // 主表数据
    data: PropTypes.any,             // 表格数据
    total: PropTypes.any,            // 总数
    loading: PropTypes.bool,         // 表格加载中
@@ -528,18 +532,27 @@
    MKEmitter.removeListener('resetTable', this.resetTable)
  }
  mkCheckTopLine = (menuId) => {
  mkCheckTopLine = (menuId, id) => {
    const { MenuID, data, setting } = this.props
    if (MenuID !== menuId || !data || data.length === 0) return
    if (data[0].$disabled) return
    this.changedata(0)
    this.setState({ selectedRowKeys: [0], activeIndex: 0 })
    this.props.chgSelectData([data[0]])
    let index = 0
    if (id) {
      index = data.findIndex(item => item.$$uuid === id)
      if (index === -1) {
        index = 0
      }
    }
    if (data[index].$disabled) return
    this.changedata(index)
    this.setState({ selectedRowKeys: [index], activeIndex: index })
    this.props.chgSelectData([data[index]])
    if (setting.$hasSyncModule) {
      MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1)
      MKEmitter.emit('syncBalconyData', MenuID, [data[index]], data.length === 1)
    }
  }
@@ -722,13 +735,13 @@
  }
  changedata = (index) => {
    const { MenuID, data, setting } = this.props
    const { MenuID, data } = this.props
    let _id = ''
    let _data = ''
    if (data && data.length > 0 && index !== '') {
      _id = data[index][setting.primaryKey] || ''
      _id = data[index].$$uuid || ''
      _data = data[index] || ''
    }