提交 5888dd64 编写于 作者: lyf's avatar lyf

添加自定义时间

上级 74276a0e
......@@ -239,7 +239,34 @@
30分钟
</el-radio>
</div>
<div class="mt20">
<el-radio
border
size="medium"
:label="1234"
>
自定义时间
</el-radio>
</div>
</el-radio-group>
<div v-show="timeRange == 1234">
<el-input-number
v-model="selfTimeRange"
class="selfTime-input"
type="number"
controls-position="right"
:min="0"
:step="1"
:precision="0"
/>
<el-button
type="primary"
size="small"
@click="selfTimeRangeChange"
>
确定
</el-button>
</div>
</div>
</div>
</div>
......@@ -334,6 +361,7 @@
startTimeValue: '',
endTimeValue: '',
timeRange: '',
selfTimeRange: '',
};
},
watch: {
......@@ -526,12 +554,24 @@
return dayjs(v).format('YYYY-MM-DD HH:mm');
},
timeRangeChange(v) {
this.selfTimeRange = '';
if (v == 1234) {
// 自定义时间
return;
}
if (this.startTimeValue && v) {
this.endTimeValue = dayjs(this.startTimeValue)
.add(v, 'minute')
.format('YYYY-MM-DD HH:mm:ss');
}
},
selfTimeRangeChange() {
if (this.startTimeValue && this.selfTimeRange) {
this.endTimeValue = dayjs(this.startTimeValue)
.add(this.selfTimeRange, 'minute')
.format('YYYY-MM-DD HH:mm:ss');
}
},
startTimeChange(v) {
if (!v) {
this.endTimeValue = '';
......@@ -585,4 +625,9 @@
transform: scale(1.3);
top: 289px !important;
}
.selfTime-input {
margin-top: 21px;
margin-right: 5px;
width: 130px;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册