el-plus-crud 0.1.41 → 0.1.42

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.42](https://github.com/KDJack/el-plus-crud/compare/v0.1.41...v0.1.42) (2024-05-16)
6
+
5
7
  ### [0.1.41](https://github.com/KDJack/el-plus-crud/compare/v0.1.40...v0.1.41) (2024-05-15)
6
8
 
7
9
  ### [0.1.40](https://github.com/KDJack/el-plus-crud/compare/v0.1.39...v0.1.40) (2024-05-15)
@@ -653,7 +653,7 @@ function gn(e) {
653
653
  }
654
654
  function ua(e, t, l, o, r) {
655
655
  const c = [];
656
- return e && e.length > 0 && JSON.parse(JSON.stringify(e)).map((a) => {
656
+ return e && e.length > 0 && e.map((a) => {
657
657
  switch (a.children ? (a.headerAlign = a.headerAlign || "center", a.children = ua(a.children, t, l, "center", r)) : a.headerAlign = a.headerAlign || o || "left", a.type || (a.type = "text"), a.type) {
658
658
  case "image":
659
659
  a.width = a.width || "110px", a.align = a.align || "left", a.headerAlign = a.headerAlign || o || "left";
@@ -4444,7 +4444,7 @@ const ri = /* @__PURE__ */ Ye(ui, [["__scopeId", "data-v-7550a821"]]), ii = {
4444
4444
  size: !u.isDialog && w.size ? parseInt(w.size) : u.pageSize
4445
4445
  }), b = ((He = ($e = u.tableConfig) == null ? void 0 : $e.explan) == null ? void 0 : He.treeProps) || { children: "children", hasChildren: "hasChildren" }, _ = J(() => {
4446
4446
  var le, pe, Ae;
4447
- const I = ua((le = u.tableConfig) == null ? void 0 : le.column, r, ((pe = u.tableConfig) == null ? void 0 : pe.tbName) || "", u.headerAlign, u.isDialog ? "auto" : u.colMinWidth), V = ze(I);
4447
+ const I = ua(o.cloneDeep((le = u.tableConfig) == null ? void 0 : le.column), r, ((pe = u.tableConfig) == null ? void 0 : pe.tbName) || "", u.headerAlign, u.isDialog ? "auto" : u.colMinWidth), V = ze(I);
4448
4448
  i.value = [];
4449
4449
  const U = V.map((ae, H) => {
4450
4450
  var we;
@@ -4580,7 +4580,7 @@ const ri = /* @__PURE__ */ Ye(ui, [["__scopeId", "data-v-7550a821"]]), ii = {
4580
4580
  return !1;
4581
4581
  O.value = 1, Y.value = !0, I && (m.current = 1);
4582
4582
  let V = await ee();
4583
- (pe = (le = (U = u.tableConfig) == null ? void 0 : U.toolbar) == null ? void 0 : le.formConfig) != null && pe.beforeRequest && (V = ((H = (ae = (Ae = u.tableConfig) == null ? void 0 : Ae.toolbar) == null ? void 0 : ae.formConfig) == null ? void 0 : H.beforeRequest(JSON.parse(JSON.stringify(V)))) || V);
4583
+ (pe = (le = (U = u.tableConfig) == null ? void 0 : U.toolbar) == null ? void 0 : le.formConfig) != null && pe.beforeRequest && (V = ((H = (ae = (Ae = u.tableConfig) == null ? void 0 : Ae.toolbar) == null ? void 0 : ae.formConfig) == null ? void 0 : H.beforeRequest(o.cloneDeep(V))) || V);
4584
4584
  try {
4585
4585
  let et = await u.tableConfig.fetch(V) || {};
4586
4586
  Array.isArray(et) && (et = { [((we = r.table) == null ? void 0 : we.list) || ((xe = (je = u.tableConfig) == null ? void 0 : je.fetchMap) == null ? void 0 : xe.list) || "records"]: et });
@@ -4625,7 +4625,7 @@ const ri = /* @__PURE__ */ Ye(ui, [["__scopeId", "data-v-7550a821"]]), ii = {
4625
4625
  async function St() {
4626
4626
  var V, U, le, pe, Ae, ae;
4627
4627
  let I = await ee();
4628
- (le = (U = (V = u.tableConfig) == null ? void 0 : V.toolbar) == null ? void 0 : U.formConfig) != null && le.beforeRequest && (I = ((ae = (Ae = (pe = u.tableConfig) == null ? void 0 : pe.toolbar) == null ? void 0 : Ae.formConfig) == null ? void 0 : ae.beforeRequest(JSON.parse(JSON.stringify(I)))) || I), I && a("queryChange", I), nt();
4628
+ (le = (U = (V = u.tableConfig) == null ? void 0 : V.toolbar) == null ? void 0 : U.formConfig) != null && le.beforeRequest && (I = ((ae = (Ae = (pe = u.tableConfig) == null ? void 0 : pe.toolbar) == null ? void 0 : Ae.formConfig) == null ? void 0 : ae.beforeRequest(o.cloneDeep(I))) || I), I && a("queryChange", I), nt();
4629
4629
  }
4630
4630
  function kt() {
4631
4631
  a("headerReset", w);
@@ -246,7 +246,7 @@ const treeProps = (props.tableConfig?.explan?.treeProps || { children: 'children
246
246
 
247
247
  // 处理后的列显示
248
248
  const headerColumns = computed(() => {
249
- const tempList = handelListColumn(props.tableConfig?.column, defaultConf, props.tableConfig?.tbName || '', props.headerAlign, props.isDialog ? 'auto' : props.colMinWidth)
249
+ const tempList = handelListColumn(lodash.cloneDeep(props.tableConfig?.column), defaultConf, props.tableConfig?.tbName || '', props.headerAlign, props.isDialog ? 'auto' : props.colMinWidth)
250
250
  // 这里重构一下合并行算法
251
251
  // 获取所有列
252
252
  const allColumn = getColumList(tempList)
@@ -653,7 +653,7 @@ async function loadData(isInit: Boolean) {
653
653
  let postData = await getListQueryData()
654
654
  // 这里处理一下外部数据格式化
655
655
  if (props.tableConfig?.toolbar?.formConfig?.beforeRequest) {
656
- postData = props.tableConfig?.toolbar?.formConfig?.beforeRequest(JSON.parse(JSON.stringify(postData))) || postData
656
+ postData = props.tableConfig?.toolbar?.formConfig?.beforeRequest(lodash.cloneDeep(postData)) || postData
657
657
  }
658
658
  try {
659
659
  let dataPage = ((await props.tableConfig.fetch(postData)) || {}) as any
@@ -746,7 +746,7 @@ async function handelTopQuery() {
746
746
  // topQueryData.value = cloneDeep(tableHeaderRef.value.getData())
747
747
  let tempQueryData = await getListQueryData()
748
748
  if (props.tableConfig?.toolbar?.formConfig?.beforeRequest) {
749
- tempQueryData = props.tableConfig?.toolbar?.formConfig?.beforeRequest(JSON.parse(JSON.stringify(tempQueryData))) || tempQueryData
749
+ tempQueryData = props.tableConfig?.toolbar?.formConfig?.beforeRequest(lodash.cloneDeep(tempQueryData)) || tempQueryData
750
750
  }
751
751
  if (tempQueryData) emits('queryChange', tempQueryData)
752
752
  reload()
package/lib/util/index.ts CHANGED
@@ -203,7 +203,7 @@ export function handelListColumn(columnList: Array<IColumnItem> | undefined, def
203
203
  const tempColumnList = [] as any[]
204
204
  if (columnList && columnList.length > 0) {
205
205
  // 不影响原有的对象,这里进行拷贝
206
- JSON.parse(JSON.stringify(columnList)).map((item: IColumnItem) => {
206
+ columnList.map((item: IColumnItem) => {
207
207
  // 如果有子集
208
208
  if (item.children) {
209
209
  // 表头居中
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "el-plus-crud",
3
3
  "description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
4
4
  "author": "K.D.Jack",
5
- "version": "0.1.41",
5
+ "version": "0.1.42",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "dist/el-plus-crud.mjs",
@@ -34,8 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@element-plus/icons-vue": "^2.3.1",
37
- "element-plus": "2.5.1",
38
- "vue": "^3.2.47"
37
+ "element-plus": "^2.7.3",
38
+ "vue": "^3.4.27"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^20.4.1",