longyvfengyun
2024-03-28 e688c5abc5f87c3ce00afb094376053643fe3857
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>