sctj-components 1.0.8 → 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.
@@ -4896,7 +4896,6 @@ const _sfc_main$6 = {
4896
4896
  emits: ["loadSucccess"],
4897
4897
  setup(__props, { expose, emit }) {
4898
4898
  const props = __props;
4899
- const { proxy } = getCurrentInstance$1();
4900
4899
  const uploadRef = ref$1(null);
4901
4900
  const action = ref$1("");
4902
4901
  const params = reactive({
@@ -4929,8 +4928,53 @@ const _sfc_main$6 = {
4929
4928
  uploadRef.value.submit();
4930
4929
  });
4931
4930
  };
4932
- const importTemplate = () => {
4933
- 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
+ }
4934
4978
  };
4935
4979
  const handleFileUploadProgress = (event, file, fileList) => {
4936
4980
  params.isUploading = true;
@@ -5070,8 +5114,8 @@ const _sfc_main$6 = {
5070
5114
  };
5071
5115
  }
5072
5116
  };
5073
- const index_vue_vue_type_style_index_0_scoped_9c88ab2c_lang = "";
5074
- 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);
5075
5119
  const _hoisted_1$3 = {
5076
5120
  key: 0,
5077
5121
  class: "search-container"
@@ -5160,7 +5204,7 @@ const _sfc_main$5 = {
5160
5204
  const { queryParams } = toRefs(data);
5161
5205
  const tagDeleteAll = async () => {
5162
5206
  var _a;
5163
- 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?");
5164
5208
  selectDataList.value = [];
5165
5209
  (_a = tableRef.value) == null ? void 0 : _a.clearSelection();
5166
5210
  };
@@ -5178,7 +5222,7 @@ const _sfc_main$5 = {
5178
5222
  getList();
5179
5223
  };
5180
5224
  const resetQuery = () => {
5181
- proxy.resetForm("queryFormRef");
5225
+ proxy.$refs.queryFormRef.resetFields();
5182
5226
  queryParams.value.pageNum = 1;
5183
5227
  getList();
5184
5228
  };
@@ -5255,7 +5299,7 @@ const _sfc_main$5 = {
5255
5299
  const close = () => {
5256
5300
  dialogParams.value.open = false;
5257
5301
  selectDataList.value = [];
5258
- proxy.resetForm("queryFormRef");
5302
+ proxy.$refs.queryFormRef.resetFields();
5259
5303
  queryParams.value = {
5260
5304
  pageNum: 1,
5261
5305
  pageSize: 20
@@ -5572,7 +5616,7 @@ const _sfc_main$5 = {
5572
5616
  };
5573
5617
  }
5574
5618
  };
5575
- 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"]]);
5576
5620
  const index_vue_vue_type_style_index_0_scoped_24729613_lang = "";
5577
5621
  const _hoisted_1$2 = { class: "action-container" };
5578
5622
  const _hoisted_2$2 = {