sctj-components 1.0.7 → 1.0.9

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.
@@ -249,7 +249,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
249
249
  const SCTJSvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$1]]);
250
250
  const index$2 = "";
251
251
  const index$1 = "";
252
- const index_vue_vue_type_style_index_0_scoped_94e5f133_lang = "";
252
+ const index_vue_vue_type_style_index_0_scoped_f55d9716_lang = "";
253
253
  const index_vue_vue_type_style_index_1_lang = "";
254
254
  const _hoisted_1$k = { class: "upload-file" };
255
255
  const _hoisted_2$e = { class: "el-upload__tip" };
@@ -288,8 +288,7 @@ const _sfc_main$q = {
288
288
  },
289
289
  uploadFileUrl: {
290
290
  type: String,
291
- default: "",
292
- required: true
291
+ default: ""
293
292
  },
294
293
  headers: {
295
294
  type: Object,
@@ -630,8 +629,8 @@ const _sfc_main$q = {
630
629
  };
631
630
  }
632
631
  };
633
- const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-94e5f133"]]);
634
- const index_vue_vue_type_style_index_0_scoped_13e683b8_lang = "";
632
+ const SCTJFileUpload = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-f55d9716"]]);
633
+ const index_vue_vue_type_style_index_0_scoped_ddc0faf6_lang = "";
635
634
  const _hoisted_1$j = { class: "component-upload-image" };
636
635
  const _hoisted_2$d = {
637
636
  key: 0,
@@ -677,8 +676,7 @@ const _sfc_main$p = {
677
676
  },
678
677
  uploadImgUrl: {
679
678
  type: String,
680
- default: "",
681
- required: true
679
+ default: ""
682
680
  },
683
681
  headers: {
684
682
  type: Object,
@@ -923,7 +921,7 @@ const _sfc_main$p = {
923
921
  };
924
922
  }
925
923
  };
926
- const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-13e683b8"]]);
924
+ const SCTJImageUpload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-ddc0faf6"]]);
927
925
  const index_vue_vue_type_style_index_0_scoped_bebc33d5_lang = "";
928
926
  const _hoisted_1$i = { class: "image-slot" };
