[Fix] Fix rule handler display bug (#376)
diff --git a/src/routes/Plugin/Common/CommonRuleHandle.js b/src/routes/Plugin/Common/CommonRuleHandle.js
index 235a640..eee1f18 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 @@
rules,
initialValue: defaultValue
})(
- <InputNumber
- precision={0}
+ <Input
+ allowClear
addonBefore={
<div style={{ width: labelWidth }}>
{item.label}
@@ -145,13 +145,7 @@
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 a44b5f7..84aa1bf 100644
--- a/src/routes/Plugin/Common/Rule.js
+++ b/src/routes/Plugin/Common/Rule.js
@@ -23,6 +23,7 @@
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 @@
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