king
2022-07-22 0c439ced2c97905cb2b02f5f689a37b19369fb8a
src/tabviews/zshare/mutilform/index.jsx
@@ -31,7 +31,6 @@
class MainSearch extends Component {
  static propTpyes = {
    menuType: PropTypes.object,  // 菜单类型,是否为HS
    action: PropTypes.object,    // 按钮信息、表单列表
    data: PropTypes.any,         // 表格数据
    BID: PropTypes.any,          // 主表ID
@@ -393,7 +392,7 @@
      let item = fieldMap.get(cell.field)
      // 下级表单控制-字段写入
      if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true')) && item.linkSubField) {
      if ((['select', 'radio', 'link'].includes(item.type) || (item.type === 'checkcard' && item.multiple !== 'true') || (item.type === 'cascader' && item.resourceType !== '2')) && item.linkSubField) {
        item.subFields = []
        item.linkSubField.forEach(m => {
          let n = fieldMap.get(m)
@@ -418,9 +417,6 @@
          item.options = fromJS(item.oriOptions).toJS()
        }
        item.linkSubField = null
      } else if (item.type === 'cascader' && item.fillField) {
        let n = fieldMap.get(item.fillField)
        item.fillFieldId = n ? n.uuid : ''
      }
      // if (item.type === 'link') {
@@ -463,31 +459,18 @@
      }
      if (item.subFields && item.options.length > 0) {
        let initval = item.initval
        if (item.type === 'cascader' && item.separator) {
          initval = initval.split(item.separator).pop()
        }
        // eslint-disable-next-line
        let option = item.options.filter(cell => item.initval == cell.value)[0]
        let option = item.options.filter(cell => initval == cell.value)[0]
        if (option) {
          reFieldsVal = reFieldsVal || {}
          item.subFields.forEach(n => {
            reFieldsVal[n.field] = option[n.field]
          })
        }
      } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
        let initvals = item.initval.split(item.separator)
        let label = []
        initvals.forEach(m => {
          // eslint-disable-next-line
          let option = item.options.filter(cell => m == cell.value)[0]
          if (option) {
            label.push(option.label)
          }
        })
        label = label.join(item.separator)
        if (label) {
          reFieldsVal = reFieldsVal || {}
          reFieldsVal[item.fillField] = label
        }
      }
      
@@ -515,7 +498,7 @@
      }
      if (deForms.length > 0) {
        if (this.props.menuType !== 'HS' && options.sysType === 'local' && window.GLOB.systemType !== 'production') {
        if (!window.GLOB.mkHS && options.sysType === 'local' && window.GLOB.systemType !== 'production') {
          this.improveSimpleActionForm(deForms)
        } else {
          this.improveActionForm(deForms)
@@ -528,7 +511,7 @@
   * @description 获取下拉表单选项信息
   */
  improveActionForm = (deForms) => {
    const { BID, menuType, action } = this.props
    const { BID, action } = this.props
    let deffers = []
    let mainItems = []  // 云端或单点数据
@@ -543,7 +526,7 @@
      }
    })
    
    if (menuType !== 'HS' && options.sysType !== 'local') {
    if (!window.GLOB.mkHS && options.sysType !== 'local') {
      localItems = [...localItems, ...mainItems]
      mainItems = []
    }
@@ -563,7 +546,7 @@
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      if (menuType === 'HS') { // 云端数据验证
      if (window.GLOB.mkHS) { // 云端数据验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
@@ -598,7 +581,7 @@
      mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp)
      if (menuType === 'HS') { // 云端数据验证
      if (window.GLOB.mkHS) { // 云端数据验证
        mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp)
        if (options.cloudServiceApi) {
          mainparam.rduri = options.cloudServiceApi
@@ -737,31 +720,18 @@
        }
        if (item.subFields && item.options.length > 0) {
          let initval = item.initval
          if (item.type === 'cascader' && item.separator) {
            initval = initval.split(item.separator).pop()
          }
          // eslint-disable-next-line
          let option = item.options.filter(cell => item.initval == cell.value)[0]
          let option = item.options.filter(cell => initval == cell.value)[0]
  
          if (option) {
            reFieldsVal = reFieldsVal || {}
            item.subFields.forEach(n => {
              reFieldsVal[n.field] = option[n.field]
            })
          }
        } else if (item.fillField && item.initval && item.separator && item.options.length > 0) {
          let initvals = item.initval.split(item.separator)
          let label = []
          initvals.forEach(m => {
            // eslint-disable-next-line
            let option = item.options.filter(cell => m == cell.value)[0]
            if (option) {
              label.push(option.label)
            }
          })
          label = label.join(item.separator)
          if (label) {
            reFieldsVal = reFieldsVal || {}
            reFieldsVal[item.fillField] = label
          }
        }
      }