fixed #153
This commit is contained in:
梁灏 2016-12-29 12:11:22 +08:00
parent b27687d35f
commit 4db5926d6b
5 changed files with 25 additions and 39 deletions

View file

@ -1,17 +1,17 @@
<template>
<div :class="classes">
<div :class="[prefixCls+ '-list']" v-el:hours>
<ul @click="handleClickHours">
<ul :class="[prefixCls + '-ul']" @click="handleClickHours">
<li :class="getCellCls(item)" v-for="item in hoursList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
<div :class="[prefixCls+ '-list']" v-el:minutes>
<ul @click="handleClickMinutes">
<ul :class="[prefixCls + '-ul']" @click="handleClickMinutes">
<li :class="getCellCls(item)" v-for="item in minutesList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
<div :class="[prefixCls+ '-list']" v-show="showSeconds" v-el:seconds>
<ul @click="handleClickSeconds">
<ul :class="[prefixCls + '-ul']" @click="handleClickSeconds">
<li :class="getCellCls(item)" v-for="item in secondsList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
@ -155,11 +155,8 @@
const data = {};
data[type] = cell.text;
this.$emit('on-change', data);
// const from = this.$els[type].scrollTop;
// const to = 24 * this.getScrollIndex(type, cell.text);
// scrollTop(this.$els[type], from, to, 500);
}
this.$emit('on-pick-click');
},
scroll (type, index) {
const from = this.$els[type].scrollTop;

View file

@ -449,9 +449,9 @@
TYPE_VALUE_RESOLVER_MAP['default']
).parser;
if (type === 'time' && !(val instanceof Date)) {
if (val && type === 'time' && !(val instanceof Date)) {
val = parser(val, this.format || DEFAULT_FORMATS[type]);
} else if (type === 'timerange' && Array.isArray(val) && val.length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
} else if (val && type === 'timerange' && Array.isArray(val) && val.length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
val = val.join(RANGE_SEPARATOR);
val = parser(val, this.format || DEFAULT_FORMATS[type]);
}

View file

@ -48,13 +48,13 @@
}
.loop-grid-columns(@index, @class) when (@index = 0) {
.@{col-prefix-cls}@{class}-@{index} {
.@{col-prefix-cls}-span@{class}-@{index} {
display: none;
}
.@{col-prefix-cls}-push-@{index} {
.@{col-prefix-cls}@{class}-push-@{index} {
left: auto;
}
.@{col-prefix-cls}-pull-@{index} {
.@{col-prefix-cls}@{class}-pull-@{index} {
right: auto;
}
}

View file

@ -24,16 +24,17 @@
<!--style="width: 168px"></time-picker>-->
<!--</i-col>-->
<i-col span="12">
<time-picker
:value="value2"
type="timerange"
placeholder="选择时间"
format="HH:mm:ss"
:hide-disabled-options="false"
@on-change="c"
@on-ok="ok"
@on-clear="clear"
style="width: 168px"></time-picker>
<Time-picker type="time" :value="value" placeholder="选择时间" style="width: 168px"></Time-picker>
<!--<time-picker-->
<!--:value="value2"-->
<!--type="timerange"-->
<!--placeholder="选择时间"-->
<!--format="HH:mm:ss"-->
<!--:hide-disabled-options="false"-->
<!--@on-change="c"-->
<!--@on-ok="ok"-->
<!--@on-clear="clear"-->
<!--style="width: 168px"></time-picker>-->
</i-col>
</row>
</template>

View file

@ -4,25 +4,13 @@
}
</style>
<template>
{{properties|json}}<br>
{{units|json}}
<Checkbox-group :model.sync="properties">
<Checkbox v-for="unit in units" :value="unit.UnitName"></Checkbox>
</Checkbox-group>
<Back-top></Back-top>
<row>
<i-col span="0">123</i-col>
<i-col span="24">24</i-col>
</row>
</template>
<script>
export default {
data () {
return {
properties: [],
units: []
}
},
ready () {
setTimeout(() => {
this.units = [{UnitName:"件"},{UnitName:"箱"},{UnitName:"双"}];
}, 1000);
}
}
</script>