king
2024-05-07 2aa5ab63b4bbce5c36dbb3511b205b3b5f6af9bd
src/menu/components/form/step-form/options.jsx
@@ -29,6 +29,18 @@
    }
  }
  let interfaces = []
  if (menu.interfaces) {
    menu.interfaces.forEach(item => {
      if (item.status === 'true') {
        interfaces.push({
          value: item.uuid,
          label: item.name
        })
      }
    })
  }
  const wrapForm = [
    {
      type: 'text',
@@ -59,10 +71,41 @@
      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: (map, record) => {
        if (!record.publicId) return
        let interfaces = window.GLOB.customMenu.interfaces || []
        let d = interfaces.filter(m => m.uuid === record.publicId && m.status === 'true')[0]
        if (!d || !d.columns) return
        let columns = JSON.parse(JSON.stringify(d.columns))
        let _sCtrl = map.get('statusControl')
        if (_sCtrl && !_sCtrl.forbid) {
          _sCtrl.options = columns
          _sCtrl.oriOptions = columns
          map.set('statusControl', _sCtrl)
        }
      }
    },
    {
      type: 'select',
@@ -85,9 +128,23 @@
        {value: 'show', label: '显示'},
        {value: 'hidden', label: '隐藏'},
      ],
      // controlFields: [
      //   {field: 'labelSize', values: ['show']},
      // ]
      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',
@@ -123,6 +180,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',
@@ -136,6 +205,19 @@
    },
    {
      type: 'radio',
      field: 'empty',
      label: '空值隐藏',
      initval: wrap.empty || 'show',
      tooltip: '当查询数据为空时,隐藏该组件。',
      required: false,
      skip: true,
      options: [
        {value: 'show', label: '否'},
        {value: 'hidden', label: '是'},
      ],
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',