Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sfp-program
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
sfp-program
Commits
20eb17e4
Commit
20eb17e4
authored
Sep 01, 2022
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量数据导入
parent
077afdfc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
301 additions
and
215 deletions
+301
-215
main.js
+3
-0
pages/dataImport/data-import.css
+201
-0
pages/dataImport/data-import.vue
+78
-213
util/interceptor.ts
+2
-2
util/numerPipe.ts
+17
-0
No files found.
main.js
View file @
20eb17e4
...
@@ -4,6 +4,9 @@ import App from './App'
...
@@ -4,6 +4,9 @@ import App from './App'
// #ifndef VUE3
// #ifndef VUE3
import
Vue
from
'vue'
import
Vue
from
'vue'
import
axios
from
'axios'
import
axios
from
'axios'
import
{
numberToCurrencyNo
}
from
'@/utils/numberToCurrency'
// 配置全局过滤器,实现数字千分位格式
Vue
.
filter
(
'numberToCurrency'
,
numberToCurrencyNo
)
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
axios
=
axios
Vue
.
prototype
.
axios
=
axios
...
...
pages/dataImport/data-import.css
0 → 100644
View file @
20eb17e4
/* 保单年度弹窗 */
.policySelectContainer
{
position
:
fixed
;
z-index
:
2
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0.35
);
}
.policySelectContainer
.policyYearContainer
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
height
:
57%
;
background-color
:
#fff
;
border-top-left-radius
:
40
rpx
;
border-top-right-radius
:
40
rpx
;
padding
:
20
rpx
30
rpx
0
;
box-sizing
:
border-box
;
}
.policyYearContainer
.modalTitle
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-weight
:
bold
;
}
.policyYearContainer
.modalTitle
text
:last-child
{
color
:
#FF0000
;
}
.policyYearItemContainer
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-around
;
}
.policyYearItemContainer
view
{
width
:
9%
;
height
:
0
;
padding-bottom
:
9%
;
margin
:
20
rpx
0
;
color
:
#fff
;
border-radius
:
50%
;
position
:
relative
;
margin-right
:
6
rpx
;
color
:
#333
;
font-weight
:
bold
;
}
.policyYearItemContainer
view
.actived
{
background
:
linear-gradient
(
135deg
,
#CEB07D
0%
,
#FFDDA9
56%
,
#FED495
100%
,
#FED495
100%
);
color
:
#6B4000
;
}
.policyYearItemContainer
view
text
{
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translate
(
-50%
,
-55%
);
}
.policyStepContainer
{
display
:
flex
;
justify-content
:
space-around
;
margin-top
:
40
rpx
;
}
.policyStepContainer
button
{
flex
:
0
0
30%
;
font-size
:
32
rpx
;
color
:
#000
;
font-weight
:
bold
;
border
:
1px
solid
#CEB07D
;
}
.policyStepContainer
uni-button
::after
{
border
:
1px
solid
#CEB07D
;
}
.policyStepContainer
button
.actived
{
background
:
linear-gradient
(
135deg
,
#CEB07D
0%
,
#FFDDA9
56%
,
#FED495
100%
,
#FED495
100%
);
color
:
#6B4000
;
}
.policyStepContainer
button
.actived
,
.policyStepContainer
button
.actived
::after
{
border
:
none
;
}
.confirm
button
{
background
:
linear-gradient
(
135deg
,
#CEB07D
0%
,
#FFDDA9
56%
,
#FED495
100%
,
#FED495
100%
);
color
:
#6B4000
;
font-weight
:
bold
;
font-size
:
36
rpx
;
margin-top
:
56
rpx
;
width
:
300
rpx
;
}
.confirm
button
,
.confirm
button
::after
{
border
:
none
;
}
.uni-textarea
{
position
:
relative
;
}
.pasteDiscernment
{
position
:
absolute
;
right
:
0
;
bottom
:
0
;
height
:
50
rpx
;
background
:
#9B8055
;
border-radius
:
100px
;
color
:
#fff
;
font-size
:
24
rpx
;
}
.batchDataImportContainer
{
background-color
:
#fbfbfb
;
height
:
90vh
;
}
.batchDataLists
{
margin-top
:
20
rpx
;
background
:
#fff
;
}
.batchDataLists
view
{
display
:
flex
;
text-align
:
center
;
border-bottom
:
1px
solid
#e4e4e4
;
}
.batchDataLists
view
text
:first-child
{
width
:
0
;
flex
:
0
0
35%
;
border-right
:
1px
solid
#e4e4e4
;
}
.batchDataLists
view
text
:last-child
{
width
:
0
;
flex
:
0
0
65%
;
}
.batchDataLists
view
.batchDataTh
{
height
:
60
rpx
;
background
:
linear-gradient
(
135deg
,
#CEB07D
0%
,
#FFDDA9
56%
,
#FED495
100%
,
#FED495
100%
);
line-height
:
60
rpx
;
border-top-left-radius
:
12
rpx
;
border-top-right-radius
:
12
rpx
;
}
.batchDataLists
view
.batchDataTd
{
height
:
80
rpx
;
line-height
:
80
rpx
;
}
.dataOptionContainer
{
margin
:
20
rpx
20
rpx
0
;
margin-bottom
:
34
rpx
;
}
.dataOptionContainer
.uni-textarea
{
background-color
:
#fff
;
margin-bottom
:
20
rpx
;
}
.tips
{
font-size
:
24
rpx
;
color
:
#666
;
padding
:
0
20
rpx
20
rpx
;
background-color
:
#fff
;
}
.tips
text
text
{
font-size
:
28
rpx
;
color
:
#9B8055
;
font-weight
:
bold
;
}
.selectStepContent
,
.selectStepContainer
{
display
:
flex
;
align-items
:
center
;
}
.selectStepContainer
{
justify-content
:
space-between
;
padding
:
20
rpx
20
rpx
0
;
background-color
:
#fff
;
}
.stepContent
{
display
:
flex
;
align-items
:
center
;
border-bottom
:
1px
solid
#e4e4e4
;
padding
:
0
5px
;
}
.selectStepContainer
button
{
background-color
:
transparent
;
}
.selectStepContainer
button
::after
{
border
:
1px
solid
#CEB07D
;
}
.optionContent
{
position
:
fixed
;
bottom
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
background-color
:
#fff
;
}
.optionContent
button
{
flex
:
0
0
46%
;
border
:
2
rpx
solid
#e7c793
;
color
:
#6B4000
;
font-size
:
36
rpx
;
}
.optionContent
button
:last-child
{
background
:
linear-gradient
(
135deg
,
#CEB07D
0%
,
#FFDDA9
56%
,
#FED495
100%
,
#FED495
100%
);
border
:
none
;
}
.batchDataTd
input
{
height
:
100%
;
}
\ No newline at end of file
pages/dataImport/data-import.vue
View file @
20eb17e4
This diff is collapsed.
Click to expand it.
util/interceptor.ts
View file @
20eb17e4
import
api
from
"../api/api"
;
import
api
from
"../api/api"
;
import
{
baseURL
,
apiURL
,
sfpURL
}
from
"../environments/environment"
;
import
{
baseURL
,
apiURL
,
sfpURL
}
from
"../environments/environment"
;
// 白名单,不需要携带token就允许被访问的接口
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`
${
baseURL
}
/api/authorize/obtainToken`
]
const
whiteApiList
=
[
`/api/authorize/obtainToken`
]
export
const
interceptor
=
()
=>
{
export
const
interceptor
=
()
=>
{
...
@@ -20,7 +20,7 @@ export const interceptor = () => {
...
@@ -20,7 +20,7 @@ export const interceptor = () => {
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
uni
.
request
({
url
:
baseURL
+
'/api/authorize/obtainToken'
,
url
:
'/api/authorize/obtainToken'
,
method
:
'POST'
,
method
:
'POST'
,
data
:{
ticket
:
'uni-app'
},
data
:{
ticket
:
'uni-app'
},
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
...
...
util/numerPipe.ts
0 → 100644
View file @
20eb17e4
export
function
numberToCurrencyNo
(
value
)
{
if
(
!
value
)
return
0
// 获取整数部分
const
intPart
=
Math
.
trunc
(
value
)
// 整数部分处理,增加,
const
intPartFormat
=
intPart
.
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'$1,'
)
// 预定义小数部分
let
floatPart
=
''
// 将数值截取为小数部分和整数部分
const
valueArray
=
value
.
toString
().
split
(
'.'
)
if
(
valueArray
.
length
===
2
)
{
// 有小数部分
floatPart
=
valueArray
[
1
].
toString
()
// 取得小数部分
return
intPartFormat
+
'.'
+
floatPart
}
return
intPartFormat
+
floatPart
}
\ No newline at end of file
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