king
2021-09-16 d7ec8fbd65cd7225ce8d405a0ee0a1f166f44d7b
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -47,6 +47,20 @@
    }
  ]
  let getTabs = (list) => {
    return list.filter(item => {
      if (item.type !== 'tabs') return false
      item.children = item.children.map(cell => {
        cell.children = getTabs(cell.children)
        return cell
      })
      return item
    })
  }
  let tabs = getTabs(JSON.parse(JSON.stringify(modules)))
  let pageTemps = [
    { value: 'billprint', text: '单据打印' },
    { value: 'pay', text: Formdict['model.pay'] },
@@ -56,25 +70,16 @@
  let funTypes = [
    { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
    { value: 'print', text: '标签打印' }
    { value: 'print', text: '标签打印' },
    { value: 'closetab', text: '标签关闭' },
  ]
  
  if (isApp) {
    pageTemps = [
      // { value: 'page', text: '菜单' },
      { value: 'linkpage', text: '关联菜单' },
      { value: 'billprint', text: '单据打印' },
      { value: 'pay', text: Formdict['model.pay'] },
      { value: 'custom', text: '链接' }
    ]
    funTypes = [
      { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
    ]
    appMenus = sessionStorage.getItem('appMenus')
    if (appMenus) {
      try {
        appMenus = JSON.parse(appMenus)
      } catch {
      } catch (e) {
        appMenus = []
      }
    } else {
@@ -86,8 +91,24 @@
      funTypes = [
        { value: 'mkBinding', text: '开通扫码登录' },
        { value: 'mkUnBinding', text: '用户解绑' },
        { value: 'reAuth', text: '重新授权' },
        { value: 'goBack', text: '返回' },
      ]
      pageTemps = [
        { value: 'linkpage', text: '关联菜单' },
        // { value: 'pay', text: Formdict['model.pay'] },
        { value: 'custom', text: '链接' }
      ]
    } else {
      pageTemps = [
        { value: 'linkpage', text: '关联菜单' },
        { value: 'billprint', text: '单据打印' },
        { value: 'pay', text: Formdict['model.pay'] },
        { value: 'custom', text: '链接' }
      ]
      funTypes = [
        { value: 'changeuser', text: Formdict['header.form.func.changeuser'] },
      ]
      opentypes = opentypes.filter(item => item.value !== 'tab')
    }
  }
@@ -115,7 +136,7 @@
      options: opentypes
    },
    {
      type: 'radio',
      type: 'select',
      key: 'funcType',
      label: Formdict['header.form.funcType'],
      initVal: card.funcType || '',
@@ -350,6 +371,9 @@
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      }, {
        value: 'closetab',
        text: '关闭标签'
      },
      ...refresh]
    },
@@ -517,12 +541,32 @@
      }]
    },
    {
      type: 'mcascader',
      type: 'cascader',
      key: 'syncComponent',
      label: '同步刷新',
      label: '刷新组件',
      initVal: card.syncComponent || [],
      tooltip: '执行成功后,需要同步刷新的组件',
      required: false,
      options: modules
    },
    {
      type: 'cascader',
      key: 'switchTab',
      label: '切换标签',
      initVal: card.switchTab || [],
      tooltip: '执行成功后,需要切换的标签页',
      required: false,
      options: tabs
    },
    {
      type: 'cascader',
      key: 'refreshTab',
      label: '刷新菜单',
      initVal: card.refreshTab || [],
      tooltip: '执行成功后或标签关闭时,需要同步刷新的菜单',
      required: false,
      forbid: isApp,
      options: menulist
    },
    {
      type: 'select',
@@ -551,7 +595,7 @@
      forbid: appType !== 'pc' && appType !== 'mob',
      required: false,
      allowClear: true,
      options: appMenus
      options: appType !== 'mob' ? appMenus : [...appMenus, {value: 'goback', text: '返回'}]
    },
    {
      type: 'text',