From ce9ff4af4cf7ccc87d3ef94a849942baf112b811 Mon Sep 17 00:00:00 2001 From: 杨磊 <505174330@qq.com> Date: 星期一, 07 四月 2025 18:03:01 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/wyyDatabase --- src/views/home/components/searchBox.vue | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 109 insertions(+), 0 deletions(-) diff --git a/src/views/home/components/searchBox.vue b/src/views/home/components/searchBox.vue new file mode 100644 index 0000000..1087fca --- /dev/null +++ b/src/views/home/components/searchBox.vue @@ -0,0 +1,109 @@ +<template> + <div class="search-container"> + <el-select + v-model="selectedType" + slot="prepend" + placeholder="璇烽�夋嫨" + class="type-select" + > + <el-option + v-for="item in options" + :key="item.value" + :label="item.label" + :value="item.value" + /> + </el-select> + <div class="inputBox"> + <input type="text" v-model="searchText" class="search-input" /> + <div class="searchBtn">鎼滅储</div> + </div> + </div> +</template> + +<script> +export default { + name: "SearchBox", + data() { + return { + searchText: "", // 杈撳叆妗嗗唴瀹� + selectedType: "", // 涓嬫媺妗嗛�変腑鍊� + options: [ + // 涓嬫媺閫夐」 + { value: "all", label: "鍏ㄩ儴" }, + { value: "name", label: "鍚嶇О" }, + { value: "id", label: "ID" }, + { value: "code", label: "缂栫爜" }, + ], + }; + }, + methods: { + // 鎼滅储澶勭悊 + handleSearch() { + this.$emit("search", { + text: this.searchText, + type: this.selectedType, + }); + }, + }, +}; +</script> + +<style scoped> +/* 缁勫悎鏍峰紡 */ +.search-container { + max-width: 800px; + margin: 20px 0; + display: flex; +} + +/* 杈撳叆妗嗘牱寮� */ +.search-input { +} + +.inputBox { + border: 1px solid #B9A587; + height: 38px; + width: 400px; + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 13px; + padding-right: 5px; + border-radius: 5px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + padding-left: 10px; +} + +.searchBtn { + width: 70px; + height: 30px; + background-color: #937950; + margin-left: 10px; + cursor: pointer; + font-size: 14px; + text-align: center; + line-height: 30px; + color: #fff; +} + +/* 涓嬫媺妗嗘牱寮� */ +.type-select { + width: 120px; +} + +/* 璋冩暣闂磋窛 */ +.el-select /deep/ .el-input__inner { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border: 1px solid #B9A587; + + border-right: none; + +} + +.el-input-group__prepend { + padding: 0; + border: none; +} +</style> -- Gitblit v1.9.1