slw 0.8.51 → 0.8.71

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,7 +8511,7 @@ 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_516f3b2e_lang = "", _withScopeId$3 = (Q) => (pushScopeId("data-v-516f3b2e"), Q = Q(), popScopeId(), Q), _hoisted_1$kW = {
8514
+ const windowGrid_vue_vue_type_style_index_0_scoped_6ef05836_lang = "", _withScopeId$3 = (Q) => (pushScopeId("data-v-6ef05836"), 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$3(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-main-area" }, null, -1)), _hoisted_3$hT = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-active-area" }, null, -1)), _hoisted_4$au = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("span", { class: "vxe-table--cell-copy-area" }, null, -1)), _hoisted_5$4U = [
@@ -8548,7 +8548,10 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
8548
8548
  { code: "contract", name: $T("收缩节点"), disabled: !1 }
8549
8549
  ]
8550
8550
  ]), editBtn = ref(null), exportButton = ref(null), uploadData = ref({}), queryTimeout = ref(null), formSelectMap = ref({}), isEditGridInitData = ref(!1);
8551
- const preTag = computed(() => gridData.value.params.preTag || ""), showButtons = (Q) => gridData.value.toolbarConfig.buttons.filter(
8551
+ const preTag = computed(() => gridData.value.params.preTag || ""), computeExcelUrl = computed(() => {
8552
+ let Q = getCurRegion();
8553
+ return Q.params.newImportUrl ? Q.params.newImportUrl : importUrl.value;
8554
+ }), showButtons = (Q) => gridData.value.toolbarConfig.buttons.filter(
8552
8555
  (H) => H.showInGrid && (gridData.value.type === "TREE" || gridData.value.type === "TREE_STRUCTURE" || H.btnShowInGrid[Q])
8553
8556
  ), $modal = $Modal, $Message = ref({
8554
8557
  success(Q) {
@@ -8889,7 +8892,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
8889
8892
  });
8890
8893
  const K = {}, ee = gridData.value.columns;
8891
8894
  for (let ne = 0; ne < ee.length; ne++)
8892
- ee[ne].editRender && (K[ee[ne].field] = "");
8895
+ ee[ne].editRender && (K[ee[ne].field] = ee[ne].editRender.name == "ElInputNumber" ? null : "");
8893
8896
  if (gridData.value.params.parentRowId && (K[gridData.value.params.parentRowId] = gridData.value.params.parentRowIdValue), K._button_id = Q._button_id, gridData.value.type === "EDIT_GRID") {
8894
8897
  const ne = getGrid();
8895
8898
  K._region_id = gridData.value.params._region_id;
@@ -9206,7 +9209,8 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
9206
9209
  }, importSuccess = (Q, H) => {
9207
9210
  Q.result && (isImport.value = !1, reload()), $vxeMessage({ content: Q.msg, status: "info", zIndex: 3e3 });
9208
9211
  }, downTemplate = () => {
9209
- axios.download("/window/downloadTemplate", {
9212
+ let Q = getCurRegion(), H = Q.params.newDownTemplateUrl ? Q.params.newDownTemplateUrl : "/window/downloadTemplate";
9213
+ axios.download(H, {
9210
9214
  _region_id: gridData.value.params._region_id
9211
9215
  });
9212
9216
  }, confirm = (Q, H) => {
@@ -9797,6 +9801,20 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
9797
9801
  const { form: X } = H.getProxyInfo();
9798
9802
  return X;
9799
9803
  }
9804
+ }, setImportUrl = (Q) => {
9805
+ const H = ref(`${(axios == null ? void 0 : axios.baseUrl) || ""}${Q}`);
9806
+ let X = getCurRegion();
9807
+ X.params.newImportUrl = H.value;
9808
+ }, setDownTemplateUrl = (Q) => {
9809
+ const H = Q;
9810
+ let X = getCurRegion();
9811
+ X.params.newDownTemplateUrl = H;
9812
+ }, beforeExcelUpload = async (Q) => {
9813
+ let H = getCurRegion();
9814
+ return H.params.beforeUploadFn ? await H.params.beforeUploadFn() : !0;
9815
+ }, setBeforeUploadFn = (Q) => {
9816
+ let H = getCurRegion();
9817
+ H.params.beforeUploadFn = Q;
9800
9818
  };
9801
9819
  return onMounted(async () => {
9802
9820
  gridData.value.addListener && getCurRegion() && addListener(), gridData.value.type === "TREE_STRUCTURE" && (gridData.value.menuConfig = {
@@ -9999,10 +10017,11 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
9999
10017
  ref: "uploadExcel",
10000
10018
  type: "drag",
10001
10019
  drag: "",
10002
- action: unref(importUrl),
10020
+ action: computeExcelUrl.value,
10003
10021
  headers: unref(httpHeaders)(),
10004
10022
  accept: ".xls,.xlsx",
10005
10023
  data: unref(uploadData),
10024
+ "before-upload": beforeExcelUpload,
10006
10025
  "on-format-error": importFormatError,
10007
10026
  "on-success": importSuccess
10008
10027
  }, {
@@ -10038,7 +10057,7 @@ const windowGrid_vue_vue_type_style_index_0_scoped_516f3b2e_lang = "", _withScop
10038
10057
  ]);
10039
10058
  };
10040
10059
  }
10041
- }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-516f3b2e"]]);
10060
+ }, WindowGrid = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-6ef05836"]]);
10042
10061
  WindowGrid.name = "slw-window-grid";
10043
10062
  WindowGrid.install = (Q) => {
10044
10063
  Q.component(WindowGrid.name, WindowGrid);
@@ -38875,7 +38894,7 @@ var js = js$1.exports;
38875
38894
  })(Q);
