fix Bug:时间选择器
This commit is contained in:
1 parent
d2cfd28e41
commit
7e094cd83e
2 files changed
+6
-12
No files matched your search
@@ -61,13 +61,13 @@ Vue.component("date-time-picker", {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
date(){
|
date(){
|
||||||
this.$emit('save-date-time', `${this.date} ${this.hour<10?'0'+this.hour:this.hour}:${this.minute<10?'0'+this.minute:this.minute}`)
|
this.saveDateTime()
|
||||||
},
|
},
|
||||||
hour(){
|
hour(){
|
||||||
this.$emit('save-date-time', `${this.date} ${this.hour<10?'0'+this.hour:this.hour}:${this.minute<10?'0'+this.minute:this.minute}`)
|
this.saveDateTime()
|
||||||
},
|
},
|
||||||
minute(){
|
minute(){
|
||||||
this.$emit('save-date-time', `${this.date} ${this.hour<10?'0'+this.hour:this.hour}:${this.minute<10?'0'+this.minute:this.minute}`)
|
this.saveDateTime()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
@@ -87,15 +87,12 @@ Vue.component("date-time-picker", {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let datetime = dayjs(this.datetime)
|
let datetime = dayjs(this.datetime)
|
||||||
console.log(datetime);
|
|
||||||
this.date = `${datetime.year()}-${datetime.month()+1}-${datetime.date()}`
|
this.date = `${datetime.year()}-${datetime.month()+1}-${datetime.date()}`
|
||||||
this.hour = `${datetime.hour()}`
|
this.hour = `${datetime.hour()}`
|
||||||
this.minute = `${datetime.minute()}`
|
this.minute = `${datetime.minute()}`
|
||||||
console.log(this.hour, this.minute);
|
|
||||||
// this.time = `${date.hour()<10?'0'+date.hour():date.hour()}:${date.minute()<10?'0'+date.minute():date.minute()}`
|
|
||||||
},
|
},
|
||||||
saveDateTime(){
|
saveDateTime(){
|
||||||
|
this.$emit('input', `${this.date} ${this.hour<10?'0'+this.hour:this.hour}:${this.minute<10?'0'+this.minute:this.minute}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
<!-- 日期时间选择器 -->
|
<!-- 日期时间选择器 -->
|
||||||
<v-list-item-content v-if="formItem.type === 'time'" class="py-0">
|
<v-list-item-content v-if="formItem.type === 'time'" class="py-0">
|
||||||
<date-time-picker :disabled='disabled' @save-date-time="setDateTime" v-model="formItem.answer"></date-time-picker>
|
<date-time-picker :disabled='disabled' v-model="formItem.answer"></date-time-picker>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -103,7 +103,7 @@ Vue.component("form-component-list", {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
datetime:"2023-12-24 22:23",
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -113,9 +113,6 @@ Vue.component("form-component-list", {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setDateTime(data){
|
|
||||||
this.datetime = data
|
|
||||||
},
|
|
||||||
async calcWorkflow(){
|
async calcWorkflow(){
|
||||||
await this.$emit('calc-workflow')
|
await this.$emit('calc-workflow')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user