king
2021-12-19 9ee3d1f9a09a865188baffdffb85f6ad329c7b09
src/mob/components/search/single-search/options.jsx
@@ -1,20 +1,7 @@
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, action = []) {
  let roleList = sessionStorage.getItem('sysRoles')
  let appType = sessionStorage.getItem('appType')
  if (roleList) {
    try {
      roleList = JSON.parse(roleList)
    } catch (e) {
      roleList = []
    }
  } else {
    roleList = []
  }
export default function (wrap) {
  const wrapForm = [
    {
      type: 'text',
@@ -54,34 +41,34 @@
      type: 'radio',
      field: 'show',
      label: '搜索样式',
      initval: wrap.show || 'button',
      initval: wrap.show || 'text',
      required: false,
      options: [
        {value: 'button', label: '搜索按钮'},
        {value: 'icon', label: '搜索图标'},
        {value: 'input', label: '输入框'},
        {value: 'text', label: '文字'},
        {value: 'icon', label: '图标'},
      ]
    },
    {
      type: 'radio',
      field: 'show',
      label: '搜索按钮',
      initval: wrap.show || 'true',
      field: 'scan',
      label: '扫码',
      initval: wrap.scan || 'hidden',
      required: false,
      options: [
        {value: 'true', label: '显示'},
        {value: 'false', label: '隐藏'},
        {value: 'hidden', label: '隐藏'},
        {value: 'show', label: '显示'},
      ]
    },
    {
      type: 'multiselect',
      field: 'blacklist',
      label: '黑名单',
      initval: wrap.blacklist || [],
      required: false,
      options: roleList,
      forbid: !!appType
    },
      type: 'number',
      field: 'borderRadius',
      label: '圆角',
      min: 0,
      max: 500,
      precision: 0,
      initval: wrap.borderRadius || 0,
      required: false
    }
  ]
  return wrapForm