form-custom-test 3.0.68 → 3.0.69

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.
@@ -3682,6 +3682,7 @@ const personTreeSchema = {
3682
3682
  customClass: "",
3683
3683
  onOpen: "",
3684
3684
  onConfirm: "",
3685
+ onRemoveTag: "",
3685
3686
  onCancel: "",
3686
3687
  onClose: ""
3687
3688
  }
@@ -4094,8 +4095,8 @@ const _hoisted_4$l = ["title", "onDblclick"];
4094
4095
  const _hoisted_5$h = ["title", "onDblclick"];
4095
4096
  const _hoisted_6$g = ["src"];
4096
4097
  const _hoisted_7$d = ["src"];
4097
- const _hoisted_8$9 = { class: "bottom clear-fix" };
4098
- const _hoisted_9$7 = { class: "ft-title" };
4098
+ const _hoisted_8$a = { class: "bottom clear-fix" };
4099
+ const _hoisted_9$8 = { class: "ft-title" };
4099
4100
  function _sfc_render$3t(_ctx, _cache, $props, $setup, $data, $options) {
4100
4101
  const _component_svg_icon = resolveComponent("svg-icon");
4101
4102
  const _component_draggable = resolveComponent("draggable");
@@ -4314,8 +4315,8 @@ function _sfc_render$3t(_ctx, _cache, $props, $setup, $data, $options) {
4314
4315
  ]),
4315
4316
  _: 2
4316
4317
  }, 1024),
