Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
a3f57396
Commit
a3f57396
authored
Sep 16, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成建设银行excel文件选中监听解析并上传函数
parent
586c3181
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
0 deletions
+58
-0
index.ts
src/service/AddressService/index.ts
+58
-0
index.ts
src/utils/StaffUtils/index.ts
+0
-0
No files found.
src/service/AddressService/index.ts
0 → 100644
View file @
a3f57396
import
baseAxios
from
'../index'
export
default
class
AddressService
{
prefix
:
string
static
instance
:
AddressService
max_len_gps
:
number
static
getInstance
()
{
if
(
!
AddressService
.
instance
)
{
AddressService
.
instance
=
new
AddressService
()
}
return
AddressService
.
instance
}
constructor
()
{
this
.
prefix
=
'/address'
this
.
max_len_gps
=
10
}
getGpses
(
data
:
{
addrs
:
string
[]
}):
Promise
<
string
[]
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
resultList
=
[]
as
string
[]
if
(
data
.
addrs
.
length
)
{
for
(
let
i
=
0
;
i
<
Math
.
ceil
(
data
.
addrs
.
length
/
this
.
max_len_gps
);
++
i
)
{
const
reqList
=
data
.
addrs
.
slice
(
i
*
this
.
max_len_gps
,
i
*
this
.
max_len_gps
+
this
.
max_len_gps
,
)
this
.
__getGpses
(
reqList
).
then
((
ret
)
=>
{
if
(
ret
.
code
===
200
)
{
resultList
.
push
(...
ret
.
data
.
gps
)
if
(
resultList
.
length
===
data
.
addrs
.
length
)
{
resolve
(
resultList
)
}
}
else
{
reject
(
'解析错误'
)
}
})
}
}
})
}
private
__getGpses
(
addrs
:
string
[])
{
if
(
addrs
.
length
>
10
)
{
throw
new
Error
(
'长度超过10'
)
}
else
{
return
baseAxios
<
{
gps
:
string
[]
}
>
({
url
:
this
.
prefix
+
'/getGps'
,
method
:
'post'
,
data
:
{
addrs
:
addrs
,
},
})
}
}
}
src/utils/StaffUtils/index.ts
View file @
a3f57396
This diff is collapsed.
Click to expand it.
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