@newview/file-ui 1.1.26 → 1.1.28
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 +6 -0
- package/dist/file-ui.js +48 -5
- package/dist/file-ui.umd.cjs +1 -1
- package/package.json +2 -1
- package/vite.config.ts +8 -0
package/README.md
CHANGED
package/dist/file-ui.js
CHANGED
|
@@ -10,6 +10,7 @@ import { QueryWrapper, storageInfo } from "@newview/infrastructure";
|
|
|
10
10
|
import { OSSFileApi, FileApi, UploadApi, FileInfoApi } from "@newview/fileservice-api";
|
|
11
11
|
import { DictionaryDetailApi, DataStructureApi, StructureInstanceApi } from "@newview/basics-api";
|
|
12
12
|
import { utilities } from "@newview/tools";
|
|
13
|
+
import { CASign } from "@newview/permission-ui";
|
|
13
14
|
const propDefine$7 = {
|
|
14
15
|
modelValue: {
|
|
15
16
|
// 是否显示
|
|
@@ -254,6 +255,11 @@ const propDefine$6 = {
|
|
|
254
255
|
//只读状态且无附件信息下的显示
|
|
255
256
|
type: String,
|
|
256
257
|
default: "暂无附件"
|
|
258
|
+
},
|
|
259
|
+
// 控制附件上传的个数
|
|
260
|
+
uploadQuantity: {
|
|
261
|
+
type: Number,
|
|
262
|
+
default: 0
|
|
257
263
|
}
|
|
258
264
|
};
|
|
259
265
|
const _sfc_main$6 = defineComponent({
|
|
@@ -335,8 +341,27 @@ let UploadFileInstance$1 = class UploadFileInstance extends BaseInstance {
|
|
|
335
341
|
* 上传之前
|
|
336
342
|
*/
|
|
337
343
|
__publicField(this, "doBeforeUpload", () => {
|
|
338
|
-
|
|
339
|
-
|
|
344
|
+
return new Promise(async (resolve, reject) => {
|
|
345
|
+
let flag = true;
|
|
346
|
+
if (this.props.uploadQuantity > 0) {
|
|
347
|
+
let apiResult = await this.fileInfoApi.getEntities(QueryWrapper.create().eq("Token", this.currentToken));
|
|
348
|
+
const result = this.utilities.parseApiResult(apiResult);
|
|
349
|
+
if (result && result.length >= this.props.uploadQuantity) {
|
|
350
|
+
this.message.warning(`仅能上传${this.props.uploadQuantity}个附件`);
|
|
351
|
+
flag = false;
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
flag = true;
|
|
355
|
+
}
|
|
356
|
+
if (flag) {
|
|
357
|
+
resolve(() => {
|
|
358
|
+
});
|
|
359
|
+
this.message.info("文件上传中,请稍等");
|
|
360
|
+
this.uploading.value = true;
|
|
361
|
+
} else {
|
|
362
|
+
reject();
|
|
363
|
+
}
|
|
364
|
+
});
|
|
340
365
|
});
|
|
341
366
|
/**
|
|
342
367
|
* 移除
|
|
@@ -19653,7 +19678,7 @@ const propDefine = {
|
|
|
19653
19678
|
};
|
|
19654
19679
|
const _sfc_main = defineComponent({
|
|
19655
19680
|
name: "NvComFormUp",
|
|
19656
|
-
components: { UploadFile, TextEditor: TextEditor2, NvDicSelect, NvStructureTypeSelect, NvStructureSelect, UploadFileList },
|
|
19681
|
+
components: { UploadFile, TextEditor: TextEditor2, NvDicSelect, NvStructureTypeSelect, NvStructureSelect, UploadFileList, CASign },
|
|
19657
19682
|
emits: ["textChange", "TokenChange"],
|
|
19658
19683
|
props: propDefine,
|
|
19659
19684
|
setup(props, ctx) {
|
|
@@ -19763,6 +19788,14 @@ class ComFormInstance extends BaseInstance {
|
|
|
19763
19788
|
};
|
|
19764
19789
|
}
|
|
19765
19790
|
});
|
|
19791
|
+
/**
|
|
19792
|
+
* CA签字签章成功回调
|
|
19793
|
+
* @param item
|
|
19794
|
+
* @param data
|
|
19795
|
+
*/
|
|
19796
|
+
__publicField(this, "signOnSuccess", (item, data) => {
|
|
19797
|
+
this.props.formModel[item.model] = data;
|
|
19798
|
+
});
|
|
19766
19799
|
this.props = props;
|
|
19767
19800
|
this.ctx = ctx;
|
|
19768
19801
|
}
|
|
@@ -19774,6 +19807,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19774
19807
|
const _component_NvStructureTypeSelect = resolveComponent("NvStructureTypeSelect");
|
|
19775
19808
|
const _component_NvStructureSelect = resolveComponent("NvStructureSelect");
|
|
19776
19809
|
const _component_UploadFileList = resolveComponent("UploadFileList");
|
|
19810
|
+
const _component_CASign = resolveComponent("CASign");
|
|
19777
19811
|
const _component_NvComForm = resolveComponent("NvComForm");
|
|
19778
19812
|
return openBlock(), createBlock(_component_NvComForm, {
|
|
19779
19813
|
onlyView: _ctx.onlyView,
|
|
@@ -19786,8 +19820,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19786
19820
|
readonly: _ctx.getPropValue(item.uploadFileProp, "readonly") || _ctx.onlyView,
|
|
19787
19821
|
token: _ctx.formModel[item.model],
|
|
19788
19822
|
multiple: _ctx.getPropValue(item.uploadFileProp, "multiple"),
|
|
19823
|
+
uploadQuantity: _ctx.getPropValue(item.uploadFileProp, "uploadQuantity", 0),
|
|
19789
19824
|
onReturnFileList: ($event) => _ctx.tokenList($event, item)
|
|
19790
|
-
}, null, 8, ["readonly", "token", "multiple", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19825
|
+
}, null, 8, ["readonly", "token", "multiple", "uploadQuantity", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19791
19826
|
item.type === "TextEditor" ? (openBlock(), createBlock(_component_TextEditor, {
|
|
19792
19827
|
key: 1,
|
|
19793
19828
|
ref: "textEditorRef",
|
|
@@ -19827,7 +19862,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19827
19862
|
token: _ctx.formModel[item.model],
|
|
19828
19863
|
paginationSet: _ctx.getPaginationSet(item),
|
|
19829
19864
|
onReturnFileList: ($event) => _ctx.tokenList($event, item)
|
|
19830
|
-
}, null, 8, ["style", "readonly", "token", "paginationSet", "onReturnFileList"])) : createCommentVNode("", true)
|
|
19865
|
+
}, null, 8, ["style", "readonly", "token", "paginationSet", "onReturnFileList"])) : createCommentVNode("", true),
|
|
19866
|
+
item.type === "CASign" ? (openBlock(), createBlock(_component_CASign, {
|
|
19867
|
+
key: 6,
|
|
19868
|
+
signContent: _ctx.getPropValue(item.signProp, "signContent"),
|
|
19869
|
+
signType: _ctx.getPropValue(item.signProp, "signType"),
|
|
19870
|
+
isFakeVerifySign: _ctx.getPropValue(item.signProp, "isFakeVerifySign"),
|
|
19871
|
+
signResult: _ctx.formModel[item.model],
|
|
19872
|
+
onSignSuccess: ($event) => _ctx.signOnSuccess(item, $event)
|
|
19873
|
+
}, null, 8, ["signContent", "signType", "isFakeVerifySign", "signResult", "onSignSuccess"])) : createCommentVNode("", true)
|
|
19831
19874
|
]),
|
|
19832
19875
|
_: 1
|
|
19833
19876
|
}, 8, ["onlyView", "formItems", "formModel"]);
|