4317
- createElementVNode("div", _hoisted_8$9, [
4318
- createElementVNode("span", _hoisted_9$7, "#" + toDisplayString(idx + 1) + " " + toDisplayString(ft.title), 1),
4318
+ createElementVNode("div", _hoisted_8$a, [
4319
+ createElementVNode("span", _hoisted_9$8, "#" + toDisplayString(idx + 1) + " " + toDisplayString(ft.title), 1),
4319
4320
  createVNode(_component_el_button, {
4320
4321
  link: "",
4321
4322
  type: "primary",
@@ -4567,7 +4568,7 @@ const _hoisted_6$f = {
4567
4568
  class: "drag-handler background-opacity"
4568
4569
  };
4569
4570
  const _hoisted_7$c = ["title"];
4570
- const _hoisted_8$8 = { key: 0 };
4571
+ const _hoisted_8$9 = { key: 0 };
4571
4572
  function _sfc_render$3r(_ctx, _cache, $props, $setup, $data, $options) {
4572
4573
  const _component_svg_icon = resolveComponent("svg-icon");
4573
4574
  return openBlock(), createElementBlock("div", {
@@ -4618,7 +4619,7 @@ function _sfc_render$3r(_ctx, _cache, $props, $setup, $data, $options) {
4618
4619
  createVNode(_component_svg_icon, { "icon-class": "el-drag-move" })
4619
4620
  ], 8, _hoisted_7$c),
4620
4621
  createElementVNode("i", null, toDisplayString(_ctx.i18n2t(`designer.widgetLabel.${$props.field.type}`, `extension.widgetLabel.${$props.field.type}`)), 1),
4621
- $props.field.options.hidden === true ? (openBlock(), createElementBlock("i", _hoisted_8$8, [
4622
+ $props.field.options.hidden === true ? (openBlock(), createElementBlock("i", _hoisted_8$9, [
4622
4623
  createVNode(_component_svg_icon, { "icon-class": "el-hide" })
4623
4624
  ])) : createCommentVNode("", true)
4624
4625
  ])) : createCommentVNode("", true)
@@ -10920,8 +10921,8 @@ const _hoisted_7$b = {
10920
10921
  key: 1,
10921
10922
  class: "drag-handler background-opacity"
10922
10923
  };
10923
- const _hoisted_8$7 = ["title"];
10924
- const _hoisted_9$6 = { key: 0 };
10924
+ const _hoisted_8$8 = ["title"];
10925
+ const _hoisted_9$7 = { key: 0 };
10925
10926
  function _sfc_render$3p(_ctx, _cache, $props, $setup, $data, $options) {
10926
10927
  const _component_svg_icon = resolveComponent("svg-icon");
10927
10928
  const _component_el_tooltip = resolveComponent("el-tooltip");
@@ -11028,9 +11029,9 @@ function _sfc_render$3p(_ctx, _cache, $props, $setup, $data, $options) {
11028
11029
  title: _ctx.i18nt("designer.hint.dragHandler")
11029
11030
  }, [
11030
11031
  createVNode(_component_svg_icon, { "icon-class": "el-drag-move" })
11031
- ], 8, _hoisted_8$7),
11032
+ ], 8, _hoisted_8$8),
11032
11033
  createElementVNode("i", null, toDisplayString(_ctx.i18n2t(`designer.widgetLabel.${$props.field.type}`, `extension.widgetLabel.${$props.field.type}`)), 1),
11033
- $props.field.options.hidden === true ? (openBlock(), createElementBlock("i", _hoisted_9$6, [
11034
+ $props.field.options.hidden === true ? (openBlock(), createElementBlock("i", _hoisted_9$7, [
11034
11035
  createVNode(_component_svg_icon, { "icon-class": "el-hide" })
11035
11036
  ])) : createCommentVNode("", true)
11036
11037
  ])) : createCommentVNode("", true)
@@ -12003,6 +12004,17 @@ function useCookies() {
12003
12004
  var cookies2 = reactive(GLOBAL_COOKIES_MANAGER);
12004
12005
  return { cookies: cookies2 };
12005
12006
  }
12007
+ function downloadMethod(fileData, fileName) {
12008
+ const blob = new Blob([fileData]);
12009
+ const downloadUrl = window.URL.createObjectURL(blob);
12010
+ const downloadLink = document.createElement("a");
12011
+ downloadLink.href = downloadUrl;
12012
+ downloadLink.download = fileName;
12013
+ document.body.appendChild(downloadLink);
12014
+ downloadLink.click();
12015
+ document.body.removeChild(downloadLink);
12016
+ window.URL.revokeObjectURL(downloadUrl);
12017
+ }
12006
12018
  var _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABsUlEQVR4AaxSy0ojURA9dTMZZobxA4ZhZhgXLlwo4kLcuRMknU4aIuILFPyP/Ieg4Asx0El3B8GdO3EhogsXLhQV8QMUFTVdnmC6JWkVRIu6fU/XOXW41L0GH4zPM1DLmVDL3lMrb792KM3mHfLU2KOR5vkEvV3LgJxCw2XNZnvQEprL9UJ1EdBjBN5qRMcGUiyGkJDOcoTQ+Dro/IpEmsn8Rk08CA5xmR4XIIy42KBeEN+/ZLNFYRpfw4oWCt/Vsn5AvnjsSUE0K5ulq7o2Wk0G9aKsuydQyQPahdv7eSC1wHonDHLieWdoiYRBnZdqeQsiM8TDXA7xNJu3iRP5okFC9UbhRQPN5Ps58Vn2rXG5xHNq233EiUwY6JDzj8MqA7KPb+kpoDYJ4IBzr9DkD3FTNhnw/ttgwoCKO9yZnJRKNxIE19AHPi5T43B9HSj8JB+niZAWiwZqVjj9dkhoy4Z7EXFSrZ4jpTYUHWi7X1LwThpkbICd/TE2/4WYMb6H3QYfb1Kp7PA2JgD5D8seQSNiAwncRQm8bgnKfDQNtmUTv+ySp8bjSZ/I2ODp9/3fRwAAAP//S/wI2gAAAAZJREFUAwCGXJIhFOitmwAAAABJRU5ErkJggg==";
12007
12019
  var fileUploadWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
12008
12020
  useCookies();
@@ -12252,6 +12264,58 @@ const _sfc_main$37 = {
12252
12264
  type: "error"
12253
12265
  });
12254
12266
  }
12267
+ },
12268
+ async handlePreview(file) {
12269
+ console.log(file, "file");
12270
+ try {
12271
+ const { response, fileId } = file;
12272
+ if (response) {
12273
+ const { data: data2 } = response;
12274
+ if (!data2.fileId) {
12275
+ throw new Error("\u6587\u4EF6ID\u4E0D\u80FD\u4E3A\u7A7A");
12276
+ }
12277
+ const { data: previewData } = await service({
12278
+ method: "get",
12279
+ url: "unified-file/sys-file/kkfile-url",
12280
+ params: { fileId: data2.fileId }
12281
+ });
12282
+ window.open(previewData);
12283
+ } else {
12284
+ if (!fileId) {
12285
+ throw new Error("\u6587\u4EF6ID\u4E0D\u80FD\u4E3A\u7A7A");
12286
+ }
12287
+ const { data: previewData } = await filePreview(fileId);
12288
+ window.open(previewData);
12289
+ }
12290
+ } catch (error) {
12291
+ console.error(error);
12292
+ }
12293
+ },
12294
+ async handleDownload(file) {
12295
+ const { response, fileId, fileName, name } = file;
12296
+ if (response) {
12297
+ const { data: data2 } = response;
12298
+ if (!data2.fileId) {
12299
+ throw new Error("\u6587\u4EF6ID\u4E0D\u80FD\u4E3A\u7A7A");
12300
+ }
12301
+ const { data: downloadData } = await service({
12302
+ method: "post",
12303
+ url: "unified-file/sys-file/download",
12304
+ params: { fileId: data2.fileId },
12305
+ responseType: "blob"
12306
+ });
12307
+ downloadMethod(downloadData, data2.fileName);
12308
+ } else {
12309
+ if (!fileId) {
12310
+ throw new Error("\u6587\u4EF6ID\u4E0D\u80FD\u4E3A\u7A7A");
12311
+ }
12312
+ const { data: downloadData } = await service({
12313
+ method: "post",
12314
+ url: "unified-file/sys-file/download",
12315
+ params: { fileId }
12316
+ });
12317
+ downloadMethod(downloadData, name || fileName);
12318
+ }
12255
12319
  }
12256
12320
  }
12257
12321
  };
@@ -12265,6 +12329,8 @@ const _hoisted_4$g = { class: "left-wrap" };
12265
12329
  const _hoisted_5$d = ["title"];
12266
12330
  const _hoisted_6$d = { class: "right-wrap" };
12267
12331
  const _hoisted_7$a = ["title", "onClick"];
12332
+ const _hoisted_8$7 = ["onClick"];
12333
+ const _hoisted_9$6 = ["onClick"];
12268
12334
  function _sfc_render$37(_ctx, _cache, $props, $setup, $data, $options) {
12269
12335
  const _component_upload_filled = resolveComponent("upload-filled");
12270
12336
  const _component_el_icon = resolveComponent("el-icon");
@@ -12328,7 +12394,17 @@ function _sfc_render$37(_ctx, _cache, $props, $setup, $data, $options) {
12328
12394
  src: _imports_0,
12329
12395
  alt: ""
12330
12396
  }, null, -1)
12331
- ])], 8, _hoisted_7$a)) : createCommentVNode("", true)
12397
+ ])], 8, _hoisted_7$a)) : createCommentVNode("", true),
12398
+ _ctx.getDisabled() ? (openBlock(), createElementBlock("div", {
12399
+ key: 1,
12400
+ onClick: withModifiers(($event) => $options.handlePreview(file), ["stop"]),
12401
+ class: "pr-8px cursor-pointer"
12402
+ }, " \u9884\u89C8 ", 8, _hoisted_8$7)) : createCommentVNode("", true),
12403
+ _ctx.getDisabled() ? (openBlock(), createElementBlock("div", {
12404
+ key: 2,
12405
+ onClick: withModifiers(($event) => $options.handleDownload(file), ["stop"]),
12406
+ class: "pr-8px cursor-pointer"
12407
+ }, " \u4E0B\u8F7D ", 8, _hoisted_9$6)) : createCommentVNode("", true)
12332
12408
  ])
