slw 0.5.983 → 0.5.985

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/lib/index.js CHANGED
@@ -8511,17 +8511,17 @@ PictureUpload.name = "slw-picture-upload";
8511
8511
  PictureUpload.install = (Q) => {
8512
8512
  Q.component(PictureUpload.name, PictureUpload);
8513
8513
  };
8514
- const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScopeId$2 = (Q) => (pushScopeId("data-v-3dfea0dd"), Q = Q(), popScopeId(), Q), _hoisted_1$kW = {
8514
+ const windowGrid_vue_vue_type_style_index_0_scoped_bb0e601d_lang = "", _withScopeId$2 = (Q) => (pushScopeId("data-v-bb0e601d"), Q = Q(), popScopeId(), Q), _hoisted_1$kW = {
8515
8515
  class: "slw-window-grid-container",
8516
8516
  style: { height: "100%" }
8517
8517
  }, _hoisted_2$kS = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-main-area" }, null, -1)), _hoisted_3$hT = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-active-area" }, null, -1)), _hoisted_4$au = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-copy-area" }, null, -1)), _hoisted_5$4U = [
8518
8518
  _hoisted_2$kS,
8519
8519
  _hoisted_3$hT,
8520
8520
  _hoisted_4$au
8521
- ], _hoisted_6$1_ = {
8521
+ ], _hoisted_6$1_ = ["onClick"], _hoisted_7$12 = {
8522
8522
  key: 0,
8523
8523
  style: { verticalAlign: "middle" }
8524
- }, _hoisted_7$12 = { style: { padding: "20px 0" } }, _sfc_main$6 = {
8524
+ }, _hoisted_8$F = { style: { padding: "20px 0" } }, _sfc_main$6 = {
8525
8525
  __name: "window-grid",
8526
8526
  props: {
8527
8527
  gridData: {
@@ -9678,7 +9678,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9678
9678
  openType: ""
9679
9679
  };
9680
9680
  }, headerProxyQuery = () => {
9681
- evalEvent(gridData.value.params.formEvents.dataInit);
9681
+ evalEvent(gridData.value.params.formEvents.regionInit);
9682
9682
  }, setCheckboxRowColor = (Q, H = "#e6f7ff") => {
9683
9683
  let G = getCurRegion();
9684
9684
  Q && (G = getRegion(Q));
@@ -9691,9 +9691,12 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9691
9691
  X.find((te) => te[G.rowId] == ee) && (K.style["background-color"] = H);
9692
9692
  }
9693
9693
  }, 500);
9694
+ }, onScanIconClick = (Q, H) => {
9695
+ const G = gridData.value.formConfig.items.filter((X) => X.field == H)[0];
9696
+ G.itemRender.props.clickFunction && evalEvent(G.itemRender.props.clickFunction, Q, H);
9694
9697
  };
