From b079bdb6467294cd6638c93b82522ce24a059abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Mon, 14 Nov 2022 14:27:39 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(date-picker):=20=E9=92=88=E5=AF=B9=20?= =?UTF-8?q?datepicker=20=E7=BB=84=E4=BB=B6=20btn=20=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E7=BC=9D=E7=BC=9D=E8=A1=A5=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datePicker/components/MonthPanel.vue | 5 +- .../datePicker/components/MonthRange.vue | 8 +- .../datePicker/components/YearPanel.vue | 6 +- .../components/components/DateContent.vue | 4 +- .../src/component/datePicker/index.less | 12 ++- .../component/src/component/upload/index.vue | 80 ++++++++++++++----- 6 files changed, 84 insertions(+), 31 deletions(-) diff --git a/package/component/src/component/datePicker/components/MonthPanel.vue b/package/component/src/component/datePicker/components/MonthPanel.vue index 4df67293..b096266c 100644 --- a/package/component/src/component/datePicker/components/MonthPanel.vue +++ b/package/component/src/component/datePicker/components/MonthPanel.vue @@ -16,9 +16,10 @@
  • diff --git a/package/component/src/component/datePicker/components/MonthRange.vue b/package/component/src/component/datePicker/components/MonthRange.vue index 22db5cb0..10743bef 100644 --- a/package/component/src/component/datePicker/components/MonthRange.vue +++ b/package/component/src/component/datePicker/components/MonthRange.vue @@ -36,7 +36,9 @@ 'laydate-range-hover': ifHasRangeHoverClass( getUnix(item, 'left') ), - 'layui-laydate-current':(startTime.unix === -1 || endTime.unix === -1)&&getUnix(item, 'left')===dayjs().startOf('month').valueOf() + 'layui-laydate-current': + (startTime.unix === -1 || endTime.unix === -1) && + getUnix(item, 'left') === dayjs().startOf('month').valueOf(), }" @click="handleMonthClick(getUnix(item, 'left'))" @mouseenter="monthItemMouseEnter($event, item)" @@ -81,7 +83,9 @@ 'laydate-range-hover': ifHasRangeHoverClass( getUnix(item, 'right') ), - 'layui-laydate-current':(startTime.unix === -1 || endTime.unix === -1)&&getUnix(item, 'right')===dayjs().startOf('month').valueOf() + 'layui-laydate-current': + (startTime.unix === -1 || endTime.unix === -1) && + getUnix(item, 'right') === dayjs().startOf('month').valueOf(), }" @click="handleMonthClick(getUnix(item, 'right'))" @mouseenter="monthItemMouseEnter($event, item)" diff --git a/package/component/src/component/datePicker/components/YearPanel.vue b/package/component/src/component/datePicker/components/YearPanel.vue index 5e6da045..eaa7a950 100644 --- a/package/component/src/component/datePicker/components/YearPanel.vue +++ b/package/component/src/component/datePicker/components/YearPanel.vue @@ -18,9 +18,9 @@
  • diff --git a/package/component/src/component/datePicker/components/components/DateContent.vue b/package/component/src/component/datePicker/components/components/DateContent.vue index b1d99d68..760ae5e7 100644 --- a/package/component/src/component/datePicker/components/components/DateContent.vue +++ b/package/component/src/component/datePicker/components/components/DateContent.vue @@ -27,7 +27,9 @@ (item.value == startDate || item.value == endDate)), 'laydate-range-hover': ifHasRangeHoverClass(item), 'layui-disabled': item.type !== 'current' && datePicker.range, - 'layui-laydate-current':modelValue===-1&&item.value===dayjs().startOf('day').valueOf() + 'layui-laydate-current': + modelValue === -1 && + item.value === dayjs().startOf('day').valueOf(), }" @click="handleDayClick(item)" @mouseenter="dayItemMouseEnter($event, item)" diff --git a/package/component/src/component/datePicker/index.less b/package/component/src/component/datePicker/index.less index 2004e177..a3a6d7ce 100644 --- a/package/component/src/component/datePicker/index.less +++ b/package/component/src/component/datePicker/index.less @@ -248,6 +248,7 @@ html #layuicss-laydate { line-height: 26px; padding: 10px; } + .layui-laydate-footer span { display: inline-block; vertical-align: top; @@ -272,27 +273,32 @@ html #layuicss-laydate { border-bottom-right-radius: 2px; } +.layui-laydate-footer span:not(:last-child) { + border-right: none; +} + .layui-laydate-footer span:hover { color: #5fb878; } + .layui-laydate-footer span.layui-laydate-preview { cursor: default; border-color: transparent !important; } + .layui-laydate-footer span.layui-laydate-preview:hover { color: #666; } + .layui-laydate-footer span:first-child.layui-laydate-preview { padding-left: 0; } + .laydate-footer-btns { position: absolute; right: 10px; top: 10px; } -.laydate-footer-btns span { - margin: 0 0 0 -1px; -} /* 年月列表 */ .layui-laydate-list { diff --git a/package/component/src/component/upload/index.vue b/package/component/src/component/upload/index.vue index abd47dad..1d6cadb1 100644 --- a/package/component/src/component/upload/index.vue +++ b/package/component/src/component/upload/index.vue @@ -17,7 +17,7 @@ import { ref, useSlots, withDefaults, - watch + watch, } from "vue"; import { templateRef } from "@vueuse/core"; import { LayLayer } from "@layui/layer-vue"; @@ -265,7 +265,7 @@ const errorF = (errorText: string) => { let errorMsg = errorText ? errorText : defaultErrorMsg; errorMsg = `layui-vue:${errorMsg}`; console.warn(errorMsg); - layer.msg(errorMsg, { icon: 2, time: 1000 }, function (res: unknown) { }); + layer.msg(errorMsg, { icon: 2, time: 1000 }, function (res: unknown) {}); emit("error", Object.assign({ currentTimeStamp, msg: errorMsg })); }; @@ -442,9 +442,22 @@ onUnmounted(() => {