38876
38895
  })(js$1);
38877
38896
  var jsExports = js$1.exports;
38878
- const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_vue_vue_type_style_index_0_scoped_25f3b206_lang = "", _withScopeId$2 = (Q) => (pushScopeId("data-v-25f3b206"), Q = Q(), popScopeId(), Q), _hoisted_1$kV = { class: "slw-window-form" }, _hoisted_2$kR = {
38897
+ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_vue_vue_type_style_index_0_scoped_02489a8c_lang = "", _withScopeId$2 = (Q) => (pushScopeId("data-v-02489a8c"), Q = Q(), popScopeId(), Q), _hoisted_1$kV = { class: "slw-window-form" }, _hoisted_2$kR = {
38879
38898
  key: 0,
38880
38899
  style: { "text-align": "left", "font-size": "18px", "line-height": "30px", "font-weight": "bold", padding: "5px 30px 0 15px" }
38881
38900
  }, _hoisted_3$hS = ["onClick"], _sfc_main$5 = {
@@ -38906,8 +38925,10 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
38906
38925
  // 是否拥有 图片上传 的按钮
38907
38926
  openType: "",
38908
38927
  fileList: []
38909
- }), filePreviewList = ref([]);
38910
- const $Message = ref({
38928
+ }), filePreviewList = ref([]), editorFocusField = ref("");
38929
+ const localEditorViews = shallowRef({}), handleReady = (Q, H) => {
38930
+ localEditorViews[Q] = H.view;
38931
+ }, $Message = ref({
38911
38932
  success(Q) {
38912
38933
  success(Q);
38913
38934
  },
@@ -39008,7 +39029,7 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39008
39029
  }), computeItemTitle = computed(() => (Q) => {
39009
39030
  const H = Q.match(/([^()]+)\(/);
39010
39031
  return $T(H ? H[1] : Q);
39011
- });
39032
+ }), computeEditorBtnStyle = computed(() => (Q) => editorFocusField.value == Q ? "background: rgba(64, 158, 255, 0.5)" : "");
39012
39033
  onMounted(async () => {
39013
39034
  var H, X, G;
39014
39035
  if (formConfig.value.params.linkUrl)
@@ -39181,7 +39202,7 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39181
39202
  }, clearData = () => {
39182
39203
  for (let Q in formData.value)
39183
39204
  formData.value[Q] = "";
39184
- }, localEditor = ref([]), validateDataChg = () => !XEUtils$1.isEqual(toRaw(formData.value), toRaw(formDataClone.value)), linkToMenu = (Q, H) => {
39205
+ }, validateDataChg = () => !XEUtils$1.isEqual(toRaw(formData.value), toRaw(formDataClone.value)), linkToMenu = (Q, H) => {
39185
39206
  }, getRegion = (Q) => {
39186
39207
  let H = regionMap.value[Q + "-" + preTag.value];
39187
39208
  return H || regionMap.value[Q];
@@ -39537,7 +39558,17 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39537
39558
  (G) => G.field == Q.toUpperCase()
39538
39559
  )[0], X = [];
39539
39560
  return H && (X = H.itemRender.options), X;
39561
+ }, setFieldName = (Q, H) => {
39562
+ let X = formConfig.value.columns.filter(
39563
+ (G) => G.field == Q.toUpperCase()
39564
+ )[0];
39565
+ if (X) {
39566
+ const G = X.itemRender.props.unitName ? H + "(" + X.itemRender.props.unitName + ")" : H;
39567
+ X.title = G;
39568
+ }
39540
39569
  }, footerSum = () => {
39570
+ }, onEditorBtnClick = (Q, H) => {
39571
+ console.log(localEditorViews[Q.field]), H == "beautify" ? formData.value[Q.field] = jsExports.js_beautify(formData.value[Q.field], codeBeautifyConfig) : H == "checkAll", localEditorViews[Q.field].focus();
39541
39572
  }, throwFunction = (Q) => {
39542
39573
  Q.getData = () => getData(), Q.submitData = () => submitData(), Q.getValue = (H) => getValue(H), Q.setValue = (H, X) => setValue(H, X);
39543
39574
  };
