Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
紫光云
web-project
Commits
03d764ba
Commit
03d764ba
authored
Jun 25, 2024
by
牛虎林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件下载接口封装
parent
41c55278
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
2 deletions
+85
-2
downloadFile.ts
src/api/project/downloadFile.ts
+16
-0
BasicBar.vue
src/views/dashboard/analysis/components/BasicBar.vue
+3
-2
performance.vue
src/views/statement/tabs/performance.vue
+66
-0
No files found.
src/api/project/downloadFile.ts
0 → 100644
View file @
03d764ba
import
{
defHttp
}
from
'@/utils/http/axios'
;
//文件下载接口
export
const
downloadFileFunction
=
(
url
:
string
,
params
?:
any
)
=>
defHttp
.
post
<
any
>
(
{
responseType
:
'blob'
,
url
,
data
:
params
,
headers
:
{
'Content-Type'
:
'application/json;charset=UTF-8'
,
}
},
{
errorMessageMode
:
'none'
,
isTransformResponse
:
false
}
);
src/views/dashboard/analysis/components/BasicBar.vue
View file @
03d764ba
...
...
@@ -6,7 +6,7 @@
</
template
>
<
script
lang=
"ts"
setup
>
import
YearSelect
from
"@/components/YearSelect/YearSelect.vue"
import
{
Ref
,
ref
,
watch
,
onBeforeMount
}
from
'vue'
;
import
{
Ref
,
ref
,
onBeforeMount
}
from
'vue'
;
import
{
Card
}
from
'ant-design-vue'
;
import
{
useECharts
}
from
'@/hooks/web/useECharts'
;
import
{
getProgress
}
from
'@/api/dashboard/dashboard'
;
...
...
@@ -23,7 +23,7 @@ onBeforeMount( async ()=>{
data
.
value
=
await
getProgress
()
}
console
.
log
(
`形象进度占比`
,
data
)
if
(
data
){
if
(
data
.
value
){
loading
.
value
=
false
}
setOptions
({
...
...
@@ -82,6 +82,7 @@ const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
function
handleNewData
(
info
:
null
)
{
poops
(
info
)
}
</
script
>
src/views/statement/tabs/performance.vue
View file @
03d764ba
<
template
>
<button
@
click=
"downloadFile"
>
导出
</button>
<BasicTable
@
register=
"registerTable"
>
<template
#
bodyCell=
"
{ column, record, index }">
<template
v-if=
"column.key === 'serialNumber'"
>
...
...
@@ -32,6 +33,9 @@
import
{
inject
}
from
'vue'
;
import
{
router
}
from
'@/router'
;
import
{
Tag
}
from
'ant-design-vue'
;
import
{
downloadFileFunction
}
from
"@/api/project/downloadFile"
import
{
downloadByData
}
from
"@/utils/file/download"
;
let
detailId
=
inject
(
'detailId'
);
console
.
log
(
'detailId'
,
detailId
);
const
[
registerTable
,
{
reload
}]
=
useTable
({
...
...
@@ -65,4 +69,66 @@
},
});
}
async
function
downloadFile
(){
const
requestParams
=
{
"headerList"
:
{
"yearQuarter"
:
"填报周期"
,
"contractName"
:
"合同名称"
,
"fundingSource"
:
"资金来源"
,
"amountInvested"
:
"立项投资额"
,
"biddingMethod"
:
"招标方式"
,
"contractType"
:
"合同类型"
,
"firstPartyName"
:
"甲方单位名称"
,
"partyName"
:
"乙方单位名称"
,
"formOfContract"
:
"合同形式"
,
"contractAmount"
:
"合同金额"
,
"changeAmount"
:
"合同累计签证、变更金额(含本次)"
,
"amountRatio"
:
"累计变更签证金额占合同金额比例"
,
"changeNumber"
:
"变更编号"
,
"changeType"
:
"变更类型"
,
"responsibleParty"
:
"责任方"
,
"changeContent"
:
"变更内容"
,
"contractValueRatio"
:
"预估变更金额占合同金额比例"
,
"visaNumber"
:
"签证编号"
,
"visaType"
:
"签证类型"
,
"visaContent"
:
"签证内容"
,
"visaAmount"
:
"预估签证金额"
,
"estimatedAmountRatio"
:
"预估签证金额占合同金额比例"
,
"meetingMinutes"
:
"会议纪要"
,
"remark"
:
"备注"
},
"searchField"
:
{
"yearQuarter"
:
""
,
"contractName"
:
""
,
"contractSigningTime"
:
""
,
"fundingSource"
:
""
,
"amountInvested"
:
""
,
"biddingMethod"
:
""
,
"contractType"
:
""
,
"firstPartyName"
:
""
,
"partyName"
:
""
,
"formOfContract"
:
""
,
"contractAmount"
:
""
,
"changeAmount"
:
""
,
"amountRatio"
:
""
,
"changeNumber"
:
""
,
"changeType"
:
""
,
"responsibleParty"
:
""
,
"changeContent"
:
""
,
"contractValueRatio"
:
""
,
"visaNumber"
:
""
,
"visaType"
:
""
,
"visaContent"
:
""
,
"visaAmount"
:
""
,
"estimatedAmountRatio"
:
""
,
"meetingMinutes"
:
""
,
"remark"
:
""
}
}
const
url
=
"/pro/reportCenter/settlement/export-settlement"
const
data
=
await
downloadFileFunction
(
url
,
requestParams
)
downloadByData
(
data
,
'文件名.xlsx'
);
console
.
log
(
"点击事件"
)
}
</
script
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment