Browse Source

(*)前端获取导入数据

master
ww664853070 2 years ago
parent
commit
12d57f3f89
  1. 4
      web/client/src/sections/humanAffairs/containers/importPersonalTrainRecord.jsx
  2. 1
      web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx

4
web/client/src/sections/humanAffairs/containers/importPersonalTrainRecord.jsx

@ -18,6 +18,7 @@ const ImportPerformanceSummaryModal = props => {
const confirm = () => { const confirm = () => {
if (postData.length) { if (postData.length) {
setLoading(true) setLoading(true)
console.log(postData,'-------------------')
// dispatch(businessManagement.importSalePerformance(postData)).then(res => { // dispatch(businessManagement.importSalePerformance(postData)).then(res => {
// if (res.success) { // if (res.success) {
// onCancel() // onCancel()
@ -64,13 +65,14 @@ const ImportPerformanceSummaryModal = props => {
if (window.FileReader) { if (window.FileReader) {
let reader = new FileReader(); let reader = new FileReader();
reader.readAsBinaryString(request.response); reader.readAsBinaryString(request.response);
reader.onload = event => { reader.onload = event => {
try { try {
const { result } = event.target; const { result } = event.target;
// excel // excel
const workbook = XLSX.read(result, { const workbook = XLSX.read(result, {
type: "binary", type: "binary",
cellDates: true,//true // cellDates: true,//true
codepage: 936,// codepage: 936,//
}); });
let data = []; // let data = []; //

1
web/client/src/sections/humanAffairs/containers/personalTrainRecord.jsx

@ -10,7 +10,6 @@ const PersonalTrainRecord = (props) => {
const [limits, setLimits] = useState()// const [limits, setLimits] = useState()//
const [query, setQuery] = useState({ limit: 10, page: 0 }); // const [query, setQuery] = useState({ limit: 10, page: 0 }); //
const [importModalV, setImportModalV] = useState(false); // const [importModalV, setImportModalV] = useState(false); //
console.log(actions, '================')
useEffect(() => { useEffect(() => {
const { getPersonalTrainRecord } = actions.humanAffairs const { getPersonalTrainRecord } = actions.humanAffairs
dispatch(getPersonalTrainRecord(query)) dispatch(getPersonalTrainRecord(query))

Loading…
Cancel
Save