From 194844e966e830c3453dcab2649c2a658583f454 Mon Sep 17 00:00:00 2001
From: aihe <961836564@qq.com>
Date: Sat, 27 Jan 2024 17:02:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/tpx-date-input/tpx-date-input.vue | 34 ++++++++++++++++++--
components/tpx-select/content-items.vue | 4 +--
2 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/components/tpx-date-input/tpx-date-input.vue b/components/tpx-date-input/tpx-date-input.vue
index fb4c185..f56bfc9 100644
--- a/components/tpx-date-input/tpx-date-input.vue
+++ b/components/tpx-date-input/tpx-date-input.vue
@@ -8,7 +8,11 @@
-
+
+
+
+
+
import { } from "@/common/untool"
+ import dayjs from "dayjs"
+
export default {
computed: {
inputValue() {
@@ -45,6 +51,21 @@
return ''
}
},
+ showTools:{
+ default () {
+ return true
+ }
+ },
+ toolsRangesList: {
+ default () {
+ return [
+ { title: '今日', val: dayjs().format("YYYY-MM-DD") },
+ { title: '昨日', val: dayjs().subtract(1, 'days').format("YYYY-MM-DD") },
+ { title: '最近一周', val: dayjs().subtract(7, 'days').format("YYYY-MM-DD") },
+ { title: '自定义', val: -1 },
+ ]
+ }
+ },
placeholderStyle:{
default () {
return ''
@@ -66,7 +87,9 @@
methods: {
handleSelectDate() {
- this.handleSwitchCladar()
+ if(!this.showTools) {
+ this.handleSwitchCladar()
+ }
},
handleChange(val){
this.$emit('change', val)
@@ -80,6 +103,13 @@
},
handleSwitchCladar() {
this.showCladar = !this.showCladar
+ },
+ handleToolsRangChange(val) {
+ if(val == -1) {
+ this.handleSwitchCladar()
+ } else {
+ this.handleChange([dayjs().format("YYYY-MM-DD"), val])
+ }
}
}
}
diff --git a/components/tpx-select/content-items.vue b/components/tpx-select/content-items.vue
index 7bba628..faf27bf 100644
--- a/components/tpx-select/content-items.vue
+++ b/components/tpx-select/content-items.vue
@@ -79,8 +79,8 @@