diff --git a/admin-web/src/pages/Sms/SignList.js b/admin-web/src/pages/Sms/SignList.js index d10bc6625..0d4898a0d 100644 --- a/admin-web/src/pages/Sms/SignList.js +++ b/admin-web/src/pages/Sms/SignList.js @@ -58,6 +58,7 @@ class SignList extends PureComponent { visible: true, type: 'add', title: '添加签名', + sign: {}, }); }; diff --git a/admin-web/src/pages/Sms/TemplateList.js b/admin-web/src/pages/Sms/TemplateList.js index 035df4e0f..0c725ea00 100644 --- a/admin-web/src/pages/Sms/TemplateList.js +++ b/admin-web/src/pages/Sms/TemplateList.js @@ -9,7 +9,8 @@ import styles from '../List/TableList.less'; import TemplateListSearch from './TemplateListSearch'; import TemplateListModal from './TemplateListModal'; -@connect(({ smsTemplateList, loading }) => ({ +@connect(({ smsSignList, smsTemplateList, loading }) => ({ + smsSignList, smsTemplateList, loading: loading.models.smsTemplateList, })) @@ -19,7 +20,7 @@ class TemplateList extends PureComponent { title: '添加模板', // 添加签名 修改签名 type: 'add', // add update id: '', - sign: {}, + template: {}, }; componentDidMount() { @@ -31,8 +32,24 @@ class TemplateList extends PureComponent { // 查询 page this.queryPage(); + + // 查询 sign 用于 signList + this.querySignList(); } + querySignList = () => { + const { dispatch } = this.props; + dispatch({ + type: 'smsSignList/page', + payload: { + current: 1, + total: 0, + size: 100, + // ...searchParams, + }, + }); + }; + queryPage = () => { const { dispatch } = this.props; const { current, total, size, searchParams } = this; @@ -58,25 +75,26 @@ class TemplateList extends PureComponent { visible: true, type: 'add', title: '添加模板', + template: {}, }); }; - handleUpdateShow = sign => { - const { id } = sign; + handleUpdateShow = template => { + const { id } = template; this.setState({ visible: true, type: 'update', title: '更新模板', id, - sign, + template, }); }; - handleDeleted = ({ id, sign }) => { + handleDeleted = ({ id, template }) => { const { dispatch } = this.props; Modal.confirm({ title: `提示消息`, - content: `确认删除 ${sign} 签名吗`, + content: `确认删除 ${template} 签名吗`, okText: '确认', cancelText: '取消', onOk: () => { @@ -147,9 +165,9 @@ class TemplateList extends PureComponent { render() { // props - const { loading, smsTemplateList } = this.props; + const { loading, smsTemplateList, smsSignList } = this.props; const { list, total, index, size } = smsTemplateList; - const { visible, title, type, sign } = this.state; + const { visible, title, type, template } = this.state; const columns = [ { @@ -167,7 +185,7 @@ class TemplateList extends PureComponent { }, }, { - title: '签名', + title: '模板', dataIndex: 'template', key: 'template', }, @@ -237,7 +255,7 @@ class TemplateList extends PureComponent {
- +

@@ -258,7 +276,8 @@ class TemplateList extends PureComponent { >} */ const SignListModal = Form.create()(props => { - const { onOk, onCancel, visible, title, form, initData = {} } = props; + const { onOk, onCancel, visible, title, form, signList, initData = {} } = props; const { getFieldDecorator, validateFields } = props.form; function handleOk(e) { @@ -47,7 +47,15 @@ const SignListModal = Form.create()(props => { }, ], initialValue: initData.sign ? initData.sign.id : null, - })()} + })( + + )} {getFieldDecorator('smsType', { diff --git a/admin-web/src/pages/Sms/TemplateListSearch.js b/admin-web/src/pages/Sms/TemplateListSearch.js index 3a65b18fb..6fc984d8f 100644 --- a/admin-web/src/pages/Sms/TemplateListSearch.js +++ b/admin-web/src/pages/Sms/TemplateListSearch.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Button, Col, Form, Input, Row } from 'antd'; +import { Button, Col, Form, Input, Row, Select } from 'antd'; const FormItem = Form.Item; @@ -9,7 +9,7 @@ const FormItem = Form.Item; * @type {React.ComponentClass>} */ const SignListSearch = Form.create()(props => { - const { handleSearch } = props; + const { handleSearch, signList } = props; const { getFieldDecorator, validateFields, form } = props.form; function onSubmit(e) { @@ -37,7 +37,15 @@ const SignListSearch = Form.create()(props => { - {getFieldDecorator('smsSignId')()} + {getFieldDecorator('smsSignId')( + + )}