修复根据数据类型配置业务规则
Showing
1 changed file
with
12 additions
and
3 deletions
| ... | @@ -561,12 +561,16 @@ const batchControlRules = () => { | ... | @@ -561,12 +561,16 @@ const batchControlRules = () => { |
| 561 | let isSingleInputField = false; | 561 | let isSingleInputField = false; |
| 562 | let isDoubleInputField = false; | 562 | let isDoubleInputField = false; |
| 563 | let isValid = true; | 563 | let isValid = true; |
| 564 | let isIncludeDate = false; | ||
| 564 | // 遍历 selectedRulesDataList,检查每个 fieldType 是否符合单文本框或双文本框 | 565 | // 遍历 selectedRulesDataList,检查每个 fieldType 是否符合单文本框或双文本框 |
| 565 | selectedRulesDataList.value.forEach((item: any) => { | 566 | selectedRulesDataList.value.forEach((item: any) => { |
| 566 | if (isSingleInput(item.fieldType)) { | 567 | if (isSingleInput(item.fieldType)) { |
| 567 | isSingleInputField = true; // 如果是单文本框,标记为单文本框 | 568 | isSingleInputField = true; // 如果是单文本框,标记为单文本框 |
| 568 | } else if (isDoubleInput(item.fieldType)) { | 569 | } else if (isDoubleInput(item.fieldType)) { |
| 569 | isDoubleInputField = true; // 如果是双文本框,标记为双文本框 | 570 | isDoubleInputField = true; // 如果是双文本框,标记为双文本框 |
| 571 | if (!isIncludeDate || (item.fieldType == 'date' || item.fieldType == 'datetime' || item.fieldType == 'timestamp' || item.fieldType == 'time')) { | ||
| 572 | isIncludeDate = true; | ||
| 573 | } | ||
| 570 | } else { | 574 | } else { |
| 571 | // 如果不是单文本框也不是双文本框,标记为无效 | 575 | // 如果不是单文本框也不是双文本框,标记为无效 |
| 572 | isValid = false; | 576 | isValid = false; |
| ... | @@ -589,12 +593,17 @@ const batchControlRules = () => { | ... | @@ -589,12 +593,17 @@ const batchControlRules = () => { |
| 589 | // 如果全都是单文本框或者全都是双文本框,则继续后续操作 | 593 | // 如果全都是单文本框或者全都是双文本框,则继续后续操作 |
| 590 | if (isSingleInputField) { | 594 | if (isSingleInputField) { |
| 591 | classEditFormItems.value[4].visible = false; | 595 | classEditFormItems.value[4].visible = false; |
| 592 | classEditFormItems.value[6].visible = true; | 596 | classEditFormItems.value[5].visible = true; |
| 593 | classEditFormItems.value[7].visible = false; | 597 | classEditFormItems.value[6].visible = false; |
| 598 | classEditFormItems.value[7].visible = true; | ||
| 594 | } else if (isDoubleInputField) { | 599 | } else if (isDoubleInputField) { |
| 595 | classEditFormItems.value[4].visible = true; | 600 | classEditFormItems.value[4].visible = true; |
| 596 | classEditFormItems.value[6].visible = false; | 601 | classEditFormItems.value[5].visible = false; |
| 602 | classEditFormItems.value[6].visible = true; | ||
| 597 | classEditFormItems.value[7].visible = true; | 603 | classEditFormItems.value[7].visible = true; |
| 604 | if (isIncludeDate) { //有日期框,隐藏精度输入 | ||
| 605 | classEditFormItems.value[4].visible = false; | ||
| 606 | } | ||
| 598 | } | 607 | } |
| 599 | classEditFormItems.value[0].default = selectedRulesData.value.rulesName; | 608 | classEditFormItems.value[0].default = selectedRulesData.value.rulesName; |
| 600 | drawerInfo.value.visible = true; | 609 | drawerInfo.value.visible = true; | ... | ... |
-
Please register or sign in to post a comment