BUG 25181

This commit is contained in:
aixianling
2021-12-02 11:50:35 +08:00
parent 88a02c0eee
commit 087011378c
2 changed files with 9 additions and 8 deletions

View File

@@ -116,8 +116,9 @@ export default {
}) })
}, },
handleDateSearch(v) { handleDateSearch(v) {
this.search.startTime = v?.[0] console.log(v)
this.search.endTime = v?.[0] || v?.[1] this.search.startTime = v?.startDate
this.search.endTime = v?.startDate|| v?.endDate
this.current = 1 this.current = 1
this.getList() this.getList()
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<section class="AiDate"> <section class="AiDate">
<u-calendar v-model="show" :maxDate="maxDate" <u-calendar v-model="show" :maxDate="maxDate"
@confirm="handleSelect" :mode="mode" @close="show=false"/> @change="handleSelect" :mode="mode" @close="show=false"/>
<div flex @click="show=true"> <div flex @click="show=true">
<div v-if="label" v-html="label"/> <div v-if="label" v-html="label"/>
<div v-else v-html="placeholder"/> <div v-else v-html="placeholder"/>
@@ -31,18 +31,18 @@ export default {
props: { props: {
value: {default: ""}, value: {default: ""},
placeholder: {default: "请选择"}, placeholder: {default: "请选择"},
mode: {default: "single"},//date 单个日期|range 日期范围 mode: {default: "date"},//date 单个日期|range 日期范围
maxDate: String maxDate: String
}, },
methods: { methods: {
handleSelect(v) { handleSelect(v) {
this.show = false
if (this.mode == 'date') { if (this.mode == 'date') {
this.selected = v?.[0] this.selected = v.result
this.$emit('change', v.result)
} else if (this.mode == 'range') { } else if (this.mode == 'range') {
this.selected = [v?.[0], v?.slice(-1)?.[0]] this.selected = [v.startDate, v.endDate]
this.$emit('change', v)
} }
this.$emit('change', this.selected)
} }
} }
} }