Browse Source

导出

release_0.0.4
xingyongchun 2 years ago
parent
commit
5e915675a5
  1. 21
      web/client/src/sections/fillion/components/bridgeTable.js
  2. 18
      web/client/src/sections/fillion/components/highwaysTable.js
  3. 21
      web/client/src/sections/fillion/components/inforTable.js
  4. 30
      web/client/src/sections/fillion/components/operationalTable.js
  5. 16
      web/client/src/sections/fillion/components/publicTable.js
  6. 30
      web/client/src/sections/fillion/components/transportationTable.js
  7. 28
      web/client/src/sections/fillion/containers/bridge.js
  8. 23
      web/client/src/sections/fillion/containers/highways.js
  9. 16
      web/client/src/sections/fillion/containers/infor.js
  10. 28
      web/client/src/sections/fillion/containers/operational.js
  11. 26
      web/client/src/sections/fillion/containers/promotional.js
  12. 24
      web/client/src/sections/fillion/containers/public.js
  13. 30
      web/client/src/sections/fillion/containers/transportation.js

21
web/client/src/sections/fillion/components/bridgeTable.js

@ -24,6 +24,7 @@ const BrideTable = (props) => {
const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('qiaoliang')
const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('bridge')
const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet])
@ -1750,22 +1751,6 @@ const BrideTable = (props) => {
setModalRecord(null);
}
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
return (
<Spin spinning={false}>
<div className='protable-transpor'>
@ -1782,12 +1767,14 @@ const BrideTable = (props) => {
key: 'tab1',
label: <span onClick={() => {
setWhichofits('qiaoliang')
setDifferentiate('bridge')
}}>桥梁{activeKey === 'tab1'}</span>,
},
{
key: 'tab2',
label: <span onClick={() => {
setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab2'}</span>,
},
@ -1844,7 +1831,7 @@ const BrideTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,differentiate) }}>
<Button
>
导出

18
web/client/src/sections/fillion/components/highwaysTable.js