@@ -39576,17 +39607,16 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39576
39607
  name: "default",
39577
39608
  fn: withCtx(() => [
39578
39609
  createVNode(unref(T$1), {
39579
- ref_for: !0,
39580
- ref_key: "localEditor",
39581
- ref: localEditor,
39582
39610
  modelValue: unref(formData)[ne.field],
39583
39611
  "onUpdate:modelValue": (re) => unref(formData)[ne.field] = re,
39584
39612
  extensions: [
39585
39613
  getCodeLanguagePlugin(ne.language),
39586
39614
  unref(EditorView$1).lineWrapping
39587
39615
  ],
39616
+ onReady: (re) => handleReady(ne.field, re),
39617
+ onFocus: (re) => isRef(editorFocusField) ? editorFocusField.value = ne.field : editorFocusField = ne.field,
39588
39618
  "auto-destroy": ""
39589
- }, null, 8, ["modelValue", "onUpdate:modelValue", "extensions"])
39619
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "extensions", "onReady", "onFocus"])
39590
39620
  ]),
39591
39621
  key: "0"
39592
39622
  } : ne.dataType === "STRING" && ne.canScan === !0 ? {
@@ -39622,7 +39652,9 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39622
39652
  name: "suffix",
39623
39653
  fn: withCtx(() => [
39624
39654
  createElementVNode("i", {
39625
- class: normalizeClass("iconfont " + ne.itemRender.props.suffixIconfont),
39655
+ class: normalizeClass(
39656
+ "iconfont " + ne.itemRender.props.suffixIconfont
39657
+ ),
39626
39658
  onClick: (re) => onIconClick(ne),
39627
39659
  style: { cursor: "pointer" }
39628
39660
  }, null, 10, ["onClick"])
@@ -39632,7 +39664,9 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39632
39664
  name: "prefix",
39633
39665
  fn: withCtx(() => [
39634
39666
  createElementVNode("i", {
39635
- class: normalizeClass("iconfont " + ne.itemRender.props.prefixIconfont),
39667
+ class: normalizeClass(
39668
+ "iconfont " + ne.itemRender.props.prefixIconfont
39669
+ ),
39636
39670
  onClick: (re) => onIconClick(ne),
39637
39671
  style: { cursor: "pointer" }
39638
39672
  }, null, 10, ["onClick"])
@@ -39733,7 +39767,7 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39733
39767
  ]);
39734
39768
  };
39735
39769
  }
39736
- }, WindowForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-25f3b206"]]);
39770
+ }, WindowForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-02489a8c"]]);
39737
39771
  WindowForm.name = "slw-window-form";
