3h1-ui 2.4.0 → 2.5.0

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/es/index.js CHANGED
@@ -19909,7 +19909,8 @@ const useTableData = (getProps, { setPage, params }) => {
19909
19909
  var _a2;
19910
19910
  if ((_a2 = getProps.value) == null ? void 0 : _a2.api) {
19911
19911
  const res = await getProps.value.api(params.value);
19912
- setTableData(res.records);
19912
+ console.log("1", getProps.value.transDataAfterReload(res));
19913
+ setTableData(getProps.value.transDataAfterReload(res));
19913
19914
  setPage({ total: (res == null ? void 0 : res.total) || 0 });
19914
19915
  }
19915
19916
  };
@@ -20046,6 +20047,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20046
20047
  isUseEdit: { type: Boolean },
20047
20048
  columnSeq: { default: () => {
20048
20049
  return {};
20050
+ } },
20051
+ transDataAfterReload: { default: () => {
20052
+ return (res) => res.records;
20049
20053
  } }
20050
20054
  },
20051
20055
  emits: [
@@ -20063,6 +20067,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20063
20067
  const innerProps = ref({});
20064
20068
  const getProps = computed(() => {
20065
20069
  const tempProps = { ...props2, ...innerProps.value };
20070
+ console.log("1", props2);
20066
20071
  if (tempProps.isCompatible) {
20067
20072
  tempProps.columns.forEach((column) => {
20068
20073
  column.field = column.dataIndex;
@@ -20084,6 +20089,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20084
20089
  ...getProps.value
20085
20090
  };
20086
20091
  });
20092
+ watchEffect(() => {
20093
+ getBindValues.value;
20094
+ console.log(
20095
+ "🚀 ~ file: TablePlus.vue:263 ~ watchEffect ~ getBindValues:",
20096
+ getBindValues.value
20097
+ );
20098
+ });
20087
20099
  const getColumns = computed(() => {
20088
20100
  return getProps.value.columns.map((item) => {
20089
20101
  return { ...basicColumn, ...item };
@@ -20149,6 +20161,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20149
20161
  const handleEditCancel = (row) => {
20150
20162
  emits("row-cancel", row);
20151
20163
  };
20164
+ const getTreeExpandRecords = () => {
20165
+ return toRaw(tableRef.value.getTreeExpandRecords());
20166
+ };
20167
+ const setAllTreeExpand = () => {
20168
+ return toRaw(tableRef.value.setAllTreeExpand(true));
20169
+ };
20170
+ const clearTreeExpand = () => {
20171
+ return toRaw(tableRef.value.clearTreeExpand());
20172
+ };
20173
+ const setTreeExpand = (rows, checked) => {
20174
+ return toRaw(tableRef.value.setTreeExpand(rows, checked));
20175
+ };
20152
20176
  const tableAction = {
20153
20177
  reload,
20154
20178
  setTableData,
@@ -20156,7 +20180,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20156
20180
  getRowSelection,
20157
20181
  setEditByRow,
20158
20182
  cancelEditByRow,
20159
- getTableData
20183
+ getTableData,
20184
+ getTreeExpandRecords,
20185
+ setAllTreeExpand,
20186
+ clearTreeExpand,
20187
+ setTreeExpand
20160
20188
  };
20161
20189
  emits("register", tableAction, formActions);
20162
20190
  return (_ctx, _cache) => {
@@ -20192,7 +20220,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20192
20220
  onCheckboxAll: handleCheckboxChange,
20193
20221
  onCheckboxChange: handleCheckboxChange,
20194
20222
  onRadioChange: handleRadioChange,
20195
- "row-config": { isHover: true },
20196
20223
  "show-overflow": "",
20197
20224
  "column-config": { resizable: true }
20198
20225
  }), {
@@ -20335,7 +20362,11 @@ function useTablePlus(tableProps) {
20335
20362
  return unref(formRef);
20336
20363
  },
20337
20364
  cancelEditByRow: (row) => getTableInstance().cancelEditByRow(row),
20338
- getTableData: () => getTableInstance().getTableData()
20365
+ getTableData: () => getTableInstance().getTableData(),
20366
+ getTreeExpandRecords: () => getTableInstance().getTreeExpandRecords(),
20367
+ setAllTreeExpand: () => getTableInstance().setAllTreeExpand(),
20368
+ clearTreeExpand: () => getTableInstance().clearTreeExpand(),
20369
+ setTreeExpand: (rows, checked) => getTableInstance().setTreeExpand(rows, checked)
20339
20370
  };
20340
20371
  return [register, methods2];
20341
20372
  }
@@ -107,6 +107,10 @@ export interface TableActionType {
107
107
  setEditByRow?: any;
108
108
  cancelEditByRow?: any;
109
109
  getTableData?: any;
110
+ getTreeExpandRecords?: any;
111
+ setAllTreeExpand?: any;
112
+ clearTreeExpand?: any;
113
+ setTreeExpand?: any;
110
114
  }
111
115
  export interface FetchSetting {
112
116
  pageField: string;
@@ -94,6 +94,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
94
94
  required: true;
95
95
  default: () => {};
96
96
  };
97
+ transDataAfterReload: {
98
+ type: any;
99
+ required: false;
100
+ default: () => (res: any) => any;
101
+ };
97
102
  }, {
98
103
  emits: (event: "register" | "selection-change" | "row-ensure" | "row-cancel", ...args: any[]) => void;
99
104
  prefixCls: string;
@@ -136,6 +141,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
136
141
  cancelEditByRow: (row: any) => void;
137
142
  handleEditEnsure: (row: any) => void;
138
143
  handleEditCancel: (row: any) => void;
144
+ getTreeExpandRecords: () => any;
145
+ setAllTreeExpand: () => any;
146
+ clearTreeExpand: () => any;
147
+ setTreeExpand: (rows: any, checked: any) => any;
139
148
  tableAction: {
140
149
  reload: () => Promise<void>;
141
150
  setTableData: (data: any) => void;
@@ -144,6 +153,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
144
153
  setEditByRow: (row: any) => void;
145
154
  cancelEditByRow: (row: any) => void;
146
155
  getTableData: () => any[];
156
+ getTreeExpandRecords: () => any;
157
+ setAllTreeExpand: () => any;
158
+ clearTreeExpand: () => any;
159
+ setTreeExpand: (rows: any, checked: any) => any;
147
160
  };
148
161
  readonly BasicForm: import("vue").DefineComponent<unknown, object, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<unknown>, {}>;
149
162
  readonly VxeTable: import("vxe-table").VXEComponent<import("vxe-table").VxeTableProps<any>, import("vxe-table").VxeTableEventProps>;
@@ -565,6 +578,11 @@ declare const _sfc_main: import("vue").DefineComponent<{
565
578
  required: true;
566
579
  default: () => {};
567
580
  };
581
+ transDataAfterReload: {
582
+ type: any;
583
+ required: false;
584
+ default: () => (res: any) => any;
585
+ };
568
586
  }>> & {
569
587
  onRegister?: (...args: any[]) => any;
570
588
  "onSelection-change"?: (...args: any[]) => any;
@@ -588,5 +606,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
588
606
  searchInfo: any;
589
607
  transSearchInfoBeforeReload: any;
590
608
  isUseEdit: boolean;
609
+ transDataAfterReload: any;
591
610
  }>;
592
611
  export default _sfc_main;
package/lib/index.js CHANGED
@@ -19911,7 +19911,8 @@ const useTableData = (getProps, { setPage, params }) => {
19911
19911
  var _a2;
19912
19912
  if ((_a2 = getProps.value) == null ? void 0 : _a2.api) {
19913
19913
  const res = await getProps.value.api(params.value);
19914
- setTableData(res.records);
19914
+ console.log("1", getProps.value.transDataAfterReload(res));
19915
+ setTableData(getProps.value.transDataAfterReload(res));
19915
19916
  setPage({ total: (res == null ? void 0 : res.total) || 0 });
19916
19917
  }
19917
19918
  };
@@ -20048,6 +20049,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20048
20049
  isUseEdit: { type: Boolean },
20049
20050
  columnSeq: { default: () => {
20050
20051
  return {};
20052
+ } },
20053
+ transDataAfterReload: { default: () => {
20054
+ return (res) => res.records;
20051
20055
  } }
20052
20056
  },
20053
20057
  emits: [
@@ -20065,6 +20069,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20065
20069
  const innerProps = vue.ref({});
20066
20070
  const getProps = vue.computed(() => {
20067
20071
  const tempProps = { ...props2, ...innerProps.value };
20072
+ console.log("1", props2);
20068
20073
  if (tempProps.isCompatible) {
20069
20074
  tempProps.columns.forEach((column) => {
20070
20075
  column.field = column.dataIndex;
@@ -20086,6 +20091,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20086
20091
  ...getProps.value
20087
20092
  };
20088
20093
  });
20094
+ vue.watchEffect(() => {
20095
+ getBindValues.value;
20096
+ console.log(
20097
+ "🚀 ~ file: TablePlus.vue:263 ~ watchEffect ~ getBindValues:",
20098
+ getBindValues.value
20099
+ );
20100
+ });
20089
20101
  const getColumns = vue.computed(() => {
20090
20102
  return getProps.value.columns.map((item) => {
20091
20103
  return { ...basicColumn, ...item };
@@ -20151,6 +20163,18 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20151
20163
  const handleEditCancel = (row) => {
20152
20164
  emits("row-cancel", row);
20153
20165
  };
20166
+ const getTreeExpandRecords = () => {
20167
+ return vue.toRaw(tableRef.value.getTreeExpandRecords());
20168
+ };
20169
+ const setAllTreeExpand = () => {
20170
+ return vue.toRaw(tableRef.value.setAllTreeExpand(true));
20171
+ };
20172
+ const clearTreeExpand = () => {
20173
+ return vue.toRaw(tableRef.value.clearTreeExpand());
20174
+ };
20175
+ const setTreeExpand = (rows, checked) => {
20176
+ return vue.toRaw(tableRef.value.setTreeExpand(rows, checked));
20177
+ };
20154
20178
  const tableAction = {
20155
20179
  reload,
20156
20180
  setTableData,
@@ -20158,7 +20182,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20158
20182
  getRowSelection,
20159
20183
  setEditByRow,
20160
20184
  cancelEditByRow,
20161
- getTableData
20185
+ getTableData,
20186
+ getTreeExpandRecords,
20187
+ setAllTreeExpand,
20188
+ clearTreeExpand,
20189
+ setTreeExpand
20162
20190
  };
20163
20191
  emits("register", tableAction, formActions);
20164
20192
  return (_ctx, _cache) => {
@@ -20194,7 +20222,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20194
20222
  onCheckboxAll: handleCheckboxChange,
20195
20223
  onCheckboxChange: handleCheckboxChange,
20196
20224
  onRadioChange: handleRadioChange,
20197
- "row-config": { isHover: true },
20198
20225
  "show-overflow": "",
20199
20226
  "column-config": { resizable: true }
20200
20227
  }), {
@@ -20337,7 +20364,11 @@ function useTablePlus(tableProps) {
20337
20364
  return vue.unref(formRef);
20338
20365
  },
20339
20366
  cancelEditByRow: (row) => getTableInstance().cancelEditByRow(row),
20340
- getTableData: () => getTableInstance().getTableData()
20367
+ getTableData: () => getTableInstance().getTableData(),
20368
+ getTreeExpandRecords: () => getTableInstance().getTreeExpandRecords(),
20369
+ setAllTreeExpand: () => getTableInstance().setAllTreeExpand(),
20370
+ clearTreeExpand: () => getTableInstance().clearTreeExpand(),
20371
+ setTreeExpand: (rows, checked) => getTableInstance().setTreeExpand(rows, checked)
20341
20372
  };
20342
20373
  return [register, methods2];
20343
20374
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -31,8 +31,8 @@
31
31
  "vue-types": "^5.0.2",
32
32
  "vxe-table": "^4.3.6",
33
33
  "xe-utils": "^3.5.7",
34
- "@shy-plugins/utils": "1.0.14",
35
- "@shy-plugins/use": "1.0.3"
34
+ "@shy-plugins/use": "1.0.3",
35
+ "@shy-plugins/utils": "1.0.14"
36
36
  },
37
37
  "types": "es/ui/index.d.ts",
38
38
  "devDependencies": {