@vue-ui-kit/ant 2.1.1 → 2.1.3

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.
@@ -25,6 +25,7 @@ declare const _default: <D extends Recordable = Recordable, F extends Recordable
25
25
  reload: () => void;
26
26
  reloadPage: () => Promise<D[]>;
27
27
  passQuery: (params: Partial<F>, lazy?: boolean) => any;
28
+ forcePassQuery: (params: Partial<F>, lazy?: boolean) => any;
28
29
  };
29
30
  $canvasTable: import('vue').ComputedRef<PCanvasTableInstance<D> | undefined>;
30
31
  selectedRowKeys: import('vue').ComputedRef<(string | number)[]>;
@@ -26,6 +26,7 @@ declare const _default: <D extends Recordable = Recordable, F extends Recordable
26
26
  reload: () => void;
27
27
  reloadPage: () => Promise<D[]>;
28
28
  passQuery: (params: Partial<F>, lazy?: boolean) => any;
29
+ forcePassQuery: (params: Partial<F>, lazy?: boolean) => any;
29
30
  };
30
31
  $table: import('vue').ComputedRef<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
31
32
  prefixCls: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-ui-kit/ant",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Vue3 UI Kit based on Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -166,7 +166,7 @@ export interface ToolbarConfig {
166
166
  buttons?: Array<ToolbarButtonProps>;
167
167
  tools?: Array<{
168
168
  code: string;
169
- icon: string;
169
+ icon?: string;
170
170
  type?: ButtonType;
171
171
  content?: string;
172
172
  disabled?: boolean;
@@ -371,6 +371,7 @@ export interface PGridInstance<
371
371
  reload: () => Promise<D[]>;
372
372
  reloadPage: () => Promise<D[]>;
373
373
  passQuery: (query: Partial<F>, lazy?: boolean) => Promise<void | D[]>;
374
+ forcePassQuery: (query: Partial<F>, lazy?: boolean) => Promise<void | D[]>;
374
375
  };
375
376
  selectedRowKeys: string[] | number[];
376
377
  selectedRecords: D[];
@@ -276,6 +276,11 @@
276
276
  pagination.page = 1;
277
277
  return lazy ? Promise.resolve() : debounceFetchData();
278
278
  };
279
+ const forcePassQuery = (params: Partial<F>, lazy?: boolean) => {
280
+ queryFormData.value = params;
281
+ pagination.page = 1;
282
+ return lazy ? Promise.resolve() : debounceFetchData();
283
+ };
279
284
  const innerToolbarHandler = (code: string) => {
280
285
  const { ajax } = proxyConfig.value!;
281
286
  switch (code) {
@@ -424,6 +429,7 @@
424
429
  reload,
425
430
  reloadPage: resetPage,
426
431
  passQuery,
432
+ forcePassQuery,
427
433
  },
428
434
  $canvasTable: computed(() => canvasTableRef.value),
429
435
  selectedRowKeys,
@@ -516,7 +522,7 @@
516
522
  @click="debounceToolToolClick(tool.code)"
517
523
  :loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])"
518
524
  >
519
- <Icon :icon="tool.icon" />
525
+ <Icon v-if="tool.icon" :icon="tool.icon" />
520
526
  {{ tool.content }}
521
527
  </a-button>
522
528
  </template>
@@ -362,6 +362,11 @@
362
362
  pagination.page = 1;
363
363
  return lazy ? Promise.resolve() : debounceFetchData();
364
364
  };
365
+ const forcePassQuery = (params: Partial<F>, lazy?: boolean) => {
366
+ queryFormData.value = params;
367
+ pagination.page = 1;
368
+ return lazy ? Promise.resolve() : debounceFetchData();
369
+ };
365
370
  const pg = computed(() =>
366
371
  mode.value === 'pagination'
367
372
  ? {
@@ -447,6 +452,7 @@
447
452
  reload,
448
453
  reloadPage: resetPage,
449
454
  passQuery,
455
+ forcePassQuery,
450
456
  },
451
457
  $table: computed(() => tableEl.value),
452
458
  selectedRowKeys: computed(() => selectedRowKeys.value),
@@ -578,7 +584,6 @@
578
584
  :loading="loading.toolbar || (!!tool.code && codeLoadings[tool.code])"
579
585
  >
580
586
  <Icon :icon="tool.icon" />
581
- {{ tool.content }}
582
587
  </a-button>
583
588
  </template>
584
589
  </span>
@@ -34,7 +34,7 @@ const defaultConfig: UIKitConfig = {
34
34
  };
35
35
 
36
36
  // 当前配置(可被修改)
37
- let currentConfig: UIKitConfig = clone(defaultConfig);
37
+ let currentConfig: UIKitConfig = clone(defaultConfig, true);
38
38
 
39
39
  // 设置配置
40
40
  export function setUIKitConfig(config: Partial<UIKitConfig>): void {
@@ -61,12 +61,12 @@ export function watchPreviousDeep<T extends object>(
61
61
  if (typeof val !== 'object' || val === null) {
62
62
  return watch(source, cb as WatchCallback<T>, options);
63
63
  }
64
- let previousValue = clone(val) as T;
64
+ let previousValue = clone(val, true) as T;
65
65
  return watch(
66
66
  source,
67
67
  (crtValue, _, onCleanup) => {
68
68
  cb(crtValue as T, previousValue, onCleanup as () => void);
69
- previousValue = clone(crtValue) as T;
69
+ previousValue = clone(crtValue, true) as T;
70
70
  },
71
71
  options,
72
72
  );