This is an automated email from the ASF dual-hosted git repository.

hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 6baf084c [Fix] Fix rule handler display bug (#376)
6baf084c is described below

commit 6baf084cafa96bbd13dd67ed84be8707fc43741b
Author: lulu <1534972...@qq.com>
AuthorDate: Tue Nov 21 16:01:15 2023 +0800

    [Fix] Fix rule handler display bug (#376)
---
 src/routes/Plugin/Common/CommonRuleHandle.js | 14 ++++----------
 src/routes/Plugin/Common/Rule.js             |  7 ++++++-
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/routes/Plugin/Common/CommonRuleHandle.js 
b/src/routes/Plugin/Common/CommonRuleHandle.js
index 235a6400..eee1f18e 100644
--- a/src/routes/Plugin/Common/CommonRuleHandle.js
+++ b/src/routes/Plugin/Common/CommonRuleHandle.js
@@ -16,7 +16,7 @@
  */
 
 import React, { Component } from "react";
-import { Form, Select, Input, InputNumber, Button, Tooltip, Popconfirm } from 
"antd";
+import { Form, Select, Input, Button, Tooltip, Popconfirm } from "antd";
 import classnames from "classnames";
 import styles from "../index.less";
 import { getIntlContent } from "../../../utils/IntlUtils";
@@ -113,8 +113,8 @@ export default class CommonRuleHandle extends Component {
                                   rules,
                                   initialValue: defaultValue
                                 })(
-                                  <InputNumber
-                                    precision={0}
+                                  <Input
+                                    allowClear
                                     addonBefore={
                                       <div style={{ width: labelWidth }}>
                                         {item.label}
@@ -145,13 +145,7 @@ export default class CommonRuleHandle extends Component {
                                       return (
                                         <Option
                                           key={option.dictValue}
-                                          value={
-                                            option.dictValue === "true"
-                                              ? true
-                                              : option.dictValue === "false"
-                                                ? false
-                                                : option.dictValue
-                                          }
+                                          value={option.dictValue}
                                         >
                                           {option.dictName} ({item.label})
                                         </Option>
diff --git a/src/routes/Plugin/Common/Rule.js b/src/routes/Plugin/Common/Rule.js
index a44b5f77..84aa1bf1 100644
--- a/src/routes/Plugin/Common/Rule.js
+++ b/src/routes/Plugin/Common/Rule.js
@@ -23,6 +23,7 @@ import { getIntlContent } from "../../../utils/IntlUtils";
 import CommonRuleHandle from "./CommonRuleHandle";
 import PluginRuleHandle from "../PluginRuleHandle";
 import RuleCopy from "./RuleCopy";
+import {parseBooleanString} from "../../../utils/utils";
 
 const FormItem = Form.Item;
 const { Option } = Select;
@@ -177,7 +178,11 @@ class AddModal extends Component {
                 pluginHandleList.forEach((handleList, index) => {
                   handle[index] = {};
                   handleList.forEach(item => {
-                    handle[index][item.field] = values[item.field + index];
+                    if (item.dataType === 3 && item.dictOptions) {
+                      handle[index][item.field] = 
parseBooleanString(values[item.field + index]);
+                    } else {
+                      handle[index][item.field] = values[item.field + index];
+                    }
                   });
                 });
                 handle = multiRuleHandle

Reply via email to