t20-common-lib 0.15.24 → 0.15.25
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/package.json
CHANGED
|
@@ -494,27 +494,21 @@ export default {
|
|
|
494
494
|
* 触发表单校验;通过后由返回值携带表单数据与附件(与 needFile 一致时含已落档行)。
|
|
495
495
|
* @returns {Promise<{ valid: false, formData: object } | { valid: true, formData: object, operate?: string, fileUploadTableData?: array }>}
|
|
496
496
|
*/
|
|
497
|
-
async validate() {
|
|
497
|
+
async validate(callback) {
|
|
498
498
|
const formRef = this.$refs.dynamicForms;
|
|
499
499
|
if (!formRef || typeof formRef.validate !== "function") {
|
|
500
|
-
|
|
500
|
+
callback(false, this.formData);
|
|
501
501
|
}
|
|
502
502
|
const pass = await new Promise((resolve) => {
|
|
503
503
|
formRef.validate((valid) => resolve(valid));
|
|
504
504
|
});
|
|
505
505
|
if (!pass) {
|
|
506
|
-
|
|
506
|
+
callback(false, this.formData);
|
|
507
507
|
}
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
if (this.needFile) {
|
|
513
|
-
result.fileUploadTableData = (this.fileUploadTableData || []).filter(
|
|
514
|
-
(t) => t.beid
|
|
515
|
-
);
|
|
516
|
-
}
|
|
517
|
-
return result;
|
|
508
|
+
const fileUploadTableData = (this.fileUploadTableData || []).filter(
|
|
509
|
+
(t) => t.beid
|
|
510
|
+
);
|
|
511
|
+
callback(true, this.formData, fileUploadTableData);
|
|
518
512
|
},
|
|
519
513
|
},
|
|
520
514
|
};
|