king
2023-03-14 da34633b25d16359cd91a656acad5e811f9972b7
src/menu/components/form/simple-form/options.jsx
@@ -1,4 +1,3 @@
import { fromJS } from 'immutable'
import MenuUtils from '@/utils/utils-custom.js'
/**
@@ -23,21 +22,28 @@
  if (appType === 'mob') {
    config.subcards[0].fields.forEach(f => {
      if (f.field && ['select', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
      if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
      }
    })
  } else {
    config.subcards[0].fields.forEach(f => {
      if (f.field && ['select', 'link', 'text', 'number'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
      if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') {
        fields.push(f)
      }
    })
  }
  let modules = []
  let menu = fromJS(window.GLOB.customMenu).toJS()
  modules = MenuUtils.getSupModules(menu.components, config.uuid)
  let menu = window.GLOB.customMenu
  modules = MenuUtils.getSupModules(menu.components, config.uuid, menu.interfaces)
  if (wrap.supModule && wrap.supModule.length > 0 && wrap.supModule[0] !== 'empty') {
    let has = MenuUtils.checkSupModules(modules, wrap.supModule.slice(-1)[0])
    if (!has) {
      wrap.supModule = ''
    }
  }
  const wrapForm = [
    {
@@ -78,6 +84,7 @@
        {value: 'static', label: '静态'},
      ],
      controlFields: [
        {field: 'empty', values: ['dynamic']},
        {field: 'supModule', values: ['static']},
      ]
    },
@@ -129,7 +136,7 @@
    },
    {
      type: 'radio',
      field: 'subEnable',
      field: 'enable',
      label: '提交',
      initval: wrap.enable || 'true',
      required: false,
@@ -137,6 +144,56 @@
        {value: 'true', label: '显示'},
        {value: 'false', label: '隐藏'},
      ]
    },
    {
      type: 'radio',
      field: 'closeEnable',
      label: '关闭',
      initval: wrap.closeEnable || 'false',
      tooltip: '管理系统中会关闭当前标签,子应用中为返回上一页。',
      required: false,
      options: [
        {value: 'true', label: '显示'},
        {value: 'false', label: '隐藏'},
      ]
    },
    {
      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',
      tooltip: '当查询数据为空时,返回上一界面。',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ],
      forbid: appType !== 'mob'
    },
    {
      type: 'radio',
      field: 'empty',
      label: '空值隐藏',
      initval: wrap.empty || 'show',
      tooltip: '当查询数据为空时,隐藏该组件。',
      required: false,
      skip: true,
      options: [
        {value: 'show', label: '否'},
        {value: 'hidden', label: '是'},
      ],
    },
    {
      type: 'radio',
@@ -148,7 +205,7 @@
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'cascader',