调查走访完成改造
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<section class="AiDate">
|
||||
<u-calendar v-model="show" @change="handleSelect" :mode="mode"/>
|
||||
<u-calendar :show="show" :maxDate="maxDate"
|
||||
@confirm="handleSelect" :mode="mode" @close="show=false"/>
|
||||
<div flex @click="show=true">
|
||||
<div v-if="label" v-html="label"/>
|
||||
<div v-else v-html="placeholder"/>
|
||||
@@ -31,16 +32,17 @@ export default {
|
||||
value: {default: ""},
|
||||
placeholder: {default: "请选择"},
|
||||
mode: {default: "single"},//date 单个日期|range 日期范围
|
||||
maxDate:String
|
||||
},
|
||||
methods: {
|
||||
handleSelect(v) {
|
||||
this.show = false
|
||||
if (this.mode == 'date') {
|
||||
this.selected = v.result
|
||||
this.$emit('change', v.result)
|
||||
this.selected = v?.[0]
|
||||
} else if (this.mode == 'range') {
|
||||
this.selected = [v.startDate, v.endDate]
|
||||
this.$emit('change', v)
|
||||
this.selected = [v?.[0], v?.slice(-1)?.[0]]
|
||||
}
|
||||
this.$emit('change', this.selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user