workflow-editor 0.0.65-up → 0.0.66-up-rc1
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/lib/{401-082f153a.js → 401-80a0280c.js} +1 -1
- package/lib/{404-f95275e3.js → 404-0fe5eb35.js} +1 -1
- package/lib/{iframe-page-eac0213f.js → iframe-page-4b3ead36.js} +1 -1
- package/lib/{index-cd023a70.js → index-c035a556.js} +977 -935
- package/lib/{tab-content-iframe-index-2d8801b1.js → tab-content-iframe-index-8b4a9034.js} +1 -1
- package/lib/{tab-content-index-f83a413e.js → tab-content-index-c83389d3.js} +1 -1
- package/lib/{tache-subprocess-history-8dab30b9.js → tache-subprocess-history-d7268ee8.js} +1 -1
- package/lib/workflow-editor.css +1 -1
- package/lib/workflow-editor.js +1 -1
- package/lib/workflow-editor.umd.cjs +27 -27
- package/package.json +2 -2
- package/packages/plugins/formValidatorUtil.js +53 -19
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workflow-editor",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.66-up-rc1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/workflow-editor.js",
|
|
7
7
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
19
|
-
"agilebuilder-ui": "1.1.
|
|
19
|
+
"agilebuilder-ui": "1.1.47",
|
|
20
20
|
"axios": "^1.5.1",
|
|
21
21
|
"element-plus": "^2.4.1",
|
|
22
22
|
"font-awesome": "^4.7.0",
|
|
@@ -357,8 +357,8 @@ function setSubObjectFieldRule(editField, subRules, entity, isSql, dataTypeMap)
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
function validator(entity, validateRules, rowIndex, isSql, pageNum, pageRowIndex) {
|
|
361
|
-
return validatorEntity(entity, validateRules, rowIndex, true, isSql, pageNum, pageRowIndex)
|
|
360
|
+
function validator(entity, validateRules, rowIndex, isSql, pageNum, pageRowIndex, isNeedField) {
|
|
361
|
+
return validatorEntity(entity, validateRules, rowIndex, true, isSql, pageNum, pageRowIndex, isNeedField)
|
|
362
362
|
}
|
|
363
363
|
/**
|
|
364
364
|
*
|
|
@@ -368,17 +368,16 @@ function validator(entity, validateRules, rowIndex, isSql, pageNum, pageRowIndex
|
|
|
368
368
|
* @param {*} isShouldRepeateValdate 是否需要再次验证大写字段名
|
|
369
369
|
* @returns
|
|
370
370
|
*/
|
|
371
|
-
function validatorEntity(entity, validateRules, rowIndex, isShouldRepeateValdate, isSql, pageNum, pageRowIndex) {
|
|
371
|
+
function validatorEntity(entity, validateRules, rowIndex, isShouldRepeateValdate, isSql, pageNum, pageRowIndex, isNeedField) {
|
|
372
372
|
let result = false
|
|
373
373
|
const validator = new Validator(validateRules)
|
|
374
|
-
|
|
374
|
+
let fieldName
|
|
375
375
|
validator.validate(
|
|
376
376
|
entity,
|
|
377
377
|
{
|
|
378
378
|
first: true
|
|
379
379
|
},
|
|
380
380
|
(errors, fields) => {
|
|
381
|
-
let fieldName
|
|
382
381
|
if (errors) {
|
|
383
382
|
const message = errors[0]['message']
|
|
384
383
|
fieldName = errors[0]['field']
|
|
@@ -425,8 +424,18 @@ function validatorEntity(entity, validateRules, rowIndex, isShouldRepeateValdate
|
|
|
425
424
|
}
|
|
426
425
|
}
|
|
427
426
|
)
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
if(isNeedField){
|
|
428
|
+
let myResult = {msg: result, field: fieldName}
|
|
429
|
+
if(pageNum !== undefined && pageRowIndex !== undefined){
|
|
430
|
+
myResult.pageNum = pageNum
|
|
431
|
+
myResult.rowIndex = pageRowIndex
|
|
432
|
+
} else {
|
|
433
|
+
myResult.rowIndex = rowIndex
|
|
434
|
+
}
|
|
435
|
+
return myResult
|
|
436
|
+
} else {
|
|
437
|
+
return result
|
|
438
|
+
}
|
|
430
439
|
}
|
|
431
440
|
|
|
432
441
|
/**
|
|
@@ -444,7 +453,8 @@ function validateSub(
|
|
|
444
453
|
additionalParamMap,
|
|
445
454
|
taskParamMap,
|
|
446
455
|
contextParameter,
|
|
447
|
-
subTablePageInfo
|
|
456
|
+
subTablePageInfo,
|
|
457
|
+
isNeedField
|
|
448
458
|
) {
|
|
449
459
|
let copyTotalSubRules = {}
|
|
450
460
|
if (totalSubRules) {
|
|
@@ -469,7 +479,11 @@ function validateSub(
|
|
|
469
479
|
const validateResult = validateTotalSubTable(copyTotalSubRules, entity, prop)
|
|
470
480
|
if (validateResult !== true) {
|
|
471
481
|
delete copyTotalSubRules[prop]
|
|
472
|
-
|
|
482
|
+
if(isNeedField){
|
|
483
|
+
return {msg: validateResult, listCode: prop}
|
|
484
|
+
} else {
|
|
485
|
+
return validateResult
|
|
486
|
+
}
|
|
473
487
|
}
|
|
474
488
|
let pageSize
|
|
475
489
|
let hasAuthFields = []
|
|
@@ -521,9 +535,12 @@ function validateSub(
|
|
|
521
535
|
}
|
|
522
536
|
}
|
|
523
537
|
})
|
|
524
|
-
const validateResult = validator(rowData, rowRule, j, isSql, pageNum, pageRowIndex)
|
|
525
|
-
if (validateResult !== true) {
|
|
538
|
+
const validateResult = validator(rowData, rowRule, j, isSql, pageNum, pageRowIndex, isNeedField)
|
|
539
|
+
if ((!isNeedField && validateResult !== true) || (isNeedField && validateResult.msg !== true)) {
|
|
526
540
|
// 表示验证失败,无需继续验证
|
|
541
|
+
if(isNeedField){
|
|
542
|
+
validateResult.listCode = prop
|
|
543
|
+
}
|
|
527
544
|
return validateResult
|
|
528
545
|
}
|
|
529
546
|
}
|
|
@@ -533,10 +550,14 @@ function validateSub(
|
|
|
533
550
|
for (const subTableName in copyTotalSubRules) {
|
|
534
551
|
const validateResult = validateTotalSubTable(copyTotalSubRules, entity, subTableName)
|
|
535
552
|
if (validateResult !== true) {
|
|
536
|
-
|
|
553
|
+
if(isNeedField){
|
|
554
|
+
return {msg: validateResult, listCode: prop}
|
|
555
|
+
} else {
|
|
556
|
+
return validateResult
|
|
557
|
+
}
|
|
537
558
|
}
|
|
538
559
|
}
|
|
539
|
-
return true
|
|
560
|
+
return isNeedField?{msg: true, listCode: prop}: true
|
|
540
561
|
}
|
|
541
562
|
|
|
542
563
|
function getEntityId(row) {
|
|
@@ -620,7 +641,18 @@ function validateTotalSubTable(totalSubRules, entity, subTableName) {
|
|
|
620
641
|
}
|
|
621
642
|
return true
|
|
622
643
|
}
|
|
623
|
-
|
|
644
|
+
/**
|
|
645
|
+
*
|
|
646
|
+
* @param {*} entity
|
|
647
|
+
* @param {*} validateRules
|
|
648
|
+
* @param {*} isSql
|
|
649
|
+
* @param {*} additionalParamMap
|
|
650
|
+
* @param {*} taskParamMap
|
|
651
|
+
* @param {*} contextParameter
|
|
652
|
+
* @param {*} subTablePageInfo
|
|
653
|
+
* @param {*} isNeedField 如果为true,表示返回的是{}对象,msg: true/提示信息、field:字段名
|
|
654
|
+
* @returns
|
|
655
|
+
*/
|
|
624
656
|
function formValidator(
|
|
625
657
|
entity,
|
|
626
658
|
validateRules,
|
|
@@ -628,7 +660,8 @@ function formValidator(
|
|
|
628
660
|
additionalParamMap,
|
|
629
661
|
taskParamMap,
|
|
630
662
|
contextParameter,
|
|
631
|
-
subTablePageInfo
|
|
663
|
+
subTablePageInfo,
|
|
664
|
+
isNeedField
|
|
632
665
|
) {
|
|
633
666
|
const validateRulesKeys = Object.keys(validateRules)
|
|
634
667
|
if (
|
|
@@ -641,8 +674,8 @@ function formValidator(
|
|
|
641
674
|
const subRules = validateRules.subRules
|
|
642
675
|
const totalSubRules = validateRules.totalSubRules
|
|
643
676
|
const dataTypeMap = validateRules.dataTypeMap
|
|
644
|
-
let validateResult = validator(entity, rules, null, isSql)
|
|
645
|
-
if (validateResult === true) {
|
|
677
|
+
let validateResult = validator(entity, rules, null, isSql, null, null, isNeedField)
|
|
678
|
+
if ((!isNeedField && validateResult === true) || (isNeedField && validateResult.msg === true)) {
|
|
646
679
|
if (subRules || totalSubRules) {
|
|
647
680
|
validateResult = validateSub(
|
|
648
681
|
entity,
|
|
@@ -653,14 +686,15 @@ function formValidator(
|
|
|
653
686
|
additionalParamMap,
|
|
654
687
|
taskParamMap,
|
|
655
688
|
contextParameter,
|
|
656
|
-
subTablePageInfo
|
|
689
|
+
subTablePageInfo,
|
|
690
|
+
isNeedField
|
|
657
691
|
)
|
|
658
692
|
}
|
|
659
693
|
}
|
|
660
694
|
return validateResult
|
|
661
695
|
} else {
|
|
662
696
|
// 表示没有子表验证规则
|
|
663
|
-
return validator(entity, validateRules, null, isSql)
|
|
697
|
+
return validator(entity, validateRules, null, isSql, null, null, isNeedField)
|
|
664
698
|
}
|
|
665
699
|
}
|
|
666
700
|
|