42756bf9 by simon

日期选择可手动输入

1 parent 605fa8d5
......@@ -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();
},
......
......@@ -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;
}
......
......@@ -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">
......