king
2025-05-08 b6c698c8833836971184a0a9c2645a15f8174d37
src/menu/components/search/main-search/options.jsx
@@ -1,7 +1,8 @@
import MenuUtils from '@/utils/utils-custom.js'
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, action = []) {
export default function (wrap, uuid) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
@@ -14,6 +15,9 @@
  } else {
    roleList = []
  }
  let menu = window.GLOB.customMenu
  let modules = MenuUtils.getSupModules(menu.components, uuid, menu.interfaces)
  const wrapForm = [
    {
@@ -36,22 +40,72 @@
      required: true
    },
    {
      type: 'radio',
      field: 'advanceType',
      label: '高级搜索',
      initval: wrap.advanceType || 'modal',
      required: false,
      options: [
        {value: 'modal', label: '弹窗'},
        {value: 'drawer', label: '抽屉'},
        {value: 'pulldown', label: '下拉'}
      ],
      controlFields: [
        {field: 'advanceWidth', values: ['modal', 'drawer']},
        {field: 'drawerPlacement', values: ['drawer']}
      ]
    },
    {
      type: 'radio',
      field: 'drawerPlacement',
      label: '弹出方向',
      initval: wrap.drawerPlacement || 'right',
      required: false,
      options: [
        {value: 'right', label: '右侧'},
        {value: 'left', label: '左侧'},
        {value: 'top', label: '上侧'},
        {value: 'bottom', label: '下侧'}
      ]
    },
    {
      type: 'number',
      field: 'advanceWidth',
      label: '高级搜索',
      label: '弹窗宽度',
      initval: wrap.advanceWidth || 1000,
      tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。',
      tooltip: '高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。当使用上下显示的抽屉时代表抽屉高度。',
      min: 10,
      max: 3000,
      precision: 0,
      required: false
    },
    {
      type: 'number',
      field: 'searchRatio',
      label: '按钮比例',
      initval: wrap.searchRatio || 6,
      tooltip: '搜索及重置按钮所占比例。栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    {
      type: 'number',
      field: 'searchLwidth',
      label: '按钮偏移',
      initval: wrap.searchLwidth !== undefined ? wrap.searchLwidth : 33.3,
      tooltip: '搜索按钮距左侧的百分比,参照搜索条件的名称宽度。',
      min: 0,
      max: 100,
      precision: 1,
      required: true
    },
    {
      type: 'radio',
      field: 'float',
      label: '对齐',
      initval: wrap.float || 'left',
      tooltip: '右对齐时,隐藏搜索按钮。',
      required: false,
      options: [
        {value: 'left', label: '左对齐'},
@@ -67,9 +121,81 @@
      options: [
        {value: 'true', label: '显示'},
        {value: 'false', label: '隐藏'},
      ],
      controlFields: [
        {field: 'borderRadius', values: ['true']},
        {field: 'resetContrl', values: ['true']}
      ]
    },
    {
      type: 'number',
      field: 'borderRadius',
      label: '按钮圆角',
      initval: wrap.borderRadius || '',
      tooltip: '搜索和重置按钮的圆角。',
      required: false
    },
    {
      type: 'radio',
      field: 'resetContrl',
      label: '重置时',
      initval: wrap.resetContrl || 'init',
      tooltip: '刷新菜单会清空URL变量。',
      required: false,
      options: [
        {value: 'init', label: '恢复初始值'},
        {value: 'clear', label: '清空'},
        {value: 'refresh', label: '刷新菜单'},
      ],
    },
    {
      type: 'radio',
      field: 'permission',
      label: '权限验证',
      initval: wrap.permission || 'false',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'radio',
      field: 'searchSize',
      label: '搜索样式',
      initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '',
      required: false,
      options: [
        {value: '', label: '默认'},
        {value: 'small', label: '小间距'},
        {value: 'updown', label: '上下排列'},
      ],
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',
      initval: wrap.cacheSearch || 'false',
      tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ],
      forbid: !!appType
    },
    {
      type: 'cascader',
      field: 'supModule',
      label: '上级组件',
      initval: wrap.supModule || [],
      required: false,
      allowClear: true,
      options: modules,
      forbid: sessionStorage.getItem('editMenuType') === 'popview'
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',