king
2022-06-18 fe21d23b147ed5cec22b4f76a88840b05495d4ad
src/menu/components/form/formaction/formconfig.jsx
@@ -9,7 +9,7 @@
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, tableName, usefulFields, modules) {
export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) {
  const appType = sessionStorage.getItem('appType')
  let _type = '提交'
  if (card.type === 'prev') {
@@ -25,19 +25,19 @@
      try {
        menulist = JSON.parse(menulist)
        menulist = menulist.map(item => ({value: item.MenuID, text: item.MenuName}))
      } catch {
      } catch (e) {
        menulist = []
      }
    } else {
      menulist = []
    }
    menulist.unshift({value: '', text: '无'})
    menulist.push({value: 'goback', text: '返回(上一页)'})
  } else {
    menulist = sessionStorage.getItem('fstMenuList')
    if (menulist) {
      try {
        menulist = JSON.parse(menulist)
      } catch {
      } catch (e) {
        menulist = []
      }
    } else {
@@ -242,19 +242,52 @@
      readonly: false
    },
    {
      type: 'radio',
      key: 'Ot',
      label: '行设置',
      initVal: card.Ot,
      required: true,
      options: [{
        value: 'notRequired',
        text: '不选择行'
      }, {
        value: 'requiredSgl',
        text: '选择单行'
      }]
    },
    {
      type: 'select',
      key: 'execSuccess',
      label: '成功后',
      initVal: card.execSuccess || 'grid',
      required: true,
      options: [{
        value: 'never',
        text: '不刷新'
      }, {
        value: 'grid',
        text: '刷新当前组件'
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      }]
    },
    {
      type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader',
      key: 'linkmenu',
      label: '打开菜单',
      label: '下一步操作',
      tooltip: '执行成功后需要打开的菜单。',
      initVal: card.linkmenu,
      help: appType === 'pc' || appType === 'mob' ? '可返回上一页。' : null,
      required: false,
      allowClear: true,
      options: menulist
    },
    {
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,如@id);自定义函数可指定返回字段(如id)。',
      initVal: card.output || '',
      required: false
    },
@@ -264,23 +297,44 @@
      label: '打开方式',
      initVal: card.open || 'blank',
      required: false,
      forbid: appType !== 'pc',
      options: [{
        value: 'blank',
        text: '新窗口'
      }, {
        value: 'self',
        text: '当前窗口'
      }]
      forbid: appType !== 'pc' && appType !== 'mob',
      options: [
        {value: 'blank', text: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', text: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ]
    },
    {
      type: 'cascader',
      key: 'syncComponent',
      label: '同步刷新',
      initVal: card.syncComponent,
      tooltip: '执行成功后需要刷新的组件。',
      tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效。',
      required: false,
      options: modules
    }
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
      initVal: card.anchors || [],
      tooltip: '执行成功后,需要跳转的锚点。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: anchors
    },
    {
      type: 'radio',
      key: 'reload',
      label: '上一页',
      initVal: card.reload || 'false',
      tooltip: '成功后是否刷新上页的数据。注:在明科云APP或小程序中有效。',
      forbid: appType !== 'mob',
      options: [{
        value: 'false',
        text: '不刷新'
      }, {
        value: 'true',
        text: '刷新'
      }]
    },
  ]
}