slw 0.8.5 → 0.8.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.
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_f7624df7_lang = "", _withScopeId$2 = (Q) => (pushScopeId("data-v-f7624df7"), 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 ? {
@@ -39609,7 +39639,7 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39609
39639
  }, 1032, ["modelValue", "onUpdate:modelValue", "onKeyup", "onChange"])
39610
39640
  ]),
39611
39641
  key: "1"
39612
- } : ne.itemRender.props.suffixIcon || ne.itemRender.props.prefixIcon ? {
39642
+ } : ne.itemRender.props.suffixIconfont || ne.itemRender.props.prefixIconfont ? {
39613
39643
  name: "default",
39614
39644
  fn: withCtx(() => [
39615
39645
  createVNode(X, {
@@ -39618,21 +39648,25 @@ const index$n = /* @__PURE__ */ getDefaultExportFromCjs(jsExports), windowForm_v
39618
39648
  onKeyup: (re) => onIconInputEnter(ne, re),
39619
39649
  onChange: (re) => onIconInputChange(ne)
39620
39650
  }, createSlots({ _: 2 }, [
39621
- ne.itemRender.props.suffixIcon ? {
39651
+ ne.itemRender.props.suffixIconfont ? {
39622
39652
  name: "suffix",
39623
39653
  fn: withCtx(() => [
39624
39654
  createElementVNode("i", {
39625
- class: normalizeClass("iconfont " + ne.itemRender.props.suffixIcon),
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"])
39629
39661
  ]),
39630
39662
  key: "0"
39631
- } : ne.itemRender.props.prefixIcon ? {
39663
+ } : ne.itemRender.props.prefixIconfont ? {
39632
39664
  name: "prefix",
39633
39665
  fn: withCtx(() => [
39634
39666
  createElementVNode("i", {
39635
- class: normalizeClass("iconfont " + ne.itemRender.props.prefixIcon),
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-f7624df7"]]);
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);
@@ -124315,7 +124349,7 @@ function reConsole() {
124315
124349
  }
124316
124350
  }
124317
124351
  console.info(
124318
- "%cSLW %cVer 0.8.5",
124352
+ "%cSLW %cVer 0.8.7",
124319
124353
  "color:#409EFF;font-size: 22px;font-weight:bolder",
124320
124354
  "color:#999;font-size: 12px"
124321
124355
  );