king
2022-06-18 fe21d23b147ed5cec22b4f76a88840b05495d4ad
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -12,7 +12,7 @@
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = []) {
export function getActionForm (card, functip, config, usefulFields, type, menulist = [], modules = [], anchors = []) {
  let appType = sessionStorage.getItem('appType')
  let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview
  let printTemps = sessionStorage.getItem('printTemps')
@@ -107,11 +107,13 @@
    opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value))
    funTypes = [
      { value: 'scan', text: '扫码' },
      { value: 'pay', text: '支付' },
      { value: 'logout', text: '退出' },
      { value: 'mkBinding', text: '开通扫码登录' },
      { value: 'mkUnBinding', text: '用户解绑' },
      { value: 'mkUnsubscribe', text: '注销账户' },
      { value: 'reAuth', text: '切换系统(清空缓存-小程序)' },
      { value: 'copyurl', text: '复制链接地址' },
      { value: 'goBack', text: '返回' },
    ]
    pageTemps = [
@@ -160,6 +162,19 @@
  }
  if (appType === 'mob' && card.control === 'parent') {
    card.control = ''
  }
  if (card.execSuccess === 'goback') {
    card.openmenu = 'goback'
    card.execSuccess = 'never'
  }
  let closetab = []
  if (!appType) {
    closetab = [{
      value: 'closetab',
      text: '关闭标签'
    }]
  }
  let forms = [
@@ -234,6 +249,20 @@
      label: '按钮名称',
      initVal: card.label,
      required: true,
    },
    {
      type: 'checkbox',
      key: 'payType',
      label: '支付方式',
      initVal: card.payType || [],
      required: true,
      options: [{
        value: 'wxpay',
        text: '微信'
      }, {
        value: 'alipay',
        text: '支付宝'
      }]
    },
    {
      type: 'radio',
@@ -427,10 +456,8 @@
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      }, {
        value: !appType ? 'closetab' : 'goback',
        text: !appType ? '关闭标签' : '返回(上一个页面)'
      },
      },
      ...closetab,
      ...refresh]
    },
    {
@@ -631,7 +658,7 @@
      key: 'syncComponent',
      label: '刷新组件',
      initVal: card.syncComponent || [],
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件',
      tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效。',
      required: false,
      options: modules
    },
@@ -640,9 +667,18 @@
      key: 'switchTab',
      label: '切换标签',
      initVal: card.switchTab || [],
      tooltip: '执行成功后,需要切换的标签页',
      tooltip: '执行成功后,需要切换的标签页。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: tabs
    },
    {
      type: 'cascader',
      key: 'anchors',
      label: '跳转锚点',
      initVal: card.anchors || [],
      tooltip: '执行成功后,需要跳转的锚点。' + (appType === 'mob' ? '注:小程序中无效' : ''),
      required: false,
      options: anchors
    },
    {
      type: 'cascader',
@@ -660,16 +696,17 @@
      label: '打开菜单',
      tooltip: '执行成功后需要打开的菜单。',
      initVal: card.openmenu || (!appType ? [] : ''),
      help: appType === 'mob' || appType === 'pc' ? '可返回上一页。' : null,
      required: false,
      allowClear: true,
      options: appType === 'mob' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : (appType === 'pc' ? appMenus : menulist),
      options: appType === 'mob' || appType === 'pc' ? [...appMenus, {value: 'goback', text: '返回(上一页)'}] : menulist,
      forbid: viewType === 'popview'
    },
    {
      type: 'text',
      key: 'output',
      label: '返回值',
      tooltip: '执行成功后的返回值。例如:@id',
      tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,如@id);自定义函数可指定返回字段(如id)。',
      initVal: card.output || '',
      required: false,
      forbid: viewType === 'popview'
@@ -687,15 +724,13 @@
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      tooltip: '菜单打开方式。',
      required: true,
      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: 'radio',
@@ -719,7 +754,7 @@
      precision: 0,
      label: '比例',
      initVal: card.ratio || 85,
      tooltip: '小于100为宽度(或高度)百分比,大于100为像素值。',
      tooltip: '模态框或抽屉的宽度,小于100为窗口宽度(或高度)百分比,大于100为像素值。',
      required: true
    },
    {
@@ -905,6 +940,21 @@
        value: 'true',
        text: '是'
      }]
    },
    {
      type: 'radio',
      key: 'progress',
      label: '进度提示',
      initVal: card.progress || 'number',
      required: false,
      forbid: appType === 'mob',
      options: [{
        value: 'number',
        text: '剩余数'
      }, {
        value: 'progressbar',
        text: '进度条'
      }]
    }
  ]