feat: 参数配置都是可选的参数
This commit is contained in:
@@ -837,6 +837,8 @@ function arrayEditInit(data: Record<string, any>, dataRule: any) {
|
|||||||
if (!item) {
|
if (!item) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 可选的
|
||||||
|
row.optional = 'true';
|
||||||
// 根据规则类型转值
|
// 根据规则类型转值
|
||||||
if (['enum', 'int'].includes(row.type)) {
|
if (['enum', 'int'].includes(row.type)) {
|
||||||
row.value = Number(item.value);
|
row.value = Number(item.value);
|
||||||
@@ -870,6 +872,8 @@ function arrayAddInit(data: any[], dataRule: any) {
|
|||||||
row.value = [];
|
row.value = [];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
// 可选的
|
||||||
|
row.optional = 'true';
|
||||||
// index值
|
// index值
|
||||||
if (row.name === 'index') {
|
if (row.name === 'index') {
|
||||||
let newIndex = dataLastIndex !== 0 ? dataLastIndex : parseInt(row.value);
|
let newIndex = dataLastIndex !== 0 ? dataLastIndex : parseInt(row.value);
|
||||||
@@ -904,7 +908,7 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
|
|||||||
if (row.array) {
|
if (row.array) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 可选的同时没有值不检查
|
// 可选的同时没有值不检查
|
||||||
if (row.optional === 'true' && !value) {
|
if (row.optional === 'true' && !value) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user