Commit 98495357 authored by mayongxin's avatar mayongxin

perf:新增消息模板管理

parent 0b30e293
Pipeline #25101 skipped with stages
......@@ -39,8 +39,6 @@
width: 100%;
height: calc(100vh - 184px);
background-color: white;
display: flex;
flex-direction: column;
justify-content: flex-start;
overflow-y: scroll;
}
}
\ No newline at end of file
import React, {useState,useEffect } from 'react'
import SiteModal from '@/components/Modal/SiteModa';
import { Form, Input, notification, Select } from 'antd'
const { Item } = Form;
const AddModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const onSubmit = () => {
let result = form.getFieldValue()
props.onSubmit&props.onSubmit({...result})
}
// useEffect(()=>{
// },[props.template])
return (
<SiteModal
{...props}
title="模板添加"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
destroyOnClose
cancelText="取消"
okText="确认"
onOk={() => onSubmit()}
confirmLoading={loading}
>
<Form form={form} labelCol={{ span: 4 }}>
<Item
label="模板名称"
name="name"
rules={[
{
required: true,
message: '请输入模板名称',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="模板类型"
name="type"
rules={[
{
required: true,
message: '请选择模板类型',
},
]}
>
<Select defaultValue={"公众号"}>
<Option value="公众号">公众号</Option>
<Option value="短信">短信</Option>
</Select>
</Item>
<Item
label="第三方模板名称"
name="third_name"
rules={[
{
required: true,
message: '请输入第三方模板名称',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="第三方模板编号"
name="third_id"
rules={[
{
required: true,
message: '请输入第三方模板编号',
},
]}
>
<Input placeholder="请输入模板名称" />
</Item>
<Item
label="模板参数"
name="params"
rules={[
{
required: true,
message: '请输入模板参数',
},
]}
>
<Input placeholder="请输入模板参数" />
</Item>
<Item
label="参数说明"
name="desc"
rules={[
{
required: true,
message: '请输入参数说明',
},
]}
>
<Input placeholder="请输入参数说明" />
</Item>
<Item
label="参数解析"
name="analysis_params"
rules={[
{
required: true,
message: '请输入参数解析',
},
]}
>
<Input placeholder="请输入参数解析" />
</Item>
</Form>
</SiteModal>
)
}
export default AddModal;
\ No newline at end of file
......@@ -6,14 +6,29 @@ const { Item } = Form;
const EditModal = props => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const onSubmit = () => { }
const onSubmit = () => {
let result = form.getFieldValue()
props.onSubmit&props.onSubmit({Id:props.template.Id,...result})
}
useEffect(()=>{
form.setFieldsValue({
name:props.template.name,
type:props.template.type,
third_name:props.template.third_name,
third_id:props.template.third_id,
params:props.template.template_params,
desc:props.template.desc,
analysis_params:props.template.analysis_params,
})
},[props.template])
return (
<SiteModal
{...props}
title="编辑站点"
title="模板编辑"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }}
width="800px"
......@@ -47,8 +62,8 @@ const EditModal = props => {
]}
>
<Select >
<Option value="1">公众号</Option>
<Option value="2">短信</Option>
<Option value="公众号">公众号</Option>
<Option value="短信">短信</Option>
</Select>
</Item>
<Item
......
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
export const GetMessageTemplate = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/GetMessageTemplate`, param);
export const InsertMessageTemplate = param =>
post(`${PUBLISH_SERVICE}/MessageTemplate/InsertMessageTemplate`, param);
export const UpdateMessageTemplate = param =>
post(`${PUBLISH_SERVICE}/MessageTemplate/UpdateMessageTemplate`, param);
export const DeleteMessageTemplate = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/DeleteMessageTemplate`, param);
export const GetThirdpartyTemplates = param =>
get(`${PUBLISH_SERVICE}/MessageTemplate/GetThirdpartyTemplates`, param);
\ No newline at end of file
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