Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
42756bf9
authored
2019-12-17 15:45:35 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日期选择可手动输入
1 parent
605fa8d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
src/components/date-picker/date-picker.js
src/components/date-picker/date-picker.scss
src/components/date-picker/date-picker.vue
src/components/date-picker/date-picker.js
View file @
42756bf
...
...
@@ -26,14 +26,14 @@ export default {
// today : 当日不可选择
filtModel
:
{
type
:
Array
,
default
()
{
default
()
{
return
[
"history"
,
"weekend"
,
"today"
]
}
},
// 需要过滤的日期列表 格式 ["yyyy-MM-dd","yyyy-MM-dd"]
filterDates
:
{
type
:
Array
,
default
()
{
default
()
{
return
[]
// ["2019-11-26", "2019-11-28"]
}
},
...
...
@@ -46,6 +46,14 @@ export default {
placeholder
:
{
type
:
String
,
default
:
" "
},
/**
* input框 是否只读
* ture为输入框不可编辑
*/
readonly
:
{
type
:
Boolean
,
default
:
false
}
},
...
...
@@ -356,8 +364,7 @@ export default {
this
.
month
=
Number
(
ymd
[
1
]);
this
.
date
=
Number
(
ymd
[
2
]);
isInit
=
true
;
}
catch
(
e
)
{
}
}
catch
(
e
)
{}
}
}
if
(
!
isInit
)
{
...
...
@@ -390,8 +397,7 @@ export default {
this
.
formatDate
();
}
},
mounted
()
{
},
mounted
()
{},
created
()
{
this
.
initData
();
},
...
...
src/components/date-picker/date-picker.scss
View file @
42756bf
...
...
@@ -15,7 +15,7 @@
position
:
absolute
;
// position: relative;
z-index
:
1101
;
z-index
:
800
;
margin-top
:
12px
;
margin-left
:
0px
;
...
...
@@ -128,7 +128,7 @@
position
:
relative
;
display
:
flex
;
justify-content
:
space-between
;
z-index
:
1
;
z-index
:
900
;
// input和下拉
.ipt
{
...
...
@@ -184,12 +184,16 @@
}
}
.readonly
{
z-index
:
1
;
}
// 遮罩
.date-mask
{
width
:
100%
;
height
:
100%
;
position
:
fixed
;
z-index
:
1001
;
z-index
:
800
;
left
:
0
;
top
:
0
;
}
...
...
src/components/date-picker/date-picker.vue
View file @
42756bf
...
...
@@ -2,8 +2,8 @@
<
template
>
<div
class=
"comp"
>
<div
class=
"date-mask"
v-if=
"visible"
@
click=
"showCalendar()"
></div>
<div
class=
"ipt-wrap"
>
<input
v-bind:value=
"value"
v-on:input=
"$emit('input', $event.target.value)"
@
click=
"showCalendar(true)"
class=
"ipt"
type=
"type"
readonly=
"readonly"
:placeholder=
"placeholder || $t('form.datePicker.datePlaceholder')"
>
<div
class=
"ipt-wrap"
:class=
"
{'readonly':readonly}"
>
<input
v-bind:value=
"value"
v-on:input=
"$emit('input', $event.target.value)"
@
click=
"showCalendar(true)"
class=
"ipt"
type=
"type"
:readonly=
"readonly"
:placeholder=
"placeholder || $t('form.datePicker.datePlaceholder')"
>
</div>
<div
v-if=
"visible"
class=
"date-wrap"
>
<div
class=
"calendar-wrap"
>
...
...
Please
register
or
sign in
to post a comment