slw 1.0.0-rc.2.6 → 1.0.0-rc.2.7

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.
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as l, createElementBlock as u, openBlock as s, createBlock as m, createCommentVNode as h, withModifiers as R, normalizeStyle as B, normalizeClass as E, withCtx as o, renderSlot as F, createElementVNode as p, Fragment as M, createVNode as a, mergeProps as k, renderList as Y, toDisplayString as A, resolveDynamicComponent as L, defineAsyncComponent as U, computed as j, unref as D, withDirectives as X, vShow as J } from "vue";
2
- import { _ as x, d as N, a as S, u as z } from "./index-CsEZka1P.js";
2
+ import { _ as x, d as N, a as S, u as z } from "./index-hcIQGMqs.js";
3
3
  const I = {
4
4
  computed: {},
5
5
  methods: {
@@ -54065,7 +54065,7 @@ const _hoisted_1$l3 = {
54065
54065
  tableData: getCanEditData(),
54066
54066
  rowIndex: H,
54067
54067
  childForm: X
54068
- }, X && Object.keys(X).length > 0 && (K.width = "85vw"), K.params.queryParams !== null && typeof K.params.queryParams < "u" && (K.params.queryParams.unQuery = !0), K.formData._button_id = gridData.value.params.edit_button_id, K._reload = (Z) => reloadRow(Z), rowDbClick(K));
54068
+ }, X && Object.keys(X).length > 0 && (K.width = "85vw"), (K.type == "TREE" || K.type == "TREE_STRUCTURE") && (K.rowIndex = G._INDEX), K.params.queryParams !== null && typeof K.params.queryParams < "u" && (K.params.queryParams.unQuery = !0), K.formData._button_id = gridData.value.params.edit_button_id, K._reload = (Z) => reloadRow(Z), rowDbClick(K));
54069
54069
  }, reload = () => {
54070
54070
  var G;
54071
54071
  (G = getCurRegion()) == null || G.commitProxy("reload");
@@ -55563,7 +55563,7 @@ const _hoisted_1$l3 = {
55563
55563
  ]);
55564
55564
  };
55565
55565
  }
55566
- }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-81ca61f3"]]);
55566
+ }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-d19c6982"]]);
55567
55567
  WindowGrid.name = "slw-window-grid";
