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) => {
//tab切换
const tabClick = (name) => {
setCurrent(name)
name === 'option' && document.getElementsByClassName("option-text")[0].focus();
name === 'option' && optionBlur()
flow && name === 'option' && document.getElementsByClassName("option-text")[0].focus();
flow && name === 'option' && optionBlur()
const top = document.getElementById(`event-${name}`).offsetTop - document.getElementById(`event-basic`).offsetTop;
window.scrollTo(0,top);
};
......
......@@ -3,34 +3,49 @@ import {WingBlank, List, InputItem, TextareaItem, WhiteSpace} from 'antd-mobile'
import Document from 'react-document-title'
import '../index.less'
import axiosRequest from "../../../utils/request";
import BlobItem from '../../../components/Adjunct/BlobItem'
import Skeleton from '../../../components/Skeleton'
const Send = (props) => {
const [data, setData] = useState({})
const [data, setData] = useState({});
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true);
const {uuid} = props.match.params;
axiosRequest({
method: 'post',
url: '/idtAppServiceV6/jspmail/mailGetMail',
body: {uuid},
}).then(res => {
setLoading(false);
setData(res)
});
}, [])
}, []);
return (
<Document title="内部邮局">
<WingBlank>
<WhiteSpace/>
<List className="date-info">
<InputItem diasbled={true} value={data.mailInfo && data.mailInfo.TITLE}>主题</InputItem>
<InputItem diasbled={true} value={data.mailInfo && JSON.parse(data.mailInfo.RECIPIENT).fzxs_mail_sender_groups}>收件人</InputItem>
<TextareaItem
disabled={true}
title="内容"
value={data.clob}
rows={4}
/>
</List>
{loading ? <Skeleton/> : (
<List className="date-info">
<InputItem disabled={true} value={data.mailInfo && data.mailInfo.TITLE}>主题</InputItem>
<InputItem disabled={true} value={data.mailInfo && JSON.parse(data.mailInfo.RECIPIENT).fzxs_mail_sender_groups}>收件人</InputItem>
<TextareaItem
disabled={true}
title="内容"
value={data.clob}
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>
)}
</WingBlank>
</Document>
);
......
......@@ -2,7 +2,7 @@ import React, {useState} from 'react';
import {WingBlank, List, InputItem, TextareaItem, WhiteSpace, Toast} from 'antd-mobile'
import Document from 'react-document-title';
import '../index.less';
import axiosRequest from '../../../utils/request';
import fileRequest from '../../../utils/fileRequest';
import Upload from 'rc-upload';
import MailA from '../../../components/Adjunct/MailA'
......@@ -25,15 +25,18 @@ const Send = (props) => {
formData.append('blob', file);
});
if (!error) {
axiosRequest({
fileRequest({
method: 'post',
url: '/idtAppServiceV6/jspmail/sendMail',
body: {jsonParam: JSON.stringify(jsonParam)},
payload: formData
}).then(res => {
Toast.success('发送成功');
props.history.push('/blank/mail');
setLoading(true)
});
}else {
Toast.fail('请输入完整的主题、收件人、内容')
}
});
};
......@@ -43,7 +46,7 @@ const Send = (props) => {
multiple: true,
beforeUpload(file) {
const newUpload = [...upload, file];
setUpload(newUpload)
setUpload(newUpload);
return false
}
};
......@@ -60,17 +63,17 @@ const Send = (props) => {
<form>
<List>
<InputItem
{...getFieldProps('_mail_title_text')}
{...getFieldProps('_mail_title_text', {rules: [{ required: true, message: '请输入主题'}]})}
placeholder="请输入主题"
>主题</InputItem>
<InputItem
{...getFieldProps('_mail_sjr_text')}
{...getFieldProps('_mail_sjr_text', {rules: [{ required: true, message: '请输入收件人'}]})}
placeholder="请输入收件人"
>收件人</InputItem>
<TextareaItem
title="内容"
placeholder="请输内容"
{...getFieldProps('_mail_editor_text')}
{...getFieldProps('_mail_editor_text', {rules: [{ required: true, message: '请输内容'}]})}
rows={4}
/>
<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 = {
export const createAPI = (baseURL) => {
return (conf = {}) => {
let opts = conf.opts || {};
// let body = conf.body || {};
let urlParams = '';
// console.log(conf)
console.log(conf);
let headers = { ...defaultHeaders, ...opts.headers };
if (conf.opts) {
......@@ -45,7 +44,7 @@ export const createAPI = (baseURL) => {
url: conf.url + urlParams,
baseURL: baseURL,
method: conf.method,
// data: body,
data: conf.payload || null,
headers,
}))
.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