@kp-ui/lowcode 1.0.65 → 1.0.67

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.
@@ -1,13 +1,13 @@
1
1
  if (typeof window !== "undefined") {
2
2
  let loadSvg = function() {
3
3
  var body = document.body;
4
- var svgDom = document.getElementById("__svg__icons__dom__1748583090408__");
4
+ var svgDom = document.getElementById("__svg__icons__dom__1749030594578__");
5
5
  if (!svgDom) {
6
6
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
7
7
  svgDom.style.position = "absolute";
8
8
  svgDom.style.width = "0";
9
9
  svgDom.style.height = "0";
10
- svgDom.id = "__svg__icons__dom__1748583090408__";
10
+ svgDom.id = "__svg__icons__dom__1749030594578__";
11
11
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
12
12
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
13
13
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@kp-ui/lowcode",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
- "types": "./types/install.d.ts",
9
+ "types": "main.d.ts",
10
10
  "dependencies": {
11
11
  "@element-plus/icons-vue": "^0.2.4",
12
12
  "@kp-ui/tool": "1.0.24",
package/render.js CHANGED
@@ -935,9 +935,8 @@ const _sfc_main = {
935
935
  */
936
936
  showDialog(dialogName, formData = {}, extraData = {}) {
937
937
  const topFormRef = this.getTopFormRef();
938
- console.log({ topFormRef });
939
- const dialogCon = getContainerWidgetByName(topFormRef.widgetList, dialogName);
940
- console.log({ dialogCon });
938
+ const formRef = this.getFormRef();
939
+ const dialogCon = getContainerWidgetByName(topFormRef.widgetList, dialogName) || getContainerWidgetByName(formRef.widgetList, dialogName);
941
940
  if (!dialogName || dialogCon.type !== "vf-dialog") {
942
941
  this.$message.error(this.i18nt("render.hint.refNotFound") + dialogName);
943
942
  return;
@@ -1081,7 +1080,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1081
1080
  _: 3
1082
1081
  }, 8, ["component-size"]);
1083
1082
  }
1084
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-ad27ca1a"]]);
1083
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4e50e948"]]);
1085
1084
  export {
1086
1085
  index as default
1087
1086
  };
@@ -142,16 +142,10 @@ const fieldMixin = {
142
142
  if (this.field.type !== "picture-upload" && this.field.type !== "file-upload" || this.designState === true) {
143
143
  return;
144
144
  }
145
- console.log("fieldModel", this.fieldModel);
146
145
  if (this.fieldModel) {
147
146
  if (typeof this.fieldModel === "string") {
148
147
  this.fieldModel = JSON.parse(this.fieldModel);
149
148
  }
150
- if (Array.isArray(this.fieldModel)) {
151
- this.fileList = deepClone(this.fieldModel);
152
- } else {
153
- this.fileList.splice(0, 0, deepClone(this.fieldModel));
154
- }
155
149
  }
156
150
  },
157
151
  initEventHandler() {
@@ -163,7 +157,12 @@ const fieldMixin = {
163
157
  this.on$("field-value-changed", (values) => {
164
158
  if (!!this.subFormItemFlag) {
165
159
  const subFormData = this.formModel[this.subFormName];
166
- this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId);
160
+ this.handleOnChangeForSubForm(
161
+ values[0],
162
+ values[1],
163
+ subFormData,
164
+ this.subFormRowId
165
+ );
167
166
  } else {
168
167
  this.handleOnChange(values[0], values[1]);
169
168
  }
@@ -478,7 +477,12 @@ const fieldMixin = {
478
477
  return;
479
478
  }
480
479
  if (!!this.field.options.onChange) {
481
- const changeFn = new Function("value", "oldValue", "ops", this.field.options.onChange);
480
+ const changeFn = new Function(
481
+ "value",
482
+ "oldValue",
483
+ "ops",
484
+ this.field.options.onChange
485
+ );
482
486
  changeFn.call(this, val, oldVal, ops[0]);
483
487
  }
484
488
  },
@@ -598,9 +602,8 @@ const fieldMixin = {
598
602
  }
599
603
  },
600
604
  getValue() {
601
- {
602
- return this.fieldModel;
603
- }
605
+ console.log("fieldModel", this.fieldModel);
606
+ return this.fieldModel;
604
607
  },
605
608
  resetField() {
606
609
  const defaultValue = this.field.options.defaultValue;
@@ -608,8 +611,8 @@ const fieldMixin = {
608
611
  this.$nextTick(() => {
609
612
  });
610
613
  if (this.field.type === "picture-upload" || this.field.type === "file-upload") {
611
- this.fileList.splice(0, this.fileList.length);
612
- this.handleChangeEvent(this.fileList);
614
+ this.fieldModel.splice(0, this.fieldModel.length);
615
+ this.handleChangeEvent(this.fieldModel);
613
616
  }
614
617
  },
615
618
  setWidgetOption(optionName, optionValue) {
@@ -37,8 +37,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
37
37
  multiple: $props.field.options.multiple,
38
38
  accept: $options.acceptType,
39
39
  maxCount: $props.field.options.limit,
40
- "file-list": $data.fileList,
41
- "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => $data.fileList = $event),
40
+ "file-list": $data.fieldModel,
41
+ "onUpdate:fileList": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
42
42
  listType: $props.field.options.uploadListType,
43
43
  customRequest: $options.customRequest,
44
44
  iconRender: $options.iconRender,
@@ -92,7 +92,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
92
92
  _: 1
93
93
  }, 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"])) : createCommentVNode("", true);
94
94
  }
95
- const fileUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7804efd1"]]);
95
+ const fileUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-bacb1889"]]);
96
96
  export {
97
97
  fileUploadWidget as default
98
98
  };
@@ -53,9 +53,7 @@ const _sfc_main = {
53
53
  oldFieldValue: null,
54
54
  //field组件change之前的值
55
55
  fieldModel: [],
56
- rules: [],
57
- fileList: []
58
- //上传文件列表
56
+ rules: []
59
57
  };
60
58
  },
61
59
  computed: {
@@ -78,7 +76,7 @@ const _sfc_main = {
78
76
  return [acceptList.length ? `支持扩展名${acceptList}` : "", maxSize ? `支持文件大小${maxSize}M` : ""].filter(Boolean);
79
77
  }
80
78
  // uploadBtnHidden() {
81
- // return !this.fileList || this.fileList.length >= this.field.options.limit;
79
+ // return !this.fieldModel || this.fieldModel.length >= this.field.options.limit;
82
80
  // }
83
81
  },
84
82
  beforeCreate() {
@@ -126,14 +124,14 @@ const _sfc_main = {
126
124
  this.previewVisible = false;
127
125
  },
128
126
  async getFileUrl(fileCode) {
129
- if (this.fileList[fileCode]) {
130
- return this.fileList[fileCode];
127
+ if (this.fieldModel[fileCode]) {
128
+ return this.fieldModel[fileCode];
131
129
  } else {
132
130
  const fileUrlObj = await filesystemApi.getPreviewFileUrl({
133
131
  fileCode
134
132
  });
135
133
  const url = fileUrlObj.data.value;
136
- this.fileList[fileCode] = url;
134
+ this.fieldModel[fileCode] = url;
137
135
  return url;
138
136
  }
139
137
  },
@@ -172,9 +170,9 @@ const _sfc_main = {
172
170
  return true;
173
171
  },
174
172
  removeFile(file) {
175
- const findInx = this.fileList.findIndex((item) => item.uid === file.uid);
176
- this.fileList.splice(findInx, 1);
177
- this.handleChangeEvent(this.fileList);
173
+ const findInx = this.fieldModel.findIndex((item) => item.uid === file.uid);
174
+ this.fieldModel.splice(findInx, 1);
175
+ this.handleChangeEvent(this.fieldModel);
178
176
  },
179
177
  async customRequest(upload) {
180
178
  const {
@@ -210,24 +208,24 @@ const _sfc_main = {
210
208
  fileCode
211
209
  } = res.data.object;
212
210
  if (limit > 1) {
213
- const findIndex = this.fileList.findIndex((item) => item.name === name);
211
+ const findIndex = this.fieldModel.findIndex((item) => item.name === name);
214
212
  if (findIndex > -1) {
215
- this.fileList.splice(findIndex, 1);
213
+ this.fieldModel.splice(findIndex, 1);
216
214
  }
217
- if (this.fileList.length < limit) {
218
- this.fileList.push({
215
+ if (this.fieldModel.length < limit) {
216
+ this.fieldModel.push({
219
217
  ...res.data.object,
220
218
  name
221
219
  });
222
220
  }
223
221
  } else {
224
- this.fileList = [{
222
+ this.fieldModel = [{
225
223
  ...res.data.object,
226
224
  name
227
225
  }];
228
226
  }
229
227
  } finally {
230
- this.handleChangeEvent(this.fileList);
228
+ this.handleChangeEvent(this.fieldModel);
231
229
  this.loading = false;
232
230
  }
233
231
  }