king
2024-05-21 f0bf8c399c354c22227f8f1a76ed806098db59c0
src/menu/components/card/data-card/options.jsx
@@ -59,6 +59,74 @@
    }
  }
  let interaction = []
  let interOptions = []
  if (wrap.scale === 'true') {
    interaction.push('scale')
  }
  if (wrap.parity === 'true') {
    interaction.push('parity')
  }
  if (wrap.hover === 'true') {
    interaction.push('hover')
  }
  if (subtype === 'datacard') {
    interOptions = [
      {value: 'parity', label: '奇偶异色'},
    ]
    if (appType !== 'mob') {
      interOptions.push(
        {value: 'hover', label: '悬浮变色'},
        {value: 'scale', label: '悬浮放大'}
      )
    }
  } else if (subtype === 'propcard' && appType !== 'mob') {
    interOptions = [
      {value: 'scale', label: '悬浮放大'}
    ]
  } else if (subtype === 'tablecard') {
    interOptions = [
      {value: 'parity', label: '奇偶异色'},
    ]
    if (appType !== 'mob') {
      interOptions.push(
        {value: 'hover', label: '悬浮变色'}
      )
    }
  }
  if (interaction.length && interOptions.length) {
    interaction = interaction.filter(m => interOptions.findIndex(cell => cell.value === m) > -1)
  }
  // let interItem = null
  // if (interOptions.length === 1) {
  //   interItem = {
  //     type: 'radio',
  //     field: interOptions[0].value,
  //     label: interOptions[0].label,
  //     initval: interaction.length === 1 ? 'true' : 'false',
  //     required: false,
  //     options: [
  //       {value: 'true', label: '启用'},
  //       {value: 'false', label: '禁用'}
  //     ]
  //   }
  // } else {
  //   interItem = {
  //     type: 'checkbox',
  //     field: 'interaction',
  //     label: '交互效果',
  //     initval: interaction,
  //     required: false,
  //     options: interOptions,
  //     forbid: interOptions.length === 0
  //   }
  // }
  const cardWrapForm = [
    {
      type: 'text',
@@ -306,31 +374,27 @@
      ],
      forbid: subtype !== 'datacard' || appType === 'mob'
    },
    // {
    //   type: 'radio',
    //   field: 'scale',
    //   label: '放大效果',
    //   initval: wrap.scale || 'false',
    //   tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'true', label: '有'},
    //   ],
    //   forbid: subtype === 'tablecard' || appType === 'mob'
    // },
    {
      type: 'radio',
      field: 'scale',
      label: '放大效果',
      initval: wrap.scale || 'false',
      tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。',
      type: 'checkbox',
      field: 'interaction',
      label: '交互效果',
      initval: interaction,
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      forbid: subtype === 'tablecard' || appType === 'mob'
    },
    {
      type: 'radio',
      field: 'parity',
      label: '奇偶背景',
      initval: wrap.parity || 'false',
      tooltip: '偶数行会添加背景色。',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      forbid: subtype === 'propcard'
      options: interOptions,
      forbid: interOptions.length === 0
    },
    {
      type: 'radio',
@@ -449,7 +513,6 @@
      ],
      controlFields: [
        {field: 'jumpField', values: ['menu', 'link']},
        {field: 'joint', values: ['menu', 'link']},
        {field: 'open', values: ['menu', 'link']},
        {field: 'menu', values: ['menu']},
        {field: 'link', values: ['link']},
@@ -483,18 +546,6 @@
      tooltip: '跳转链接为查询数据的返回值。',
      required: true,
      options: columns,
      forbid: subtype !== 'propcard' || appType !== 'mob'
    },
    {
      type: 'radio',
      field: 'joint',
      label: '参数拼接',
      initval: wrap.joint || 'true',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ],
      forbid: subtype !== 'propcard' || appType !== 'mob'
    },
    {
@@ -610,6 +661,19 @@
    },
    {
      type: 'radio',
      field: 'searchBtn',
      label: '搜索按钮',
      initval: wrap.searchBtn || 'hidden',
      // tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ],
      forbid: appType === 'mob' || isprint,
    },
    {
      type: 'radio',
      field: 'shifting',
      label: '按钮偏移',
      initval: wrap.shifting || 'false',
@@ -669,7 +733,7 @@
          width: '20%'
        },
        {
          title: '菜单',
          title: '组件',
          dataIndex: 'nodes',
          inputType: 'cascader',
          editable: true,