yuanjia-form-pro-standard 1.1.6-beta9.6 → 1.1.6-beta9.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/designer.es.js CHANGED
@@ -152536,12 +152536,12 @@ var FileSaver_min = { exports: {} };
152536
152536
  });
152537
152537
  })(FileSaver_min);
152538
152538
  var electronicCaseWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
152539
- let pendingOSSRequest$1 = null;
152540
- async function getOSSConfigWithCache$1() {
152541
- if (pendingOSSRequest$1) {
152542
- return await pendingOSSRequest$1;
152539
+ let pendingOSSRequest = null;
152540
+ async function getOSSConfigWithCache() {
152541
+ if (pendingOSSRequest) {
152542
+ return await pendingOSSRequest;
152543
152543
  }
152544
- pendingOSSRequest$1 = axios$1.post(`https://data.yuanjia101.com/api/SmallTools/PutObjectSignPolicy`).then((res) => {
152544
+ pendingOSSRequest = axios$1.post(`https://data.yuanjia101.com/api/SmallTools/PutObjectSignPolicy`).then((res) => {
152545
152545
  const config2 = {
152546
152546
  key_id: res.data.accessKeyId,
152547
152547
  base64policy: res.data.policy,
@@ -152550,12 +152550,12 @@ async function getOSSConfigWithCache$1() {
152550
152550
  return config2;
152551
152551
  }).catch((error2) => {
152552
152552
  console.error("\u83B7\u53D6 OSS \u914D\u7F6E\u5931\u8D25:", error2);
152553
- pendingOSSRequest$1 = null;
152553
+ pendingOSSRequest = null;
152554
152554
  throw error2;
152555
152555
  }).finally(() => {
152556
- pendingOSSRequest$1 = null;
152556
+ pendingOSSRequest = null;
152557
152557
  });
152558
- return await pendingOSSRequest$1;
152558
+ return await pendingOSSRequest;
152559
152559
  }
152560
152560
  const _sfc_main$50 = {
152561
152561
  name: "electronic-case-widget",
@@ -152931,7 +152931,7 @@ const _sfc_main$50 = {
152931
152931
  async getOSSConfig() {
152932
152932
  var _a2, _b2;
152933
152933
  try {
152934
- this.ossConfigParams = await getOSSConfigWithCache$1();
152934
+ this.ossConfigParams = await getOSSConfigWithCache();
152935
152935
  } catch (error2) {
152936
152936
  console.error("\u83B7\u53D6 OSS \u914D\u7F6E\u5931\u8D25:", error2);
152937
152937
  (_b2 = (_a2 = this.$message) == null ? void 0 : _a2.error) == null ? void 0 : _b2.call(_a2, "\u83B7\u53D6\u4E0A\u4F20\u914D\u7F6E\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");
@@ -156884,37 +156884,6 @@ var __glob_0_15$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
156884
156884
  "default": numberWidget
156885
156885
  }, Symbol.toStringTag, { value: "Module" }));
156886
156886
  var pictureUploadWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
156887
- let pendingOSSRequest = null;
156888
- async function getOSSConfigWithCache() {
156889
- if (pendingOSSRequest) {
156890
- return await pendingOSSRequest;
156891
- }
156892
- const token = almLocalStorage.getItem("token");
156893
- const rToken = almLocalStorage.getItem("rToken");
156894
- const tokenTime = almLocalStorage.getItem("tokenTime");
156895
- const headers = {};
156896
- if (token !== null)
156897
- headers["Authorization"] = "Bearer " + token;
156898
- if (!tokenTime && rToken) {
156899
- headers["X-Authorization"] = "Bearer " + rToken;
156900
- }
156901
- const url = commonGETApiTranslation("api/SysFile/OssSign");
156902
- pendingOSSRequest = axios$1.get(url, { headers }).then((res) => {
156903
- const config2 = {
156904
- key_id: "LTAIFRkpHKDTK5dv",
156905
- base64policy: res.data.Data.policy,
156906
- signature: res.data.Data.signature
156907
- };
156908
- return config2;
156909
- }).catch((error2) => {
156910
- console.error("\u83B7\u53D6 OSS \u914D\u7F6E\u5931\u8D25:", error2);
156911
- pendingOSSRequest = null;
156912
- throw error2;
156913
- }).finally(() => {
156914
- pendingOSSRequest = null;
156915
- });
156916
- return await pendingOSSRequest;
156917
- }
156918
156887
  const _sfc_main$4W = {
156919
156888
  name: "picture-upload-widget",
156920
156889
  componentName: "FieldWidget",
@@ -156975,6 +156944,7 @@ const _sfc_main$4W = {
156975
156944
  fileList: [],
156976
156945
  fileListBeforeRemove: [],
156977
156946
  uploadBtnHidden: false,
156947
+ uploadingFiles: new Set(),
156978
156948
  previewUrl: "",
156979
156949
  showPreviewDialogFlag: false
156980
156950
  };
@@ -157016,11 +156986,16 @@ const _sfc_main$4W = {
157016
156986
  },
157017
156987
  beforeUnmount() {
157018
156988
  this.unregisterFromRefList();
156989
+ this.uploadingFiles.clear();
157019
156990
  },
157020
156991
  methods: {
157021
156992
  async getOSSConfig() {
157022
156993
  try {
157023
- this.ossConfigParams = await getOSSConfigWithCache();
156994
+ this.ossConfigParams = {
156995
+ key_id: "LTAIFRkpHKDTK5dv",
156996
+ base64policy: "eyJleHBpcmF0aW9uIjoiMjAyNi0wMS0yMlQwNzo1ODo0My43MDRaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF1dfQ==",
156997
+ signature: "xA+TgXT5N4gcIE5me9Fcq2mJdXA="
156998
+ };
157024
156999
  } catch (error2) {
157025
157000
  console.error("\u83B7\u53D6 OSS \u914D\u7F6E\u5931\u8D25:", error2);
157026
157001
  }
@@ -157072,8 +157047,16 @@ const _sfc_main$4W = {
157072
157047
  const newFileName = sanitizeFilename(file.name);
157073
157048
  const newFile = new File([file], newFileName, { type: file.type });
157074
157049
  this.uploadData.key = "vform/" + random + newFile.name;
157050
+ if (file.uid) {
157051
+ this.uploadingFiles.add(file.uid);
157052
+ }
157075
157053
  return this.handleOnBeforeUpload(newFile);
157076
157054
  },
157055
+ handlePictureProgress(event, file, fileList) {
157056
+ if (file.uid) {
157057
+ this.uploadingFiles.add(file.uid);
157058
+ }
157059
+ },
157077
157060
  handleOnBeforeUpload(file) {
157078
157061
  if (!!this.field.options.onBeforeUpload) {
157079
157062
  let bfFunc = new Function("file", this.field.options.onBeforeUpload);
@@ -157106,6 +157089,9 @@ const _sfc_main$4W = {
157106
157089
  },
157107
157090
  handlePictureUpload(res, file, fileList) {
157108
157091
  if (file.status === "success") {
157092
+ if (file.uid) {
157093
+ this.uploadingFiles.delete(file.uid);
157094
+ }
157109
157095
  if (fileList.length) {
157110
157096
  fileList.forEach((item) => {
157111
157097
  if (item.raw.name) {
@@ -157149,6 +157135,9 @@ const _sfc_main$4W = {
157149
157135
  this.fileListBeforeRemove = deepClone(fileList);
157150
157136
  },
157151
157137
  handlePictureRemove(file, fileList) {
157138
+ if (file.uid) {
157139
+ this.uploadingFiles.delete(file.uid);
157140
+ }
157152
157141
  this.fileList = deepClone(fileList);
157153
157142
  this.updateFieldModelAndEmitDataChangeForRemove(file, fileList);
157154
157143
  this.uploadBtnHidden = fileList.length >= this.field.options.limit;
@@ -157158,6 +157147,9 @@ const _sfc_main$4W = {
157158
157147
  }
157159
157148
  },
157160
157149
  handleUploadError(err, file, fileList) {
157150
+ if (file.uid) {
157151
+ this.uploadingFiles.delete(file.uid);
157152
+ }
157161
157153
  if (!!this.field.options.onUploadError) {
157162
157154
  let customFn = new Function("error", "file", "fileList", this.field.options.onUploadError);
157163
157155
  customFn.call(this, err, file, fileList);
@@ -157183,16 +157175,7 @@ const _sfc_main$4W = {
157183
157175
  }
157184
157176
  if (this.field.formItemFlag && !this.field.options.hidden && this.isShow) {
157185
157177
  const uploadStatusValidator = (rule, value2, callback) => {
157186
- const uploadRef = this.$refs.fieldEditor;
157187
- if (!uploadRef) {
157188
- callback();
157189
- return;
157190
- }
157191
- const currentFileList = uploadRef.uploadFiles || uploadRef.fileList || this.fileList || [];
157192
- const hasUploadingFile = currentFileList.some((file) => {
157193
- const status = file.status;
157194
- return status && status !== "success" && status !== "fail";
157195
- });
157178
+ const hasUploadingFile = this.uploadingFiles.size > 0;
157196
157179
  if (hasUploadingFile) {
157197
157180
  callback(new Error(this.field.options.uploadingHint || `[${this.field.options.label || this.field.options.name}]` + this.i18nt("render.hint.fileUploading")));
157198
157181
  } else {
@@ -157252,6 +157235,7 @@ function _sfc_render$4W(_ctx, _cache, $props, $setup, $data, $options) {
157252
157235
  "on-exceed": $options.handlePictureExceed,
157253
157236
  "on-preview": $options.handlePicturePreview,
157254
157237
  "before-upload": $options.beforePictureUpload,
157238
+ "on-progress": $options.handlePictureProgress,
157255
157239
  "on-success": $options.handlePictureUpload,
157256
157240
  "on-error": $options.handleUploadError,
157257
157241
  "before-remove": $options.handleBeforeRemove,
@@ -157283,7 +157267,7 @@ function _sfc_render$4W(_ctx, _cache, $props, $setup, $data, $options) {
157283
157267
  _cache[2] || (_cache[2] = createElementVNode("i", { class: "el-icon-plus avatar-uploader-icon" }, null, -1))
157284
157268
  ]),
157285
157269
  _: 1
157286
- }, 8, ["disabled", "action", "headers", "data", "with-credentials", "multiple", "file-list", "show-file-list", "class", "limit", "on-exceed", "on-preview", "before-upload", "on-success", "on-error", "before-remove", "on-remove"]),
157270
+ }, 8, ["disabled", "action", "headers", "data", "with-credentials", "multiple", "file-list", "show-file-list", "class", "limit", "on-exceed", "on-preview", "before-upload", "on-progress", "on-success", "on-error", "before-remove", "on-remove"]),
157287
157271
  $data.showPreviewDialogFlag ? withDirectives((openBlock(), createElementBlock("div", _hoisted_5$i, [
157288
157272
  createVNode(_component_el_dialog, {
157289
157273
  title: "",
@@ -157313,7 +157297,7 @@ function _sfc_render$4W(_ctx, _cache, $props, $setup, $data, $options) {
157313
157297
  _: 1
157314
157298
  }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
157315
157299
  }
157316
- var pictureUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4W, [["render", _sfc_render$4W], ["__scopeId", "data-v-4d3c056d"]]);
157300
+ var pictureUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4W, [["render", _sfc_render$4W], ["__scopeId", "data-v-66827f61"]]);
157317
157301
  var __glob_0_16$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
157318
157302
  __proto__: null,
157319
157303
  "default": pictureUploadWidget
@@ -241292,13 +241276,13 @@ var Draggable = /* @__PURE__ */ getDefaultExportFromCjs(vuedraggable_umd.exports
241292
241276
  if (typeof window !== "undefined") {
241293
241277
  let loadSvg = function() {
241294
241278
  var body = document.body;
241295
- var svgDom = document.getElementById("__svg__icons__dom__1769064804868__");
241279
+ var svgDom = document.getElementById("__svg__icons__dom__1769066159830__");
241296
241280
  if (!svgDom) {
241297
241281
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
241298
241282
  svgDom.style.position = "absolute";
241299
241283
  svgDom.style.width = "0";
241300
241284
  svgDom.style.height = "0";
241301
- svgDom.id = "__svg__icons__dom__1769064804868__";
241285
+ svgDom.id = "__svg__icons__dom__1769066159830__";
241302
241286
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
241303
241287
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
241304
241288
  }