slw 1.0.0-alpha.3 → 1.0.0-alpha.4

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 { pushScopeId as P, popScopeId as V, createElementVNode as h, resolveComponent as g, openBlock as o, createElementBlock as p, createBlock as f, normalizeClass as T, normalizeStyle as A, withModifiers as R, withCtx as r, renderSlot as q, createCommentVNode as _, Fragment as B, createVNode as s, mergeProps as k, renderList as j, toDisplayString as E, normalizeProps as K, guardReactiveProps as Q, resolveDynamicComponent as Z, defineAsyncComponent as $, computed as F, unref as D, withDirectives as ee, vShow as te } from "vue";
2
- import { _ as x, d as S, a as L, u as N } from "./index-656e59c3.js";
2
+ import { _ as x, d as S, a as L, u as N } from "./index-066ef62f.js";
3
3
  import "vue-router";
4
4
  const I = {
5
5
  computed: {},
@@ -8525,7 +8525,7 @@ PictureUpload.name = "slw-picture-upload";
8525
8525
  PictureUpload.install = (Q) => {
8526
8526
  Q.component(PictureUpload.name, PictureUpload);
8527
8527
  };
8528
- const windowGrid_vue_vue_type_style_index_0_scoped_f42eb57c_lang = "", _withScopeId$9 = (Q) => (pushScopeId("data-v-f42eb57c"), Q = Q(), popScopeId(), Q), _hoisted_1$l2 = {
8528
+ const windowGrid_vue_vue_type_style_index_0_scoped_52333277_lang = "", _withScopeId$9 = (Q) => (pushScopeId("data-v-52333277"), Q = Q(), popScopeId(), Q), _hoisted_1$l2 = {
8529
8529
  class: "slw-window-grid-container",
8530
8530
  style: { height: "100%" }
8531
8531
  }, _hoisted_2$kY = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-main-area" }, null, -1)), _hoisted_3$hY = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-active-area" }, null, -1)), _hoisted_4$ay = /* @__PURE__ */ _withScopeId$9(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-copy-area" }, null, -1)), _hoisted_5$4Y = [
@@ -8661,61 +8661,50 @@ const windowGrid_vue_vue_type_style_index_0_scoped_f42eb57c_lang = "", _withScop
8661
8661
  total: "data.count"
8662
8662
  },
