点口管理添加关键字过滤

This commit is contained in:
2026-06-10 17:35:55 +08:00
parent 810d2bfc40
commit 2c8af0f2e0
2 changed files with 49 additions and 4 deletions
+28 -2
View File
@@ -378,18 +378,19 @@
display: flex;
align-items: center;
gap: 16rpx;
margin-bottom: 16rpx;
}
// 选择按钮
.project-select-btn {
flex: 1;
width: 90%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 12rpx 24rpx;
background: #f5f6f8;
border-radius: 12rpx;
max-height: 70rpx;
max-height: 60rpx;
.select-text {
font-size: 28rpx;
@@ -402,6 +403,31 @@
}
}
// 搜索框
.search-box {
width: 90%;
display: flex;
align-items: center;
background: #f5f6f8;
border-radius: 12rpx;
padding: 0 16rpx;
max-height: 70rpx;
.search-input {
flex: 1;
font-size: 28rpx;
color: #333;
padding: 0 12rpx;
height: 60rpx;
}
.search-clear {
display: flex;
align-items: center;
padding: 4rpx;
}
}
.refresh-btn {
padding: 8rpx;
display: flex;
+21 -2
View File
@@ -13,6 +13,14 @@
<u-icon name="reload" :size="36" :class="{ rotating: loading }"></u-icon>
</view>
</view>
<!-- 关键字搜索 -->
<view class="search-box">
<u-icon name="search" :size="28" color="#999"></u-icon>
<input class="search-input" placeholder="输入关键字过滤" v-model="keyword" />
<view v-if="keyword" class="search-clear" @click="keyword = ''">
<u-icon name="close-circle-fill" :size="28" color="#c0c4cc"></u-icon>
</view>
</view>
</view>
<!-- 列表内容 -->
@@ -24,7 +32,7 @@
</view>
<!-- 数据列表 -->
<view v-else class="list-wrap">
<view v-for="(item, index) in listData" :key="item.id || index" class="list-item"
<view v-for="(item, index) in filteredList" :key="item.id || index" class="list-item"
@click="handleItemClick(item)">
<text class="item-index">{{ index + 1 }}</text>
<text class="item-title">{{ item.PointBatchCode || '--' }}</text>
@@ -66,6 +74,8 @@
currentProject
} = storeToRefs(userStore)
const keyword = ref('')
// ===== 单位工程选择 =====
const showUnitWorkSelect = ref(false)
const selectedUnitWork = ref(null)
@@ -89,6 +99,15 @@
const listData = ref([])
const loading = ref(false)
// 关键字过滤
const filteredList = computed(() => {
if (!keyword.value) return listData.value
const kw = keyword.value.toLowerCase()
return listData.value.filter(item =>
String(item.PointBatchCode || '').toLowerCase().includes(kw)
)
})
// 加载数据
const fetchData = async () => {
if (loading.value) return
@@ -118,4 +137,4 @@
// TODO: 跳转详情
}
</script>
</script>