Commit c0781567 authored by 熊成伟's avatar 熊成伟

debug

parent d1b256f2
Pipeline #15890 passed with stages
in 1 minute and 1 second
import React from 'react';
import './index.less'
const MailA = (props) => {
const {data} = props;
const imgExt = ["png","jpg","jpeg","bmp","gif"];
const type = data.FILENAME && data.FILENAME.split('.')[1];
return (
<div>
<div className={`adjunct-card ${imgExt.indexOf(type) > -1 ? 'adjunct-pdf' : 'adjunct-word'}`}>
<div className="adjunct-title">
<img alt="" src={imgExt.indexOf(type) > -1 ? '/img/test/pdf.png' : '/img/test/word.png'} className="adjunct-img"/>
<div className="adjunct-content">
<p className="adjunct-title-1">{data.FILENAME}</p>
</div>
</div>
</div>
</div>
);
};
export default MailA;
...@@ -171,8 +171,8 @@ const Process = (props) => { ...@@ -171,8 +171,8 @@ const Process = (props) => {
//tab切换 //tab切换
const tabClick = (name) => { const tabClick = (name) => {
setCurrent(name) setCurrent(name)
name === 'option' && document.getElementsByClassName("option-text")[0].focus(); flow && name === 'option' && document.getElementsByClassName("option-text")[0].focus();
name === 'option' && optionBlur() flow && name === 'option' && optionBlur()
const top = document.getElementById(`event-${name}`).offsetTop - document.getElementById(`event-basic`).offsetTop; const top = document.getElementById(`event-${name}`).offsetTop - document.getElementById(`event-basic`).offsetTop;
window.scrollTo(0,top); window.scrollTo(0,top);
}; };
......
...@@ -3,34 +3,49 @@ import {WingBlank, List, InputItem, TextareaItem, WhiteSpace} from 'antd-mobile' ...@@ -3,34 +3,49 @@ import {WingBlank, List, InputItem, TextareaItem, WhiteSpace} from 'antd-mobile'
import Document from 'react-document-title' import Document from 'react-document-title'
import '../index.less' import '../index.less'
import axiosRequest from "../../../utils/request"; import axiosRequest from "../../../utils/request";
import BlobItem from '../../../components/Adjunct/BlobItem'
import Skeleton from '../../../components/Skeleton'
const Send = (props) => { const Send = (props) => {
const [data, setData] = useState({}) const [data, setData] = useState({});
const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
setLoading(true);
const {uuid} = props.match.params; const {uuid} = props.match.params;
axiosRequest({ axiosRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/jspmail/mailGetMail', url: '/idtAppServiceV6/jspmail/mailGetMail',
body: {uuid}, body: {uuid},
}).then(res => { }).then(res => {
setLoading(false);
setData(res) setData(res)
}); });
}, []) }, []);
return ( return (
<Document title="内部邮局"> <Document title="内部邮局">
<WingBlank> <WingBlank>
<WhiteSpace/> <WhiteSpace/>
{loading ? <Skeleton/> : (
<List className="date-info"> <List className="date-info">
<InputItem diasbled={true} value={data.mailInfo && data.mailInfo.TITLE}>主题</InputItem> <InputItem disabled={true} value={data.mailInfo && data.mailInfo.TITLE}>主题</InputItem>
<InputItem diasbled={true} value={data.mailInfo && JSON.parse(data.mailInfo.RECIPIENT).fzxs_mail_sender_groups}>收件人</InputItem> <InputItem disabled={true} value={data.mailInfo && JSON.parse(data.mailInfo.RECIPIENT).fzxs_mail_sender_groups}>收件人</InputItem>
<TextareaItem <TextareaItem
disabled={true} disabled={true}
title="内容" title="内容"
value={data.clob} value={data.clob}
rows={4} rows={4}
/> />
<div className="am-textarea-label upload-title">附件:</div>
<WingBlank>
{data.blobList && data.blobList.length > 0 && data.blobList.map((item, index) => (
<BlobItem key={index} data={item}/>
))}
</WingBlank>
<WhiteSpace/>
</List> </List>
)}
</WingBlank> </WingBlank>
</Document> </Document>
); );
......
...@@ -2,7 +2,7 @@ import React, {useState} from 'react'; ...@@ -2,7 +2,7 @@ import React, {useState} from 'react';
import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Toast} from 'antd-mobile' import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Toast} from 'antd-mobile'
import Document from 'react-document-title'; import Document from 'react-document-title';
import '../index.less'; import '../index.less';
import axiosRequest from '../../../utils/request'; import fileRequest from '../../../utils/fileRequest';
import Upload from 'rc-upload'; import Upload from 'rc-upload';
import MailA from '../../../components/Adjunct/MailA' import MailA from '../../../components/Adjunct/MailA'
...@@ -25,15 +25,18 @@ const Send = (props) => { ...@@ -25,15 +25,18 @@ const Send = (props) => {
formData.append('blob', file); formData.append('blob', file);
}); });
if (!error) { if (!error) {
axiosRequest({ fileRequest({
method: 'post', method: 'post',
url: '/idtAppServiceV6/jspmail/sendMail', url: '/idtAppServiceV6/jspmail/sendMail',
body: {jsonParam: JSON.stringify(jsonParam)}, body: {jsonParam: JSON.stringify(jsonParam)},
payload: formData
}).then(res => { }).then(res => {
Toast.success('发送成功'); Toast.success('发送成功');
props.history.push('/blank/mail'); props.history.push('/blank/mail');
setLoading(true) setLoading(true)
}); });
}else {
Toast.fail('请输入完整的主题、收件人、内容')
} }
}); });
}; };
...@@ -43,7 +46,7 @@ const Send = (props) => { ...@@ -43,7 +46,7 @@ const Send = (props) => {
multiple: true, multiple: true,
beforeUpload(file) { beforeUpload(file) {
const newUpload = [...upload, file]; const newUpload = [...upload, file];
setUpload(newUpload) setUpload(newUpload);
return false return false
} }
}; };
...@@ -60,17 +63,17 @@ const Send = (props) => { ...@@ -60,17 +63,17 @@ const Send = (props) => {
<form> <form>
<List> <List>
<InputItem <InputItem
{...getFieldProps('_mail_title_text')} {...getFieldProps('_mail_title_text', {rules: [{ required: true, message: '请输入主题'}]})}
placeholder="请输入主题" placeholder="请输入主题"
>主题</InputItem> >主题</InputItem>
<InputItem <InputItem
{...getFieldProps('_mail_sjr_text')} {...getFieldProps('_mail_sjr_text', {rules: [{ required: true, message: '请输入收件人'}]})}
placeholder="请输入收件人" placeholder="请输入收件人"
>收件人</InputItem> >收件人</InputItem>
<TextareaItem <TextareaItem
title="内容" title="内容"
placeholder="请输内容" placeholder="请输内容"
{...getFieldProps('_mail_editor_text')} {...getFieldProps('_mail_editor_text', {rules: [{ required: true, message: '请输内容'}]})}
rows={4} rows={4}
/> />
<div className="am-textarea-label upload-title">附件:</div> <div className="am-textarea-label upload-title">附件:</div>
......
import { createAPI } from './instance';
// export const apiUrl = 'http://124.93.101.8:9988/dgbg/';
export const apiUrl = '/';
const instance = createAPI(apiUrl);
async function fileRequest(option = {}) {
const res = await instance({
method: option.method || 'post',
url: option.url,
opts: option.body|| null,
payload: option.payload
});
return res;
}
export default fileRequest;
...@@ -30,9 +30,8 @@ let defaultHeaders = { ...@@ -30,9 +30,8 @@ let defaultHeaders = {
export const createAPI = (baseURL) => { export const createAPI = (baseURL) => {
return (conf = {}) => { return (conf = {}) => {
let opts = conf.opts || {}; let opts = conf.opts || {};
// let body = conf.body || {};
let urlParams = ''; let urlParams = '';
// console.log(conf) console.log(conf);
let headers = { ...defaultHeaders, ...opts.headers }; let headers = { ...defaultHeaders, ...opts.headers };
if (conf.opts) { if (conf.opts) {
...@@ -45,7 +44,7 @@ export const createAPI = (baseURL) => { ...@@ -45,7 +44,7 @@ export const createAPI = (baseURL) => {
url: conf.url + urlParams, url: conf.url + urlParams,
baseURL: baseURL, baseURL: baseURL,
method: conf.method, method: conf.method,
// data: body, data: conf.payload || null,
headers, headers,
})) }))
.then(function (response) { .then(function (response) {
......
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