king
2024-01-06 920e94fc5483b081b3d43c86df8f56d838f2f14d
src/tabviews/custom/components/table/edit-table/index.jsx
@@ -113,10 +113,6 @@
            item.type = 'text'
          }
          if (item.marks && item.marks.length === 0) {
            item.marks = ''
          }
          if (item.editable === 'true') {
            setting.hasSubmit = setting.commit !== 'change'
            item.$ctrl = setting.commit === 'change'
@@ -388,7 +384,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadmainLinedata (id) {
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
@@ -416,11 +412,25 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        return
      }
      if (!result.data || !result.data[0]) {
        let data = fromJS(this.state.data).toJS()
        let selectedData = fromJS(this.state.selectedData).toJS()
        data = data.filter(item => item.$$uuid !== id)
        selectedData = selectedData.filter(item => item.$$uuid !== id)
        MKEmitter.emit('transferData' + setting.tableId, id, 'delete')
        this.setState({
          data,
          selectedData,
          loading: false
        })
        return
      }
@@ -560,7 +570,7 @@
    if (!id) {
      this.reloadtable()
    } else {
      this.loadmainLinedata(id)
      this.loadLinedata(id)
    }
  }
@@ -574,9 +584,11 @@
        BID: id,
        BData: data
      }, () => {
        setTimeout(() => {
          this.loadmaindata(true, 'true')
        }, setting.delay || 0)
        if (!setting.checkBid) {
          setTimeout(() => {
            this.loadmaindata(true, 'true')
          }, setting.delay || 0)
        }
      })
    }
  }
@@ -592,9 +604,9 @@
    if (config.uuid !== menuId) return
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadmainLinedata(lines[0].$$uuid)
        this.loadLinedata(lines[0].$$uuid, position)
      } else {
        this.reloadtable(btn)
      }