@newview/file-ui 1.1.18 → 1.1.20
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/README.md +3 -0
- package/dist/file-ui.js +44 -29
- package/dist/file-ui.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/DicSelect.d.ts +13 -0
- package/types/StructureSelect.d.ts +12 -0
- package/types/StructureTypeSelect.d.ts +12 -0
- package/vite.config.ts +2 -2
package/README.md
CHANGED
package/dist/file-ui.js
CHANGED
|
@@ -142,7 +142,7 @@ class FilePreviewInstance extends BaseInstance {
|
|
|
142
142
|
}
|
|
143
143
|
//#endregion 业务逻辑 - 文件预览 END
|
|
144
144
|
}
|
|
145
|
-
const
|
|
145
|
+
const FilePreview_vue_vue_type_style_index_0_scoped_e7f81a3b_lang = "";
|
|
146
146
|
const _export_sfc = (sfc, props) => {
|
|
147
147
|
const target = sfc.__vccOpts || sfc;
|
|
148
148
|
for (const [key, val] of props) {
|
|
@@ -157,6 +157,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
157
157
|
const _component_Modal = resolveComponent("Modal");
|
|
158
158
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
159
159
|
createVNode(_component_ImagePreview, {
|
|
160
|
+
transfer: "",
|
|
160
161
|
modelValue: _ctx.previewImage,
|
|
161
162
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.previewImage = $event),
|
|
162
163
|
"preview-list": _ctx.previewList,
|
|
@@ -187,7 +188,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
187
188
|
}, 8, ["modelValue", "title", "onOnVisibleChange"])
|
|
188
189
|
], 64);
|
|
189
190
|
}
|
|
190
|
-
const filePreview = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-
|
|
191
|
+
const filePreview = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-e7f81a3b"]]);
|
|
191
192
|
const propDefine$5 = {
|
|
192
193
|
linkParam: {
|
|
193
194
|
// 带入的参数
|
|
@@ -237,7 +238,7 @@ const propDefine$5 = {
|
|
|
237
238
|
multiple: {
|
|
238
239
|
// 是否支持多选文件
|
|
239
240
|
type: Boolean,
|
|
240
|
-
default:
|
|
241
|
+
default: true
|
|
241
242
|
},
|
|
242
243
|
readonly: {
|
|
243
244
|
// 是否只读
|
|
@@ -306,7 +307,7 @@ class UploadFileInstance extends BaseInstance {
|
|
|
306
307
|
}
|
|
307
308
|
this.message.success("上传成功");
|
|
308
309
|
this.ctx.emit("success", { token: result.Token, fileId: result.FileId });
|
|
309
|
-
this.loadFileList();
|
|
310
|
+
this.loadFileList(true);
|
|
310
311
|
});
|
|
311
312
|
/**
|
|
312
313
|
* 文件格式错误
|
|
@@ -353,7 +354,7 @@ class UploadFileInstance extends BaseInstance {
|
|
|
353
354
|
this.message.warning("删除失败,请稍后重试!");
|
|
354
355
|
this.uploading.value = false;
|
|
355
356
|
} else {
|
|
356
|
-
this.loadFileList();
|
|
357
|
+
this.loadFileList(true);
|
|
357
358
|
this.message.success("删除成功");
|
|
358
359
|
this.uploading.value = false;
|
|
359
360
|
}
|
|
@@ -525,7 +526,6 @@ class UploadFileInstance extends BaseInstance {
|
|
|
525
526
|
* @param fileInfo
|
|
526
527
|
*/
|
|
527
528
|
__publicField(this, "doView", (fileInfo) => {
|
|
528
|
-
debugger;
|
|
529
529
|
this.previewFileInfo = fileInfo;
|
|
530
530
|
this.previewVisible.value = true;
|
|
531
531
|
this.previewIndex.value = fileInfo.PreviewIndex;
|
|
@@ -575,12 +575,14 @@ class UploadFileInstance extends BaseInstance {
|
|
|
575
575
|
* 获取文件列表
|
|
576
576
|
* @returns
|
|
577
577
|
*/
|
|
578
|
-
async loadFileList() {
|
|
578
|
+
async loadFileList(isChange = false) {
|
|
579
579
|
this.uploading.value = true;
|
|
580
580
|
const apiResult = await this.fileInfoApi.getEntities(QueryWrapper.create().eq("Token", this.currentToken));
|
|
581
581
|
this.fileList.value = this.utilities.parseApiResult(apiResult);
|
|
582
582
|
this.uploading.value = false;
|
|
583
|
-
|
|
583
|
+
if (isChange) {
|
|
584
|
+
this.ctx.emit("returnFileList", { token: this.currentToken, list: this.fileList.value });
|
|
585
|
+
}
|
|
584
586
|
this.setPreviewList();
|
|
585
587
|
}
|
|
586
588
|
// 私有方法 | private 方法名() {}
|
|
@@ -600,8 +602,8 @@ class UploadFileInstance extends BaseInstance {
|
|
|
600
602
|
}
|
|
601
603
|
//#endregion 业务逻辑 文件预览 END
|
|
602
604
|
}
|
|
603
|
-
const
|
|
604
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
605
|
+
const UploadFile_vue_vue_type_style_index_0_scoped_3abe7ff1_lang = "";
|
|
606
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-3abe7ff1"), n = n(), popScopeId(), n);
|
|
605
607
|
const _hoisted_1$2 = { class: "uploadFile" };
|
|
606
608
|
const _hoisted_2$2 = ["onClick", "title"];
|
|
607
609
|
const _hoisted_3$2 = { class: "file-upload-list-cover" };
|
|
@@ -662,6 +664,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
662
664
|
createVNode(_component_Image, {
|
|
663
665
|
src: _ctx.getThumbnailUrl(item),
|
|
664
666
|
fit: "cover",
|
|
667
|
+
transfer: "",
|
|
665
668
|
width: "100%",
|
|
666
669
|
height: "100%"
|
|
667
670
|
}, null, 8, ["src"]),
|
|
@@ -814,7 +817,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
814
817
|
}, null, 8, ["modelValue", "preview-list", "preview-index", "file-info"])
|
|
815
818
|
]);
|
|
816
819
|
}
|
|
817
|
-
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-
|
|
820
|
+
const UploadFile = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-3abe7ff1"]]);
|
|
818
821
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
819
822
|
function getDefaultExportFromCjs(x) {
|
|
820
823
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -18992,8 +18995,9 @@ class ComFormInstance extends BaseInstance {
|
|
|
18992
18995
|
* 文本改变
|
|
18993
18996
|
* @param data
|
|
18994
18997
|
*/
|
|
18995
|
-
__publicField(this, "textChange", (data) => {
|
|
18996
|
-
|
|
18998
|
+
__publicField(this, "textChange", (item, data) => {
|
|
18999
|
+
var _a;
|
|
19000
|
+
(_a = item.textEditorProp) == null ? void 0 : _a.onChange(data);
|
|
18997
19001
|
});
|
|
18998
19002
|
//#endregion 文本输入框 END
|
|
18999
19003
|
/**
|
|
@@ -19004,6 +19008,16 @@ class ComFormInstance extends BaseInstance {
|
|
|
19004
19008
|
__publicField(this, "StructureOnChange", (item, data) => {
|
|
19005
19009
|
this.props.formModel[item.model] = data;
|
|
19006
19010
|
});
|
|
19011
|
+
/**
|
|
19012
|
+
* 获取属性值
|
|
19013
|
+
* @param prop
|
|
19014
|
+
* @param propName
|
|
19015
|
+
* @param defaultValue
|
|
19016
|
+
* @returns
|
|
19017
|
+
*/
|
|
19018
|
+
__publicField(this, "getPropValue", (prop, propName, defaultValue) => {
|
|
19019
|
+
return this.utilities.isNull(prop) ? defaultValue : prop[propName];
|
|
19020
|
+
});
|
|
19007
19021
|
this.props = props;
|
|
19008
19022
|
this.ctx = ctx;
|
|
19009
19023
|
}
|
|
@@ -19023,40 +19037,41 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19023
19037
|
extend: withCtx(({ item }) => [
|
|
19024
19038
|
item.type === "UploadFile" ? (openBlock(), createBlock(_component_UploadFile, {
|
|
19025
19039
|
key: 0,
|
|
19026
|
-
readonly: _ctx.onlyView,
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19040
|
+
readonly: _ctx.getPropValue(item.uploadFileProp, "readonly") || _ctx.onlyView,
|
|
19041
|
+
token: _ctx.formModel[item.model],
|
|
19042
|
+
multiple: _ctx.getPropValue(item.uploadFileProp, "multiple"),
|
|
19043
|
+
onReturnFileList: ($event) => _ctx.tokenList($event, item)
|
|
19044
|
+
}, null, 8, ["readonly", "token", "multiple", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19030
19045
|
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
19031
19046
|
key: 1,
|
|
19032
19047
|
ref: "textEditorRef",
|
|
19033
|
-
readonly: _ctx.onlyView,
|
|
19034
|
-
style: normalizeStyle({ height: `${item.textHeight
|
|
19048
|
+
readonly: _ctx.getPropValue(item.textEditorProp, "readonly") || _ctx.onlyView,
|
|
19049
|
+
style: normalizeStyle({ height: `${item.textEditorProp && item.textEditorProp.textHeight ? item.textEditorProp.textHeight : "300"}px` }),
|
|
19035
19050
|
token: _ctx.formModel[item.model],
|
|
19036
|
-
border: item.textBorder,
|
|
19037
|
-
onTextChange: _ctx.textChange
|
|
19051
|
+
border: _ctx.getPropValue(item.textEditorProp, "textBorder"),
|
|
19052
|
+
onTextChange: ($event) => _ctx.textChange(item, $event)
|
|
19038
19053
|
}, null, 8, ["readonly", "style", "token", "border", "onTextChange"])) : createCommentVNode("", true),
|
|
19039
19054
|
item.type === "DicSelect" ? (openBlock(), createBlock(_component_NvDicSelect, {
|
|
19040
19055
|
key: 2,
|
|
19041
|
-
readonly: _ctx.onlyView,
|
|
19042
|
-
code: item.
|
|
19043
|
-
platformId: item.
|
|
19056
|
+
readonly: _ctx.getPropValue(item.dicSelProp, "readonly") || _ctx.onlyView,
|
|
19057
|
+
code: _ctx.getPropValue(item.dicSelProp, "code"),
|
|
19058
|
+
platformId: _ctx.getPropValue(item.dicSelProp, "platformId"),
|
|
19044
19059
|
modelValue: _ctx.formModel[item.model],
|
|
19045
19060
|
"onUpdate:modelValue": ($event) => _ctx.formModel[item.model] = $event
|
|
19046
19061
|
}, null, 8, ["readonly", "code", "platformId", "modelValue", "onUpdate:modelValue"])) : createCommentVNode("", true),
|
|
19047
19062
|
item.type === "StructureType" ? (openBlock(), createBlock(_component_NvStructureTypeSelect, {
|
|
19048
19063
|
key: 3,
|
|
19049
|
-
readonly: _ctx.onlyView,
|
|
19064
|
+
readonly: _ctx.getPropValue(item.structureTypeProp, "readonly") || _ctx.onlyView,
|
|
19050
19065
|
dataValue: _ctx.formModel[item.model],
|
|
19051
|
-
multiple: item.multiple,
|
|
19066
|
+
multiple: _ctx.getPropValue(item.structureTypeProp, "multiple"),
|
|
19052
19067
|
onOnChange: ($event) => _ctx.StructureOnChange(item, $event)
|
|
19053
19068
|
}, null, 8, ["readonly", "dataValue", "multiple", "onOnChange"])) : createCommentVNode("", true),
|
|
19054
19069
|
item.type === "Structure" ? (openBlock(), createBlock(_component_NvStructureSelect, {
|
|
19055
19070
|
key: 4,
|
|
19056
|
-
readonly: _ctx.onlyView,
|
|
19071
|
+
readonly: _ctx.getPropValue(item.structureProp, "readonly") || _ctx.onlyView,
|
|
19057
19072
|
dataValue: _ctx.formModel[item.model],
|
|
19058
|
-
multiple: item.multiple,
|
|
19059
|
-
selType: item.selType,
|
|
19073
|
+
multiple: _ctx.getPropValue(item.structureProp, "multiple"),
|
|
19074
|
+
selType: _ctx.getPropValue(item.structureProp, "selType"),
|
|
19060
19075
|
onOnChange: ($event) => _ctx.StructureOnChange(item, $event)
|
|
19061
19076
|
}, null, 8, ["readonly", "dataValue", "multiple", "selType", "onOnChange"])) : createCommentVNode("", true)
|
|
19062
19077
|
]),
|