feat: use project standard search bar pattern for asset pages, add title/phone/date filters

This commit is contained in:
2026-05-21 09:54:59 +08:00
parent a42fc6453a
commit 4c3becf33e
4 changed files with 131 additions and 40 deletions
+40 -4
View File
@@ -1,8 +1,27 @@
<template>
<div class="asset-user-container">
<el-card shadow="never" class="!border-none">
<!-- 搜索区域 -->
<el-card class="!border-none" shadow="never">
<el-form class="ls-form" :model="searchData" inline>
<el-form-item class="w-[280px]" label="手机号">
<el-input
placeholder="请输入手机号"
v-model="searchData.phone"
clearable
@keyup.enter="handleSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 列表区域 -->
<el-card class="!border-none mt-4" shadow="never">
<div class="mb-4">
<el-button type="primary" @click="handleAdd">新增分发账号</el-button>
<el-button type="primary" @click="handleAdd">新增账号</el-button>
</div>
<el-table :data="tableData" v-loading="loading">
@@ -65,7 +84,12 @@ import { apiAssetUserList, apiAssetUserAdd, apiAssetUserEdit, apiAssetUserDelete
const loading = ref(false)
const tableData = ref([])
const total = ref(0)
const queryParams = reactive({
const searchData = reactive({
phone: ''
})
const queryParams = reactive<any>({
page_no: 1,
page_size: 15
})
@@ -89,7 +113,8 @@ const rules = {
const getList = async () => {
loading.value = true
try {
const res = await apiAssetUserList(queryParams)
const params = { ...queryParams, ...searchData }
const res = await apiAssetUserList(params)
tableData.value = res.lists
total.value = res.count
} catch (e) {
@@ -99,6 +124,17 @@ const getList = async () => {
}
}
const handleSearch = () => {
queryParams.page_no = 1
getList()
}
const handleReset = () => {
searchData.phone = ''
queryParams.page_no = 1
getList()
}
const handleAdd = () => {
dialogTitle.value = '新增账号'
Object.assign(formData, { id: '', phone: '', password: '', status: 1 })