|
@@ -1,44 +1,40 @@
|
|
|
<script setup lang="ts">
|
|
|
import sleep from "@/utils/sleep";
|
|
|
|
|
|
-const searchCode = ref('');
|
|
|
+const searchCode = ref("");
|
|
|
const inputRef = shallowRef();
|
|
|
|
|
|
-const codeList = ref([])
|
|
|
+const codeList = ref([]);
|
|
|
|
|
|
async function handleBlur() {
|
|
|
- await sleep(500)
|
|
|
+ await sleep(500);
|
|
|
inputRef?.value?.focus();
|
|
|
}
|
|
|
|
|
|
function handleKeyDown() {
|
|
|
- codeList.value.push(searchCode.value)
|
|
|
- searchCode.value = ''
|
|
|
+ codeList.value.push(searchCode.value);
|
|
|
+ searchCode.value = "";
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await nextTick();
|
|
|
await handleBlur();
|
|
|
-})
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="layout_container">
|
|
|
<header style="text-align: center">
|
|
|
- <el-input ref="inputRef"
|
|
|
- style="width: 220px"
|
|
|
- v-model="searchCode"
|
|
|
- @keydown.enter.stop.prevent="handleKeyDown"
|
|
|
- @blur="handleBlur"/>
|
|
|
+ <el-input
|
|
|
+ ref="inputRef"
|
|
|
+ style="width: 220px"
|
|
|
+ v-model="searchCode"
|
|
|
+ @keydown.enter.stop.prevent="handleKeyDown"
|
|
|
+ @blur="handleBlur"
|
|
|
+ />
|
|
|
</header>
|
|
|
<div class="layout_main">
|
|
|
- <el-table max-height="55vh">
|
|
|
-
|
|
|
- </el-table>
|
|
|
+ <el-table max-height="55vh"></el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
-<style lang="scss">
|
|
|
-
|
|
|
-</style>
|