@newview/file-ui 1.1.18 → 1.1.19

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/dist/file-ui.js CHANGED
@@ -237,7 +237,7 @@ const propDefine$5 = {
237
237
  multiple: {
238
238
  // 是否支持多选文件
239
239
  type: Boolean,
240
- default: false
240
+ default: true
241
241
  },
242
242
  readonly: {
243
243
  // 是否只读
@@ -306,7 +306,7 @@ class UploadFileInstance extends BaseInstance {
306
306
  }
307
307
  this.message.success("上传成功");
308
308
  this.ctx.emit("success", { token: result.Token, fileId: result.FileId });
309
- this.loadFileList();
309
+ this.loadFileList(true);
310
310
  });
311
311
  /**
312
312
  * 文件格式错误
@@ -353,7 +353,7 @@ class UploadFileInstance extends BaseInstance {
353
353
  this.message.warning("删除失败,请稍后重试!");
354
354
  this.uploading.value = false;
355
355
  } else {
356
- this.loadFileList();
356
+ this.loadFileList(true);
357
357
  this.message.success("删除成功");
358
358
  this.uploading.value = false;
359
359
  }
@@ -525,7 +525,6 @@ class UploadFileInstance extends BaseInstance {
525
525
  * @param fileInfo
526
526
  */
527
527
  __publicField(this, "doView", (fileInfo) => {
528
- debugger;
529
528
  this.previewFileInfo = fileInfo;
530
529
  this.previewVisible.value = true;
531
530
  this.previewIndex.value = fileInfo.PreviewIndex;
@@ -575,12 +574,14 @@ class UploadFileInstance extends BaseInstance {
575
574
  * 获取文件列表
576
575
  * @returns
577
576
  */
578
- async loadFileList() {
577
+ async loadFileList(isChange = false) {
579
578
  this.uploading.value = true;
580
579
  const apiResult = await this.fileInfoApi.getEntities(QueryWrapper.create().eq("Token", this.currentToken));
581
580
  this.fileList.value = this.utilities.parseApiResult(apiResult);
582
581
  this.uploading.value = false;
583
- this.ctx.emit("returnFileList", { token: this.currentToken, list: this.fileList.value });
582
+ if (isChange) {
583
+ this.ctx.emit("returnFileList", { token: this.currentToken, list: this.fileList.value });
584
+ }
584
585
  this.setPreviewList();
585
586
  }
586
587
  // 私有方法 | private 方法名() {}
@@ -18992,8 +18993,9 @@ class ComFormInstance extends BaseInstance {
18992
18993
  * 文本改变
18993
18994
  * @param data
18994
18995
  */
18995
- __publicField(this, "textChange", (data) => {
18996
- this.ctx.emit("textChange", data);
18996
+ __publicField(this, "textChange", (item, data) => {
18997
+ var _a;
18998
+ (_a = item.textEditorProp) == null ? void 0 : _a.onChange(data);
18997
18999
  });
18998
19000
  //#endregion 文本输入框 END
18999
19001
  /**
@@ -19004,6 +19006,16 @@ class ComFormInstance extends BaseInstance {
19004
19006
  __publicField(this, "StructureOnChange", (item, data) => {
19005
19007
  this.props.formModel[item.model] = data;
19006
19008
  });
19009
+ /**
19010
+ * 获取属性值
19011
+ * @param prop
19012
+ * @param propName
19013
+ * @param defaultValue
19014
+ * @returns
19015
+ */
19016
+ __publicField(this, "getPropValue", (prop, propName, defaultValue) => {
19017
+ return this.utilities.isNull(prop) ? defaultValue : prop[propName];
19018
+ });
19007
19019
  this.props = props;
19008
19020
  this.ctx = ctx;
19009
19021
  }
@@ -19023,40 +19035,41 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
19023
19035
  extend: withCtx(({ item }) => [
19024
19036
  item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
19025
19037
  key: 0,
19026
- readonly: _ctx.onlyView,
19027
- onReturnFileList: ($event) => _ctx.tokenList($event, item),
19028
- token: _ctx.formModel[item.model]
19029
- }, null, 8, ["readonly", "onReturnFileList", "token"])) : createCommentVNode("", true),
19038
+ readonly: _ctx.getPropValue(item.uploadFileProp, "readonly") || _ctx.onlyView,
19039
+ token: _ctx.formModel[item.model],
19040
+ multiple: _ctx.getPropValue(item.uploadFileProp, "multiple"),
19041
+ onReturnFileList: ($event) => _ctx.tokenList($event, item)
19042
+ }, null, 8, ["readonly", "token", "multiple", "onReturnFileList"])) : createCommentVNode("", true),
19030
19043
  item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
19031
19044
  key: 1,
19032
19045
  ref: "textEditorRef",
19033
- readonly: _ctx.onlyView,
19034
- style: normalizeStyle({ height: `${item.textHeight == void 0 ? "300" : item.textHeight}px` }),
19046
+ readonly: _ctx.getPropValue(item.textEditorProp, "readonly") || _ctx.onlyView,
19047
+ style: normalizeStyle({ height: `${item.textEditorProp && item.textEditorProp.textHeight ? item.textEditorProp.textHeight : "300"}px` }),
19035
19048
  token: _ctx.formModel[item.model],
19036
- border: item.textBorder,
19037
- onTextChange: _ctx.textChange
19049
+ border: _ctx.getPropValue(item.textEditorProp, "textBorder"),
19050
+ onTextChange: ($event) => _ctx.textChange(item, $event)
19038
19051
  }, null, 8, ["readonly", "style", "token", "border", "onTextChange"])) : createCommentVNode("", true),
