@epie/bi-crud 2.0.48 → 2.0.50

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.
@@ -8574,6 +8574,9 @@ function useHelper({
8574
8574
  }
8575
8575
  });
8576
8576
  }
8577
+ function refreshAutoParams() {
8578
+ mitt.emit("crud.refresh-auto-params");
8579
+ }
8577
8580
  // 打开新增
8578
8581
  function rowAdd() {
8579
8582
  mitt.emit("crud.proxy", {
@@ -8704,6 +8707,7 @@ function useHelper({
8704
8707
  rowDelete,
8705
8708
  rowClose,
8706
8709
  refresh,
8710
+ refreshAutoParams,
8707
8711
  rowDescription,
8708
8712
  getPermission,
8709
8713
  paramsReplace,
@@ -30536,6 +30540,14 @@ function useRender$1(ctx) {
30536
30540
  };
30537
30541
  }
30538
30542
 
30543
+ /** 从 crud.params 去掉行内筛选项,避免 refresh 用 Object.assign 合并时残留已清空字段 */
30544
+ function unsetInlineSearchParams(crud, items) {
30545
+ for (const item of items || []) {
30546
+ if (item?.prop) {
30547
+ unset(crud.params, item.prop);
30548
+ }
30549
+ }
30550
+ }
30539
30551
  const epieInlineSearchProps = () => ({
30540
30552
  data: {
30541
30553
  type: Object,
@@ -30566,6 +30578,7 @@ var EpieInlineSearch = defineComponent({
30566
30578
  const loading = ref(false);
30567
30579
  // 重置数据
30568
30580
  function reset() {
30581
+ unsetInlineSearchParams(crud, props.items || []);
30569
30582
  for (const i in form) {
30570
30583
  delete form[i];
30571
30584
  }
@@ -30575,6 +30588,7 @@ var EpieInlineSearch = defineComponent({
30575
30588
  // const form = Form.value?.getForm();
30576
30589
  async function next(params) {
30577
30590
  loading.value = true;
30591
+ unsetInlineSearchParams(crud, props.items || []);
30578
30592
  await crud.refresh({
30579
30593
  ...form,
30580
30594
  page: 1,
@@ -30590,6 +30604,9 @@ var EpieInlineSearch = defineComponent({
30590
30604
  next();
30591
30605
  }
30592
30606
  }
30607
+ mitt.on("crud.refresh-auto-params", () => {
30608
+ search();
30609
+ });
30593
30610
  return {
30594
30611
  form,
30595
30612
  reset,
@@ -8577,6 +8577,9 @@
8577
8577
  }
8578
8578
  });
8579
8579
  }
8580
+ function refreshAutoParams() {
8581
+ mitt.emit("crud.refresh-auto-params");
8582
+ }
8580
8583
  // 打开新增
8581
8584
  function rowAdd() {
8582
8585
  mitt.emit("crud.proxy", {
@@ -8707,6 +8710,7 @@
8707
8710
  rowDelete,
8708
8711
  rowClose,
8709
8712
  refresh,
8713
+ refreshAutoParams,
8710
8714
  rowDescription,
8711
8715
  getPermission,
8712
8716
  paramsReplace,
@@ -30539,6 +30543,14 @@
30539
30543
  };
30540
30544
  }
30541
30545
 
30546
+ /** 从 crud.params 去掉行内筛选项,避免 refresh 用 Object.assign 合并时残留已清空字段 */
30547
+ function unsetInlineSearchParams(crud, items) {
30548
+ for (const item of items || []) {
30549
+ if (item?.prop) {
30550
+ unset(crud.params, item.prop);
30551
+ }
30552
+ }
30553
+ }
30542
30554
  const epieInlineSearchProps = () => ({
30543
30555
  data: {
30544
30556
  type: Object,
@@ -30569,6 +30581,7 @@
30569
30581
  const loading = vue.ref(false);
30570
30582
  // 重置数据
30571
30583
  function reset() {
30584
+ unsetInlineSearchParams(crud, props.items || []);
30572
30585
  for (const i in form) {
30573
30586
  delete form[i];
30574
30587
  }
@@ -30578,6 +30591,7 @@
30578
30591
  // const form = Form.value?.getForm();
30579
30592
  async function next(params) {
30580
30593
  loading.value = true;
30594
+ unsetInlineSearchParams(crud, props.items || []);
30581
30595
  await crud.refresh({
30582
30596
  ...form,
30583
30597
  page: 1,
@@ -30593,6 +30607,9 @@
30593
30607
  next();
30594
30608
  }
30595
30609
  }
30610
+ mitt.on("crud.refresh-auto-params", () => {
30611
+ search();
30612
+ });
30596
30613
  return {
30597
30614
  form,
30598
30615
  reset,
@@ -9,6 +9,7 @@ export declare function useHelper({ mitt, props, crud }: any): {
9
9
  rowDelete: (...selection: any[]) => void;
10
10
  rowClose: () => void;
11
11
  refresh: (params?: any) => Promise<unknown>;
12
+ refreshAutoParams: () => void;
12
13
  rowDescription: (data: any) => void;
13
14
  getPermission: (key: "page" | "list" | "info" | "update" | "add" | "delete") => boolean;
14
15
  paramsReplace: (params: any) => any;
@@ -133,6 +133,7 @@ export declare namespace EpieCrud {
133
133
  rowDelete(...selection: any[]): void;
134
134
  rowDescription(row?: any): void;
135
135
  refresh: Service["page"]["request"];
136
+ refreshAutoParams: Service["page"]["request"];
136
137
  }
137
138
  interface Provide extends Ref {
138
139
  [key: string]: any;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epie/bi-crud",
3
3
  "simpleName": "bi-crud",
4
- "version": "2.0.48",
4
+ "version": "2.0.50",
5
5
  "private": false,
6
6
  "main": "lib/bi-crud.umd.js",
7
7
  "module": "lib/bi-crud.esm.js",