@yidun/antd-super-table 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -214,21 +214,23 @@ SuperTable: sceneStorageType 为 "api" 时,必须提供 sceneRequest 配置
214
214
 
215
215
  ### 查询条件属性
216
216
 
217
- | 属性名 | 类型 | 默认值 | 说明 |
218
- | ------------- | --------- | ------- | ----------------------------------- |
219
- | type | string | - | 查询条件类型 |
220
- | name | string | - | 字段名称 |
221
- | label | string | - | 显示标签 |
222
- | value | any | - | 默认值 |
223
- | props | object | {} | 传递给组件的属性 |
224
- | component | Component | - | 自定义组件(type为component时必填) |
225
- | modelPropName | string | 'value' | 自定义组件的v-model属性名 |
226
- | span | number | 1 | 列宽系数 |
227
- | visible | boolean | true | 是否显示 |
228
- | fixed | boolean | false | 是否固定(不可删除) |
229
- | selected | boolean | false | 是否默认选中 |
230
- | quiet | boolean | false | 是否静默更新(不触发搜索) |
231
- | showLabel | boolean | true | 是否显示标签 |
217
+ | 属性名 | 类型 | 默认值 | 说明 |
218
+ | ------------- | ------------- | ------- | ----------------------------------------------------------------- |
219
+ | type | string | - | 查询条件类型 |
220
+ | name | string | - | 字段名称 |
221
+ | label | string | - | 显示标签 |
222
+ | value | any | - | 默认值 |
223
+ | props | object | {} | 传递给组件的属性 |
224
+ | component | Component | - | 自定义组件(type为component时必填) |
225
+ | modelPropName | string | 'value' | 自定义组件的v-model属性名 |
226
+ | span | number | 1 | 列宽系数 |
227
+ | visible | boolean | true | 是否显示 |
228
+ | fixed | boolean | false | 是否固定(不可删除) |
229
+ | selected | boolean | false | 是否默认选中 |
230
+ | quiet | boolean | false | 是否静默更新(不触发搜索) |
231
+ | showLabel | boolean | true | 是否显示标签 |
232
+ | tooltip | string/number | - | 查询项提示信息,展示为标签旁 icon 的 tooltip(默认 top) |
233
+ | addonAfter | object | - | 仅 `input` 生效,后置 `link/small` 按钮配置(文案/样式/点击事件) |
232
234
 
233
235
  ### 完整示例
234
236
 
@@ -243,7 +245,15 @@ export const createFormItems = () => {
243
245
  type: 'input', // 类型
244
246
  label: '输入框',
245
247
  name: 'input', // 字段名称
248
+ tooltip: '按关键词过滤',
246
249
  fixed: true,
250
+ addonAfter: {
251
+ text: '查询帮助',
252
+ className: 'my-addon-after-btn',
253
+ onClick: ({ name, value }) => {
254
+ console.log('[super-table] addonAfter click:', { name, value })
255
+ },
256
+ },
247
257
  },
248
258
  {
249
259
  key: 'inputGroup',
@@ -284,6 +294,7 @@ export const createFormItems = () => {
284
294
  type: 'inputNumber',
285
295
  label: '数字输入框',
286
296
  name: 'inputNumber',
297
+ tooltip: 1001,
287
298
  fixed: true,
288
299
  },
289
300
  {
@@ -814,6 +825,9 @@ export interface SuperTableFormItem {
814
825
  /** 查询项label */
815
826
  label: string
816
827
 
828
+ /** 查询项提示信息,展示在标签旁的 tooltip 中 */
829
+ tooltip?: string | number
830
+
817
831
  /** 传递给查询详的props */
818
832
  props?: Record<string, any>
819
833
 
@@ -832,6 +846,20 @@ export interface SuperTableFormItem {
832
846
  /** 带select前缀的组合输入框配置 */
833
847
  addonBeforeProps?: SelectProps
834
848
 
849
+ /** input 的后置附加按钮配置 */
850
+ addonAfter?: {
851
+ /** 按钮文案 */
852
+ text?: string
853
+ /** 按钮自定义 class */
854
+ className?: string
855
+ /** 是否显示,默认 true */
856
+ show?: boolean
857
+ /** 是否禁用 */
858
+ disabled?: boolean
859
+ /** 点击回调 */
860
+ onClick?: (context: { name: string; value: any; formItem: SuperTableFormItem }) => void
861
+ }
862
+
835
863
  /** 改变时保持静默,不要触发搜索*/
836
864
  quiet?: boolean
837
865
 
@@ -1007,6 +1035,8 @@ export interface SuperTableAntdProps extends TableProps {
1007
1035
  - ✨ 新增列级自定义单元格插槽能力:支持在列配置中通过 `slotName` 指定外层具名插槽渲染
1008
1036
  - 🔁 渲染优先级优化:命中 `slotName` 时优先插槽渲染,未命中时继续使用原有 `type/component` 渲染
1009
1037
  - 🎨 样式优化:自定义插槽单元格新增容器,并默认 `white-space: normal` 以支持多行内容展示
1038
+ - ✨ 查询条件新增 `tooltip`(`string | number`)能力:主页面与场景弹窗均支持 icon 悬浮提示(默认 top)
1039
+ - 🎯 场景弹窗 tooltip 区域宽度统一预留:无 tooltip 时不展示 icon,但保留占位,避免布局抖动
1010
1040
  - 🧩 示例补充:新增 `slotName` 列配置与多行列表插槽示例(含 badge/button/tag 等非纯文本元素)
1011
1041
  - 📝 详细变更记录见 [CHANGELOG.md](./CHANGELOG.md)
1012
1042