39738
39772
  WindowForm.install = (Q) => {
39739
39773
  Q.component(WindowForm.name, WindowForm);
@@ -40366,7 +40400,7 @@ _sfc_main$2.name = "slw-preview-modal";
40366
40400
  _sfc_main$2.install = (Q) => {
40367
40401
  Q.component(_sfc_main$2.name, _sfc_main$2);
40368
40402
  };
40369
- const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withScopeId = (Q) => (pushScopeId("data-v-4404f820"), Q = Q(), popScopeId(), Q), _hoisted_1$kR = { class: "slw-config-window-container" }, _hoisted_2$kQ = { class: "child-table-p" }, _sfc_main$1 = {
40403
+ const windowIndex_vue_vue_type_style_index_0_scoped_d7ca317f_lang = "", _withScopeId = (Q) => (pushScopeId("data-v-d7ca317f"), Q = Q(), popScopeId(), Q), _hoisted_1$kR = { class: "slw-config-window-container" }, _hoisted_2$kQ = { class: "child-table-p" }, _sfc_main$1 = {
40370
40404
  __name: "window-index",
40371
40405
  props: {
40372
40406
  windowId: {
@@ -40990,7 +41024,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
40990
41024
  ue.name = "ElInput";
40991
41025
  break;
40992
41026
  case "LIST":
40993
- ue.name = "ElSelect", pe.style = "width: 100px;min-width: 80px;", ue.props.filterable = !0, ue.props.disabled = oe[se].readOnly, oe[se].selector && oe[se].selector.data && (ue.options = oe[se].selector.data.map((ge) => Object.assign(
41027
+ ue.name = "ElSelect", ue.attrs.style = "width: 100%;min-width: 80px;", ue.props.filterable = !0, ue.props.disabled = oe[se].notUpdate || oe[se].readOnly, oe[se].selector && oe[se].selector.data && (ue.options = oe[se].selector.data.map((ge) => Object.assign(
40994
41028
  {
40995
41029
  value: ge.VALUE,
40996
41030
  label: ge.NAME
@@ -41001,7 +41035,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41001
41035
  };
41002
41036
  break;
41003
41037
  case "TABLE":
41004
- pe.style = "width: 100%;min-width: 80px;", ue.props.disabled = oe[se].readOnly, pe.selectorId = oe[se].selectorId, pe.formatter = ({ row: ge, column: _e }) => (!ge["_" + _e.property + "_NAME"] && _e.editRender.options && _e.editRender.options.forEach(($e) => {
41038
+ ue.attrs.style = "width: 100%;min-width: 80px;", ue.props.disabled = oe[se].notUpdate || oe[se].readOnly, pe.selectorId = oe[se].selectorId, pe.formatter = ({ row: ge, column: _e }) => (!ge["_" + _e.property + "_NAME"] && _e.editRender.options && _e.editRender.options.forEach(($e) => {
41005
41039
  if ($e.VALUE == ge[_e.property]) {
41006
41040
  ge["_" + _e.property + "_NAME"] = $e.NAME;
41007
41041
  return;
@@ -41038,14 +41072,14 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41038
41072
  ...ue.props,
41039
41073
  type: "date",
41040
41074
  valueFormat: "YYYY-MM-DD"
41041
- };
41075
+ }, ue.attrs.style = "width: 100%";
41042
41076
  break;
41043
41077
  case "DATETIME":
41044
41078
  ue.name = "ElDatePicker", ue.props = {
41045
41079
  ...ue.props,
41046
41080
  type: "datetime",
41047
41081
  valueFormat: "YYYY-MM-DD HH:mm:ss"
41048
- };
41082
+ }, ue.attrs.style = "width: 100%";
41049
41083
  break;
41050
41084
  case "TIME":
41051
41085
  ue.name = "ElTimePicker", ue.props = {
@@ -41069,7 +41103,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41069
41103
  let me = {
41070
41104
  name: ue.props.unitName ? "unitInput" : ue.name,
41071
41105
  props: ue.props,
41072
- attrs: { placeholder: ue.props.placeholder, id: ce },
41106
+ attrs: { placeholder: ue.props.placeholder, id: ce, ...ue.attrs },
41073
41107
  options: ue.options,
41074
41108
  events: pe.events
41075
41109
  };
@@ -41149,18 +41183,18 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41149
41183
  params: X
41150
41184
  };
41151
41185
  }, beforeHideMethod = async (Q) => {
41152
- const H = formConfig.value.openType === "edit" || formConfig.value.openType === "new", X = xForm.value.validateDataChg(), G = Q.type === "mask" || Q.type === "close", Z = typeof Q == "function", K = typeof Q == "boolean" && !Q;
41153
- if (H && X && (G || Z || K)) {
41186
+ const H = formConfig.value.openType === "edit" || formConfig.value.openType === "new", X = xForm.value.validateDataChg(), K = Q.type === "mask" || Q.type === "close" || typeof Q == "function";
41187
+ if (H && X && K) {
41154
41188
  if (await $vxeConfirm(
41155
41189
  "当前页面数据有更改,是否保存数据?",
41156
41190
  void 0,
41157
41191
  { zIndex: 3e3 }
41158
41192
  ) === "confirm")
41159
41193
  saveData(!0);
41160
- else if (Z ? Q() : K && (formConfig.value.showEdit = Q), Q.type === "mask")
41194
+ else if (Q(), saveDataBtnLoading.value = !1, Q.type === "mask")
41161
41195
  return new Error();
41162
41196
  } else
41163
- Z ? Q() : K && (formConfig.value.showEdit = Q);
41197
+ Q(), saveDataBtnLoading.value = !1;
41164
41198
  }, editPreData = () => {
41165
41199
  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];
41166
41200
  }, editAfterData = () => {
@@ -41246,7 +41280,6 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41246
41280
  transfer: "",
41247
41281
  style: { overflow: "hidden" },
41248
41282
  visible: unref(formConfig).showEdit,
41249
- "onUpdate:visible": beforeHideMethod,
41250
41283
  width: unref(formConfig).width,
41251
41284
  height: unref(formConfig).height,
41252
41285
  draggable: "",
@@ -41258,7 +41291,6 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41258
41291
  footer: unref(formConfig).openType === "edit" || unref(formConfig).openType === "new" ? void 0 : null,
41259
41292
  "show-zoom": "",
41260
41293
  onZoom: zoomModal,
41261
- "before-hide-method": beforeHideMethod,
41262
41294
  "before-close": beforeHideMethod
41263
41295
  }, createSlots({
41264
41296
  header: withCtx(() => [
@@ -41507,7 +41539,7 @@ const windowIndex_vue_vue_type_style_index_0_scoped_4404f820_lang = "", _withSco
41507
41539
  ]);
41508
41540
  };
41509
41541
  }
41510
- }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-4404f820"]]);
41542
+ }, WindowIndex = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-d7ca317f"]]);
41511
41543
  WindowIndex.name = "slw-window-index";
41512
41544
  WindowIndex.install = (Q) => {
41513
41545
  Q.component(WindowIndex.name, WindowIndex);
@@ -124315,7 +124347,7 @@ function reConsole() {
124315
124347
  }
124316
124348
  }
124317
124349
  console.info(
124318
- "%cSLW %cVer 0.8.51",
124350
+ "%cSLW %cVer 0.8.71",
124319
124351
  "color:#409EFF;font-size: 22px;font-weight:bolder",
124320
124352
  "color:#999;font-size: 12px"
124321
124353
  );