king
2025-05-08 b6c698c8833836971184a0a9c2645a15f8174d37
src/menu/components/table/base-table/options.jsx
@@ -1,7 +1,7 @@
/**
 * @description Wrap表单配置信息
 */
export default function (wrap, action = [], columns = []) {
export default function (wrap, action = [], columns = [], toolBtns = []) {
  const wrapForm = [
    {
      type: 'radio',
@@ -16,6 +16,17 @@
      ],
      controlFields: [
        {field: 'selected', values: ['radio', 'checkbox']},
      ]
    },
    {
      type: 'radio',
      field: 'parity',
      label: '奇偶异色',
      initval: wrap.parity || 'false',
      required: false,
      options: [
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ]
    },
    {
@@ -36,8 +47,8 @@
      initval: wrap.actionfixed !== 'true' ? 'false' : 'true',
      required: false,
      options: [
        {value: 'true', label: '是'},
        {value: 'false', label: '否'},
        {value: 'true', label: '启用'},
        {value: 'false', label: '禁用'},
      ]
    },
    {
@@ -66,32 +77,17 @@
      ]
    },
    {
      type: 'select',
      field: 'selected',
      label: '数据选中',
      initval: wrap.selected || 'false',
      tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。注:启用无人值守时无效。',
      type: 'radio',
      field: 'searchSize',
      label: '搜索样式',
      initval: wrap.searchSize === 'middle' ? '' : wrap.searchSize || '',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'init', label: '初始化'},
        {value: 'always', label: '数据加载'},
        {value: 'sign', label: '选中标记'}
        {value: '', label: '默认'},
        {value: 'small', label: '小间距'},
        {value: 'updown', label: '上下排列'},
      ],
    },
    // {
    //   type: 'radio',
    //   field: 'selected',
    //   label: '首行选中',
    //   initval: wrap.selected || 'false',
    //   tooltip: '当按钮执行完成并返回主键值时,默认选中主键值对应行。',
    //   required: false,
    //   options: [
    //     {value: 'false', label: '无'},
    //     {value: 'init', label: '初始化'},
    //     {value: 'always', label: '数据加载'},
    //   ]
    // },
    {
      type: 'radio',
      field: 'tableMode',
@@ -138,23 +134,27 @@
      ]
    },
    {
      type: 'number',
      field: 'btnlimit',
      label: '按钮限制',
      initval: wrap.btnlimit || '',
      tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。',
      min: 3,
      max: 3000,
      precision: 0,
      required: false
      type: 'select',
      field: 'selected',
      label: '数据选中',
      initval: wrap.selected || 'false',
      tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。本地记录:数据刷新时上次被选中的行将自动选中。注:启用无人值守时无效。',
      required: false,
      options: [
        {value: 'false', label: '无'},
        {value: 'init', label: '初始化'},
        {value: 'always', label: '数据加载'},
        {value: 'sign', label: '选中标记'},
        {value: 'local', label: '本地记录'},
      ],
    },
    {
      type: 'number',
      field: 'height',
      label: '表格高度',
      label: '最大高度',
      initval: wrap.height || '',
      tooltip: '表格高度,空值时高度自适应。注:小于等于100时为高度的百分比。',
      min: 10,
      tooltip: '表格内容区的最大高度(不包含表头),空值时高度自适应。注:小于等于100大于0时为高度的百分比,小于0时为窗口高度减去此值。',
      min: -1000,
      max: 3000,
      precision: 0,
      required: false,
@@ -167,7 +167,16 @@
      tooltip: '双击表格中行,触发的按钮。',
      required: false,
      allowClear: true,
      options: action.map(item => ({value: item.uuid, label: item.label})),
      options: [...toolBtns, ...action].map(item => ({value: item.uuid, label: item.label})),
    },
    {
      type: 'select',
      field: 'autoExec',
      label: '自动执行',
      initval: wrap.autoExec || '',
      tooltip: '初始化自动执行按钮。',
      required: false,
      options: toolBtns.map(item => ({value: item.uuid, label: item.label}))
    },
    {
      type: 'select',
@@ -177,6 +186,7 @@
      tooltip: '鼠标悬浮于行上方时的提示信息。',
      required: false,
      allowClear: true,
      joint: true,
      options: columns
    },
    {
@@ -187,6 +197,7 @@
      tooltip: '用于控制行数据是否可选择。',
      required: false,
      allowClear: true,
      joint: true,
      options: columns,
      controlFields: [
        {field: 'controlVal', notNull: true},
@@ -201,6 +212,28 @@
      required: false
    },
    {
      type: 'number',
      field: 'btnlimit',
      label: '按钮限制',
      initval: wrap.btnlimit || '',
      tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。',
      min: 3,
      max: 3000,
      precision: 0,
      required: false
    },
    {
      type: 'number',
      field: 'maxPageSize',
      label: '每页最大数',
      initval: wrap.maxPageSize || '',
      tooltip: '分页时每页可显示的最大数量。',
      min: 10,
      max: 500,
      precision: 0,
      required: false
    },
    {
      type: 'radio',
      field: 'cacheSearch',
      label: '搜索缓存',