update 通知公告显示优化
This commit is contained in:
@@ -96,13 +96,13 @@ export default class form extends Component {
|
||||
return (
|
||||
<Form initialValues={initialValues} ref={this.form} className="yo-form">
|
||||
<Spin spinning={this.state.loading} indicator={<AntIcon type="loading" />}>
|
||||
<div className="yo-form-group">
|
||||
<div className="yo-form-group yo-form--fluid">
|
||||
<Form.Item
|
||||
label="标题"
|
||||
name="title"
|
||||
rules={[{ required: true, message: '请输入标题', trigger: 'blur' }]}
|
||||
>
|
||||
<Input autoComplete="off" placeholder="请输入标题" className="w-300" />
|
||||
<Input autoComplete="off" placeholder="请输入标题" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="类型"
|
||||
@@ -120,7 +120,17 @@ export default class form extends Component {
|
||||
<Form.Item
|
||||
label="内容"
|
||||
name="content"
|
||||
// rules={[{ required: true, message: '请输入内容' }]}
|
||||
rules={[
|
||||
{ required: true, message: '请输入内容' },
|
||||
{
|
||||
validator: async (field, value) => {
|
||||
const v = value.replace(/<\/?.+?\/?>/g, '')
|
||||
if (!v) {
|
||||
throw Error('请输入内容')
|
||||
}
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<BraftEditor />
|
||||
</Form.Item>
|
||||
|
||||
@@ -28,7 +28,7 @@ const apiAction = {
|
||||
* 用于弹窗标题
|
||||
* [必要]
|
||||
*/
|
||||
const name = '啥玩意'
|
||||
const name = '通知公告'
|
||||
|
||||
/**
|
||||
* 统一配置权限标识
|
||||
@@ -253,6 +253,7 @@ export default class index extends Component {
|
||||
<Auth auth={{ [authName]: 'add' }}>
|
||||
<ModalForm
|
||||
title={`新增${name}`}
|
||||
width={800}
|
||||
action={apiAction.add}
|
||||
ref={this.addForm}
|
||||
onSuccess={() => this.table.current.onReloadData()}
|
||||
@@ -264,6 +265,7 @@ export default class index extends Component {
|
||||
<Auth auth={{ [authName]: 'edit' }}>
|
||||
<ModalForm
|
||||
title={`编辑${name}`}
|
||||
width={800}
|
||||
action={apiAction.edit}
|
||||
ref={this.editForm}
|
||||
onSuccess={() => this.table.current.onReloadData()}
|
||||
|
||||
Reference in New Issue
Block a user