king
2024-03-21 a9b02f6862522b54d0824152017bf2acfec2af7b
src/menu/components/card/double-data-card/options.jsx
@@ -1,17 +1,12 @@
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, columns = [], setting) {
export default function (wrap, columns = [], setting, buttons = []) {
  let appType = sessionStorage.getItem('appType')
  // let MenuType = ''
  // let menu = window.GLOB.customMenu
  let laypage = setting && setting.laypage !== 'false'
  // if (menu.parentId === 'BillPrintTemp') {
  //   MenuType = 'billPrint'
  // }
  let roleList = sessionStorage.getItem('sysRoles')
  let isprint = sessionStorage.getItem('MenuType') === 'billPrint'
  let ispop = sessionStorage.getItem('editMenuType') === 'popview'
  if (roleList) {
    try {
@@ -65,22 +60,6 @@
      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: 'radio',
      field: 'pagestyle',
@@ -91,11 +70,12 @@
      disabled: !laypage,
      options: [
        {value: 'page', label: '页码'},
        {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || sessionStorage.getItem('editMenuType') === 'popview'},
        {value: 'slide', label: '滑动加载', forbid: appType !== 'mob' || ispop},
        {value: 'more', label: '查看更多'},
      ],
      controlFields: [
        {field: 'slidetip', values: ['slide']},
        {field: 'maxPageSize', values: ['page']},
      ],
    },
    {
@@ -112,6 +92,7 @@
      controlFields: [
        {field: 'selected', values: ['radio', 'checkbox']},
        {field: 'selStyle', values: ['radio', 'checkbox']},
        {field: 'pickup', values: ['radio', 'checkbox']},
      ],
    },
    {
@@ -132,39 +113,43 @@
      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: '禁用'},
      ],
    },
    // {
    //   type: 'number',
    //   field: 'printHeight',
    //   label: '换算高度',
    //   initval: wrap.printHeight || '',
    //   tooltip: '当前数据卡高度相当于几条数据。',
    //   required: false,
    //   forbid: MenuType !== 'billPrint'
    // },
    {
      type: 'radio',
      field: 'empty',
@@ -197,6 +182,15 @@
      initval: wrap.controlVal || '',
      tooltip: '当字段值与禁用值相等时,行数据会禁用,多个值用逗号分隔。',
      required: false
    },
    {
      type: 'select',
      field: 'autoExec',
      label: '自动执行',
      initval: wrap.autoExec || '',
      tooltip: '初始化自动执行按钮。',
      required: false,
      options: buttons
    },
    {
      type: 'number',
@@ -233,13 +227,63 @@
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
      initval: wrap.permission || (!appType ? 'true' : 'false'),
      required: false,
      options: [
        {value: 'true', label: !appType ? '继承菜单' : '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheLocal',
      label: '本地缓存',
      initval: wrap.cacheLocal || 'true',
      required: false,
      options: [
        {value: 'true', label: '继承菜单'},
        {value: 'false', label: '禁用'},
      ],
      forbid: ispop || isprint
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
      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',
@@ -248,7 +292,7 @@
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
      forbid: !!appType || isprint
    },
    {
      type: 'text',