Commit 07e5e01b by zhaochengxiang

显示规范提示

parent 483018e8
...@@ -831,36 +831,7 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => { ...@@ -831,36 +831,7 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => {
(item.type === type) && (!iid || item.iid === iid) (item.type === type) && (!iid || item.iid === iid)
)) ))
if (index !== -1) { if (index !== -1) {
const items = (validateReports[index].reportItems??[]).filter(item => item.checkRule?.ruleTemplate?.checkProperty?.originalPropertyEnName === propertyName) return (validateReports[index].reportItems??[]).filter(item => item.checkRule?.ruleTemplate?.checkProperty?.originalPropertyEnName === propertyName)
return items.map(item => {
const [preCheckProperty, checkProperty] = [item.checkRule?.ruleTemplate?.preCheckProperty, item.checkRule?.ruleTemplate?.checkProperty]
let tip = ''
if (preCheckProperty) {
tip = `${preCheckProperty?.propertyCnName??''} ${preCheckProperty.expressionTypeCnName??''} ${preCheckProperty.verifyExpression?.cnName??''}`
if (IsArr(preCheckProperty?.verifyExpression?.value)) {
tip = `${tip} ${preCheckProperty?.verifyExpression?.value.join(';')}`
} else {
tip = `${tip} ${preCheckProperty?.verifyExpression?.value}`
}
}
if (checkProperty) {
tip = tip?`${tip} `:''
tip = `${tip}${checkProperty?.propertyCnName??''} ${checkProperty.expressionTypeCnName??''} ${checkProperty.verifyExpression?.cnName??''}`
if (IsArr(checkProperty?.verifyExpression?.value)) {
tip = `${tip} ${checkProperty?.verifyExpression?.value.join(';')}`
} else {
tip = `${tip} ${checkProperty?.verifyExpression?.value}`
}
}
return ({
alertTypeName: item.checkRule?.alertTypeName,
alertTypeId: item.checkRule?.alertTypeId,
tip
})
})
} }
return [] return []
...@@ -875,8 +846,8 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => { ...@@ -875,8 +846,8 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => {
(reports??[]).map((item, index) => ( (reports??[]).map((item, index) => (
<Row key={index}> <Row key={index}>
<Space> <Space>
{ (item.alertTypeId === 'enforced') ? <WarningFilled style={{ color: '#E94848' }} /> : <ExclamationCircleFilled style={{ color: '#F7AB00' }} /> } { (item.checkRule?.alertTypeId === 'enforced') ? <WarningFilled style={{ color: '#E94848' }} /> : <ExclamationCircleFilled style={{ color: '#F7AB00' }} /> }
<span>{item.tip}</span> <span>{item.checkRule?.alertContent}</span>
</Space> </Space>
</Row> </Row>
)) ))
...@@ -884,7 +855,7 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => { ...@@ -884,7 +855,7 @@ export const ValidateTip = ({ validateReports, type, propertyName, iid }) => {
</div> </div>
}> }>
{ {
(reports??[]).findIndex(item => item.alertTypeId === 'enforced') !== -1 ? <WarningFilled style={{ color: '#E94848' }} /> : <ExclamationCircleFilled style={{ color: '#F7AB00' }} /> (reports??[]).findIndex(item => item.checkRule?.alertTypeId === 'enforced') !== -1 ? <WarningFilled style={{ color: '#E94848' }} /> : <ExclamationCircleFilled style={{ color: '#F7AB00' }} />
} }
</Tooltip> </Tooltip>
} }
......
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