Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mining-manager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
Mining
mining-manager
Commits
884c4477
Commit
884c4477
authored
Feb 11, 2022
by
mxm-web-develop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
321
parent
eb96ad45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
5 deletions
+39
-5
index.ts
src/api/index.ts
+11
-1
workspace.vue
src/components/workspace.vue
+28
-4
No files found.
src/api/index.ts
View file @
884c4477
...
...
@@ -63,8 +63,17 @@ export const downloadTxt = async(params:GetTransListParams)=>{
return
instance
.
get
(
'/download/unsigntxs'
,{
params
:
params
}).
then
(
async
res
=>
{
await
downloadjs
(
res
.
data
,
'report.txt'
,
'text/plain'
)
try
{
await
downloadjs
(
res
.
data
)
}
catch
(
err
){
console
.
log
(
'下载出错了'
,
err
);
}
return
}).
catch
((
err
:
any
)
=>
{
return
{
status
:
'error'
,
message
:
err
.
response
.
data
.
message
}
})
}
\ No newline at end of file
src/components/workspace.vue
View file @
884c4477
...
...
@@ -4,6 +4,7 @@ import Controllbar from './controllbar.vue';
import
{
useAxios
}
from
'@vueuse/integrations/useAxios'
import
{
computed
,
onMounted
,
reactive
,
ref
,
watch
}
from
'vue'
;
import
{
downloadTxt
,
getTransList
}
from
'../api'
;
import
{
ElMessage
}
from
'element-plus'
import
dayjs
from
'dayjs'
const
reqData
=
reactive
({
platId
:
0
,
...
...
@@ -18,6 +19,7 @@ const reqData = reactive({
const
loading
=
ref
(
false
)
const
disableDownload
=
ref
(
true
)
const
table
=
ref
([])
const
downloadModal
=
ref
(
false
)
const
pageController
=
reactive
({
size
:
0
})
...
...
@@ -83,7 +85,16 @@ const childDataChange = (v:{data:any,type:string})=>{
}
console
.
log
(
reqData
);
}
const
download
=
async
()
=>
await
downloadTxt
(
reqData
)
const
download
=
async
()
=>
{
const
res
=
await
downloadTxt
(
reqData
)
as
any
if
(
res
.
status
===
'error'
){
downloadModal
.
value
=
false
;
ElMessage
({
message
:
res
.
message
,
type
:
'error'
})
}
}
const
dateFilter
=
computed
(()
=>
{
return
function
(
v
:
any
){
const
time
=
parseInt
(
v
)
*
1000
...
...
@@ -117,12 +128,25 @@ const requestDataChanged = (v:any)=> reqData.page = v
})
</
script
>
<
template
>
<el-dialog
v-model=
"downloadModal"
title=
"下载Txt记录"
width=
"30%"
>
<span>
确认下载Txt记录
</span>
<template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"downloadModal = false"
>
Cancel
</el-button>
<el-button
class=
" bg-blue-500"
type=
"primary"
@
click=
"download"
>
Confirm
</el-button
>
</span>
</
template
>
</el-dialog>
<div
class=
"container relative flex py-6 mx-auto min-h-full min-h-workspace bg-white"
>
<!--
<div
class=
"left w-60 border-r px-3 "
>
</div>
-->
<div
class=
"right relative flex-grow px-3 pb-28 "
>
<Tabs
@
fresh=
"initTable"
></Tabs>
<Controllbar
@
eventEmitted=
"childDataChange"
@
dodownload=
"download"
:btnEnable=
"disableDownload"
></Controllbar>
<Controllbar
@
eventEmitted=
"childDataChange"
@
dodownload=
"download
Modal=true
"
:btnEnable=
"disableDownload"
></Controllbar>
<div
class=
"table-view w-full "
>
<div
class=
" text-sm opacity-50 py-3 px-3"
>
当前交易笔数:{{pageController.size}}
</div>
<el-table
...
...
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