@yidun/antd-super-table 0.1.10 → 0.1.12

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.
@@ -47,6 +47,36 @@ export type SuperTableSceneStorageType = 'local' | 'api'
47
47
  */
48
48
  export type SuperTableDataItem = Record<string, any>
49
49
 
50
+ /**
51
+ * 查询项 input addonAfter 点击回调参数
52
+ * @public
53
+ */
54
+ export interface SuperTableFormItemAddonAfterContext {
55
+ /** 查询项名称 */
56
+ name: string
57
+ /** 当前值 */
58
+ value: any
59
+ /** 当前查询项配置 */
60
+ formItem: SuperTableFormItem
61
+ }
62
+
63
+ /**
64
+ * 查询项 input addonAfter 配置
65
+ * @public
66
+ */
67
+ export interface SuperTableFormItemAddonAfter {
68
+ /** 按钮文案 */
69
+ text?: string
70
+ /** 按钮自定义 class */
71
+ className?: string
72
+ /** 是否显示 */
73
+ show?: boolean
74
+ /** 是否禁用 */
75
+ disabled?: boolean
76
+ /** 点击回调 */
77
+ onClick?: (context: SuperTableFormItemAddonAfterContext) => void
78
+ }
79
+
50
80
  /**
51
81
  * 查询条件配置接口
52
82
  * @public
@@ -64,6 +94,9 @@ export interface SuperTableFormItem {
64
94
  /** 查询项标签 */
65
95
  label: string
66
96
 
97
+ /** 查询项提示信息,展示在标签旁的 tooltip 中 */
98
+ tooltip?: string | number
99
+
67
100
  /** 传递给查询项的props */
68
101
  props?: Record<string, any>
69
102
 
@@ -82,6 +115,15 @@ export interface SuperTableFormItem {
82
115
  /** 带select前缀的组合输入框配置 */
83
116
  addonBeforeProps?: SelectProps
84
117
 
118
+ /** input 的后置附加按钮配置 */
119
+ addonAfter?: SuperTableFormItemAddonAfter
120
+
121
+ /** addonAfter 兼容错拼字段(不推荐) */
122
+ addonAffter?: SuperTableFormItemAddonAfter
123
+
124
+ /** addonAfter 兼容错拼字段(不推荐) */
125
+ addonAter?: SuperTableFormItemAddonAfter
126
+
85
127
  /** 改变时保持静默,不要触发搜索 */
86
128
  quiet?: boolean
87
129
 
@@ -19,10 +19,14 @@ export declare const initFormItems: (formItems: SuperTableFormItem[]) => {
19
19
  name: string;
20
20
  modelPropName?: string;
21
21
  label: string;
22
+ tooltip?: string | number;
22
23
  value?: any;
23
24
  component?: import("vue").Component;
24
25
  span?: number;
25
26
  addonBeforeProps?: import("ant-design-vue").SelectProps;
27
+ addonAfter?: import("..").SuperTableFormItemAddonAfter;
28
+ addonAffter?: import("..").SuperTableFormItemAddonAfter;
29
+ addonAter?: import("..").SuperTableFormItemAddonAfter;
26
30
  quiet?: boolean;
27
31
  showLabel?: boolean;
28
32
  fixed?: boolean;
@@ -8,7 +8,15 @@ export const createFormItems = () => {
8
8
  type: 'input', // 类型
9
9
  label: '输入框',
10
10
  name: 'input', // 字段名称
11
+ tooltip: '按关键词过滤',
11
12
  fixed: true,
13
+ addonAfter: {
14
+ text: '查询帮助',
15
+ className: 'super-table-addon-after-btn',
16
+ onClick: ({ name, value }) => {
17
+ console.log('[super-table] addonAfter click:', { name, value })
18
+ },
19
+ },
12
20
  },
13
21
  {
14
22
  key: 'inputGroup',
@@ -49,6 +57,7 @@ export const createFormItems = () => {
49
57
  type: 'inputNumber',
50
58
  label: '数字输入框',
51
59
  name: 'inputNumber',
60
+ tooltip: 1001,
52
61
  fixed: true,
53
62
  },
54
63
  {
@@ -102,7 +111,7 @@ export const createFormItems = () => {
102
111
  { label: 'Last Week', value: dayjs().add(-7, 'd') },
103
112
  { label: 'Last Month', value: dayjs().add(-1, 'month') },
104
113
  ],
105
- }
114
+ },
106
115
  },
107
116
  {
108
117
  key: 'rangePicker',
package/example/index.vue CHANGED
@@ -45,6 +45,8 @@ const tableColumns: any = createTableColumns({
45
45
 
46
46
  const setting = useLocalStorage('super-table-example-config', {
47
47
  enableScene: true,
48
+ enableAdvancedFilter: false,
49
+ autoSearch: true,
48
50
  enableTableConfig: false,
49
51
  sortable: false,
50
52
  showRefreshButton: false,
@@ -280,6 +282,22 @@ onMounted(() => {
280
282
  un-checked-children="关闭"
281
283
  />
282
284
  </a-form-item>
285
+ <a-form-item label="高级筛选">
286
+ <a-switch
287
+ v-model:checked="setting.enableAdvancedFilter"
288
+ :disabled="setting.enableScene"
289
+ checked-children="开启"
290
+ un-checked-children="关闭"
291
+ />
292
+ </a-form-item>
293
+ <a-form-item label="自动查询">
294
+ <a-switch
295
+ v-model:checked="setting.autoSearch"
296
+ :disabled="setting.enableScene"
297
+ checked-children="开启"
298
+ un-checked-children="关闭"
299
+ />
300
+ </a-form-item>
283
301
  <a-form-item label="排序">
284
302
  <a-switch
285
303
  v-model:checked="setting.sortable"
@@ -394,6 +412,8 @@ onMounted(() => {
394
412
  :sortable="setting.sortable"
395
413
  :enable-table-config="setting.enableTableConfig"
396
414
  :enable-scene="setting.enableScene"
415
+ :enable-advanced-filter="setting.enableAdvancedFilter"
416
+ :auto-search="setting.autoSearch"
397
417
  :show-refresh-button="setting.showRefreshButton"
398
418
  :show-expand-button="setting.showExpandButton"
399
419
  :form-item-col-span="setting.formItemColSpan"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yidun/antd-super-table",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",