king
2024-08-15 cb59703536b8fe29117ea1de415361395f4820e6
src/menu/components/carousel/data-card/options.jsx
@@ -4,6 +4,7 @@
export default function (wrap, subtype) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
  if (roleList) {
    try {
@@ -16,6 +17,13 @@
  }
  const cardWrapForm = [
    {
      type: 'text',
      field: 'title',
      label: '标题',
      initval: wrap.title || '',
      required: false
    },
    {
      type: 'text',
      field: 'name',
@@ -46,10 +54,67 @@
        {value: 'dynamic', label: '动态'},
        {value: 'static', label: '静态'},
      ],
      controlFields: [
      controlFields: subtype === 'propcard' ? [
        {field: 'empty', values: ['dynamic']},
      ],
      ] : null,
      forbid: subtype !== 'propcard'
    },
    {
      type: 'radio',
      field: 'display',
      label: '显示模式',
      initval: wrap.display || 'normal',
      required: false,
      options: [
        {value: 'normal', label: '正常'},
        {value: 'modal', label: '弹窗'},
      ],
      controlFields: [
        {field: 'modalWidth', values: ['modal']},
        {field: 'modalContent', values: ['modal']},
        {field: 'code', values: ['modal']},
      ]
    },
    {
      type: 'radio',
      field: 'modalContent',
      label: '弹窗内容',
      initval: wrap.modalContent || 'message',
      tooltip: '使用系统更新时,如果返回值的ErrCode为-1,只会做系统配置更新不会显示弹窗。注:数据源使用同步查询时无效。',
      required: false,
      options: [
        {value: 'message', label: '消息提醒'},
        {value: 'update', label: '系统更新'},
      ]
    },
    {
      type: 'styleInput',
      field: 'height',
      label: '组件高度',
      initval: wrap.height || '',
      required: true,
      options: ['px', 'vh']
    },
    {
      type: 'styleInput',
      field: 'modalWidth',
      label: '弹窗宽度',
      initval: wrap.modalWidth || '300px',
      required: true,
      options: ['px', 'vw'],
      forbid: appType === 'mob'
    },
    {
      type: 'text',
      field: 'code',
      label: '消息编码',
      initval: wrap.code || '',
      tooltip: '用于记录消息是否已读的标识,如果不同页面中存在相同消息,可指定固定值。',
      required: false,
      rules: [{
        pattern: /^[0-9a-zA-Z_]*$/ig,
        message: '只允许包含数字、字母以及_。'
      }]
    },
    {
      type: 'radio',
@@ -59,7 +124,10 @@
      required: false,
      options: [
        {value: 'false', label: '否'},
        {value: 'true', label: '是'},
        {value: 'true', label: '是'}
      ],
      controlFields: [
        {field: 'speed', values: ['true']}
      ]
    },
    {
@@ -67,7 +135,7 @@
      field: 'speed',
      label: '时间间隔',
      initval: wrap.speed || 3,
      tooltip: '使用自动切换时有效,默认为3秒',
      tooltip: '默认为3秒',
      min: 1,
      max: 100,
      precision: 0,
@@ -129,13 +197,36 @@
      initval: wrap.empty || 'show',
      tooltip: '当查询数据为空时,隐藏该组件。',
      required: false,
      skip: true,
      options: [
        {value: 'show', label: '否'},
        {value: 'hidden', label: '是'},
      ],
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: ispop
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: ispop
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',