king
2024-06-07 8040a18c4b2a848d252bf01838f06c7aec1be9f3
src/menu/components/card/double-data-card/options.jsx
@@ -1,7 +1,7 @@
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, columns = [], setting) {
export default function (wrap, columns = [], setting, buttons = []) {
  let appType = sessionStorage.getItem('appType')
  let laypage = setting && setting.laypage !== 'false'
  let roleList = sessionStorage.getItem('sysRoles')
@@ -60,22 +60,18 @@
      precision: 0,
      required: true
    },
    // {
    //   type: 'radio',
    //   field: 'layout',
    //   label: '卡片布局',
    //   initval: wrap.layout || 'grid',
    //   tooltip: appType === 'mob' ? '弹性布局时,滑动加载无效' : '',
    //   required: false,
    //   options: [
    //     {value: 'grid', label: '栅格布局'},
    //     {value: 'flex', label: '弹性布局'},
    //   ],
    //   controlFields: [
    //     {field: 'printHeight', values: ['flex']},
    //     {field: 'cardFloat', values: ['grid']},
    //   ]
    // },
    {
      type: 'number',
      field: 'zHeight',
      label: '最大高度',
      initval: wrap.zHeight || '',
      tooltip: '卡片内容区的最大高度(不包含标题、翻页等元素),添加高度后组件中第一个属性卡将固定于头部。注:小于等于100大于0时为高度的百分比,小于0时为窗口高度减去此值。',
      min: -1000,
      max: 3000,
      precision: 0,
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      field: 'pagestyle',
@@ -91,6 +87,7 @@
      ],
      controlFields: [
        {field: 'slidetip', values: ['slide']},
        {field: 'maxPageSize', values: ['page']},
      ],
    },
    {
@@ -107,6 +104,7 @@
      controlFields: [
        {field: 'selected', values: ['radio', 'checkbox']},
        {field: 'selStyle', values: ['radio', 'checkbox']},
        {field: 'pickup', values: ['radio', 'checkbox']},
      ],
    },
    {
@@ -127,28 +125,41 @@
      type: 'select',
      field: 'selStyle',
      label: '选中风格',
      initval: wrap.selStyle || 'active',
      tooltip: '存在边框时,边框会使用系统色。',
      initval: wrap.selStyle || 'check',
      // tooltip: '存在边框时,边框会使用系统色。',
      required: false,
      options: [
        {value: 'none', label: '无'},
        {value: 'active', label: '外阴影'},
        {value: 'backFont', label: '背景+文字'},
        {value: 'font', label: '文字'},
        // {value: 'active', label: '外阴影'},
        // {value: 'backFont', label: '背景+文字'},
        // {value: 'font', label: '文字'},
        {value: 'check', label: '勾选(圆框)'},
        {value: 'check square', label: '勾选(方框)'}
      ]
    },
    {
      type: 'radio',
      field: 'parity',
      label: '奇偶背景',
      initval: wrap.parity || 'false',
      tooltip: '偶数行会添加背景色。',
      field: 'pickup',
      label: '收起开关',
      initval: wrap.pickup || 'false',
      tooltip: '数据卡右上角会显示收起开关。',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'true', label: '有'},
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: appType === 'mob'
    },
    {
      type: 'radio',
      field: 'parity',
      label: '奇偶异色',
      initval: wrap.parity || 'false',
      tooltip: '子表偶数行会添加背景色。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
    },
    {
@@ -171,6 +182,7 @@
      tooltip: '用于控制行数据是否可选择。',
      required: false,
      allowClear: true,
      joint: true,
      options: columns,
      controlFields: [
        {field: 'controlVal', notNull: true},
@@ -185,6 +197,15 @@
      required: false
    },
    {
      type: 'select',
      field: 'autoExec',
      label: '自动执行',
      initval: wrap.autoExec || '',
      tooltip: '初始化自动执行按钮。',
      required: false,
      options: buttons
    },
    {
      type: 'number',
      field: 'minWidth',
      label: '最小宽度',
@@ -195,26 +216,14 @@
      tooltip: '设置卡片区域的最小宽度,显示区域小于此值将出现横向滚动。',
      required: false
    },
    {
      type: 'number',
      field: 'zHeight',
      label: '高度',
      min: 10,
      max: 5000,
      precision: 0,
      initval: wrap.zHeight,
      tooltip: '卡片区域高度,内容超出时纵向滚动。注:小于等于100时为高度的百分比,第一个扩展属性卡将定位在顶部。',
      required: false,
      forbid: appType === 'mob'
    },
    {
      type: 'color',
      field: 'zBColor',
      label: '边框颜色',
      initval: wrap.zBColor || 'transparent',
      tooltip: '卡片区域设置高度或最小宽度时,滚动区域边框的颜色。',
      required: false
    },
    // {
    //   type: 'color',
    //   field: 'zBColor',
    //   label: '边框颜色',
    //   initval: wrap.zBColor || 'transparent',
    //   tooltip: '卡片区域设置高度或最小宽度时,滚动区域边框的颜色。',
    //   required: false
    // },
    {
      type: 'radio',
      field: 'permission',
@@ -240,6 +249,44 @@
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'radio',
      field: 'shifting',
      label: '按钮偏移',
      initval: wrap.shifting || 'false',
      tooltip: '启用时,工具栏按钮将显示在标题栏右上角。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType || isprint
    },
    {
      type: 'number',
      field: 'maxPageSize',
      label: '每页最大数',
      initval: wrap.maxPageSize || '',
      tooltip: '分页时每页可显示的最大数量。',
      min: 10,
      max: 500,
      precision: 0,
      required: false,
      forbid: !laypage || appType === 'mob'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',