king
2023-05-25 972f277c5920d9d38749d675912b47b2b120320e
src/menu/components/card/cardcellcomponent/formconfig.jsx
@@ -56,6 +56,58 @@
    width = +width.replace(/x/, '.5')
  }
  let linkTypes = [
    { value: 'tel', text: '电话' },
    { value: 'email', text: '邮箱' },
    { value: 'other', text: '其他' }
  ]
  if (appType === 'mob') {
    linkTypes = [
      { value: 'tel', text: '电话' },
      { value: 'email', text: '邮箱' },
      { value: 'qywx', text: '企业微信' },
      { value: 'linkmenu', text: '关联菜单' },
      { value: 'other', text: '其他' }
    ]
  } else if (appType === 'pc') {
    linkTypes = [
      { value: 'tel', text: '电话' },
      { value: 'email', text: '邮箱' },
      { value: 'linkmenu', text: '关联菜单' },
      { value: 'other', text: '其他' }
    ]
  }
  if (card.linkType === 'qywx') {
    if (appType !== 'mob') {
      card.link = ''
      card.linkType = ''
      card.linkurl = ''
    }
  } else if (card.linkType === 'linkmenu') {
    if (appType !== 'mob' && appType !== 'pc') {
      card.link = ''
      card.linkType = ''
      card.linkurl = ''
      card.linkmenu = ''
    }
  }
  let appMenus = sessionStorage.getItem('appMenus')
  if (['pc', 'mob'].includes(appType)) {
    if (appMenus) {
      try {
        appMenus = JSON.parse(appMenus)
      } catch (e) {
        appMenus = []
      }
    } else {
      appMenus = []
    }
    appMenus.push({value: 'goback', text: '返回(上一页)'})
  }
  let forms = [
    {
      type: 'select',
@@ -519,17 +571,12 @@
      forbid: isHeader
    },
    {
      type: 'radio',
      type: linkTypes.length > 4 ? 'select' : 'radio',
      key: 'linkType',
      label: '链接类型',
      initVal: card.linkType || 'other',
      required: false,
      options: [
        { value: 'tel', text: '电话' },
        { value: 'email', text: '邮箱' },
        { value: 'qywx', text: '企业微信' },
        { value: 'other', text: '其他' }
      ]
      options: linkTypes
    },
    {
      type: 'radio',
@@ -544,6 +591,15 @@
    },
    {
      type: 'select',
      key: 'linkmenu',
      label: '关联菜单',
      initVal: card.linkmenu || '',
      required: true,
      options: appMenus || [],
      forbid: !['pc', 'mob'].includes(appType)
    },
    {
      type: 'select',
      key: 'linkurl',
      label: '链接地址',
      initVal: card.linkurl || '',
@@ -552,6 +608,19 @@
    },
    {
      type: 'radio',
      key: 'open',
      label: '打开方式',
      initVal: card.open || 'blank',
      tooltip: '菜单打开方式。',
      required: true,
      forbid: !['pc', 'mob'].includes(appType),
      options: [
        {value: 'blank', text: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', text: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ]
    },
    {
      type: 'radio',
      key: 'joint',
      label: '拼接参数',
      initVal: card.joint || 'true',