king
2023-06-14 08cce3334a2dc81d690b518136b0aaea64e48b0b
src/menu/components/card/cardcomponent/options.jsx
@@ -40,6 +40,12 @@
  if (hasMenus) {
    ops = [{value: 'menus', label: '菜单组'}]
  }
  let adapters = sessionStorage.getItem('adapter') || ''
  if (adapters.indexOf('wxmini') > -1) {
    ops.push({value: 'miniprogram', label: '小程序'})
  } else if (setting.click === 'miniprogram') {
    setting.click = ''
  }
  const cardSettingForm = [
    {
@@ -55,6 +61,24 @@
    },
    {
      type: 'radio',
      field: 'cardRole',
      label: '卡片角色',
      initval: setting.cardRole || 'card',
      required: false,
      options: [
        {value: 'card', label: '属性卡'},
        {value: 'header', label: '表格头'},
      ],
      controlFields: [
        {field: 'type', values: ['card']},
        {field: 'click', values: ['card']},
        {field: 'btnControl', values: ['card']},
      ],
      del: true,
      forbid: cardType !== 'extendCard'
    },
    {
      type: 'radio',
      field: 'type',
      label: '卡片类型',
      initval: setting.type || 'simple',
@@ -67,7 +91,7 @@
      controlFields: [
        {field: 'transform', values: ['multi']},
      ],
      forbid: appType === 'mob'
      forbid: appType === 'mob' || subtype === 'dualdatacard'
    },
    {
      type: 'select',
@@ -85,7 +109,8 @@
        {value: 'opacity', label: '透明度'},
        {value: 'rotateX', label: '纵向展开'},
        {value: 'rotateY', label: '横向展开'},
      ]
      ],
      forbid: appType === 'mob' || subtype === 'dualdatacard'
    },
    {
      type: 'text',
@@ -97,11 +122,21 @@
      forbid: subtype !== 'propcard'
    },
    {
      type: !hasMenus ? 'radio' : 'select',
      type: 'select',
      field: 'bgField',
      label: '背景图',
      initval: setting.bgField || '',
      tooltip: '动态背景,背景图片由字段值控制。请注意调整背景样式。',
      required: false,
      options: columns,
      forbid: cardType === 'extendCard'
    },
    {
      type: ops.length === 0 ? 'radio' : 'select',
      field: 'click',
      label: '点击事件',
      initval: setting.click || '',
      tooltip: '当绑定点击事件时,卡片的切换功能将失效。',
      // tooltip: '当绑定点击事件时,卡片的切换功能将失效。',
      required: false,
      options: [
        {value: '', label: '无'},
@@ -114,11 +149,13 @@
        {field: 'menu', values: ['menu']},
        {field: 'linkurl', values: ['link']},
        {field: 'open', values: ['menu', 'link', 'menus']},
        {field: 'joint', values: ['menu', 'link', 'menus']},
        {field: 'joint', values: ['menu', 'link', 'menus', 'miniprogram']},
        {field: 'linkbtn', values: ['button']},
        {field: 'clickType', values: ['button']},
        {field: 'menuType', values: ['menus']},
        {field: 'menus', values: ['menus']},
        {field: 'miniAppId', values: ['miniprogram']},
        {field: 'miniPath', values: ['miniprogram']},
      ]
    },
    {
@@ -148,16 +185,31 @@
      span: 24
    },
    {
      type: 'text',
      field: 'miniAppId',
      label: '小程序AppID',
      initval: setting.miniAppId || '',
      required: true
    },
    {
      type: 'text',
      field: 'miniPath',
      label: '页面路径',
      initval: setting.miniPath || '',
      tooltip: '可指定跳转小程序页面,为空时打开首页,注:参数拼接在指定页面时有效。',
      required: false
    },
    {
      type: 'radio',
      field: 'open',
      label: '打开方式',
      initval: setting.open || 'blank',
      required: false,
      options: [
        {value: 'blank', label: '新窗口'},
        {value: 'self', label: '当前窗口'},
        {value: 'blank', label: appType !== 'mob' ? '新窗口' : '新页面'},
        {value: 'self', label: appType !== 'mob' ? '当前窗口' : '当前页面'},
      ],
      forbid: appType !== 'pc'
      forbid: appType !== 'pc' && appType !== 'mob'
    },
    {
      type: 'radio',
@@ -177,6 +229,17 @@
      initval: setting.linkbtn || '',
      required: true,
      options: buttons
    },
    {
      type: 'radio',
      field: 'layout',
      label: '元素布局',
      initval: setting.layout || 'grid',
      required: false,
      options: [
        {value: 'grid', label: '栅格布局'},
        {value: 'flex', label: '弹性布局'},
      ]
    },
    {
      type: 'radio',
@@ -204,6 +267,19 @@
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      field: 'checkAll',
      label: '全选',
      initval: setting.checkAll || 'hidden',
      tooltip: '全选仅在数据卡可多选,且选中风格为勾选框时有效。',
      required: false,
      options: [
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ],
      forbid: cardType !== 'extendCard'
    },
    {
      type: 'table',
      field: 'menus',
      label: '菜单组',
@@ -219,7 +295,7 @@
          editable: true,
          unique: true,
          required: false,
          width: '35%'
          width: '30%'
        },
        {
          title: '菜单',
@@ -228,7 +304,7 @@
          editable: true,
          required: true,
          extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}],
          width: '35%',
          width: '40%',
          render: (text, record) => record.label,
          options: menulist
        }