Skip to content

Commit

Permalink
feat(notify): 重构通知模板组件
Browse files Browse the repository at this point in the history
- 新增 EmailTemplateEditor、JsonTemplateEditor 等模板编辑器组件
- 更新模板详情和编辑 Modal 组件,支持不同类型的模板内容展示和编辑
- 优化模板类型选择逻辑,根据发送类型动态显示模板内容
- 调整模板编辑表单,增加模板类型选择功能
  • Loading branch information
aide-cloud committed Jan 15, 2025
1 parent 2342903 commit 49de3c8
Show file tree
Hide file tree
Showing 13 changed files with 492 additions and 584 deletions.
2 changes: 2 additions & 0 deletions src/api/notify/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export type CreateTemplateRequest = {
remark: string
/** 模板状态 */
status: Status
/** 模板类型 */
templateType?: string
}

/**
Expand Down
11 changes: 2 additions & 9 deletions src/components/data/child/data-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import type { RangePickerProps } from 'antd/es/date-picker'
import type { PasswordProps, TextAreaProps } from 'antd/es/input'
import type { FC } from 'react'
import { AnnotationsEditor, type AnnotationsEditorProps } from './annotation-editor'
import { EmailTemplateEditor, type EmailTemplateEditorProps } from './eamil-template-editor'
import FetchSelect, { type FetchSelectProps } from './fetch-select'
import { JsonInputEditor, type JsonInputEditorProps } from './json-input'
import { JsonTemplateEditor, type JsonTemplateEditorProps } from './json-template-editor'
import { DingTemplateEditor, type DingTemplateEditorProps } from './template-editor-ding'
import { EmailTemplateEditor, type EmailTemplateEditorProps } from './template-editor-eamil'
import { FeishuTemplateEditor, type FeishuTemplateEditorProps } from './template-editor-feishu'
import { JsonTemplateEditor, type JsonTemplateEditorProps } from './template-editor-json'
import { WechatTemplateEditor, type WechatTemplateEditorProps } from './template-editor-wechat'
import { TimeUintInput, type TimeUintInputProps } from './time-value'
const { Search } = Input
Expand Down Expand Up @@ -93,10 +92,6 @@ export type DataInputProps = {
type: 'json-template-editor'
props?: JsonTemplateEditorProps
}
| {
type: 'json-input'
props?: JsonInputEditorProps
}
| {
type: 'button-input'
props?: ButtonInputProps
Expand Down Expand Up @@ -186,8 +181,6 @@ export const DataInput: FC<DataInputProps> = (props) => {
return <DingTemplateEditor {...props.props} value={value} defaultValue={defaultValue} onChange={onChange} />
case 'annotation-template-editor':
return <AnnotationsEditor {...props.props} value={value} onChange={onChange} />
case 'json-input':
return <JsonInputEditor {...props.props} value={value} defaultValue={defaultValue} onChange={onChange} />
case 'button-input':
return <Search {...props.props} value={value} defaultValue={defaultValue} onChange={onChange} />
default:
Expand Down
193 changes: 0 additions & 193 deletions src/components/data/child/eamil-template-editor.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/data/child/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { AnnotationsEditorProps } from './annotation-editor'
import { EmailTemplateEditorProps } from './eamil-template-editor'
import { FetchSelectProps } from './fetch-select'
import { JsonTemplateEditorProps } from './json-template-editor'
import { DingTemplateEditorProps } from './template-editor-ding'
import { EmailTemplateEditorProps } from './template-editor-eamil'
import { FeishuTemplateEditorProps } from './template-editor-feishu'
import { JsonTemplateEditorProps } from './template-editor-json'
import { WechatTemplateEditorProps } from './template-editor-wechat'
import { TimeUintInputProps } from './time-value'

Expand Down
117 changes: 0 additions & 117 deletions src/components/data/child/json-input.tsx

This file was deleted.

Loading

0 comments on commit 49de3c8

Please sign in to comment.