From e688c5abc5f87c3ce00afb094376053643fe3857 Mon Sep 17 00:00:00 2001 From: longyvfengyun <496960745@qq.com> Date: 星期四, 28 三月 2024 09:04:56 +0800 Subject: [PATCH] 内容提交 --- src/views/user/boxList.vue | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/src/views/user/boxList.vue b/src/views/user/boxList.vue index 614c204..3dc8159 100644 --- a/src/views/user/boxList.vue +++ b/src/views/user/boxList.vue @@ -1,5 +1,5 @@ <script setup> -import {ref, onMounted} from "vue"; +import {ref, onMounted, watch} from "vue"; import {ElMessage, ElMessageBox} from "element-plus"; import { allDrivesModule, changeDriveInfoModule, @@ -41,6 +41,10 @@ // 鍏抽棴绛夊緟妗� loading.value = false; } + +watch(carName, ()=>{ + searchDriveList(); +}); /** * 姣忛〉鏌ヨ涓暟鍙樻洿 @@ -91,9 +95,19 @@ }).catch(()=>{}); } +import useBoxListSearch from "@/views/user/hooks/useBoxListSearch"; + +// 妯$硦鏌ヨ妯″潡 +const {loading: boxSearchLoading, selectBox, boxList, boxListSearch} = useBoxListSearch(); +watch(selectBox, (name)=>{ + carName.value = name; + console.log(carName.value); +}) + onMounted(()=>{ searchDriveList(); searchAllDrives(); + boxListSearch(); }); </script> @@ -115,6 +129,24 @@ <!-- </div>--> <!-- </div>--> <div class="input-item"> + <el-select + v-model="selectBox" + clearable + filterable + remote + reserve-keyword + placeholder="璇疯緭鍏ヨ溅杈嗗悕绉�" + remote-show-suffix + :remote-method="boxListSearch" + :loading="boxSearchLoading"> + <el-option + v-for="(item, key) in boxList" + :key="'key'+key" + :label="item.label" + :value="item.value" + /> + </el-select> + <span class="w16-block"></span> <el-button type="success" icon="Plus" @click="addVisible=true">娣诲姞</el-button> <el-button type="primary" icon="Search" @click="searchDriveList">鏌ヨ</el-button> </div> @@ -227,4 +259,8 @@ margin-right: 8px; } } +span.w16-block { + display: inline-block; + width: 16px; +} </style> -- Gitblit v1.9.1