Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lihuizhen
ec-report-refactor
Commits
46b724d5
Commit
46b724d5
authored
May 17, 2022
by
lxm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://106.15.103.105/lihuizhen/ec-report-refactor
into develop
# Conflicts: # pages/index/index.vue
parents
d764ef22
a3f2e721
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
26 deletions
+46
-26
http.interceptor.js
common/http.interceptor.js
+0
-1
DatePicker.vue
components/DatePicker/DatePicker.vue
+45
-24
index.vue
pages/index/index.vue
+1
-1
No files found.
common/http.interceptor.js
View file @
46b724d5
...
...
@@ -27,7 +27,6 @@ const install = (Vue, vm) => {
config
.
header
.
Authorization
=
vm
.
vuex_token
config
.
header
.
requestId
=
vm
.
$u
.
guid
()
config
.
header
.
source
=
"wechat"
return
config
},
(
config
)
=>
{
return
Promise
.
reject
(
config
)
...
...
components/DatePicker/DatePicker.vue
View file @
46b724d5
...
...
@@ -3,22 +3,23 @@
<NormalTitle
:elementInfo=
"elementInfo"
></NormalTitle>
<view
class=
"date-wrap"
>
<u-input
style=
"width:
'100%'
"
style=
"width:
100%
"
placeholder=
"请输入日期"
input-align=
"center"
v-model=
"
elementInfo.option.dateTime.dat
e"
v-model=
"
pickerValu
e"
type=
"select"
:select-open=
"
pickerTime
"
:select-open=
"
show
"
:border=
"true"
@
click=
"pickerTime = true"
:custom-style=
"
{color: '#fff'}"
:borderColor=
"elementInfo.option.dateTime.borderColor"
:custom-style=
"
{color: elementInfo.option.dateTime.color}"
@click="show = true"
>
</u-input>
</view>
<u-picker
mode=
"time"
v-model=
"
pickerTime
"
v-model=
"
show
"
@
confirm=
"timeConfirm"
:default-time=
"
elementInfo.option.dateTime.date ? elementInfo.option.dateTime.date : null
"
:default-time=
"
pickerValue ? pickerValue : ''
"
:params=
"elementInfo.option.dateTime.showTime ? timeParams : dateParams"
></u-picker>
</view>
...
...
@@ -50,28 +51,48 @@
minute
:
true
,
second
:
true
},
pickerTime
:
false
show
:
false
,
pickerValue
:
''
};
},
onReady
()
{
},
onUnLoad
()
{
mounted
()
{
this
.
pickerValue
=
this
.
dateTimeFormat
(
this
.
elementInfo
.
option
.
dateTime
.
date
)
},
methods
:
{
timeConfirm
(
e
){
const
year
=
e
.
year
const
month
=
e
.
month
const
day
=
e
.
day
const
hour
=
e
.
hour
const
minute
=
e
.
minute
const
year
=
e
.
year
const
month
=
e
.
month
const
day
=
e
.
day
const
hour
=
e
.
hour
const
minute
=
e
.
minute
const
second
=
e
.
second
const
dateTime
=
`
${
year
}
-
${
month
}
-
${
day
}
${
hour
}
:
${
minute
}
:
${
second
}
`
this
.
$emit
(
'changeDateTime'
,
{
id
:
this
.
elementInfo
.
id
,
time
:
dateTime
})
if
(
this
.
elementInfo
.
option
.
dateTime
.
showTime
)
{
this
.
pickerValue
=
`
${
year
}
-
${
month
}
-
${
day
}
${
hour
}
:
${
minute
}
:
${
second
}
`
}
else
{
this
.
pickerValue
=
`
${
year
}
-
${
month
}
-
${
day
}
`
}
const
{
index
,
paramName
,
data
}
=
this
.
elementInfo
.
child
if
(
index
.
length
)
{
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
this
.
pickerValue
})
}
},
// 日期时间格式化
dateTimeFormat
(
val
){
const
date
=
new
Date
(
val
)
const
year
=
date
.
getFullYear
()
// 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
const
month
=
date
.
getMonth
()
+
1
<
10
?
"0"
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
;
const
day
=
date
.
getDate
()
<
10
?
"0"
+
date
.
getDate
()
:
date
.
getDate
();
const
hours
=
date
.
getHours
()
<
10
?
"0"
+
date
.
getHours
()
:
date
.
getHours
();
const
minutes
=
date
.
getMinutes
()
<
10
?
"0"
+
date
.
getMinutes
()
:
date
.
getMinutes
();
const
seconds
=
date
.
getSeconds
()
<
10
?
"0"
+
date
.
getSeconds
()
:
date
.
getSeconds
();
// 拼接
if
(
this
.
elementInfo
.
option
.
dateTime
.
showTime
)
{
return
year
+
"-"
+
month
+
"-"
+
day
+
" "
+
hours
+
":"
+
minutes
+
":"
+
seconds
;
}
return
year
+
"-"
+
month
+
"-"
+
day
;
},
}
}
...
...
@@ -85,7 +106,7 @@
flex-flow
:
column
;
justify-content
:
center
;
width
:
100%
;
color
:
#fff
;
//
color: #fff;
}
</
style
>
pages/index/index.vue
View file @
46b724d5
...
...
@@ -11,7 +11,7 @@
height: `${parseInt(element.height * scale)}px`,
left: `${parseInt(element.left * scale)}px`,
top: `${parseInt(element.top * scale)}px`,
zIndex: `${element.type == 'NormalTabs' ? 999999 : index + 1}`
zIndex: `${element.type == 'NormalTabs'
|| element.type == 'DateTimePicker'
? 999999 : index + 1}`
}"
>
<DatePicker
v-if=
"element.type == 'DateTimePicker'"
@
changeDateTime =
"changeDateTime"
:elementInfo=
"element"
></DatePicker>
...
...
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