king
2023-03-02 d1f19b794216b37417e114b71c1cd7a2ac3d7748
src/tabviews/zshare/mutilform/index.jsx
@@ -41,6 +41,7 @@
  state = {
    formlist: [],    // 表单项
    ID: ''
  }
  record = {}
@@ -506,7 +507,7 @@
    this.record = record
    this.setState({ formlist }, () => {
    this.setState({ formlist, ID: this.props.data ? this.props.data.$$uuid || '' : '' }, () => {
      if (unload) return
      
      if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) {
@@ -544,6 +545,10 @@
      if (item.database === 'sso') {
        let sql = _sso + item.base_sql
        _sso = ''
        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
        sql = sql.replace(/@BID@/ig, `'${BID}'`)
        if (debug) {
          console.info(sql)
        }
@@ -551,6 +556,10 @@
      } else {
        let sql = _sql + item.base_sql
        _sql = ''
        sql = sql.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
        sql = sql.replace(/@BID@/ig, `'${BID}'`)
        if (debug) {
          console.info(sql)
        }
@@ -564,8 +573,7 @@
      LText: localItems.join(' union all '),
      obj_name: '',
      arr_field: '',
      table_type: 'Y',
      BID: BID || ''
      table_type: 'Y'
    }
    if (param.LText) {
@@ -599,8 +607,7 @@
      LText: mainItems.join(' union all '),
      obj_name: '',
      arr_field: '',
      table_type: 'Y',
      BID: BID || ''
      table_type: 'Y'
    }
    if (mainparam.LText) {
@@ -660,9 +667,11 @@
        func: 'sPC_Get_SelectedList',
        LText: _sql + form.base_sql,
        obj_name: form.field,
        arr_field: form.arr_field,
        BID: this.props.BID || ''
        arr_field: form.arr_field
      }
      param.LText = param.LText.replace(/@ID@/ig, `'${this.state.ID || ''}'`)
      param.LText = param.LText.replace(/@BID@/ig, `'${this.props.BID || ''}'`)
      if (debug) {
        console.info(param.LText)
@@ -715,6 +724,7 @@
      if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
        let options = []
        let map = new Map()
        let all = false
        result[item.field].forEach(cell => {
          let _cell = { key: Utils.getuuid() , ParentID: ''}
@@ -725,7 +735,15 @@
          if (item.type !== 'checkcard') {
            _cell.value = cell[item.valueField]
            _cell.label = cell[item.valueText] + ''
            if (!_cell.label || map.has(_cell.ParentID + _cell.value)) return
            if (map.has(_cell.ParentID + _cell.value)) return
            if (!_cell.label) {
              if (!all) {
                _cell.label = '全部'
                all = true
              } else {
                return
              }
            }
            
            map.set(_cell.ParentID + _cell.value, 0)
          } else {
@@ -877,6 +895,7 @@
    formlist.forEach((item, index) => {
      if (item.hidden) return
      if (item.empty === 'hidden' && item.options.length === 0) return
      if (item.type === 'split') {
        fields.push(