diff --git a/components.d.ts b/components.d.ts index 7b19416..5181cf9 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,14 +8,13 @@ export {} declare module 'vue' { export interface GlobalComponents { ElButton: typeof import('element-plus/es')['ElButton'] - ElCol: typeof import('element-plus/es')['ElCol'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElFooter: typeof import('element-plus/es')['ElFooter'] ElHeader: typeof import('element-plus/es')['ElHeader'] + ElIcon: typeof import('element-plus/es')['ElIcon'] ElPopover: typeof import('element-plus/es')['ElPopover'] - ElRow: typeof import('element-plus/es')['ElRow'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ErrorModal: typeof import('./src/components/dialogs/ErrorModal.vue')['default'] @@ -25,7 +24,4 @@ declare module 'vue' { SimpleKeyboard: typeof import('./src/components/SimpleKeyboard.vue')['default'] StackInfoModal: typeof import('./src/components/dialogs/StackInfoModal.vue')['default'] } - export interface ComponentCustomProperties { - vLoading: typeof import('element-plus/es')['ElLoadingDirective'] - } } diff --git a/src/pages/Index/Regular/Emergency.vue b/src/pages/Index/Regular/Emergency.vue index 9d829ac..da4a011 100644 --- a/src/pages/Index/Regular/Emergency.vue +++ b/src/pages/Index/Regular/Emergency.vue @@ -391,7 +391,6 @@ const showKeyboard = (field: 'sampleBarcode' | 'userid') => { // 处理键盘输入 const handleKeyboardInput = (value: string) => { if (!currentInputField.value) return - console.log('value----', value) // 更新当前输入值 currentInputValue.value = value // 更新对应字段的值 diff --git a/src/pages/Index/Regular/Running.vue b/src/pages/Index/Regular/Running.vue index 2e3b4a7..31eaf9c 100644 --- a/src/pages/Index/Regular/Running.vue +++ b/src/pages/Index/Regular/Running.vue @@ -31,7 +31,8 @@ 光学模组
-
+ > +
- + @@ -22,13 +22,17 @@ - + @confirm="handleConfirmUpdatePin" @cancel="handleCancelUpdatePin" /> --> + + + @@ -38,7 +42,7 @@ @confirm="handleConfirmInsert" @cancel="handleCancelInsert" @resetAlreadyExist="resetAlreadyExist" /> - @@ -29,12 +36,57 @@ const emit = defineEmits<{ (e: 'cancel'): void }>() +const inputType = ref('password') +const isShowType = ref(false) const pin = ref('') const confirmPin = () => { emit('confirm', pin.value) } +// 键盘相关状态 +const keyboardVisible = ref(false) +const currentInputValue = ref('') +const currentInputField = ref<'sampleBarcode' | 'userid' | ''>('') + +// 隐藏键盘 +const hideKeyboard = () => { + keyboardVisible.value = false + currentInputField.value = '' + currentInputValue.value = '' +} + +// 显示键盘 +const showKeyboard = () => { + // 清空当前输入值,避免累加 + // currentInputValue.value = '' + currentInputValue.value = pin.value + keyboardVisible.value = true +} + +// 处理键盘输入 +const handleKeyboardInput = (value: string) => { + // 更新当前输入值 + currentInputValue.value = value + // 更新对应字段的值 + pin.value = value +} + +// 处理键盘按键 +const handleKeyPress = (button: string) => { + if (button === '{enter}') { + hideKeyboard() + } else if (button === '{bksp}') { + // 处理退格键 + const value = currentInputValue.value + if (value.length > 0) { + const newValue = value.slice(0, -1) + handleKeyboardInput(newValue) + } + } +} + + const cancel = () => { emit('cancel') } @@ -138,4 +190,34 @@ const cancel = () => { } } } + +.keyboard { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + height: 300px; + background-color: #f5f7fa; + border-top-left-radius: 16px; + border-top-right-radius: 16px; + box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1); + z-index: 1000; +} +// 键盘动画 +.slide-up-enter-active, +.slide-up-leave-active { + transition: transform 0.3s ease; +} + +.slide-up-enter-from, +.slide-up-leave-to { + transform: translateY(100%); +} + +.pwd-view{ + font-size: 30px; + position: absolute; + margin-left: -40px; + margin-top: 16px; +} diff --git a/src/pages/Index/components/Setting/UpdatePinModal.vue b/src/pages/Index/components/Setting/UpdatePinModal.vue new file mode 100644 index 0000000..c50c15a --- /dev/null +++ b/src/pages/Index/components/Setting/UpdatePinModal.vue @@ -0,0 +1,290 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/Index/components/Setting/index.ts b/src/pages/Index/components/Setting/index.ts index 2e0db9d..fdc3824 100644 --- a/src/pages/Index/components/Setting/index.ts +++ b/src/pages/Index/components/Setting/index.ts @@ -2,3 +2,4 @@ export { default as AddUserModal } from './AddUserModal.vue' export { default as DelMessage } from './DelMessage.vue' export { default as DelWarn } from './DelWarn.vue' export { default as EnterPinModal } from './EnterPinModal.vue' +export { default as UpdatePinModal } from './UpdatePinModal.vue' \ No newline at end of file