55568
55568
  WindowGrid.install = (G) => {
55569
55569
  G.component(WindowGrid.name, WindowGrid);
@@ -93406,7 +93406,7 @@ const _hoisted_1$kT = { class: "form-widget-container" }, _hoisted_2$kS = { clas
93406
93406
  emits: ["update:type", "update:rootLayout", "update:viewData", "update:rowData"],
93407
93407
  setup(G, { emit: H }) {
93408
93408
  const X = defineAsyncComponent(
93409
- () => import("./index-DTWfv1SI.js")
93409
+ () => import("./index-Fjfcbx3J.js")
93410
93410
  ), Q = G, K = H;
93411
93411
  let Z = useVModel(Q, "type", K), ee = useVModel(Q, "rootLayout", K), te = useVModel(Q, "viewData", K), ne = useVModel(Q, "rowData", K), re = ref$1(0), oe = ref$1(null);
93412
93412
  oe.value = createDesigner();
@@ -94428,10 +94428,65 @@ const _hoisted_1$kS = { class: "slw-config-window-container" }, _hoisted_2$kR =
94428
94428
  }, beforeHideMethod = async (G) => {
94429
94429
  const H = formConfig.value.openType === "edit" || formConfig.value.openType === "new", X = xForm.value.validateDataChg(), Q = G.type === "close";
94430
94430
  H && X && Q && await $vxeConfirm("当前页面数据有更改,是否保存数据?", void 0, { zIndex: 3e3 }) === "confirm" ? saveData(!0) : saveDataBtnLoading.value = !1, exeEndEdit();
94431
- }, editPreData = () => {
94432
- isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), --formConfig.value.rowIndex < 0 && (formConfig.value.rowIndex = formConfig.value.tableData.length - 1), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
94431
+ };
94432
+ function updateTableDataWithFormData(G, H) {
94433
+ if (!H || H._INDEX === void 0 || H._INDEX === null)
94434
+ return console.warn("formData does not have _INDEX property"), !1;
94435
+ const X = H._INDEX, Q = findNodeByIndex(G, X);
94436
+ if (!Q)
94437
+ return console.warn(`Node with _INDEX ${X} not found in tableData`), !1;
94438
+ const K = Q._CHILDS;
94439
+ for (const Z in H)
94440
+ Z !== "_CHILDS" && (Q[Z] = H[Z]);
94441
+ return K && (!H._CHILDS || H._CHILDS.length === 0) ? Q._CHILDS = K : H._CHILDS && H._CHILDS.length > 0 && (Q._CHILDS = H._CHILDS), !0;
94442
+ }
94443
+ function findNodeByIndex(G, H) {
94444
+ if (!Array.isArray(G)) return null;
94445
+ for (const X of G) {
94446
+ if (X._INDEX === H)
94447
+ return X;
94448
+ if (X._CHILDS && X._CHILDS.length > 0) {
94449
+ const Q = findNodeByIndex(X._CHILDS, H);
94450
+ if (Q)
94451
+ return Q;
94452
+ }
94453
+ }
94454
+ return null;
94455
+ }
94456
+ function getAdjacentData(G, H, X) {
94457
+ const Q = ["prev", "next"];
94458
+ if (!Q.includes(X))
94459
+ throw new Error(`Invalid direction: ${X}. Must be one of: ${Q.join(", ")}`);
94460
+ function K(re, oe = []) {
94461
+ if (!Array.isArray(re)) return oe;
94462
+ for (const ae of re)
94463
+ oe.push(ae), ae._CHILDS && ae._CHILDS.length > 0 && K(ae._CHILDS, oe);
94464
+ return oe;
94465
+ }
94466
+ const Z = K(G);
94467
+ Z.sort((re, oe) => re._INDEX - oe._INDEX);
94468
+ const ee = H == null ? void 0 : H._INDEX;
94469
+ if (ee == null)
94470
+ return Z.find((re) => re._INDEX === 0);
94471
+ let te;
94472
+ X === "next" ? te = ee + 1 : X === "prev" && (te = ee - 1);
94473
+ let ne = Z.find((re) => re._INDEX === te);
94474
+ return ne || (X === "next" ? Z.find((re) => re._INDEX === 0) : X === "prev" ? Z[Z.length - 1] : null);
94475
+ }
94476
+ const editPreData = () => {
94477
+ if (formConfig.value.type == "TREE" || formConfig.value.type == "TREE_STRUCTURE") {
94478
+ formConfig.value.formData._button_id = formConfig.value.params.edit_button_id, isAutoSave.value && (updateTableDataWithFormData(formConfig.value.tableData, formConfig.value.formData), saveData(!1));
94479
+ const G = getAdjacentData(formConfig.value.tableData, formConfig.value.formData, "prev");
94480
+ formConfig.value.formData = XEUtils$1.clone(toRaw(G), !0);
94481
+ } else
94482
+ isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), --formConfig.value.rowIndex < 0 && (formConfig.value.rowIndex = formConfig.value.tableData.length - 1), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
94433
94483
  }, editAfterData = () => {
94434
- isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), ++formConfig.value.rowIndex >= formConfig.value.tableData.length && (formConfig.value.rowIndex = 0), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
94484
+ if (formConfig.value.type == "TREE" || formConfig.value.type == "TREE_STRUCTURE") {
94485
+ formConfig.value.formData._button_id = formConfig.value.params.edit_button_id, isAutoSave.value && (updateTableDataWithFormData(formConfig.value.tableData, formConfig.value.formData), saveData(!1));
94486
+ const G = getAdjacentData(formConfig.value.tableData, formConfig.value.formData, "next");
94487
+ formConfig.value.formData = XEUtils$1.clone(toRaw(G), !0);
94488
+ } else
94489
+ isAutoSave.value && (formConfig.value.tableData[formConfig.value.rowIndex] = formConfig.value.formData, saveData(!1)), ++formConfig.value.rowIndex >= formConfig.value.tableData.length && (formConfig.value.rowIndex = 0), formConfig.value.formData = formConfig.value.tableData[formConfig.value.rowIndex];
94435
94490
  }, settPageHeight = () => {
94436
94491
  props.height ? props.height.indexOf("%") > 0 ? layoutHeight.value = document.documentElement.clientHeight / 100 * parseInt(props.height) : layoutHeight.value = parseInt(props.height) : layoutHeight.value = document.documentElement.clientHeight;
94437
94492
  }, jumpDesign = async (G, H, X) => {
@@ -94761,7 +94816,7 @@ const _hoisted_1$kS = { class: "slw-config-window-container" }, _hoisted_2$kR =
94761
94816
  ]);
94762
94817
  };
94763
94818
  }
94764
- }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c80daca5"]]);
94819
+ }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-0719b940"]]);
94765
94820
  WindowIndex.name = "slw-window-index";
94766
94821
  WindowIndex.install = (G) => {
94767
94822
  G.component(WindowIndex.name, WindowIndex);
@@ -222745,7 +222800,7 @@ function reConsole() {
222745
222800
  }
222746
222801
  }
222747
222802
  console.info(
222748
- `%cSLW %cVer 1.0.0-rc.2.6%c
222803
+ `%cSLW %cVer 1.0.0-rc.2.7%c
222749
222804
  %c指引文档:%chttp://slwdoc.js.sforcecon.com:5900/%c
222750
222805
  %c启光文档:%chttp://docs.js.sforcecon.com:5900/view`,
222751
222806
  "color:#409EFF;font-size: 22px;font-weight:bolder;text-shadow: 2px 2px 4px #84c1ff;",
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as f } from "./index-CsEZka1P.js";
1
+ import { i as f } from "./index-hcIQGMqs.js";
2
2
  export {
3
3
  f as default
4
4
  };