king
2024-05-16 b69b5f6329ca5f87932436b7a6c1ddfc3377e10f
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',
@@ -106,6 +174,7 @@
        {field: 'broadcast', values: ['dynamic', 'public']},
        {field: 'supModule', values: ['static']},
        {field: 'publicId', values: ['public']},
        {field: 'emptyExec', values: ['dynamic', 'public']},
      ],
      forbid: subtype !== 'propcard'
    },
@@ -186,6 +255,7 @@
      ],
      controlFields: [
        {field: 'slidetip', values: ['slide']},
        {field: 'maxPageSize', values: ['page']},
      ],
      forbid: subtype === 'propcard'
    },
@@ -204,7 +274,7 @@
        {field: 'checkAll', values: ['checkbox']},
        {field: 'selected', values: ['radio', 'checkbox']},
        {field: 'selStyle', values: ['radio', 'checkbox']},
        // {field: 'priKeyType', values: ['radio', 'checkbox']},
        {field: 'pickup', values: ['radio', 'checkbox']},
      ],
      forbid: subtype === 'tablecard'
    },
@@ -266,7 +336,8 @@
      options: [
        {value: 'none', label: '无'},
        {value: 'active', label: '外阴影'},
        {value: 'backFont', label: '背景+文字'},
        {value: 'backFont', label: '背景(浅)+文字(深)'},
        {value: 'deepBackFont', label: '背景(深)+文字(浅)'},
        {value: 'font', label: '文字'},
        {value: 'tabs', label: '标签页'},
        ...(subtype === 'datacard' ? [
@@ -292,29 +363,38 @@
    },
    {
      type: 'radio',
      field: 'scale',
      label: '放大效果',
      initval: wrap.scale || 'false',
      tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。',
      field: 'pickup',
      label: '收起开关',
      initval: wrap.pickup || 'false',
      tooltip: '数据卡右上角会显示收起开关。',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      forbid: subtype === 'tablecard' || appType === 'mob'
      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: 'parity',
      label: '奇偶背景',
      initval: wrap.parity || 'false',
      tooltip: '偶数行会添加背景色。',
      type: 'checkbox',
      field: 'interaction',
      label: '交互效果',
      initval: interaction,
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
      ],
      forbid: subtype === 'propcard'
      options: interOptions,
      forbid: interOptions.length === 0
    },
    {
      type: 'radio',
@@ -398,10 +478,26 @@
      field: 'autoExec',
      label: '自动执行',
      initval: wrap.autoExec || '',
      tooltip: '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。',
      tooltip: subtype === 'propcard' ? '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。' : '初始化自动执行按钮。',
      required: false,
      options: buttons,
      forbid: subtype !== 'propcard'
      forbid: subtype !== 'propcard' && subtype !== 'datacard',
      controlFields: [
        {field: 'emptyExec', notNull: true},
      ]
    },
    {
      type: 'radio',
      field: 'emptyExec',
      label: '空值执行',
      initval: wrap.emptyExec || 'true',
      tooltip: '当查询数据为空时,自动执行按钮是否执行。',
      required: false,
      forbid: subtype !== 'propcard',
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
      ],
    },
    {
      type: 'radio',
@@ -417,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']},
@@ -451,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'
    },
    {
@@ -577,6 +660,44 @@
      forbid: !!appType || isprint
    },
    {
      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',
      tooltip: '启用时,工具栏按钮将显示在标题栏右上角。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || subtype !== 'datacard' || isprint
    },
    {
      type: 'number',
      field: 'maxPageSize',
      label: '每页最大数',
      initval: wrap.maxPageSize || '',
      tooltip: '分页时每页可显示的最大数量。',
      min: 10,
      max: 500,
      precision: 0,
      required: false,
      forbid: !laypage || appType === 'mob' || subtype !== 'datacard'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
@@ -602,6 +723,7 @@
      required: true,
      forbid: subtype !== 'datacard' || appType === 'mob' || isprint,
      span: 24,
      actions: ['edit', 'del', 'add', 'move'],
      columns: [
        {
          title: '序号',
@@ -611,7 +733,7 @@
          width: '20%'
        },
        {
          title: '菜单',
          title: '组件',
          dataIndex: 'nodes',
          inputType: 'cascader',
          editable: true,