Commit 7b8975fe authored by 熊成伟's avatar 熊成伟

debug

parent ce489afc
Pipeline #16378 passed with stages
in 1 minute and 3 seconds
......@@ -42,5 +42,5 @@
"react-app-rewired": "^1.2.9",
"style-loader": "^1.2.1"
},
"proxy": "http://124.93.101.8:9988/"
"proxy": "http://124.93.101.8:9988"
}
......@@ -2,6 +2,7 @@ import React, {useState, useEffect} from 'react';
import Document from 'react-document-title'
import {WingBlank, WhiteSpace, ActionSheet, Toast} from 'antd-mobile'
import axiosRequest from '../../utils/request';
import {exportExcel} from '../../utils/api'
import TopTabs from '../../components/Tabs/BlankTabs'
import Skeleton from '../../components/Skeleton'
import Basic from './commponents/Basic'
......@@ -147,13 +148,12 @@ const Process = (props) => {
};
const download = (uuid, callback) => {
const developer = localStorage.getItem('developer');
axiosRequest({
exportExcel({
method: 'post',
url: `/idtAppServiceV6/oApp/downloadLargeFile`,
body: {uuid, tableId, templateId, developer}
}).then(res => {
callback && callback()
});
body: {uuid, tableId, developer},
callback: callback
})
}
//tab切换
......@@ -227,32 +227,6 @@ const Process = (props) => {
});
};
// const handleScroll = () => {
// const basic = document.getElementById("event-basic").offsetTop;
// const adjunct = document.getElementById("event-adjunct").offsetTop;
// const flow = document.getElementById("event-flow").offsetTop;
// const option = document.getElementById("event-option").offsetTop;
// const top = document.documentElement.scrollTop || document.body.scrollTop;
// let clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
// let scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
// if (top >= basic && top < adjunct) {
// setCurrent('basic')
// }else if (top >= adjunct - basic && top < flow) {
// setCurrent('adjunct')
// }else if (top >= flow - basic && top < option) {
// setCurrent('flow')
// }else if (top >= option - basic) {
// setCurrent('option')
// }
// if (top + clientHeight === scrollHeight) {
// setCurrent('option')
// }
// };
// useEffect(() => {
// window.addEventListener('scroll', handleScroll, true);
// return () => window.removeEventListener('scroll', handleScroll, true);
// }, []);
const resultLoading = basicLoading && adjunctLoading && flowLoading;
return (
<Document title="待办详情">
......
......@@ -12,7 +12,26 @@ const Adjunct = (props) => {
// document.getElementsByTagName('body')[0].appendChild(iframe);
// }
const downloadFile = (uuid) => {
download(uuid,)
download(uuid, res => {
console.log(res)
// try {
// var enc = new TextDecoder('utf-8');
// var result = JSON.parse(enc.decode(new Uint8Array(res))); //转化成json对象
// console.log(result)
// } catch (error) {
// var blob = new Blob([res], {
// type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
// });
// var downloadElement = document.createElement('a');
// var href = window.URL.createObjectURL(blob); //创建下载的链接
// downloadElement.href = href;
// downloadElement.download = ''; //下载后文件名
// document.body.appendChild(downloadElement);
// downloadElement.click(); //点击下载
// document.body.removeChild(downloadElement); //下载完成移除元素
// window.URL.revokeObjectURL(href); //释放掉blob对象
// }
})
}
const listData = [
{title: '附件', line: data.length > 0, content:
......
......@@ -54,10 +54,10 @@ const Send = (props) => {
res.uuid && uploadFile(upload, 'zw', res.uuid);
res.uuid && uploadFile(upload2, 'fj', res.uuid);
resolve()
})).then(() => {
})).then((res) => {
if (name !== '办公用品采购') {
res.uuid && Toast.success('新增成功');
props.history.goBack()
res && res.uuid && Toast.success('新增成功');
res && res.uuid && props.history.goBack()
}else {
setGoodSubmit(true)
}
......@@ -213,25 +213,38 @@ const Send = (props) => {
newGoods[index].checked = !newGoods[index].checked;
setGoods(newGoods)
};
const checkTitle = () => {
fileRequest({
method: 'post',
url: '/idtAppServiceV6/control/getList',
body: {
script: 'oa_fwgl_jyFwwhbh',
args: JSON.stringify([numberList[0], numberList[1]]),
keys: JSON.stringify([numberList[2]])
}
}).then((res) => {
Toast.success('校验成功');
});
};
// const checkTitle = () => {
// fileRequest({
// method: 'post',
// url: '/idtAppServiceV6/control/getList',
// body: {
// script: 'oa_fwgl_jyFwwhbh',
// args: JSON.stringify([numberList[0], numberList[1]]),
// keys: JSON.stringify([numberList[2]])
// }
// }).then((res) => {
// Toast.success('校验成功');
// });
// };
const saveNumber = (number1, number2, number3) => {
const result = [...numberList];
number1 && (result[0] = number1);
number2 && (result[1] = number2);
number3 && (result[2] = number3);
setNumberList(result)
setNumberList(result);
const developer = localStorage.getItem('developer');
name.indexOf('发文') > -1 && result[0] && result[1] && axiosRequest({
method: 'post',
url: '/idtAppServiceV6/control/getMap',
body: {
script: 'oa_fwgl_setFwwhbh',
args: JSON.stringify([result[1], result[0]]),
replaceMap: JSON.stringify({developer})
}
}).then((res) => {
res && res.MAXFWWHBH && props.form.setFieldsValue({编号: res.MAXFWWHBH});
});
};
return (
......@@ -287,15 +300,15 @@ const Send = (props) => {
)
} else if (name=== '收文管理' && item.label.indexOf('文号') > -1) {
return (
<List.Item key={index} className="line-number">
<List.Item key={index}>
文号
<div className="pos-aline">
<Picker value={[numberList[0]]} data={numberData} cols={1} onChange={val => saveNumber(val[0])}>
<List.Item className="room-num-2"/>
</Picker>
<div className="pos-aline">[ <input className="room-num-2" onChange={(val) => saveNumber(null, val.target.value)}/> ]</div>
<input className="room-num-2" onChange={(val) => saveNumber(null, null, val.target.value)}/>
<Button className="org-btn" size="small" onClick={checkTitle}>校验</Button>
<div className="pos-aline">[ <input className="room-num-2" onBlur={val => saveNumber(null, val.target.value)}/> ]</div>
<input {...getFieldProps('文号')} className="room-num-2"/>
{/*<Button className="org-btn" size="small" onClick={checkTitle}>校验</Button>*/}
</div>
</List.Item>
)
......@@ -307,8 +320,8 @@ const Send = (props) => {
<Picker value={[numberList[0]]} data={numberData} cols={1} onChange={val => saveNumber(val[0])}>
<List.Item className="room-num-2"/>
</Picker>
<div className="pos-aline">[ <input className="room-num-2" onChange={(val) => saveNumber(null, val.target.value)}/> ]</div>
<input className="room-num-2" onChange={(val) => saveNumber(null, null, val.target.value)}/>
<div className="pos-aline">[ <input className="room-num-2" onBlur={val => saveNumber(null, val.target.value)}/> ]</div>
<input className="room-num-2" {...getFieldProps('编号')}/>
</div>
</List.Item>
)
......
import { exportRequest } from './exportFile';
const token = localStorage.getItem('token')
// 导出
export function exportExcel(params) {
var body = {
name: params.name,
body: params.body,
callback: params.callback,
method: params.method || 'post'
};
var config = {
headers: {
token
}
};
return exportRequest(params.url, body, config);
}
import axios from 'axios';
const instance = axios.create();
export function exportRequest(url, conf = {}, headers = {}) {
//导出添加header
const handleFunction = (res) => {
//这里res.data是返回的blob对象
try {
var enc = new TextDecoder('utf-8');
var result = JSON.parse(enc.decode(new Uint8Array(res.data))); //转化成json对象
console.log(result)
} catch (error) {
var blob = new Blob([res.data]);
var downloadElement = document.createElement('a');
var href = window.URL.createObjectURL(blob); //创建下载的链接
downloadElement.href = href;
// downloadElement.download = `${conf.name || 'table'}.xls`; //下载后文件名
document.body.appendChild(downloadElement);
downloadElement.click(); //点击下载
document.body.removeChild(downloadElement); //下载完成移除元素
window.URL.revokeObjectURL(href); //释放掉blob对象
conf.callback && typeof conf.callback === 'function' && conf.callback();
}
};
return instance({
url: 'http://124.93.101.8:9988' + url,
method: conf.method,
params: conf.body,
headers,
}).then(response => {
handleFunction(response);
console.log(response)
})
}
......@@ -39,6 +39,7 @@ export const createAPI = (baseURL) => {
urlParams += qs.stringify(conf.opts)
}
// console.log(headers)
return instance(Object.assign({}, {
url: conf.url + urlParams,
......@@ -53,8 +54,8 @@ export const createAPI = (baseURL) => {
if (!response || !(response.data || response.tree)) {
// response.status === 'failure' && (window.location.href = '/login')
response.code === 'idt-jwt-500' && (window.location.href = '/login')
console.log('response出错, 无返回数据!', response);
Toast.fail(response.message)
console.log('response出错, 无返回数据!');
response.status === 'failure' && Toast.fail(response.message)
// return false;
};
if (response.data && response.data.errorMessage) {
......
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