9695
9698
  onMounted(() => {
9696
- gridData.value.addListener && getCurRegion() && addListener(), gridData.value.toolbarConfig.buttons.forEach((Q) => {
9699
+ gridData.value.addListener && getCurRegion() && addListener(), evalEvent(gridData.value.params.formEvents.dataInit), gridData.value.toolbarConfig.buttons.forEach((Q) => {
9697
9700
  typeof Q.type < "u" && Q.type.toLowerCase() === "edit" && (editBtn.value = Q), typeof Q.type < "u" && Q.type.toLowerCase() === "export" && (exportButton.value = Q), Q.hasOwnProperty("buttonRender") || (Q.buttonRender = {
9698
9701
  name: "ElButton",
9699
9702
  props: {
@@ -9770,14 +9773,14 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9770
9773
  gridData.value.formConfig.formData[Q.toUpperCase()] = H;
9771
9774
  };
9772
9775
  return __expose({ gridReload, reload }), (Q, H) => {
9773
- const G = resolveComponent("el-icon"), X = resolveComponent("el-tooltip"), Z = resolveComponent("el-button"), K = resolveComponent("vxe-grid"), ee = resolveComponent("cloud-upload"), te = resolveComponent("el-upload"), ne = resolveComponent("download-outline"), re = resolveComponent("el-dialog");
9776
+ const G = resolveComponent("el-input"), X = resolveComponent("el-icon"), Z = resolveComponent("el-tooltip"), K = resolveComponent("el-button"), ee = resolveComponent("vxe-grid"), te = resolveComponent("cloud-upload"), ne = resolveComponent("el-upload"), re = resolveComponent("download-outline"), oe = resolveComponent("el-dialog");
9774
9777
  return openBlock(), createElementBlock("div", _hoisted_1$kW, [
9775
9778
  createElementVNode("div", {
9776
9779
  class: "vxe-table--cell-area",
9777
9780
  ref_key: "cellarea",
9778
9781
  ref: cellarea
9779
9782
  }, _hoisted_5$4U, 512),
9780
- createVNode(K, mergeProps$1({
9783
+ createVNode(ee, mergeProps$1({
9781
9784
  ref_key: "curRegion",
9782
9785
  ref: curRegion,
9783
9786
  class: { "cell--area": unref(gridData).addListener },
@@ -9793,36 +9796,51 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9793
9796
  onCheckboxAll: headerCheckboxChange,
9794
9797
  onProxyQuery: headerProxyQuery
9795
9798
  }), {
9796
- operation: withCtx(({ row: oe, rowIndex: ae }) => [
9797
- (openBlock(!0), createElementBlock(Fragment, null, renderList(showButtons(ae), (le) => (openBlock(), createBlock(Z, {
9798
- key: le._button_id,
9799
- iconComponent: le.iconComponent,
9799
+ scan_item: withCtx(({ data: ae, property: le }) => [
9800
+ createVNode(G, {
9801
+ modelValue: ae[le],
9802
+ "onUpdate:modelValue": (se) => ae[le] = se
9803
+ }, {
9804
+ suffix: withCtx(() => [
9805
+ createElementVNode("i", {
9806
+ class: "iconfont icon-scan1",
9807
+ onClick: (se) => onScanIconClick(ae[le], le),
9808
+ style: { cursor: "pointer" }
9809
+ }, null, 8, _hoisted_6$1_)
9810
+ ]),
9811
+ _: 2
9812
+ }, 1032, ["modelValue", "onUpdate:modelValue"])
9813
+ ]),
9814
+ operation: withCtx(({ row: ae, rowIndex: le }) => [
9815
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(showButtons(le), (se) => (openBlock(), createBlock(K, {
9816
+ key: se._button_id,
9817
+ iconComponent: se.iconComponent,
9800
9818
  "auto-insert-space": "",
9801
9819
  size: "small",
9802
- style: normalizeStyle({ ...le.css, marginLeft: "0px", padding: "5px" }),
9820
+ style: normalizeStyle({ ...se.css, marginLeft: "0px", padding: "5px" }),
9803
9821
  type: "primary",
9804
9822
  text: "",
9805
- onClick: (se) => toolBarButtonClick(le, oe, ae)
9823
+ onClick: (ce) => toolBarButtonClick(se, ae, le)
9806
9824
  }, createSlots({
9807
9825
  default: withCtx(() => [
9808
- !le.iconComponent || typeof le.iconComponent > "u" ? (openBlock(), createElementBlock("span", _hoisted_6$1_, toDisplayString(unref($T)(le.name)), 1)) : createCommentVNode("", !0)
9826
+ !se.iconComponent || typeof se.iconComponent > "u" ? (openBlock(), createElementBlock("span", _hoisted_7$12, toDisplayString(unref($T)(se.name)), 1)) : createCommentVNode("", !0)
9809
9827
  ]),
9810
9828
  _: 2
9811
9829
  }, [
9812
- le.iconComponent ? {
9830
+ se.iconComponent ? {
9813
9831
  name: "icon",
9814
9832
  fn: withCtx(() => [
9815
- createVNode(X, {
9816
- content: unref($T)(le.name),
9833
+ createVNode(Z, {
9834
+ content: unref($T)(se.name),
9817
9835
  placement: "top"
9818
9836
  }, {
9819
9837
  default: withCtx(() => [
9820
- createVNode(G, {
9838
+ createVNode(X, {
9821
9839
  size: "15",
9822
9840
  style: { verticalAlign: "middle" }
9823
9841
  }, {
9824
9842
  default: withCtx(() => [
9825
- (openBlock(), createBlock(resolveDynamicComponent(le.iconComponent)))
9843
+ (openBlock(), createBlock(resolveDynamicComponent(se.iconComponent)))
9826
9844
  ]),
9827
9845
  _: 2
9828
9846
  }, 1024)
@@ -9836,12 +9854,12 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9836
9854
  ]),
9837
9855
  _: 1
9838
9856
  }, 16, ["class"]),
9839
- createVNode(re, {
9857
+ createVNode(oe, {
9840
9858
  ref: "importModal",
9841
9859
  modelValue: unref(isImport),
9842
- "onUpdate:modelValue": H[0] || (H[0] = (oe) => isRef(isImport) ? isImport.value = oe : isImport = oe),
9860
+ "onUpdate:modelValue": H[0] || (H[0] = (ae) => isRef(isImport) ? isImport.value = ae : isImport = ae),
9843
9861
  visible: unref(isImport),
9844
- "onUpdate:visible": H[1] || (H[1] = (oe) => isRef(isImport) ? isImport.value = oe : isImport = oe),
9862
+ "onUpdate:visible": H[1] || (H[1] = (ae) => isRef(isImport) ? isImport.value = ae : isImport = ae),
9845
9863
  zIndex: 1e3,
9846
9864
  title: unref($T)("Excel导入"),
9847
9865
  width: "500px",
@@ -9857,19 +9875,19 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9857
9875
  "show-footer": ""
9858
9876
  }, {
9859
9877
  footer: withCtx(() => [
9860
- createVNode(Z, {
9878
+ createVNode(K, {
9861
9879
  "auto-insert-space": !0,
9862
9880
  type: "primary",
9863
9881
  onClick: downTemplate
9864
9882
  }, {
9865
9883
  default: withCtx(() => [
9866
9884
  createTextVNode(toDisplayString(unref($T)("模板")) + " ", 1),
9867
- createVNode(G, {
9885
+ createVNode(X, {
9868
9886
  size: "15",
9869
9887
  style: { verticalAlign: "middle" }
9870
9888
  }, {
9871
9889
  default: withCtx(() => [
9872
- createVNode(ne)
9890
+ createVNode(re)
9873
9891
  ]),
9874
9892
  _: 1
9875
9893
  })
@@ -9878,7 +9896,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9878
9896
  })
9879
9897
  ]),
9880
9898
  default: withCtx(() => [
9881
- createVNode(te, {
9899
+ createVNode(ne, {
9882
9900
  ref: "uploadExcel",
9883
9901
  type: "drag",
9884
9902
  drag: "",
@@ -9890,8 +9908,8 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9890
9908
  "on-success": importSuccess
9891
9909
  }, {
9892
9910
  default: withCtx(() => [
9893
- createElementVNode("div", _hoisted_7$12, [
9894
- createVNode(ee, { width: 50 }),
9911
+ createElementVNode("div", _hoisted_8$F, [
9912
+ createVNode(te, { width: 50 }),
9895
9913
  createElementVNode("p", null, toDisplayString(unref($T)("点击或拖文件到此处上传")), 1)
9896
9914
  ])
9897
9915
  ]),
@@ -9900,11 +9918,11 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9900
9918
  ]),
9901
9919
  _: 1
9902
9920
  }, 8, ["modelValue", "visible", "title"]),
9903
- createVNode(re, {
9921
+ createVNode(oe, {
9904
9922
  ref: "pictureUploadModal",
9905
9923
  width: "20%",
9906
9924
  modelValue: unref(uploadConfig).show,
9907
- "onUpdate:modelValue": H[2] || (H[2] = (oe) => unref(uploadConfig).show = oe),
9925
+ "onUpdate:modelValue": H[2] || (H[2] = (ae) => unref(uploadConfig).show = ae),
9908
9926
  "z-index": 1e3,
9909
9927
  draggable: "",
9910
9928
  "append-to-body": "",
@@ -9921,7 +9939,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_3dfea0dd_lang = "", _withScop
9921
9939
  ]);
9922
9940
  };
9923
9941
  }
9924
- }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-3dfea0dd"]]);
9942
+ }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-bb0e601d"]]);
9925
9943
  WindowGrid.name = "slw-window-grid";
9926
9944
  WindowGrid.install = (Q) => {
9927
9945
  Q.component(WindowGrid.name, WindowGrid);
@@ -37068,7 +37086,12 @@ const windowForm_vue_vue_type_style_index_0_lang = "", _hoisted_1$kV = { class:
37068
37086
  return formConfig.value.columns.forEach((H) => {
37069
37087
  H.editRender && H.editRender.props.readonlyLogic && (Q[H.field] = H);
37070
37088
  }), Q;
37071
- }), subQueryFields = computed(() => formConfig.value.columns.filter((Q) => Q.dataType === "SQL")), computeSpan = computed(() => (Q) => Q.dataType === "EDITOR" || Q.dataType === "TEXT" ? 24 : Q.fwidth ? Number(Q.fwidth) > 24 ? 24 : Number(Q.fwidth) : 12);
37089
+ }), subQueryFields = computed(() => formConfig.value.columns.filter((Q) => Q.dataType === "SQL")), computeSpan = computed(() => (Q) => Q.dataType === "EDITOR" || Q.dataType === "TEXT" ? 24 : Q.fwidth ? Number(Q.fwidth) > 24 ? 24 : Number(Q.fwidth) : 12), formRemoteSearchMap = computed(() => {
37090
+ let Q = {};
37091
+ return formConfig.value.columns.forEach((H) => {
37092
+ H.remoteSearch && H.selectorId && (Q[H.id] = H);
37093
+ }), Q;
37094
+ });
37072
37095
  onMounted(async () => {
37073
37096
  if (formConfig.value.params.linkUrl)
37074
37097
  return;
@@ -37102,12 +37125,21 @@ const windowForm_vue_vue_type_style_index_0_lang = "", _hoisted_1$kV = { class:
37102
37125
  } : formConfig.value.params.queryParams && Object.keys(formConfig.value.params.queryParams).forEach((G) => {
37103
37126
  let X = G.toLowerCase();
37104
37127
  H.hasOwnProperty(X) && (H[X] = formConfig.value.params.queryParams[G]);
37105
- }), axios.post("/window/data/" + formConfig.value.params.datasourceCode, H).then((G) => {
37128
+ }), axios.post("/window/data/" + formConfig.value.params.datasourceCode, H).then(async (G) => {
37106
37129
  if (G && G.data && G.data.result && G.data.data) {
37107
- G.data.data[0] && (formData.value = {
37130
+ if (G.data.data[0] && (formData.value = {
37108
37131
  ...formData.value,
37109
37132
  ...G.data.data[0]
37110
- });
37133
+ }, Object.keys(formRemoteSearchMap.value).length > 0))
37134
+ for (const K of Object.keys(formRemoteSearchMap.value)) {
37135
+ let ee = formRemoteSearchMap.value[K];
37136
+ ee.itemRender.options = await remoteMethod(
37137
+ formData.value[ee.field],
37138
+ ee.id,
37139
+ ee.selectorId,
37140
+ "$_value"
37141
+ ), ee.itemRender.options.length > 0 && (formData.value[ee.field] = ee.itemRender.options[0].VALUE);
37142
+ }
37111
37143
  let X = formData.value, Z = {
37112
37144
  rowId: formConfig.value.rowId,
37113
37145
  // eslint-disable-next-line no-prototype-builtins
@@ -37325,24 +37357,25 @@ const windowForm_vue_vue_type_style_index_0_lang = "", _hoisted_1$kV = { class:
37325
37357
  }
37326
37358
  }
37327
37359
  readonlyLogic();
37328
- }, remoteMethod = async (Q, H, G) => {
37329
- let X = [], Z = await axios.post(
37360
+ }, remoteMethod = async (Q, H, G, X = "$_f_value") => {
37361
+ let Z = [], K = {
37362
+ _region_id: formConfig.value.params._region_id,
37363
+ _field_id: H,
37364
+ _select_id: G
37365
+ };
37366
+ K[X] = Q;
37367
+ let ee = await axios.post(
37330
37368
  "/window/selector",
37331
- $qs.stringify({
37332
- $_f_value: Q,
37333
- _region_id: formConfig.value.params._region_id,
37334
- _field_id: H,
37335
- _select_id: G
37336
- })
37369
+ $qs.stringify(K)
37337
37370
  );
37338
- if (Z.data.result && Z.data.data)
37339
- return X = Z.data.data.map((K) => Object.assign(
37371
+ if (ee.data.result && ee.data.data)
37372
+ return Z = ee.data.data.map((te) => Object.assign(
37340
37373
  {
37341
- value: K.VALUE,
37342
- label: K.NAME
37374
+ value: te.VALUE,
37375
+ label: te.NAME
37343
37376
  },
37344
- K
37345
- )), X;
37377
+ te
37378
+ )), Z;
37346
37379
  }, readonlyLogic = () => {
37347
37380
  if (Object.keys(readOnlyColumnMap.value).length > 0) {
37348
37381
  let Q = Object.keys(readOnlyColumnMap.value);
@@ -38318,7 +38351,7 @@ _sfc_main$2.name = "slw-preview-modal";
38318
38351
  _sfc_main$2.install = (Q) => {
38319
38352
  Q.component(_sfc_main$2.name, _sfc_main$2);
38320
38353
  };
38321
- const windowIndex_vue_vue_type_style_index_0_scoped_efded3ce_lang = "", _withScopeId = (Q) => (pushScopeId("data-v-efded3ce"), Q = Q(), popScopeId(), Q), _hoisted_1$kR = { class: "slw-config-window-container" }, _hoisted_2$kQ = { class: "child-table-p" }, _sfc_main$1 = {
38354
+ const windowIndex_vue_vue_type_style_index_0_scoped_adf36f9a_lang = "", _withScopeId = (Q) => (pushScopeId("data-v-adf36f9a"), Q = Q(), popScopeId(), Q), _hoisted_1$kR = { class: "slw-config-window-container" }, _hoisted_2$kQ = { class: "child-table-p" }, _sfc_main$1 = {
38322
38355
  __name: "window-index",
38323
38356
  props: {
38324
38357
  windowId: {
@@ -38652,7 +38685,8 @@ const windowIndex_vue_vue_type_style_index_0_scoped_efded3ce_lang = "", _withSco
38652
38685
  filterable: !0,
38653
38686
  newLine: K[se].newLine,
38654
38687
  autocomplete: "off",
38655
- style: { width: "100%" }
38688
+ style: { width: "100%" },
38689
+ clickFunction: K[se].clickFunction
38656
38690
  },
38657
38691
  defaultValue: ce,
38658
38692
  // 取消获取本地存储localStorage内的表单值
@@ -38665,7 +38699,10 @@ const windowIndex_vue_vue_type_style_index_0_scoped_efded3ce_lang = "", _withSco
38665
38699
  attrs: { id: "query-" + K[se].columnName }
38666
38700
  },
38667
38701
  visible: !K[se].hide,
38668
- folding: se > 2
38702
+ folding: se > 2,
38703
+ events: {},
38704
+ canScan: K[se].canScan || !1
38705
+ // 支持扫码
38669
38706
  };
38670
38707
  switch (K[se].dataType) {
38671
38708
  case "LIST":
@@ -38725,7 +38762,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_efded3ce_lang = "", _withSco
38725
38762
  ue.itemRender.name = "ElInput", ue.itemRender.props.type = "textarea";
38726
38763
  break;
38727
38764
  }
38728
- ue.itemRender.props.clearable = !0, X.formConfig.items.push(ue), ae = ae && K[se].hide;
38765
+ ue.itemRender.props.clearable = !0, X.formConfig.items.push(ue), ae = ae && K[se].hide, ue.canScan && (ue.slots = { default: "scan_item" });
38729
38766
  }
38730
38767
  X.formConfig.items.push({
38731
38768
  align: "right",
@@ -39419,7 +39456,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_efded3ce_lang = "", _withSco
39419
39456
  ]);
39420
39457
  };
39421
39458
  }
39422
- }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-efded3ce"]]);
39459
+ }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-adf36f9a"]]);
39423
39460
  WindowIndex.name = "slw-window-index";
39424
39461
  WindowIndex.install = (Q) => {
39425
39462
  Q.component(WindowIndex.name, WindowIndex);
@@ -122183,7 +122220,7 @@ function reConsole() {
122183
122220
  }
122184
122221
  }
122185
122222
  console.info(
122186
- "%cSLW %cVer 0.5.983",
122223
+ "%cSLW %cVer 0.5.985",
122187
122224
  "color:#409EFF;font-size: 22px;font-weight:bolder",
122188
122225
  "color:#999;font-size: 12px"
122189
122226
  );