929
927
  const _sfc_main$o = {
@@ -4898,7 +4896,6 @@ const _sfc_main$6 = {
4898
4896
  emits: ["loadSucccess"],
4899
4897
  setup(__props, { expose, emit }) {
4900
4898
  const props = __props;
4901
- const { proxy } = getCurrentInstance$1();
4902
4899
  const uploadRef = ref$1(null);
4903
4900
  const action = ref$1("");
4904
4901
  const params = reactive({
@@ -4931,8 +4928,53 @@ const _sfc_main$6 = {
4931
4928
  uploadRef.value.submit();
4932
4929
  });
4933
4930
  };
4934
- const importTemplate = () => {
4935
- proxy == null ? void 0 : proxy.download(props.templateUrl, { ...extraParams }, `${props.templateTitle}\u5BFC\u5165\u6A21\u677F.xlsx`);
4931
+ const buildUrlWithParams = (url, params2 = {}) => {
4932
+ if (!url)
4933
+ return "";
4934
+ try {
4935
+ const fullUrl = new URL(url, window.location.origin);
4936
+ Object.keys(params2).forEach((key) => {
4937
+ if (params2[key] !== void 0 && params2[key] !== null) {
4938
+ fullUrl.searchParams.append(key, params2[key]);
4939
+ }
4940
+ });
4941
+ return fullUrl.toString();
4942
+ } catch (e) {
4943
+ const query = Object.keys(params2).filter((key) => params2[key] !== void 0 && params2[key] !== null).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(params2[key])}`).join("&");
4944
+ if (!query)
4945
+ return url;
4946
+ return url.includes("?") ? `${url}&${query}` : `${url}?${query}`;
4947
+ }
4948
+ };
4949
+ const importTemplate = async () => {
4950
+ if (!props.templateUrl) {
4951
+ ElMessage.error("\u672A\u914D\u7F6E\u6A21\u677F\u4E0B\u8F7D\u5730\u5740");
4952
+ return;
4953
+ }
4954
+ try {
4955
+ const href = buildUrlWithParams(props.templateUrl, { ...extraParams });
4956
+ const response = await fetch(href, {
4957
+ method: "POST",
4958
+ headers: props.headers || {}
4959
+ });
4960
+ if (!response.ok) {
4961
+ throw new Error(`\u4E0B\u8F7D\u5931\u8D25\uFF0C\u72B6\u6001\u7801\uFF1A${response.status}`);
4962
+ }
4963
+ const blob = await response.blob();
4964
+ const blobUrl = window.URL.createObjectURL(blob);
4965
+ const link = document.createElement("a");
4966
+ link.style.display = "none";
4967
+ link.href = blobUrl;
4968
+ const fileName = `${props.templateTitle || ""}\u5BFC\u5165\u6A21\u677F.xlsx`;
4969
+ link.download = fileName;
4970
+ document.body.appendChild(link);
4971
+ link.click();
4972
+ document.body.removeChild(link);
4973
+ window.URL.revokeObjectURL(blobUrl);
4974
+ } catch (e) {
4975
+ console.error(e);
4976
+ ElMessage.error("\u6A21\u677F\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
4977
+ }
4936
4978
  };
4937
4979
  const handleFileUploadProgress = (event, file, fileList) => {
4938
4980
  params.isUploading = true;
@@ -5072,8 +5114,8 @@ const _sfc_main$6 = {
5072
5114
  };
5073
5115
  }
5074
5116
  };
5075
- const index_vue_vue_type_style_index_0_scoped_9c88ab2c_lang = "";
5076
- const _withScopeId$2 = (n) => (pushScopeId("data-v-9c88ab2c"), n = n(), popScopeId(), n);
5117
+ const index_vue_vue_type_style_index_0_scoped_42a8ab57_lang = "";
5118
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-42a8ab57"), n = n(), popScopeId(), n);
5077
5119
  const _hoisted_1$3 = {
5078
5120
  key: 0,
5079
5121
  class: "search-container"
@@ -5162,7 +5204,7 @@ const _sfc_main$5 = {
5162
5204
  const { queryParams } = toRefs(data);
5163
5205
  const tagDeleteAll = async () => {
5164
5206
  var _a;
5165
- await proxy.$modal.confirm("\u60A8\u786E\u5B9A\u8981\u5168\u90E8\u5220\u9664\u5417?");
5207
+ await ElMessage.warning("\u60A8\u786E\u5B9A\u8981\u5168\u90E8\u5220\u9664\u5417?");
5166
5208
  selectDataList.value = [];
5167
5209
  (_a = tableRef.value) == null ? void 0 : _a.clearSelection();
5168
5210
  };
@@ -5180,7 +5222,7 @@ const _sfc_main$5 = {
5180
5222
  getList();
5181
5223
  };
5182
5224
  const resetQuery = () => {
5183
- proxy.resetForm("queryFormRef");
5225
+ proxy.$refs.queryFormRef.resetFields();
5184
5226
  queryParams.value.pageNum = 1;
5185
5227
  getList();
5186
5228
  };
@@ -5257,7 +5299,7 @@ const _sfc_main$5 = {
5257
5299
  const close = () => {
5258
5300
  dialogParams.value.open = false;
5259
5301
  selectDataList.value = [];
5260
- proxy.resetForm("queryFormRef");
5302
+ proxy.$refs.queryFormRef.resetFields();
5261
5303
  queryParams.value = {
5262
5304
  pageNum: 1,
5263
5305
  pageSize: 20
@@ -5574,7 +5616,7 @@ const _sfc_main$5 = {
5574
5616
  };
5575
5617
  }
5576
5618
  };
5577
- const SCTJDialogTable = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-9c88ab2c"]]);
5619
+ const SCTJDialogTable = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-42a8ab57"]]);
5578
5620
  const index_vue_vue_type_style_index_0_scoped_24729613_lang = "";
5579
5621
  const _hoisted_1$2 = { class: "action-container" };
5580
5622
  const _hoisted_2$2 = {