19039
19052
  item.type === "DicSelect" ? (openBlock(), createBlock(_component_NvDicSelect, {
19040
19053
  key: 2,
19041
- readonly: _ctx.onlyView,
19042
- code: item.dicCode,
19043
- platformId: item.dicPId,
19054
+ readonly: _ctx.getPropValue(item.dicSelProp, "readonly") || _ctx.onlyView,
19055
+ code: _ctx.getPropValue(item.dicSelProp, "code"),
19056
+ platformId: _ctx.getPropValue(item.dicSelProp, "platformId"),
19044
19057
  modelValue: _ctx.formModel[item.model],
19045
19058
  "onUpdate:modelValue": ($event) => _ctx.formModel[item.model] = $event
19046
19059
  }, null, 8, ["readonly", "code", "platformId", "modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true),
19047
19060
  item.type === "StructureType" ? (openBlock(), createBlock(_component_NvStructureTypeSelect, {
19048
19061
  key: 3,
19049
- readonly: _ctx.onlyView,
19062
+ readonly: _ctx.getPropValue(item.structureTypeProp, "readonly") || _ctx.onlyView,
19050
19063
  dataValue: _ctx.formModel[item.model],
19051
- multiple: item.multiple,
19064
+ multiple: _ctx.getPropValue(item.structureTypeProp, "multiple"),
19052
19065
  onOnChange: ($event) => _ctx.StructureOnChange(item, $event)
19053
19066
  }, null, 8, ["readonly", "dataValue", "multiple", "onOnChange"])) : createCommentVNode("", true),
19054
19067
  item.type === "Structure" ? (openBlock(), createBlock(_component_NvStructureSelect, {
19055
19068
  key: 4,
19056
- readonly: _ctx.onlyView,
19069
+ readonly: _ctx.getPropValue(item.structureProp, "readonly") || _ctx.onlyView,
19057
19070
  dataValue: _ctx.formModel[item.model],
19058
- multiple: item.multiple,
19059
- selType: item.selType,
19071
+ multiple: _ctx.getPropValue(item.structureProp, "multiple"),
19072
+ selType: _ctx.getPropValue(item.structureProp, "selType"),
19060
19073
  onOnChange: ($event) => _ctx.StructureOnChange(item, $event)
19061
19074
  }, null, 8, ["readonly", "dataValue", "multiple", "selType", "onOnChange"])) : createCommentVNode("", true)
19062
19075
  ]),