Commit 62be24dd authored by “yiyousong”'s avatar “yiyousong”

perf: 修改数据搜索引擎业务搜索

parent 1d520cc8
...@@ -82,10 +82,29 @@ ...@@ -82,10 +82,29 @@
placement="bottom-start" placement="bottom-start"
popper-class="search-popover" popper-class="search-popover"
> >
<div class="w-full">
<div class="mb-3">推荐业务</div>
<div class="flex w-full flex-col gap-3">
<div
class="flex cursor-pointer"
v-for="(v, i) in calcBusinessList"
:key="v.id"
@click="form.businessName = v.businessName"
>
<div :class="['mr-4', ' w-[20px]', `index-${i + 1}`]">
{{ i + 1 }}
</div>
<div class="flex-1 truncate">{{ v.businessName }}</div>
</div>
</div>
</div>
<el-input <el-input
size="small" size="small"
placeholder="暂未选择" placeholder="暂未选择"
slot="reference" slot="reference"
v-model="form.businessName"
clearable
@input="handleBusinessNameInput"
></el-input> ></el-input>
</el-popover> </el-popover>
</div> </div>
...@@ -127,10 +146,12 @@ ...@@ -127,10 +146,12 @@
<script> <script>
import { findBottomSubarrays } from "@/utils"; import { findBottomSubarrays } from "@/utils";
import { mapState } from "vuex";
export default { export default {
components: {}, components: {},
data() { data() {
return { return {
calcBusiness: [],
subMenus: [], subMenus: [],
form: { form: {
type: "year", type: "year",
...@@ -145,6 +166,7 @@ export default { ...@@ -145,6 +166,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("user", ["businessList", "deptList", "windowList"]),
activeKey() { activeKey() {
return this.$route.path; return this.$route.path;
}, },
...@@ -157,8 +179,17 @@ export default { ...@@ -157,8 +179,17 @@ export default {
return this.form.day; return this.form.day;
} }
}, },
calcBusinessList: {
get() {
return this.calcBusiness;
},
set(val) {
return (this.calcBusiness = val);
},
},
}, },
created() { created() {
this.calcBusiness = this.businessList.slice(0, 10);
this.getSubMenus(); this.getSubMenus();
}, },
mounted() {}, mounted() {},
...@@ -188,6 +219,16 @@ export default { ...@@ -188,6 +219,16 @@ export default {
this.form.month = ""; this.form.month = "";
this.form.day = ""; this.form.day = "";
}, },
handleBusinessNameInput(name) {
if (name !== "") {
let list = this.businessList.filter((v) =>
v.businessName.includes(name)
);
this.calcBusinessList = list.slice(0, 10);
} else {
this.calcBusinessList = this.businessList.slice(0, 10);
}
},
}, },
}; };
</script> </script>
...@@ -260,6 +301,15 @@ export default { ...@@ -260,6 +301,15 @@ export default {
border: 2px solid var(--primary); border: 2px solid var(--primary);
} }
} }
.index-1 {
color: #ff5948;
}
.index-2 {
color: #ff6f48;
}
.index-3 {
color: #ff8d48;
}
:deep(.el-picker-panel) { :deep(.el-picker-panel) {
border: none; border: none;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment