调查走访完成改造

This commit is contained in:
aixianling
2021-11-18 17:53:42 +08:00
parent dbcab7c66e
commit e91ea0a423
4 changed files with 55 additions and 48 deletions

View File

@@ -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)
}
}
}