8663
8663
  ajax: {
8664
- query: async ({ page: H, sorts: X, filters: G, form: K }, Z) => {
8665
- var se;
8664
+ query: async ({ page: H, sorts: X, filters: G, form: K }) => {
8665
+ var le;
8666
8666
  if (gridData.value.noSearchData) {
8667
8667
  delete gridData.value.noSearchData;
8668
8668
  return;
8669
8669
  }
8670
- if (Z != null && Z.clearGrid) {
8671
- for (let ue in queryFormData.value)
8672
- queryFormData.value[ue] = null;
8673
- return localStorage.setItem(gridData.value.params._region_id + preTag.value, JSON.stringify(queryFormData.value)), {
8674
- data: {
8675
- data: [],
8676
- count: 0
8677
- },
8678
- status: 200
8679
- };
8680
- }
8681
- let ee = getParentRegion(), te = null;
8682
- ee != null && ee.params && (te = ee.params.subtableSearchExParams);
8683
- const ne = Object.assign({}, gridData.value.params.queryParams, queryFormData.value, Z, te);
8684
- Object.entries(ne).forEach(([ce, ue]) => {
8685
- var he;
8686
- if (ue == null && (queryFormData.value[ce] = null), ne[ce] instanceof Array) {
8687
- let de = gridData.value.formConfig.items.filter((ge) => ge.field == ce)[0], fe = (he = de == null ? void 0 : de.itemRender) == null ? void 0 : he.name, pe = XEUtils$4.clone(ne[ce], !0);
8688
- fe == "ElTimePicker" ? (ne[ce] = pe[0], ne["end_" + ce] = pe[1]) : ["ElDateRangePicker", "ElDateTimeRangePicker"].includes(fe) && (ne[ce] = pe[0], ne["end_" + ce] = pe[1], queryFormData.value[ce] = pe[0], queryFormData.value["end_" + ce] = pe[1]);
8670
+ let Z = getParentRegion(), ee = null;
8671
+ Z != null && Z.params && (ee = Z.params.subtableSearchExParams);
8672
+ const te = Object.assign({}, gridData.value.params.queryParams, queryFormData.value, ee);
8673
+ Object.entries(te).forEach(([se, ce]) => {
8674
+ var ue;
8675
+ if (ce == null && (queryFormData.value[se] = null), te[se] instanceof Array) {
8676
+ let he = gridData.value.formConfig.items.filter((pe) => pe.field == se)[0], de = (ue = he == null ? void 0 : he.itemRender) == null ? void 0 : ue.name, fe = XEUtils$4.clone(te[se], !0);
8677
+ de == "ElTimePicker" ? (te[se] = fe[0], te["end_" + se] = fe[1]) : ["ElDateRangePicker", "ElDateTimeRangePicker"].includes(de) && (te[se] = fe[0], te["end_" + se] = fe[1], queryFormData.value[se] = fe[0], queryFormData.value["end_" + se] = fe[1]);
8689
8678
  }
8690
8679
  });
8691
- const oe = X[0];
8692
- oe && (ne.$_sort_column = oe.property, ne.$_sort_type = oe.order);
8693
- for (let { property: ce, datas: ue } of G) {
8694
- let he = ue.join(","), de = gridData.value.columns.filter((fe) => fe.field == ce)[0];
8695
- if ((de == null ? void 0 : de.dataType) == "LIST" && ((se = de == null ? void 0 : de.itemRender.options) == null ? void 0 : se.length) > 0) {
8696
- let fe = de.itemRender.options.filter((pe) => pe.label.indexOf(he) > -1)[0];
8697
- fe && (he = fe.value);
8698
- } else if ((de == null ? void 0 : de.dataType) == "TABLE") {
8699
- let pe = (await getSelectorData({ _region_id: gridData.value.params._region_id }, de.id, de.selectorId)).filter((ge) => ge.NAME.indexOf(he) > -1)[0];
8700
- pe && (he = pe.VALUE);
8680
+ const ne = X[0];
8681
+ ne && (te.$_sort_column = ne.property, te.$_sort_type = ne.order);
8682
+ for (let { property: se, datas: ce } of G) {
8683
+ let ue = ce.join(","), he = gridData.value.columns.filter((de) => de.field == se)[0];
8684
+ if ((he == null ? void 0 : he.dataType) == "LIST" && ((le = he == null ? void 0 : he.itemRender.options) == null ? void 0 : le.length) > 0) {
8685
+ let de = he.itemRender.options.filter((fe) => fe.label.indexOf(ue) > -1)[0];
8686
+ de && (ue = de.value);
8687
+ } else if ((he == null ? void 0 : he.dataType) == "TABLE") {
8688
+ let fe = (await getSelectorData({ _region_id: gridData.value.params._region_id }, he.id, he.selectorId)).filter((pe) => pe.NAME.indexOf(ue) > -1)[0];
8689
+ fe && (ue = fe.VALUE);
8701
8690
  }
8702
- ne[ce.toLowerCase()] = he;
8691
+ te[se.toLowerCase()] = ue;
8703
8692
  }
8704
- if (ne.page = H.currentPage, ne.limit = H.pageSize, ne._region_id = gridData.value.params._region_id, gridData.value.params.parentRowId && (ne[gridData.value.params.parentRowId] = gridData.value.params.parentRowIdValue), Object.keys(ne).forEach((ce) => {
8705
- ne[ce] instanceof Object && (ne[ce] = Object.values(ne[ce]).join());
8706
- }), Q ? Object.keys(Q).forEach((ce) => {
8707
- const ue = ce.toLowerCase();
8708
- ne.hasOwnProperty(ue) && (ne[ue] = Q[ce]);
8709
- }) : localStorage.setItem(gridData.value.params._region_id + preTag.value, JSON.stringify(queryFormData.value)), gridData.value.params.exportForm = XEUtils$4.clone(ne, !0), queryBeforeList && queryBeforeList.length > 0) {
8710
- let ce = {};
8711
- if (queryBeforeList.forEach((ue) => {
8712
- if (ue && typeof ue == "function")
8693
+ if (te.page = H.currentPage, te.limit = H.pageSize, te._region_id = gridData.value.params._region_id, gridData.value.params.parentRowId && (te[gridData.value.params.parentRowId] = gridData.value.params.parentRowIdValue), Object.keys(te).forEach((se) => {
8694
+ te[se] instanceof Object && (te[se] = Object.values(te[se]).join());
8695
+ }), Q ? Object.keys(Q).forEach((se) => {
8696
+ const ce = se.toLowerCase();
8697
+ te.hasOwnProperty(ce) && (te[ce] = Q[se]);
8698
+ }) : localStorage.setItem(gridData.value.params._region_id + preTag.value, JSON.stringify(queryFormData.value)), gridData.value.params.exportForm = XEUtils$4.clone(te, !0), queryBeforeList && queryBeforeList.length > 0) {
8699
+ let se = {};
8700
+ if (queryBeforeList.forEach((ce) => {
8701
+ if (ce && typeof ce == "function")
8713
8702
  try {
8714
- ce = ue();
8715
- } catch (he) {
8716
- console.error(he);
8703
+ se = ce();
8704
+ } catch (ue) {
8705
+ console.error(ue);
8717
8706
  }
8718
- }), ce === !1)
8707
+ }), se === !1)
8719
8708
  return {
8720
8709
  data: {
8721
8710
  data: [],
@@ -8724,69 +8713,69 @@ const windowGrid_vue_vue_type_style_index_0_scoped_f42eb57c_lang = "", _withScop
8724
8713
  status: 200
8725
8714
  };
8726
8715
  }
8727
- const re = axios.post("/window/data/" + gridData.value.params.datasourceCode, ne);
8728
- let ae = {};
8729
- return re.then((ce) => {
8730
- let ue = {};
8731
- if (ce && ce.data && ce.data.result && ce.data.data && ce.data.data.length > 0) {
8732
- let pe = function(me) {
8733
- me.forEach((_e, we) => {
8734
- let xe = 0;
8735
- gridData.value.toolbarConfig.buttons.forEach(($e) => {
8736
- if (typeof $e.type < "u") {
8737
- $e.btnLoad[fe] = !1;
8738
- const ke = $e.displayLogic ? displayLogic($e.displayLogic, {
8739
- ..._e,
8716
+ const oe = axios.post("/window/data/" + gridData.value.params.datasourceCode, te);
8717
+ let re = {};
8718
+ return oe.then((se) => {
8719
+ let ce = {};
8720
+ if (se && se.data && se.data.result && se.data.data && se.data.data.length > 0) {
8721
+ let fe = function(ve) {
8722
+ ve.forEach((me, _e) => {
8723
+ let we = 0;
8724
+ gridData.value.toolbarConfig.buttons.forEach((xe) => {
8725
+ if (typeof xe.type < "u") {
8726
+ xe.btnLoad[de] = !1;
8727
+ const $e = xe.displayLogic ? displayLogic(xe.displayLogic, {
8728
+ ...me,
8740
8729
  ...assembleParentData(gridData.value.params.parentData)
8741
- }) : !0, Se = $e.showInGrid && ke, Ee = !$e.showInGrid && ke;
8742
- if ($e.btnShowInGrid[fe] = Se, $e.btnShow[fe] = Ee, he = he || Se, Se)
8743
- if ($e.iconComponent)
8744
- xe = xe + 0.7;
8730
+ }) : !0, ke = xe.showInGrid && $e, Se = !xe.showInGrid && $e;
8731
+ if (xe.btnShowInGrid[de] = ke, xe.btnShow[de] = Se, ue = ue || ke, ke)
8732
+ if (xe.iconComponent)
8733
+ we = we + 0.7;
8745
8734
  else {
8746
- let Pe = $e.name.match(/[\u4e00-\u9fa5]/g);
8747
- if (Pe) {
8748
- let Ne = Math.ceil(Pe.length / 2);
8749
- xe += Ne;
8735
+ let Ee = xe.name.match(/[\u4e00-\u9fa5]/g);
8736
+ if (Ee) {
8737
+ let Pe = Math.ceil(Ee.length / 2);
8738
+ we += Pe;
8750
8739
  } else {
8751
- let Ne = Math.ceil($e.name.length / 6);
8752
- xe += Ne;
8740
+ let Pe = Math.ceil(xe.name.length / 6);
8741
+ we += Pe;
8753
8742
  }
8754
8743
  }
8755
8744
  }
8756
- }), xe > de && (de = xe), _e._INDEX = fe, fe++, _e._CHILDS && _e._CHILDS.length > 0 && pe(_e._CHILDS);
8745
+ }), we > he && (he = we), me._INDEX = de, de++, me._CHILDS && me._CHILDS.length > 0 && fe(me._CHILDS);
8757
8746
  });
8758
- }, he = !1, de = 0, fe = 0;
8759
- pe(ce.data.data);
8760
- let ge = !1;
8761
- gridData.value.columns.forEach((me) => {
8762
- if (me.colId == "_operation_" && me.title == "操作") {
8763
- me.width != de * 60 && de * 60 >= 60 && (ge = !0, me.width = de.toFixed(1) * 60);
8747
+ }, ue = !1, he = 0, de = 0;
8748
+ fe(se.data.data);
8749
+ let pe = !1;
8750
+ gridData.value.columns.forEach((ve) => {
8751
+ if (ve.colId == "_operation_" && ve.title == "操作") {
8752
+ ve.width != he * 60 && he * 60 >= 60 && (pe = !0, ve.width = he.toFixed(1) * 60);
8764
8753
  return;
8765
8754
  }
8766
- }), ge && getCurRegion().loadColumn(gridData.value.columns), gridData.value.params.rowIndex != null && (rowIndex.value = gridData.value.params.rowIndex), ce.data.data.length > rowIndex.value ? ue = ce.data.data[rowIndex.value] : ue = ce.data.data[0];
8767
- const ve = getCurRegion();
8768
- if (ve) {
8769
- const me = ve.getColumnById("_operation_");
8770
- me && he && ve.showColumn(me);
8755
+ }), pe && getCurRegion().loadColumn(gridData.value.columns), gridData.value.params.rowIndex != null && (rowIndex.value = gridData.value.params.rowIndex), se.data.data.length > rowIndex.value ? ce = se.data.data[rowIndex.value] : ce = se.data.data[0];
8756
+ const ge = getCurRegion();
8757
+ if (ge) {
8758
+ const ve = ge.getColumnById("_operation_");
8759
+ ve && ue && ge.showColumn(ve);
8771
8760
  }
8772
- !isEditGridInitData.value && gridData.value.type === "EDIT_GRID" && editGridInitData(ue);
8761
+ !isEditGridInitData.value && gridData.value.type === "EDIT_GRID" && editGridInitData(ce);
8773
8762
  }
8774
- rowClickCommon(ue, rowIndex.value), queryAfterList && queryAfterList.length > 0 && queryAfterList.forEach((he) => {
8775
- var de;
8776
- if (he && typeof he == "function")
8763
+ rowClickCommon(ce, rowIndex.value), queryAfterList && queryAfterList.length > 0 && queryAfterList.forEach((ue) => {
8764
+ var he;
8765
+ if (ue && typeof ue == "function")
8777
8766
  try {
8778
- ae = he(((de = ce == null ? void 0 : ce.data) == null ? void 0 : de.data) || []);
8779
- } catch (fe) {
8780
- console.error(fe);
8767
+ re = ue(((he = se == null ? void 0 : se.data) == null ? void 0 : he.data) || []);
8768
+ } catch (de) {
8769
+ console.error(de);
8781
8770
  }
8782
8771
  });
8783
- }), typeof await re > "u" || ae === !1 ? {
8772
+ }), typeof await oe > "u" || re === !1 ? {
8784
8773
  data: {
8785
8774
  data: [],
8786
8775
  count: 0
8787
8776
  },
8788
8777
  status: 200
8789
- } : re;
8778
+ } : oe;
8790
8779
  }
8791
8780
  }
8792
8781
  }, gridData.value.params.parentRegionId && (gridData.value.proxyConfig.autoLoad = !1);
@@ -9151,14 +9140,16 @@ const windowGrid_vue_vue_type_style_index_0_scoped_f42eb57c_lang = "", _withScop
9151
9140
  }, G.params.queryParams !== null && typeof G.params.queryParams < "u" && (G.params.queryParams.unQuery = !0), G.formData._button_id = gridData.value.params.edit_button_id, G._reload = () => reload(), rowDbClick(G);
9152
9141
  }, reload = () => {
9153
9142
  var Q;
9154
- (Q = getCurRegion()) == null || Q.commitProxy("query");
9143
+ (Q = getCurRegion()) == null || Q.commitProxy("reload");
9155
9144
  }, clearGrid = () => {
9156
- getCurRegion().commitProxy("query", { clearGrid: !0 });
9145
+ for (let Q in queryFormData.value)
9146
+ queryFormData.value[Q] = null;
9147
+ localStorage.setItem(gridData.value.params._region_id + preTag.value, JSON.stringify(queryFormData.value)), getCurRegion().reloadData();
9157
9148
  }, resetGrid = () => {
9158
9149
  var Q;
9159
9150
  for (let H in queryFormData.value)
9160
9151
  queryFormData.value[H] = null;
9161
- (Q = getCurRegion()) == null || Q.commitProxy("query");
9152
+ (Q = getCurRegion()) == null || Q.commitProxy("reload");
9162
9153
  }, getCheckedData = () => {
9163
9154
  const Q = getCurRegion();
9164
9155
  return Q ? Q.getCheckboxRecords().concat(Q.getCheckboxReserveRecords()) : null;
@@ -10150,7 +10141,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_f42eb57c_lang = "", _withScop
10150
10141
  ]);
10151
10142
  };
10152
10143
  }
10153
- }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-f42eb57c"]]);
10144
+ }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-52333277"]]);
10154
10145
  WindowGrid.name = "slw-window-grid";
10155
10146
  WindowGrid.install = (Q) => {
10156
10147
  Q.component(WindowGrid.name, WindowGrid);
@@ -59085,7 +59076,7 @@ const windowDesigner_vue_vue_type_style_index_0_scoped_a3ebe962_lang = "", _with
59085
59076
  emits: ["update:type", "update:rootLayout", "update:viewData", "update:rowData"],
59086
59077
  setup(Q, { emit: H }) {
59087
59078
  const X = Q, G = defineAsyncComponent(
59088
- () => import("./index-5418c07e.js")
59079
+ () => import("./index-0266a427.js")
59089
59080
  );
59090
59081
  let K = useVModel(X, "type", H), Z = useVModel(X, "rootLayout", H), ee = useVModel(X, "viewData", H), te = useVModel(X, "rowData", H), ne = ref(0), oe = ref(null);
59091
59082
  oe.value = createDesigner();
@@ -165456,7 +165447,7 @@ function reConsole() {
165456
165447
  }
165457
165448
  }
165458
165449
  console.info(
165459
- `%cSLW %cVer 1.0.0-alpha.3%c
165450
+ `%cSLW %cVer 1.0.0-alpha.4%c
165460
165451
  %c指引文档:%chttp://slwdoc.js.sforcecon.com:5900/%c
165461
165452
  %c启光文档:%chttp://docs.js.sforcecon.com:5900/notepad/view/592`,
165462
165453
  "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 m } from "./index-656e59c3.js";
1
+ import { i as m } from "./index-066ef62f.js";
2
2
  import "vue";
3
3
  import "vue-router";
4
4
  export {