workflow-editor 0.0.46-up → 0.0.46-up-tmp1
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-8bf1a5e0.js → 401-93d91c53.js} +1 -1
- package/lib/{404-375fade3.js → 404-618a618c.js} +1 -1
- package/lib/{iframe-page-ad458609.js → iframe-page-02023063.js} +1 -1
- package/lib/{index-88677c18.js → index-8b0bd5ad.js} +12 -7
- package/lib/{tab-content-iframe-index-cd0feda2.js → tab-content-iframe-index-be571e85.js} +1 -1
- package/lib/{tab-content-index-c325002d.js → tab-content-index-91630b88.js} +1 -1
- package/lib/{tache-subprocess-history-596b702e.js → tache-subprocess-history-974aed28.js} +1 -1
- package/lib/workflow-editor.js +1 -1
- package/lib/workflow-editor.umd.cjs +1 -1
- package/package.json +1 -1
- package/packages/plugins/formValidatorUtil.js +26 -0
package/package.json
CHANGED
|
@@ -23,7 +23,10 @@ function getLeafPropRule(editField, dataTypeMap) {
|
|
|
23
23
|
rule.pattern = new RegExp('^(-?\\d+)(\\.\\d+)?$')
|
|
24
24
|
rule.message = editField.label + ' ' + getI18n().t('workflowEditorMessage.requiredAndMustBeDecimal')
|
|
25
25
|
} else if (dataType === 'BOOLEAN') {
|
|
26
|
+
rule.type = 'boolean'
|
|
26
27
|
rule.message = editField.label + ' ' + getI18n().t('workflowEditorMessage.mustFill')
|
|
28
|
+
// 布尔型校验需要自定义,为了兼容oracle和mysql数据
|
|
29
|
+
packageBooleanRule(rule)
|
|
27
30
|
} else {
|
|
28
31
|
// if (entity[editField.name] || entity[editField.name] === 0) {
|
|
29
32
|
// if (typeof entity[editField.name] === 'number' && dataType === 'TEXT') {
|
|
@@ -49,6 +52,29 @@ function getLeafPropRule(editField, dataTypeMap) {
|
|
|
49
52
|
return rule
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
/**
|
|
56
|
+
* 布尔型校验需要自定义,为了兼容oracle和mysql数据库
|
|
57
|
+
* @param fieldRule
|
|
58
|
+
*/
|
|
59
|
+
function packageBooleanRule(fieldRule) {
|
|
60
|
+
if (fieldRule.type && fieldRule.type === 'boolean') {
|
|
61
|
+
fieldRule.validator = function (rule, value, callback) {
|
|
62
|
+
if (value === undefined || value === null) {
|
|
63
|
+
if (rule.required) {
|
|
64
|
+
return false
|
|
65
|
+
} else {
|
|
66
|
+
return true
|
|
67
|
+
}
|
|
68
|
+
} else if (typeof value === 'number' && (value === 1 || value === 0)) {
|
|
69
|
+
return true
|
|
70
|
+
} else if (typeof value === 'boolean' && (value === true || value === false)) {
|
|
71
|
+
return true
|
|
72
|
+
}
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
52
78
|
/**
|
|
53
79
|
* 获得对象验证规则
|
|
54
80
|
* @param {*} editField 字段信息
|