king
2024-08-25 ae170a9d58b4f91a225eada1dc83ed4a116b8d50
src/menu/components/form/step-form/options.jsx
@@ -29,6 +29,19 @@
    }
  }
  let interfaces = []
  if (menu.interfaces) {
    menu.interfaces.forEach(item => {
      if (item.status === 'true') {
        interfaces.push({
          value: item.uuid,
          label: item.name,
          columns: JSON.parse(JSON.stringify(item.columns))
        })
      }
    })
  }
  const wrapForm = [
    {
      type: 'text',
@@ -59,10 +72,33 @@
      options: [
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
        {value: 'public', label: '公共数据源'}
      ],
      controlFields: [
        {field: 'empty', values: ['dynamic']},
        {field: 'supModule', values: ['static']},
        {field: 'publicId', values: ['public']},
      ]
    },
    {
      type: 'select',
      field: 'publicId',
      label: '数据源',
      initval: wrap.publicId || '',
      required: true,
      options: interfaces,
      reset_source: config.subtype !== 'tabform',
      callback: (record) => {
        if (!record.publicId) return
        let d = interfaces.filter(m => m.value === record.publicId)[0]
        if (!d || !d.columns) return
        return {
          statusControl: d.columns
        }
      }
    },
    {
      type: 'select',
@@ -70,6 +106,7 @@
      label: '状态控制',
      initval: wrap.statusControl || '',
      tooltip: '表单加载时的状态,当字段值与表单组的状态值一致时,启用对应的表单组。',
      timestamp: new Date().getTime(),
      required: false,
      options: config.columns,
      forbid: config.subtype === 'tabform'
@@ -84,8 +121,36 @@
      options: [
        {value: 'show', label: '显示'},
        {value: 'hidden', label: '隐藏'},
      ],
      controlFields: [
        // {field: 'labelSize', values: ['show']},
        {field: 'labelJump', values: ['show']},
      ]
    },
    {
      type: 'radio',
      field: 'labelJump',
      label: '名称切换',
      initval: wrap.labelJump || 'false',
      tooltip: '开启时,可通过点击分组名称向前跳转。',
      required: false,
      forbid: config.subtype === 'tabform',
      options: [
        {value: 'false', label: '关闭'},
        {value: 'true', label: '开启'},
      ]
    },
    // {
    //   type: 'number',
    //   field: 'labelSize',
    //   label: '名称大小',
    //   initval: wrap.labelSize || '',
    //   tooltip: '分组名称字体大小。',
    //   min: 12,
    //   max: 50,
    //   precision: 0,
    //   required: false
    // },
    {
      type: 'radio',
      field: 'tabtype',
@@ -109,6 +174,18 @@
    },
    {
      type: 'radio',
      field: 'formStyle',
      label: '表单样式',
      initval: wrap.formStyle || '',
      required: false,
      options: [
        {value: '', label: '默认'},
        {value: 'shadow', label: '阴影'},
      ],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      field: 'goback',
      label: '空值返回',
      initval: wrap.goback || 'false',
@@ -122,6 +199,18 @@
    },
    {
      type: 'radio',
      field: 'empty',
      label: '空值隐藏',
      initval: wrap.empty || 'show',
      tooltip: '当查询数据为空时,隐藏该组件。',
      required: false,
      options: [
        {value: 'show', label: '否'},
        {value: 'hidden', label: '是'},
      ],
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',