|
@@ -160,31 +160,35 @@ const RulesSet = () => {
|
|
label: ruleOptionLabel[state.ruleTypeValue],
|
|
label: ruleOptionLabel[state.ruleTypeValue],
|
|
value: ruleValue
|
|
value: ruleValue
|
|
}
|
|
}
|
|
- setRuleArr([...ruleArr, { id: rule.id, type: rule.type, label: rule.label, value: rule.value }])
|
|
|
|
|
|
+ setRuleArr([...ruleArr, rule])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const createBarExtraContent = () => {
|
|
|
|
+ return (
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ tryUpdateRuleCode({
|
|
|
|
+ tab: state.tabId,
|
|
|
|
+ rules: ruleArr.map(item => ({
|
|
|
|
+ type: item.type,
|
|
|
|
+ value: item.value,
|
|
|
|
+ label: item.label,
|
|
|
|
+ id: item.id
|
|
|
|
+ })),
|
|
|
|
+ connector: state.connector
|
|
|
|
+ })
|
|
|
|
+ }}>
|
|
|
|
+ 保存
|
|
|
|
+ </Button>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
return (
|
|
return (
|
|
<PageContainer title={false}>
|
|
<PageContainer title={false}>
|
|
<div className="p-4 bg-white" style={{ height: `${contentHeight}px` }}>
|
|
<div className="p-4 bg-white" style={{ height: `${contentHeight}px` }}>
|
|
- <div className="flex flex-row-reverse">
|
|
|
|
- <Button
|
|
|
|
- type="primary"
|
|
|
|
- onClick={() => {
|
|
|
|
- tryUpdateRuleCode({
|
|
|
|
- tab: state.tabId,
|
|
|
|
- rules: ruleArr.map(item => ({
|
|
|
|
- type: item.type,
|
|
|
|
- value: item.value,
|
|
|
|
- label: item.label,
|
|
|
|
- id: item.id
|
|
|
|
- })),
|
|
|
|
- connector: state.connector
|
|
|
|
- })
|
|
|
|
- }}>
|
|
|
|
- 保存
|
|
|
|
- </Button>
|
|
|
|
- </div>
|
|
|
|
<Tabs
|
|
<Tabs
|
|
defaultActiveKey="yuS"
|
|
defaultActiveKey="yuS"
|
|
|
|
+ tabBarExtraContent={createBarExtraContent()}
|
|
onChange={key => {
|
|
onChange={key => {
|
|
setState({
|
|
setState({
|
|
...state,
|
|
...state,
|
|
@@ -288,7 +292,12 @@ const RulesSet = () => {
|
|
<div>
|
|
<div>
|
|
<Input
|
|
<Input
|
|
type="number"
|
|
type="number"
|
|
- value={state.autoCode}
|
|
|
|
|
|
+ onChange={e =>
|
|
|
|
+ setState({
|
|
|
|
+ ...state,
|
|
|
|
+ autoCode: e.target.value
|
|
|
|
+ })
|
|
|
|
+ }
|
|
defaultValue={state.autoCode}
|
|
defaultValue={state.autoCode}
|
|
style={{ width: 160 }}
|
|
style={{ width: 160 }}
|
|
/>
|
|
/>
|