refactor(ui): 紧急修复!!搜索框如果出现名字重复,会卡死

This commit is contained in:
Join
2025-12-10 11:34:48 +08:00
parent 078c37944f
commit f0cf1b4c0f
3 changed files with 18 additions and 15 deletions
@@ -12,14 +12,14 @@
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item :label="$t('product.name')" prop="productName">
<a-select v-model="queryParam.productName" placeholder="请选择或搜索产品名称"
<a-form-item :label="$t('product.name')" prop="productKey">
<a-select v-model="queryParam.productKey" placeholder="请选择或搜索产品名称"
show-search :filter-option="false"
:loading="productLoading" @search="handleProductSearch"
@focus="handleProductFocus" allow-clear
style="width: 100%">
<a-select-option v-for="product in productList" :key="product.id"
:value="product.name"
<a-select-option v-for="product in productList" :key="product.productKey"
:value="product.productKey"
:title="product.name">
<div class="product-option">
<div class="product-name">{{ product.name }}</div>
@@ -180,7 +180,7 @@
:showTotal="total => `共 ${total} 条`"
@showSizeChange="onShowSizeChange" @change="changeSize"/>
</a-card>
<!-- 视频平台设备通道选择弹窗 -->
<video-channel-select-modal
:visible="channelSelectVisible"
@@ -331,9 +331,6 @@ export default {
if (this.queryParam.deviceName !== undefined && this.queryParam.deviceName !== null) {
this.queryParam.deviceName = this.queryParam.deviceName.replace(/^\s*|\s*$/g, '')
}
if (this.queryParam.productName !== undefined && this.queryParam.productName !== null) {
this.queryParam.productName = this.queryParam.productName.replace(/^\s*|\s*$/g, '')
}
if (this.queryParam.productKey !== undefined && this.queryParam.productKey !== null) {
this.queryParam.productKey = this.queryParam.productKey.replace(/^\s*|\s*$/g, '')
}
@@ -45,8 +45,8 @@
>
<a-select-option
v-for="product in productSearchList"
:key="product.id"
:value="product.productKey"
:key="product.productKey"
:value="product.name"
:title="product.productKey"
>
<div class="product-search-option">
@@ -7,9 +7,9 @@
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item :label="$t('product.name')" prop="name">
<a-form-item :label="$t('product.name')" prop="productKey">
<a-select
v-model="queryParam.name"
v-model="queryParam.productKey"
placeholder="请选择或搜索产品名称"
show-search
:filter-option="false"
@@ -21,8 +21,8 @@
>
<a-select-option
v-for="product in productSearchList"
:key="product.id"
:value="product.name"
:key="product.productKey"
:value="product.productKey"
:title="product.name"
>
<div class="product-search-option">
@@ -40,11 +40,17 @@
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="产品分类" prop="classifiedName">
<a-input v-model="queryParam.classifiedName" placeholder="请输入产品分类"
@keyup.enter="handleQuery" allow-clear/>
</a-form-item>
</a-col>
<!-- <a-col :md="8" :sm="24">
<a-form-item label="ProductKey" prop="productKey">
<a-input v-model="queryParam.productKey" placeholder="请输入ProductKey"
@keyup.enter="handleQuery" allow-clear/>
</a-form-item>
</a-col>
</a-col> -->
<template v-if="advanced">
<a-col :md="8" :sm="24">