Browse Source

导出

release_0.0.4
xingyongchun 2 years ago
parent
commit
5e915675a5
  1. 21
      web/client/src/sections/fillion/components/bridgeTable.js
  2. 16
      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. 26
      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 [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('qiaoliang') const [whichofits, setWhichofits] = useState('qiaoliang')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('bridge')
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
@ -1750,22 +1751,6 @@ const BrideTable = (props) => {
setModalRecord(null); 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 ( return (
<Spin spinning={false}> <Spin spinning={false}>
<div className='protable-transpor'> <div className='protable-transpor'>
@ -1782,12 +1767,14 @@ const BrideTable = (props) => {
key: 'tab1', key: 'tab1',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('qiaoliang') setWhichofits('qiaoliang')
setDifferentiate('bridge')
}}>桥梁{activeKey === 'tab1'}</span>, }}>桥梁{activeKey === 'tab1'}</span>,
}, },
{ {
key: 'tab2', key: 'tab2',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('gongcheng') setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab2'}</span>, }}>工程一览{activeKey === 'tab2'}</span>,
}, },
@ -1844,7 +1831,7 @@ const BrideTable = (props) => {
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,differentiate) }}>
<Button <Button
> >
导出 导出

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

@ -29,22 +29,6 @@ const hightModal = (type, record) => {
} else { } else {
setModalRecord(null); 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 = const columns =
[ [

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

@ -35,22 +35,6 @@ const InForTable = (props) => {
setModalRecord(null); 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 deldata = (id) => { // 治超删除
const query = { const query = {
overspeedId: id overspeedId: id
@ -463,7 +447,10 @@ const InForTable = (props) => {
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> <Popconfirm title="确认导出?" onConfirm={() => {
console.log(rowSelected)
props.exports(rowSelected, counts) }}>
<Button <Button
> >
导出 导出

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

@ -22,7 +22,9 @@ const OperaTionalTable = (props) => {
const [recortd, setRecortd] = useState() const [recortd, setRecortd] = useState()
const [rewkeys, setRewkeys] = useState('keyun') const [rewkeys, setRewkeys] = useState('keyun')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
// const [, setDelet] = useState() const [differentiate, setDifferentiate] = useState()
const [genre, setGenre] = useState()
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet]) useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet])
@ -63,22 +65,6 @@ const OperaTionalTable = (props) => {
setModalRecord(null); 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 = { const columns = {
tab1: [ tab1: [
{ {
@ -1881,6 +1867,8 @@ const OperaTionalTable = (props) => {
label: <span onClick={() => { label: <span onClick={() => {
{ {
setRewkeys('chuzu') setRewkeys('chuzu')
setDifferentiate('vehicle')
setGenre('出租车')
} }
}}>出租车{activeKey === 'tab2'}</span>, }}>出租车{activeKey === 'tab2'}</span>,
@ -1890,13 +1878,17 @@ const OperaTionalTable = (props) => {
label: <span onClick={() => { label: <span onClick={() => {
{ {
setRewkeys('weihuo') setRewkeys('weihuo')
setDifferentiate('vehicle')
setGenre('危货')
} }
}}>危险货运{activeKey === 'tab3'}</span>, }}>危险货运{activeKey === 'tab3'}</span>,
}, { }, {
key: 'tab4', key: 'tab4',
label: <span onClick={() => { label: <span onClick={() => {
setRewkeys('yehu') setDifferentiate('business')
setRewkeys('yehu')
}}>业户{activeKey === 'tab4'}</span>, }}>业户{activeKey === 'tab4'}</span>,
}, },
@ -1974,7 +1966,7 @@ const OperaTionalTable = (props) => {
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...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 <Button
> >
导出 导出

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

@ -51,22 +51,6 @@ const PublicTable = (props) => {
setModalRecord(null); 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 deldata = (id) => { // 线路
const query = { const query = {
lineId: id lineId: id

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

@ -21,6 +21,8 @@ const TransporTationTable = (props) => {
const [recortd, setRecortd] = useState() const [recortd, setRecortd] = useState()
const [whichofits, setWhichofits] = useState('县') const [whichofits, setWhichofits] = useState('县')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const [differentiate, setDifferentiate] = useState('road')
const [grade, setGrade] = useState('县')
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
//打开弹窗 //打开弹窗
@ -60,22 +62,6 @@ const TransporTationTable = (props) => {
setDelet(res) 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 = { const columns = {
tab1: [ tab1: [
{ {
@ -3750,23 +3736,33 @@ const TransporTationTable = (props) => {
key: 'tab1', key: 'tab1',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('县') setWhichofits('县')
setDifferentiate('road')
setGrade('县')
}}>县道{activeKey === 'tab1'}</span>, }}>县道{activeKey === 'tab1'}</span>,
}, },
{ {
key: 'tab2', key: 'tab2',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('乡') setWhichofits('乡')
setGrade('乡')
setDifferentiate('road')
}}>乡道{activeKey === 'tab2'}</span>, }}>乡道{activeKey === 'tab2'}</span>,
}, },
{ {
key: 'tab3', key: 'tab3',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('村') setWhichofits('村')
setDifferentiate('road')
setGrade('村')
}}>村道{activeKey === 'tab3'}</span>, }}>村道{activeKey === 'tab3'}</span>,
}, { }, {
key: 'tab4', key: 'tab4',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('gongcheng') setWhichofits('gongcheng')
setDifferentiate('project')
}}>工程一览{activeKey === 'tab4'}</span>, }}>工程一览{activeKey === 'tab4'}</span>,
}, },
], ],
@ -3847,7 +3843,7 @@ const TransporTationTable = (props) => {
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected,grade,differentiate) }}>
<Button <Button
> >
导出 导出

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

@ -12,21 +12,17 @@ const bridge = (props) => {
setData(props) setData(props)
}, []); }, []);
//批量导出 const exports = (ids, differentiate) => {
const exports = (ids, counts) => { let idas = ids.toString()
// console.log(user); if (differentiate == 'bridge') {
let reportIds = []; window.open(
if (ids.length) '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
reportIds = ids }if(differentiate=='project'){
else window.open(
reportIds = (counts || {}).ids || []; '/_api/' + `data/export/?ids=${idas || ''}&exp=${differentiate}&token=${user.token}`)
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 ( return (
<> <BridgeTable data={data} exports={exports} /> <> <BridgeTable data={data} exports={exports} />

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

@ -12,22 +12,13 @@ const highways = (props) => {
setData(props) setData(props)
}, []); }, []);
//批量导出 const exports = (ids,counts) => {
const exports = (ids, counts) => { console.log(counts);
// console.log(user); let idas=ids.toString()
let reportIds = []; window.open(
if (ids.length) '/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
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 ( return (
<> <HighwaysTable data={data} exports={exports} /> <> <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) => { const exports = (ids,counts) => {
// console.log(user); console.log(counts);
let reportIds = []; let idas=ids.toString()
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( window.open(
'/_api/' + '/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
})
} }
return ( return (
<> <InForTable data={data} exports={exports} /> <> <InForTable data={data} exports={exports} />

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

@ -12,22 +12,18 @@ const operational = (props) => {
setData(props) setData(props)
}, []); }, []);
//批量导出 const exports = (ids,differentiate,genre) => {
const exports = (ids, counts) => { let idas=ids.toString()
// console.log(user); if(differentiate=='vehicle'){
let reportIds = []; window.open(
if (ids.length) '/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&municipalType=${genre}&token=${user.token}`)
reportIds = ids }if(differentiate=='business'){
else window.open(
reportIds = (counts || {}).ids || []; '/_api/'+`data/export/?ids=${idas||''}&exp=${differentiate}&token=${user.token}`)
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 ( return (
<> <OperaTionalTable data={data} exports={exports} /> <> <OperaTionalTable data={data} exports={exports} />
</> </>

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

@ -13,24 +13,16 @@ const promotional = (props) => {
setData(props) setData(props)
}, []); }, []);
// //批量导出 //批量导出
// const exports = (ids, counts) => { const exports = (ids,counts) => {
// // console.log(user); console.log(counts);
// let reportIds = []; let idas=ids.toString()
// if (ids.length) window.open(
// reportIds = ids '/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
// 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 ( 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) setData(props)
}, []); }, []);
//批量导出 //批量导出
const exports = (ids, counts) => { const exports = (ids,counts) => {
// console.log(user); console.log(counts);
let reportIds = []; let idas=ids.toString()
if (ids.length) window.open(
reportIds = ids '/_api/'+`data/export/?ids=${idas||''}&exp=${'overspeed'}&token=${user.token}`)
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 ( return (
<> <PublicTable data={data} exports={exports} /> <> <PublicTable data={data} exports={exports} />
</> </>

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

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

Loading…
Cancel
Save