king
2021-12-18 b223552a0c4bc787ad251add025a93d77527ffbe
src/mob/components/tabs/antv-tabs/options.jsx
@@ -1,7 +1,7 @@
/**
 * @description Wrap表单配置信息
 */
export default function (tab, setting) {
export function getTabForm(tab, setting) {
  let appType = sessionStorage.getItem('appType')
  let roleList = sessionStorage.getItem('sysRoles')
@@ -34,19 +34,19 @@
      allowClear: true,
      span: 22
    },
    {
      type: 'radio',
      field: 'hasSearch',
      label: '搜索',
      initval: tab.hasSearch || 'false',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'icon', label: '有'},
      ],
      forbid: appType !== 'mob' || setting.position !== 'top' || setting.display !== 'inline-block',
      span: 22
    },
    // {
    //   type: 'radio',
    //   field: 'hasSearch',
    //   label: '搜索',
    //   initval: tab.hasSearch || 'false',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'icon', label: '有'},
    //   ],
    //   forbid: appType !== 'mob' || setting.display !== 'inline-block',
    //   span: 22
    // },
    {
      type: 'multiselect',
      field: 'blacklist',
@@ -60,4 +60,60 @@
  ]
  return tabForm
}
}
/**
 * @description tabs表单配置信息
 */
export function getTabsSetForm(setting) {
  const tabForm = [
    {
      type: 'text',
      field: 'name',
      label: '组件名称',
      initval: setting.name || '',
      tooltip: '用于组件间的区分。',
      required: true
    },
    {
      type: 'number',
      field: 'width',
      label: '宽度',
      initval: setting.width || 24,
      tooltip: '栅格布局,每行等分为24列。',
      min: 1,
      max: 24,
      precision: 0,
      required: true
    },
    // {
    //   type: 'select',
    //   field: 'position',
    //   label: '标签位置',
    //   initval: setting.position || 'top',
    //   required: true,
    //   options: [
    //     {value: 'top', label: 'top'},
    //     {value: 'bottom', label: 'bottom'},
    //     {value: 'left', label: 'left'},
    //     {value: 'right', label: 'right'},
    //   ],
    //   controlFields: [
    //     {field: 'display', values: ['top', 'bottom']},
    //   ]
    // },
    {
      type: 'radio',
      field: 'display',
      label: '标签显示',
      initval: setting.display || 'flex',
      required: false,
      options: [
        {value: 'flex', label: '弹性布局'},
        {value: 'inline-block', label: '定宽'},
      ],
    }
  ]
  return tabForm
}