Skip to content

Commit

Permalink
feat(template): bind form reset (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
aide-cloud committed Apr 29, 2024
1 parent 013a64e commit 6863e94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const BindNotifyTemplate: React.FC<BindNotifyTemplateProps> = (
}, [strategyId, open])

useEffect(() => {
form?.resetFields(['content'])
form?.resetFields()
const item = templateList.find(
(item) => item.notifyType === notifyTeype
) || { notifyType: notifyTeype, content: '' }
Expand Down
12 changes: 7 additions & 5 deletions web/src/pages/home/monitor/strategy-group/strategy/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,8 @@ const TemplateTooltip = () => {
)
}

const templateEditorHight = 400

export const bindNotifyTemplateDataFormOptions = (
notifyType?: NotifyTemplateType
): DataFormItem[] => {
Expand All @@ -1052,39 +1054,39 @@ export const bindNotifyTemplateDataFormOptions = (
defaultContentType.dataProps = {
type: 'email-template-editor',
parentProps: {
height: 300
height: templateEditorHight
}
}
break
case NotifyTemplateType.NotifyTemplateTypeWeChatWork:
defaultContentType.dataProps = {
type: 'wechat-template-editor',
parentProps: {
height: 300
height: templateEditorHight
}
}
break
case NotifyTemplateType.NotifyTemplateTypeCustom:
defaultContentType.dataProps = {
type: 'json-template-editor',
parentProps: {
height: 300
height: templateEditorHight
}
}
break
case NotifyTemplateType.NotifyTemplateTypeFeiShu:
defaultContentType.dataProps = {
type: 'feishu-template-editor',
parentProps: {
height: 300
height: templateEditorHight
}
}
break
case NotifyTemplateType.NotifyTemplateTypeDingDing:
defaultContentType.dataProps = {
type: 'ding-template-editor',
parentProps: {
height: 300
height: templateEditorHight
}
}
break
Expand Down

0 comments on commit 6863e94

Please sign in to comment.