This commit is contained in:
Jerry
2020-04-20 20:51:17 +08:00
parent 9472a84ba1
commit 7d87893112
7 changed files with 44 additions and 16 deletions

View File

@@ -1,14 +1,17 @@
<template>
<div class="date-range">
<!--<year-range-panel />-->
<el-select v-model="dateType" :size="size" style="max-width: 100px; min-width: 100px; margin-right: 10px;" v-if="!hideTypeOnlyOne || validTypeList.length > 1">
<el-select v-model="dateType" :size="size"
style="max-width: 100px; min-width: 100px; margin-right: 10px;"
v-if="!hideTypeOnlyOne || validTypeList.length > 1">
<el-option v-for="type in validTypeList" :key="type.value" :value="type.value" :label="type.label" />
</el-select>
<el-date-picker style="flex-grow: 1;" v-model="currentDates" :size="size" :placeholder="placeholder" :type="innerDateType"
<el-date-picker style="flex-grow: 1;" v-model="currentDates"
:size="size" :placeholder="placeholder" :type="innerDateType"
:disabled="disabled" :format="innerDateFormat" :readonly="readonly" :editable="editable"
:clearable="clearable" :start-placeholder="startPlaceholder" :end-placeholder="endPlaceholder"
:align="align" :range-separator="rangeSeparator" :value-format="valueFormat"
:prefix-icon="prefixIcon" :clear-icon="clearIcon" @change="onValueChange"></el-date-picker>
:prefix-icon="prefixIcon" :clear-icon="clearIcon" @change="onValueChange" />
</div>
</template>

View File

@@ -81,7 +81,7 @@ export default {
this.rowJustify = 'space-between';
let tempCount = residueCount === 0 ? 0 : (lineCount - residueCount);
if (hasOperator) {
let residueWidth = width - ((lineCount - residueCount) * this.itemWidth) - 20;
let residueWidth = width - ((lineCount - residueCount) * this.itemWidth) - ((tempCount >= 1) ? 20 : 0);
// 判断剩余的空间是否够放下操作按钮
if (residueWidth >= this.minMenuWidth && residueCount === 0) {
this.rowJustify = 'start';