From 2f991edf8e04327a9814eb30524e5f53f2a004ef Mon Sep 17 00:00:00 2001 From: Dreamer <154239735@qq.com> Date: Thu, 18 Nov 2021 22:01:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E5=90=8E=E5=87=BA=E7=8E=B0undefinde=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86howAnimation?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devui/time-picker/src/components/popup-line/index.scss | 1 + .../devui/time-picker/src/components/popup-line/index.tsx | 2 +- .../devui/time-picker/src/components/time-popup/index.scss | 1 - .../devui/time-picker/src/components/time-scroll/index.tsx | 4 +++- .../devui/time-picker/src/composables/use-time-picker.ts | 7 +++++-- .../devui-vue/devui/time-picker/src/time-picker-types.ts | 4 ++++ 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss index 52ba7c3e..d6b63d34 100644 --- a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss +++ b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss @@ -7,6 +7,7 @@ width: 100%; height: 256px; border-bottom: 1px solid $devui-dividing-line; + display: flex; .time-item { height: 100%; diff --git a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx index 3cd25381..fc85ee99 100644 --- a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx +++ b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx @@ -75,7 +75,7 @@ export default defineComponent({ const TimeUl = (timeList:Array)=>{ return ( -
6?'33.333%':'50%'}}> +
    {TimeLi(timeList)} diff --git a/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss b/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss index 161c6f30..61a8ae49 100644 --- a/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss +++ b/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss @@ -8,7 +8,6 @@ background-color: $devui-connected-overlay-bg; box-shadow: 0 0 2px 2px $devui-shadow; border-radius: $devui-border-radius; - border: 1px solid $devui-line; overflow: hidden; position: fixed; z-index: -1; diff --git a/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx b/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx index 36cf4c2e..99bbc06d 100644 --- a/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx +++ b/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx @@ -1,10 +1,12 @@ import { defineComponent, onBeforeUnmount, onMounted, onUnmounted } from 'vue' +import { TimePickerProps, timePickerProps } from '../../time-picker-types' import useTimeScroll from './composables/use-time-scroll' import './index.scss' export default defineComponent({ name:'DTimeScroll', + props:timePickerProps, setup(props,ctx){ const { scrollBoxDom, @@ -44,7 +46,7 @@ export default defineComponent({ return ( <>
    -
    { ctx.slots.default?.() diff --git a/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts b/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts index 9b2f58b9..8dfae174 100644 --- a/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts +++ b/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts @@ -37,7 +37,8 @@ export default function useTimePicker( const mouseInIputFun = ()=>{ if(firsthandActiveTime.value == '00:00:00'){ - const vModelValueArr = vModeValue.value.split(':') + + const vModelValueArr = value.split(':') const minTimeValueArr = minTime.split(':') vModeValue.value == '' @@ -45,8 +46,9 @@ export default function useTimePicker( : '' if( vModeValue.value > minTime ){ - firsthandActiveTime.value = vModeValue.value + firsthandActiveTime.value = value setInputValue(vModelValueArr[0],vModelValueArr[1],vModelValueArr[2]) + }else{ firsthandActiveTime.value = minTime setInputValue(minTimeValueArr[0],minTimeValueArr[1],minTimeValueArr[2]) @@ -70,6 +72,7 @@ export default function useTimePicker( const vModelValueArr = vModeValue.value.split(':') vModeValue.value && setInputValue(vModelValueArr[0],vModelValueArr[1],vModelValueArr[2]) + } diff --git a/packages/devui-vue/devui/time-picker/src/time-picker-types.ts b/packages/devui-vue/devui/time-picker/src/time-picker-types.ts index 498f6929..1dd9841a 100644 --- a/packages/devui-vue/devui/time-picker/src/time-picker-types.ts +++ b/packages/devui-vue/devui/time-picker/src/time-picker-types.ts @@ -33,6 +33,10 @@ export const timePickerProps = { autoOpen:{ type:Boolean, default:false + }, + showAnimation:{ + type:Boolean, + default:true } } as const; -- Gitee From d552790d8746b2123e4aeb44a21c9c993afda00a Mon Sep 17 00:00:00 2001 From: Dreamer <154239735@qq.com> Date: Thu, 18 Nov 2021 22:12:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E5=87=BA=E7=8E=B0undefined=E7=9A=84BUG=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0=E4=BA=86showAnimation=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/popup-line/index.scss | 1 - .../src/components/popup-line/index.tsx | 1 - .../src/components/time-popup/index.scss | 2 +- .../src/components/time-scroll/index.tsx | 1 - .../time-picker/src/composables/use-time-picker.ts | 3 --- .../devui/time-picker/src/time-picker-types.ts | 1 - .../devui-vue/docs/components/time-picker/index.md | 14 ++++++++------ 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss index d6b63d34..854f2838 100644 --- a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss +++ b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.scss @@ -8,7 +8,6 @@ height: 256px; border-bottom: 1px solid $devui-dividing-line; display: flex; - .time-item { height: 100%; display: inline-block; diff --git a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx index fc85ee99..d13669b2 100644 --- a/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx +++ b/packages/devui-vue/devui/time-picker/src/components/popup-line/index.tsx @@ -53,7 +53,6 @@ export default defineComponent({ timeListDom, ) - const setOutoTime = (time:string)=>{ resetTimeValue(time) } diff --git a/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss b/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss index 61a8ae49..bc97ca46 100644 --- a/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss +++ b/packages/devui-vue/devui/time-picker/src/components/time-popup/index.scss @@ -30,4 +30,4 @@ display: flex; justify-content: space-between; align-items: center; -} +} \ No newline at end of file diff --git a/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx b/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx index 99bbc06d..14aff802 100644 --- a/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx +++ b/packages/devui-vue/devui/time-picker/src/components/time-scroll/index.tsx @@ -60,6 +60,5 @@ export default defineComponent({ ) } - } }) \ No newline at end of file diff --git a/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts b/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts index 8dfae174..03e2fd79 100644 --- a/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts +++ b/packages/devui-vue/devui/time-picker/src/composables/use-time-picker.ts @@ -37,7 +37,6 @@ export default function useTimePicker( const mouseInIputFun = ()=>{ if(firsthandActiveTime.value == '00:00:00'){ - const vModelValueArr = value.split(':') const minTimeValueArr = minTime.split(':') @@ -48,13 +47,11 @@ export default function useTimePicker( if( vModeValue.value > minTime ){ firsthandActiveTime.value = value setInputValue(vModelValueArr[0],vModelValueArr[1],vModelValueArr[2]) - }else{ firsthandActiveTime.value = minTime setInputValue(minTimeValueArr[0],minTimeValueArr[1],minTimeValueArr[2]) } } - isActive.value = true showPopup.value = true } diff --git a/packages/devui-vue/devui/time-picker/src/time-picker-types.ts b/packages/devui-vue/devui/time-picker/src/time-picker-types.ts index 1dd9841a..121d3fec 100644 --- a/packages/devui-vue/devui/time-picker/src/time-picker-types.ts +++ b/packages/devui-vue/devui/time-picker/src/time-picker-types.ts @@ -40,5 +40,4 @@ export const timePickerProps = { } } as const; - export type TimePickerProps = ExtractPropTypes; diff --git a/packages/devui-vue/docs/components/time-picker/index.md b/packages/devui-vue/docs/components/time-picker/index.md index 858f7c11..a79d3da5 100644 --- a/packages/devui-vue/docs/components/time-picker/index.md +++ b/packages/devui-vue/docs/components/time-picker/index.md @@ -86,29 +86,30 @@

    mm:HH:ss

    - +

    hh:mm

    - +

    MM:ss

    - +