12333
12409
  ])
12334
12410
  ]),
@@ -12370,7 +12446,7 @@ function _sfc_render$37(_ctx, _cache, $props, $setup, $data, $options) {
12370
12446
  _: 1
12371
12447
  }, 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"]);
12372
12448
  }
12373
- var fileUploadWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$37, [["render", _sfc_render$37], ["__scopeId", "data-v-067c85e4"]]);
12449
+ var fileUploadWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$37, [["render", _sfc_render$37], ["__scopeId", "data-v-ad7262c4"]]);
12374
12450
  var __glob_0_7$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12375
12451
  __proto__: null,
12376
12452
  "default": fileUploadWidget
@@ -68056,13 +68132,13 @@ function registerIcon(app) {
68056
68132
  if (typeof window !== "undefined") {
68057
68133
  let loadSvg = function() {
68058
68134
  var body = document.body;
68059
- var svgDom = document.getElementById("__svg__icons__dom__1774318539998__");
68135
+ var svgDom = document.getElementById("__svg__icons__dom__1774320770687__");
68060
68136
  if (!svgDom) {
68061
68137
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
68062
68138
  svgDom.style.position = "absolute";
68063
68139
  svgDom.style.width = "0";
68064
68140
  svgDom.style.height = "0";
68065
- svgDom.id = "__svg__icons__dom__1774318539998__";
68141
+ svgDom.id = "__svg__icons__dom__1774320770687__";
68066
68142
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
68067
68143
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
68068
68144
  }
@@ -73877,12 +73953,12 @@ const getToken = () => {
73877
73953
  return accessToken;
73878
73954
  };
73879
73955
  useCookies();
73880
- const service = axios.create({
73956
+ const service$1 = axios.create({
73881
73957
  baseURL: "/api",
73882
73958
  timeout: 5e4,
73883
73959
  headers: { "Content-Type": "application/json;charset=utf-8" }
73884
73960
  });
73885
- service.interceptors.request.use((config) => {
73961
+ service$1.interceptors.request.use((config) => {
73886
73962
  config.headers["Client"] = "web";
73887
73963
  const accessToken = getToken();
73888
73964
  const company = sessionStorage.getItem("companyId");
@@ -73900,7 +73976,7 @@ service.interceptors.request.use((config) => {
73900
73976
  }, (error) => {
73901
73977
  return Promise.reject(error);
73902
73978
  });
73903
- service.interceptors.response.use((response) => {
73979
+ service$1.interceptors.response.use((response) => {
73904
73980
  const { responseType } = response.config;
73905
73981
  if (responseType === "blob") {
73906
73982
  return response;
@@ -74054,20 +74130,29 @@ const _sfc_main$d = {
74054
74130
  this.unregisterFromRefList();
74055
74131
  },
74056
74132
  methods: {
74057
- handleCloseTag(item, index2) {
74058
- console.log(index2, "index");
74059
- this.oldFieldValue = this.fieldModel ? deepClone(this.fieldModel) : null;
74060
- this.fieldModel.splice(index2, 1);
74061
- console.log(this.fieldModel, "this.fieldModel");
74062
- this.syncUpdateFormModel(this.fieldModel);
74063
- this.emitFieldDataChange(this.fieldModel, this.oldFieldValue);
74133
+ handleRemoveTag(removedItem, removedIndex) {
74134
+ if (this.field.options.disabled) {
74135
+ return;
74136
+ }
74137
+ const remaining = Array.isArray(this.fieldModel) ? this.fieldModel : [];
74138
+ let prevSnapshot;
74139
+ if (removedItem != null && typeof removedIndex === "number" && removedIndex >= 0) {
74140
+ prevSnapshot = deepClone(remaining);
74141
+ prevSnapshot.splice(removedIndex, 0, removedItem);
74142
+ } else {
74143
+ prevSnapshot = deepClone(remaining);
74144
+ }
74145
+ this.oldFieldValue = prevSnapshot;
74146
+ this.syncUpdateFormModel(remaining);
74147
+ this.emitFieldDataChange(remaining, this.oldFieldValue);
74148
+ this.triggerEvent("onRemoveTag", removedItem, remaining, removedIndex);
74064
74149
  this.$nextTick(() => {
74065
74150
  this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
74066
74151
  });
74067
74152
  },
74068
74153
  getTreeData() {
74069
74154
  const data2 = this.field.options.treeParams ? JSON.parse(this.field.options.treeParams) : {};
74070
- service({
74155
+ service$1({
74071
74156
  method: "post",
74072
74157
  url: "/unified-system/sysCompany/fullTree",
74073
74158
  data: __spreadValues({ companyId: sessionStorage.getItem("companyId") }, data2)
@@ -74221,6 +74306,12 @@ const _sfc_main$d = {
74221
74306
  const nodes = args[0];
74222
74307
  const fn = new Function("checkedNodes", "selectedNodes", "selectedValue", handler);
74223
74308
  fn.call(this, nodes, nodes, nodes);
74309
+ } else if (eventName === "onRemoveTag" && args.length >= 2) {
74310
+ const removedItem = args[0];
74311
+ const remainingNodes = args[1];
74312
+ const removedIndex = args[2];
74313
+ const fn = new Function("removedItem", "remainingNodes", "remainingValue", "selectedValue", "removedIndex", handler);
74314
+ fn.call(this, removedItem, remainingNodes, remainingNodes, remainingNodes, removedIndex);
74224
74315
  } else if (args.length > 0) {
74225
74316
  const paramNames = args.map((_, index2) => `arg${index2}`).join(", ");
74226
74317
  const fn = new Function(paramNames, handler);
@@ -74280,7 +74371,8 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
74280
74371
  disabled: $props.field.options.disabled,
74281
74372
  placeholder: "\u8BF7\u9009\u62E9\u4EBA\u5458",
74282
74373
  onClick: $options.handleClick,
74283
- ref: "inputTagRef"
74374
+ ref: "inputTagRef",
74375
+ onRemoveTag: $options.handleRemoveTag
74284
74376
  }, {
74285
74377
  tag: withCtx(({ value: value2 }) => [
74286
74378
  createElementVNode("div", _hoisted_2$8, [
@@ -74288,7 +74380,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
74288
74380
  ])
74289
74381
  ]),
74290
74382
  _: 1
74291
- }, 8, ["modelValue", "disabled", "onClick"])
74383
+ }, 8, ["modelValue", "disabled", "onClick", "onRemoveTag"])
74292
74384
  ]),
74293
74385
  createVNode(_component_el_dialog, {
74294
74386
  modelValue: $data.dialogVisible,
@@ -74296,7 +74388,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
74296
74388
  title: $props.field.options.dialogTitle || "\u4EBA\u5458\u6811",
74297
74389
  width: "480px",
74298
74390
  onClose: $options.handleClose,
74299
- "body-class": " pl-24px pt-24px"
74391
+ "body-class": " pl-24px pt-24px pb-0px"
74300
74392
  }, createSlots({
74301
74393
  default: withCtx(() => [
74302
74394
  createVNode(_component_el_input, {
@@ -74364,7 +74456,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
74364
74456
  _: 1
74365
74457
  }, 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"]);
74366
74458
  }
74367
- var PersonTreeWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-61b961e2"]]);
74459
+ var PersonTreeWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-0fdf3b3c"]]);
74368
74460
  const _sfc_main$c = {
74369
74461
  name: "radio-other-widget",
74370
74462
  componentName: "FieldWidget",
@@ -74810,7 +74902,7 @@ const _sfc_main$a = {
74810
74902
  }
74811
74903
  this.loading = true;
74812
74904
  this.roomList = [];
74813
- service.get(this.field.options.remoteUrl).then((response) => {
74905
+ service$1.get(this.field.options.remoteUrl).then((response) => {
74814
74906
  let data2 = response;
74815
74907
  if (response && response.data) {
74816
74908
  data2 = response.data;
@@ -77995,7 +78087,7 @@ const _sfc_main = {
77995
78087
  return v !== void 0 && v !== null && v !== "";
77996
78088
  },
77997
78089
  async getCurrentUser() {
77998
- const { data: data2 } = await service({
78090
+ const { data: data2 } = await service$1({
77999
78091
  method: "get",
78000
78092
  url: "unified-system/employee/loginInfo?accessType=0"
78001
78093
  });
@@ -78113,6 +78205,11 @@ const loadExtension = function(app) {
78113
78205
  registerCPEditor(app, "person-tree-hideFooter", "person-tree-hideFooter-editor", createBooleanEditor("hideFooter", "extension.setting.personTreeHideFooter"));
78114
78206
  registerEPEditor(app, "person-tree-onOpen", "person-tree-onOpen-editor", createEventHandlerEditor("onOpen", []));
78115
78207
  registerEPEditor(app, "person-tree-onConfirm", "person-tree-onConfirm-editor", createEventHandlerEditor("onConfirm", ["checkedNodes"]));
78208
+ registerEPEditor(app, "person-tree-onRemoveTag", "person-tree-onRemoveTag-editor", createEventHandlerEditor("onRemoveTag", [
78209
+ "removedItem",
78210
+ "remainingNodes",
78211
+ "removedIndex"
78212
+ ]));
78116
78213
  registerEPEditor(app, "person-tree-onCancel", "person-tree-onCancel-editor", createEventHandlerEditor("onCancel", []));
78117
78214
  registerEPEditor(app, "person-tree-onClose", "person-tree-onClose-editor", createEventHandlerEditor("onClose", []));
78118
78215
  addCustomWidgetSchema(radioOtherSchema);
@@ -78177,8 +78274,8 @@ VFormDesigner.install = function(app) {
78177
78274
  registerIcon(app);
78178
78275
  app.component("draggable", Draggable);
78179
78276
  app.component(VFormDesigner.name, VFormDesigner);
78180
- app.config.globalProperties.$service = service;
78181
- app.provide("service", service);
78277
+ app.config.globalProperties.$service = service$1;
78278
+ app.provide("service", service$1);
78182
78279
  app.provide("ElMessage", getElMessage(app));
78183
78280
  app.config.globalProperties.$cookies = cookies;
78184
78281
  app.provide("cookies", cookies);
@@ -78188,8 +78285,8 @@ VFormRender.install = function(app) {
78188
78285
  app.use(ContainerItems);
78189
78286
  registerIcon(app);
78190
78287
  app.component(VFormRender.name, VFormRender);
78191
- app.config.globalProperties.$service = service;
78192
- app.provide("service", service);
78288
+ app.config.globalProperties.$service = service$1;
78289
+ app.provide("service", service$1);
78193
78290
  app.config.globalProperties.$cookies = cookies;
78194
78291
  app.provide("cookies", cookies);
78195
78292
  };
@@ -78207,11 +78304,11 @@ const install = (app) => {
78207
78304
  components.forEach((component) => {
78208
78305
  app.component(component.name, component);
78209
78306
  });
78210
- app.config.globalProperties.$service = service;
78211
- app.provide("service", service);
78307
+ app.config.globalProperties.$service = service$1;
78308
+ app.provide("service", service$1);
78212
78309
  window.axios = axios;
78213
78310
  if (typeof window !== "undefined") {
78214
- window.service = service;
78311
+ window.service = service$1;
78215
78312
  }
78216
78313
  };
78217
78314
  var install$1 = {