@ -29,23 +29,7 @@ const hightModal = (type, record) => {
} else {
setModalRecord(null);
}
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
}
const columns =
[
{

21
web/client/src/sections/fillion/components/inforTable.js

@ -35,22 +35,6 @@ const InForTable = (props) => {
setModalRecord(null);
}
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const deldata = (id) => { // 治超删除
const query = {
overspeedId: id
@ -463,7 +447,10 @@ const InForTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Popconfirm title="确认导出?" onConfirm={() => {
console.log(rowSelected)
props.exports(rowSelected, counts) }}>
<Button
>
导出

30
web/client/src/sections/fillion/components/operationalTable.js

@ -22,7 +22,9 @@ const OperaTionalTable = (props) => {
const [recortd, setRecortd] = useState()
const [rewkeys, setRewkeys] = useState('keyun')
const [delet, setDelet] = useState()
// const [, setDelet] = useState()
const [differentiate, setDifferentiate] = useState()
const [genre, setGenre] = useState()
const ref = useRef()
useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet])
@ -63,22 +65,6 @@ const OperaTionalTable = (props) => {
setModalRecord(null);
}
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const columns = {
tab1: [
{
@ -1881,6 +1867,8 @@ const OperaTionalTable = (props) => {
label: <span onClick={() => {
{
setRewkeys('chuzu')
setDifferentiate('vehicle')
setGenre('出租车')
}
}}>出租车{activeKey === 'tab2'}</span>,
@ -1890,13 +1878,17 @@ const OperaTionalTable = (props) => {
label: <span onClick={() => {
{
setRewkeys('weihuo')
setDifferentiate('vehicle')
setGenre('危货')
}
}}>危险货运{activeKey === 'tab3'}</span>,
}, {
key: 'tab4',
label: <span onClick={() => {
setRewkeys('yehu')
setDifferentiate('business')
setRewkeys('yehu')
}}>业户{activeKey === 'tab4'}</span>,
},
@ -1974,7 +1966,7 @@ const OperaTionalTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,differentiate,genre) }}>
<Button
>
导出

16
web/client/src/sections/fillion/components/publicTable.js

@ -51,22 +51,6 @@ const PublicTable = (props) => {
setModalRecord(null);
}
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const deldata = (id) => { // 线路
const query = {
lineId: id

30
web/client/src/sections/fillion/components/transportationTable.js

@ -21,6 +21,8 @@ const TransporTationTable = (props) => {
const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('县')
const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('road')
const [grade, setGrade] = useState('县')
const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet])
//打开弹窗
@ -60,22 +62,6 @@ const TransporTationTable = (props) => {
setDelet(res)
})
}
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const columns = {
tab1: [
{
@ -3750,23 +3736,33 @@ const TransporTationTable = (props) => {
key: 'tab1',
label: <span onClick={() => {
setWhichofits('县')
setDifferentiate('road')
setGrade('县')
}}>县道{activeKey === 'tab1'}</span>,
},
{
key: 'tab2',
label: <span onClick={() => {
setWhichofits('乡')
setGrade('乡')
setDifferentiate('road')
}}>乡道{activeKey === 'tab2'}</span>,
},
{
key: 'tab3',
label: <span onClick={() => {
setWhichofits('村')
setDifferentiate('road')
setGrade('村')
}}>村道{activeKey === 'tab3'}</span>,
}, {
key: 'tab4',
label: <span onClick={() => {
setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab4'}</span>,
},
],
@ -3847,7 +3843,7 @@ const TransporTationTable = (props) => {
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,grade,differentiate) }}>
<Button
>
导出

28
web/client/src/sections/fillion/containers/bridge.js

@ -9,24 +9,20 @@ const bridge = (props) => {
const [data, setData] = useState()
useEffect(() => {
// dispatch(getDepMessage())
setData(props)
}, []);
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
const exports = (ids, differentiate) => {
let idas = ids.toString()
if (differentiate == 'bridge') {
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
}if(differentiate=='project'){
window.open(
'/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
}
}
return (
<> <BridgeTable data={data} exports={exports} />

23
web/client/src/sections/fillion/containers/highways.js

@ -12,22 +12,13 @@ const highways = (props) => {
setData(props)
}, []);
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const exports = (ids,counts) => {
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
return (
<> <HighwaysTable data={data} exports={exports} />
</>

16
web/client/src/sections/fillion/containers/infor.js

@ -26,19 +26,11 @@ const infor = (props) => {
// }
//批量导出
const exports = (ids,counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
return (
<> <InForTable data={data} exports={exports} />

28
web/client/src/sections/fillion/containers/operational.js

@ -12,22 +12,18 @@ const operational = (props) => {
setData(props)
}, []);
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
const exports = (ids,differentiate,genre) => {
let idas=ids.toString()
if(differentiate=='vehicle'){
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&municipalType=${genre}&token=${user.token}`)
}if(differentiate=='business'){
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&token=${user.token}`)
}
}
return (
<> <OperaTionalTable data={data} exports={exports} />
</>

26
web/client/src/sections/fillion/containers/promotional.js

@ -13,24 +13,16 @@ const promotional = (props) => {
setData(props)
}, []);
// //批量导出
// const exports = (ids, counts) => {
// // console.log(user);
// let reportIds = [];
// if (ids.length)
// reportIds = ids
// else
// reportIds = (counts || {}).ids || [];
// superagent.post('/_report/http')
// .send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
// const resTextIs = res.text.split('/').pop()
// window.open(
// '/_api/' +
// `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
// })
// }
//批量导出
const exports = (ids,counts) => {
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
return (
<> <PromoTionalTable data={data} />
<> <PromoTionalTable data={data} exports={exports}/>
</>
)
}

24
web/client/src/sections/fillion/containers/public.js

@ -12,22 +12,14 @@ const Public = (props) => {
setData(props)
}, []);
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
//批量导出
const exports = (ids,counts) => {
console.log(counts);
let idas=ids.toString()
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
}
return (
<> <PublicTable data={data} exports={exports} />
</>

30
web/client/src/sections/fillion/containers/transportation.js

@ -12,22 +12,20 @@ const transportation = (props) => {
setData(props)
}, []);
//批量导出
const exports = (ids, counts) => {
// console.log(user);
let reportIds = [];
if (ids.length)
reportIds = ids
else
reportIds = (counts || {}).ids || [];
superagent.post('/_report/http')
.send({ id: reportIds.map(i => Number(i)) }).end((err, res) => {
const resTextIs = res.text.split('/').pop()
window.open(
'/_api/' +
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
}
//批量导出
const exports = (ids,grade,differentiate) => {
console.log(differentiate);
let idas=ids.toString()
if(differentiate=='road'){
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&roadLevel=${grade||''}&token=${user.token}`)
}if(differentiate=='project'){
window.open(
'/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&token=${user.token}`)
}
}
return (
<> <TransporTationTable data={data} exports={exports} />
</>

Loading…
Cancel
Save