king
2024-01-15 9d3c77a83bc4e7febbfb8fd05de2f90100c5af6c
src/menu/components/form/formaction/formconfig.jsx
@@ -125,18 +125,20 @@
  let resets = []
  fields.forEach(item => {
    if (item.hidden === 'true') return
    if (item.type !== 'text' && item.type !== 'number') return
    resets.push({
      value: item.uuid,
      text: item.label
    })
    if (item.label !== item.field) {
      resets.push({
        value: item.field,
        text: item.label + ' (' + item.field + ')'
      })
    } else {
      resets.push({
        value: item.field,
        text: item.label
      })
    }
  })
  if (card.resetForm && resets.findIndex(item => item.value === card.resetForm) === -1) {
    card.resetForm = ''
  }
  return [
    {
@@ -472,6 +474,15 @@
      options: modules
    },
    {
      type: 'number',
      key: 'syncDelay',
      label: '刷新延迟',
      initVal: card.syncDelay,
      tooltip: '同步刷新组件的延迟时间,单位毫秒。',
      // placeholder: '单位毫秒',
      required: false
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
@@ -492,12 +503,12 @@
    },
    {
      type: 'select',
      key: 'resetForm',
      key: 'resetForms',
      label: '重置表单',
      tooltip: '按钮执行成功后需要重置的表单,表单会恢复默认值并聚焦。',
      initVal: card.resetForm || '',
      initVal: card.resetForms || [],
      required: false,
      allowClear: true,
      mode: 'multiple',
      options: resets
    },
    {
@@ -515,5 +526,20 @@
        text: '刷新'
      }]
    },
    {
      type: 'radio',
      key: 'formCache',
      label: '表单缓存',
      initVal: card.formCache || 'false',
      tooltip: '主要用于数据修改后,更新相关表单的选项,清空缓存后表单再次打开时数据会重新加载。',
      required: false,
      options: [{
        value: 'false',
        text: '不清空'
      }, {
        value: 'clear',
        text: '清空'
      }]
    },
  ]
}