|
@@ -1,12 +1,11 @@
|
|
import React, { useRef } from 'react'
|
|
import React, { useRef } from 'react'
|
|
-import { Button, message } from 'antd'
|
|
|
|
|
|
+import { Button, message, Form } from 'antd'
|
|
import {
|
|
import {
|
|
ModalForm,
|
|
ModalForm,
|
|
ProFormDependency,
|
|
ProFormDependency,
|
|
ProFormRadio,
|
|
ProFormRadio,
|
|
ProFormSelect,
|
|
ProFormSelect,
|
|
- ProFormText,
|
|
|
|
- ProFormTextArea
|
|
|
|
|
|
+ ProFormText
|
|
} from '@ant-design/pro-form'
|
|
} from '@ant-design/pro-form'
|
|
import type { ProFormColumnsType } from '@ant-design/pro-form'
|
|
import type { ProFormColumnsType } from '@ant-design/pro-form'
|
|
import ProTable from '@ant-design/pro-table'
|
|
import ProTable from '@ant-design/pro-table'
|
|
@@ -17,6 +16,7 @@ import { queryNoticeList, sendNotice } from '@/services/user/api'
|
|
import consts from '@/utils/consts'
|
|
import consts from '@/utils/consts'
|
|
import { PlusOutlined } from '@ant-design/icons'
|
|
import { PlusOutlined } from '@ant-design/icons'
|
|
import useWebSocketFn, { cmdType } from '@/hooks/core/useWebSocketFn'
|
|
import useWebSocketFn, { cmdType } from '@/hooks/core/useWebSocketFn'
|
|
|
|
+import RighEditor from './components/RighEditor'
|
|
|
|
|
|
export enum msgTypeEnum {
|
|
export enum msgTypeEnum {
|
|
Notification = 'notification',
|
|
Notification = 'notification',
|
|
@@ -90,6 +90,7 @@ const Notification: React.FC = () => {
|
|
<div>通知推送</div>
|
|
<div>通知推送</div>
|
|
</div> */}
|
|
</div> */}
|
|
<ProTable
|
|
<ProTable
|
|
|
|
+ isKeyPressSubmit
|
|
toolbar={{
|
|
toolbar={{
|
|
title: '通知推送'
|
|
title: '通知推送'
|
|
}}
|
|
}}
|
|
@@ -100,6 +101,7 @@ const Notification: React.FC = () => {
|
|
toolbar={{
|
|
toolbar={{
|
|
actions: [
|
|
actions: [
|
|
<ModalForm
|
|
<ModalForm
|
|
|
|
+ isKeyPressSubmit={false}
|
|
key="modalForm"
|
|
key="modalForm"
|
|
trigger={
|
|
trigger={
|
|
<Button type="primary">
|
|
<Button type="primary">
|
|
@@ -118,8 +120,18 @@ const Notification: React.FC = () => {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
}}>
|
|
}}>
|
|
- <ProFormText label="标题" name="title" required />
|
|
|
|
- <ProFormTextArea label="内容" name="content" required />
|
|
|
|
|
|
+ <ProFormText
|
|
|
|
+ label="标题"
|
|
|
|
+ name="title"
|
|
|
|
+ rules={[{ required: true, message: '请输入标题' }]}
|
|
|
|
+ />
|
|
|
|
+ {/* <ProFormTextArea label="内容" name="content" required /> */}
|
|
|
|
+ <Form.Item
|
|
|
|
+ label="内容"
|
|
|
|
+ name="content"
|
|
|
|
+ rules={[{ required: true, message: '请输入通知内容' }]}>
|
|
|
|
+ <RighEditor />
|
|
|
|
+ </Form.Item>
|
|
<ProFormRadio.Group
|
|
<ProFormRadio.Group
|
|
label="类型"
|
|
label="类型"
|
|
name="msgType"
|
|
name="msgType"
|
|
@@ -134,6 +146,7 @@ const Notification: React.FC = () => {
|
|
<ProFormSelect
|
|
<ProFormSelect
|
|
name="media"
|
|
name="media"
|
|
label="通知类型"
|
|
label="通知类型"
|
|
|
|
+ rules={[{ required: true, message: '请选择类型' }]}
|
|
options={[
|
|
options={[
|
|
{ label: '版本更新', value: mediaType.VersionUpdate },
|
|
{ label: '版本更新', value: mediaType.VersionUpdate },
|
|
{ label: '节假通知', value: mediaType.HolidayNotice }
|
|
{ label: '节假通知', value: mediaType.HolidayNotice }
|
|
@@ -147,6 +160,7 @@ const Notification: React.FC = () => {
|
|
msgType === msgTypeEnum.Notification && media === mediaType.VersionUpdate ? (
|
|
msgType === msgTypeEnum.Notification && media === mediaType.VersionUpdate ? (
|
|
<ProFormRadio.Group
|
|
<ProFormRadio.Group
|
|
name="refresh"
|
|
name="refresh"
|
|
|
|
+ rules={[{ required: true, message: '请选择刷新机制' }]}
|
|
options={[
|
|
options={[
|
|
{ label: '手动刷新', value: 0 },
|
|
{ label: '手动刷新', value: 0 },
|
|
{ label: '强制刷新', value: 1 }
|
|
{ label: '强制刷新', value: 1 }
|