Commit dab0abfd by zhaochengxiang

新增规则库

parent 29511782
...@@ -92,12 +92,7 @@ export default FC ...@@ -92,12 +92,7 @@ export default FC
export const Basic = React.forwardRef(function ({ item }, ref) { export const Basic = React.forwardRef(function ({ item }, ref) {
const [loadingCheckTypes, setLoadingCheckTypes] = React.useState(false) const [loadingCheckTypes, setLoadingCheckTypes] = React.useState(false)
const [checkTypes, setCheckTypes] = React.useState() const [checkTypes, setCheckTypes] = React.useState()
const [loadingCheckPropertyTypes, setLoadingCheckPrpertyTypes] = React.useState(false) const [checkTypeValue, setCheckTypeValue] = React.useState()
const [checkPropertyTypes, setCheckPropertyTypes] = React.useState()
const [loadingExpressionTypes, setLoadingExpressionTypes] = React.useState(false)
const [expressionTypes, setExpressionTypes] = React.useState()
const [loadingExpressions, setLoadingExpressions] = React.useState(false)
const [expressions, setExpressions] = React.useState()
const [form] = Form.useForm() const [form] = Form.useForm()
...@@ -126,7 +121,9 @@ export const Basic = React.forwardRef(function ({ item }, ref) { ...@@ -126,7 +121,9 @@ export const Basic = React.forwardRef(function ({ item }, ref) {
} }
const onValuesChange = (changedValues, allValues) => { const onValuesChange = (changedValues, allValues) => {
console.log('all values', allValues) if (changedValues.hasOwnProperty('checkType')) {
setCheckTypeValue(changedValues.checkType)
}
} }
return ( return (
...@@ -162,11 +159,28 @@ export const Basic = React.forwardRef(function ({ item }, ref) { ...@@ -162,11 +159,28 @@ export const Basic = React.forwardRef(function ({ item }, ref) {
)) } )) }
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name='checkProperty' label='检查规则' {
rules={[{ required: true, message: '请选择检查类型!' }]} checkTypeValue === 'single' && <Form.Item name='checkProperty' label='检查规则'
rules={[{ required: true, message: '请选择检查规则!' }]}
>
<CheckItem />
</Form.Item>
}
{
checkTypeValue === 'preCheck' && <Form.Item label='检查规则'>
<Form.Item name='preCheckProperty' label='满足条件'
rules={[{ required: true, message: '请选择检查规则!' }]}
> >
<CheckItem /> <CheckItem />
</Form.Item> </Form.Item>
<Form.Item name='checkProperty' label='检查内容'
rules={[{ required: true, message: '请选择检查规则!' }]}
>
<CheckItem />
</Form.Item>
</Form.Item>
}
</Form> </Form>
) )
}) })
...@@ -313,7 +327,11 @@ const CheckItem = ({ value, onChange }) => { ...@@ -313,7 +327,11 @@ const CheckItem = ({ value, onChange }) => {
...currentExpression, value: e.target.value ...currentExpression, value: e.target.value
}) })
}}/> } }}/> }
{ (currentExpression?.valueType === 'List<String>') && <Input /> } { (currentExpression?.valueType === 'List<String>') && <Input placeholder='枚举值用;隔开 如高;中;低' onChange={(e) => {
setCurrentExpression({
...currentExpression, value: (e.target.value??'').split(';')
})
}} /> }
</Space> </Space>
) )
} }
\ No newline at end of file
...@@ -59,10 +59,10 @@ const ModelConfig = () => { ...@@ -59,10 +59,10 @@ const ModelConfig = () => {
<TabPane tab='规范配置' key='3'> <TabPane tab='规范配置' key='3'>
<ConstraintDetail /> <ConstraintDetail />
</TabPane> </TabPane>
{/* <TabPane tab='规则库管理' key='4'> <TabPane tab='规则库管理' key='4'>
<RuleTemplateCURD /> <RuleTemplateCURD />
</TabPane> */} </TabPane>
<TabPane tab='分区配置' key='4'> <TabPane tab='分区配置' key='5'>
<PartitionCURD /> <PartitionCURD />
</TabPane> </TabPane>
</Tabs> </Tabs>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment