king
2021-06-28 3c26f581cd77bed95cc56464f8424993f3c6b13a
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -12,6 +12,7 @@
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) {
  let appType = sessionStorage.getItem('appType')
  let setting = config.setting || {}
  let columns = config.columns || []
  let appMenus = []
@@ -51,7 +52,7 @@
    { value: 'pay', text: Formdict['model.pay'] },
    { value: 'custom', text: Formdict['header.form.custom'] }
  ]
  const isApp = ['pc', 'mob'].includes(sessionStorage.getItem('appType'))
  const isApp = ['pc', 'mob'].includes(appType)
  let funTypes = [
    { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
@@ -195,26 +196,12 @@
      options: pageTemps
    },
    {
      type: 'radio',
      key: 'open',
      label: '链接方式',
      initVal: card.open || 'blank',
      required: true,
      forbid: sessionStorage.getItem('appType') !== 'pc',
      options: [{
        value: 'blank',
        text: '新窗口'
      }, {
        value: 'self',
        text: '当前窗口'
      }]
    },
    {
      type: 'select',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || '',
      required: true,
      forbid: !isApp,
      options: appMenus
    },
    // {
@@ -439,10 +426,10 @@
        text: '图标'
      }, {
        value: 'button',
        text: '按钮'
        text: '图标+文字'
      }, {
        value: 'link',
        text: '链接'
        text: '文字+图标'
      }]
    },
    {
@@ -451,7 +438,7 @@
      label: "滑动显示",
      initVal: card.swipe || 'false',
      required: false,
      forbid: (type !== 'datacard' || sessionStorage.getItem('appType') !== 'mob'),
      forbid: (type !== 'datacard' || appType !== 'mob'),
      options: [{
        value: 'false',
        text: '否'
@@ -464,7 +451,7 @@
      }]
    },
    {
      type: 'select',
      type: 'icon',
      key: 'icon',
      label: Formdict['model.icon'],
      initVal: card.icon,
@@ -476,6 +463,7 @@
      key: 'class',
      label: Formdict['model.form.color'],
      initVal: card.class,
      tooltip: '此颜色为按钮初始化颜色,可在样式调整中修改。',
      required: false,
      options: []
    },
@@ -543,7 +531,6 @@
      tooltip: '禁用控制字段,可根据数据控制按钮是否禁用。',
      initVal: card.controlField || '',
      required: false,
      // forbid: card.$type !== 'tableButton',
      options: [{label: '无', field: ''}, ...columns]
    },
    {
@@ -552,8 +539,32 @@
      label: '控制值',
      tooltip: '当选择控制字段,且字段值与控制值相等时,按钮会禁用,多个值用逗号分隔。',
      initVal: card.controlVal || '',
      // forbid: card.$type !== 'tableButton',
      required: false
    },
    {
      type: 'select',
      key: 'openmenu',
      label: '打开菜单',
      tooltip: '执行成功后需要打开的菜单。',
      initVal: card.openmenu,
      forbid: appType !== 'pc' && appType !== 'mob',
      required: false,
      options: [{value: '', text: '无'}, ...appMenus]
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      required: true,
      forbid: appType !== 'pc',
      options: [{
        value: 'blank',
        text: '新窗口'
      }, {
        value: 'self',
        text: '当前窗口'
      }]
    }
  ]