diff --git a/src/pages/configuration/subpage/OtherConfig.tsx b/src/pages/configuration/subpage/OtherConfig.tsx index e1b3554..2755fbd 100644 --- a/src/pages/configuration/subpage/OtherConfig.tsx +++ b/src/pages/configuration/subpage/OtherConfig.tsx @@ -4,11 +4,12 @@ import {ActionType} from "@ant-design/pro-components"; import {FormInstance} from "antd/es/form"; import Column from "antd/es/table/Column"; import RedoOutlined from "@ant-design/icons/lib/icons/RedoOutlined"; + class OtherConfig extends React.Component { refresh = () => { //TODO: refresh - this.setState({forced: true, limit: 0}) + this.setState({forced: true, limit: 0, activated: true}) } submit = () => { //TODO: submit @@ -27,14 +28,14 @@ class OtherConfig extends React.Component { } static getDerivedStateFromProps(props: any, state: any) { - if (props.activate !== state.activated && typeof state.refresh === "function") + if (props.activate && props.activate !== state.activated && typeof state.refresh === "function") state.refresh() return {activated: props.activate}; } render() { return ( -
+
{"强制总经理审批:"} { @@ -47,7 +48,7 @@ class OtherConfig extends React.Component { min={0} max={100000} defaultValue={500} disabled={this.state.forced} value={this.state.limit} onChange={(value) => { - if (isNaN(value)||Number(value) < 0) { + if (isNaN(value) || Number(value) < 0) { this.setState({limit: 0}) } else if (value.toString().split(".").length === 1) { this.setState({limit: Number(value)}) @@ -58,10 +59,10 @@ class OtherConfig extends React.Component { } }}/> - + + }}>