fix: bug
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m50s

This commit is contained in:
sexygoat
2026-04-23 15:52:18 +08:00
parent 0bc2efdf0e
commit 8ca03ed7ac
4 changed files with 80 additions and 37 deletions

View File

@@ -371,8 +371,8 @@
) )
} }
// 如果操作数量 <= 2,直接显示所有按钮 // 如果操作数量 <= 3,直接显示所有按钮
if (actionList.length <= 2) { if (actionList.length <= 3) {
return h( return h(
'div', 'div',
{ style: 'display: flex; gap: 8px;' }, { style: 'display: flex; gap: 8px;' },
@@ -390,7 +390,7 @@
) )
} }
// 如果操作数量 > 2,显示第一个 + 更多下拉菜单 // 如果操作数量 > 3,显示第一个 + 更多下拉菜单
const firstAction = actionList[0] const firstAction = actionList[0]
const moreActions = actionList.slice(1) const moreActions = actionList.slice(1)

View File

@@ -369,10 +369,20 @@
class="card-operations" class="card-operations"
style="margin-top: 16px; text-align: right" style="margin-top: 16px; text-align: right"
> >
<ElButton v-permission="'iot_info:start'" type="success" @click="handleEnableCard"> <ElButton
v-if="cardInfo?.network_status === 0"
v-permission="'iot_info:start'"
type="success"
@click="handleEnableCard"
>
启用此卡 启用此卡
</ElButton> </ElButton>
<ElButton v-permission="'iot_info:stop'" type="warning" @click="handleDisableCard"> <ElButton
v-if="cardInfo?.network_status === 1"
v-permission="'iot_info:stop'"
type="warning"
@click="handleDisableCard"
>
停用此卡 停用此卡
</ElButton> </ElButton>
<!--<ElButton type="danger" v-permission="'iot_info:handler_stop'" @click="handleManualDeactivate"> 手动停用 </ElButton>--> <!--<ElButton type="danger" v-permission="'iot_info:handler_stop'" @click="handleManualDeactivate"> 手动停用 </ElButton>-->

View File

@@ -5,7 +5,8 @@
<ArtSearchBar <ArtSearchBar
v-model:filter="searchForm" v-model:filter="searchForm"
:items="searchFormItems" :items="searchFormItems"
:show-expand="false" show-expand
label-width="100"
@reset="handleReset" @reset="handleReset"
@search="handleSearch" @search="handleSearch"
></ArtSearchBar> ></ArtSearchBar>
@@ -73,7 +74,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { h } from 'vue' import { h } from 'vue'
import { CommissionService } from '@/api/modules' import { CommissionService, ShopService } from '@/api/modules'
import { ElMessage, ElMessageBox, ElTag } from 'element-plus' import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus' import type { FormInstance, FormRules } from 'element-plus'
import type { import type {
@@ -98,11 +99,15 @@
const tableRef = ref() const tableRef = ref()
const currentWithdrawalId = ref<number>(0) const currentWithdrawalId = ref<number>(0)
// 店铺选项
const shopOptions = ref<any[]>([])
// 搜索表单初始值 // 搜索表单初始值
const initialSearchState = { const initialSearchState = {
withdrawal_no: '', withdrawal_no: '',
shop_name: '', shop_name: '',
status: undefined as WithdrawalStatus | undefined, status: undefined as WithdrawalStatus | undefined,
dateRange: [],
start_time: '', start_time: '',
end_time: '' end_time: ''
} }
@@ -120,16 +125,6 @@
// 搜索表单配置 // 搜索表单配置
const searchFormItems: SearchFormItem[] = [ const searchFormItems: SearchFormItem[] = [
{
label: '状态',
prop: 'status',
type: 'select',
options: withdrawalStatusOptions,
config: {
clearable: true,
placeholder: '请选择状态'
}
},
{ {
label: '提现单号', label: '提现单号',
prop: 'withdrawal_no', prop: 'withdrawal_no',
@@ -142,30 +137,40 @@
{ {
label: '店铺名称', label: '店铺名称',
prop: 'shop_name', prop: 'shop_name',
type: 'input', type: 'select',
placeholder: '请输入店铺名称搜索',
options: () =>
shopOptions.value.map((shop) => ({
label: shop.shop_name,
value: shop.shop_name
})),
config: { config: {
clearable: true, clearable: true,
placeholder: '请输入店铺名称' filterable: true,
remote: true,
remoteMethod: (query: string) => searchShops(query)
} }
}, },
{ {
label: '申请时间', label: '状态',
prop: 'dateRange', prop: 'status',
type: 'daterange', type: 'select',
options: withdrawalStatusOptions,
config: { config: {
clearable: true, clearable: true,
placeholder: '请选择状态'
}
},
{
label: '开始至结束',
prop: 'dateRange',
type: 'date',
config: {
type: 'daterange',
rangeSeparator: '至',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
endPlaceholder: '结束日期', endPlaceholder: '结束日期',
valueFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'YYYY-MM-DD'
onChange: (val: [string, string] | null) => {
if (val && val.length === 2) {
searchForm.start_time = val[0]
searchForm.end_time = val[1]
} else {
searchForm.start_time = ''
searchForm.end_time = ''
}
}
} }
} }
] ]
@@ -302,8 +307,28 @@
onMounted(() => { onMounted(() => {
getTableData() getTableData()
searchShops('')
}) })
// 搜索店铺
const searchShops = async (query: string) => {
try {
const params: any = {
page: 1,
page_size: 20
}
if (query) {
params.shop_name = query
}
const res = await ShopService.getShops(params)
if (res.code === 0) {
shopOptions.value = res.data.items || []
}
} catch (error) {
console.error('Search shops failed:', error)
}
}
// 获取提现申请列表 // 获取提现申请列表
const getTableData = async () => { const getTableData = async () => {
loading.value = true loading.value = true
@@ -338,6 +363,14 @@
// 搜索 // 搜索
const handleSearch = () => { const handleSearch = () => {
// 处理日期范围
if (searchForm.dateRange && Array.isArray(searchForm.dateRange)) {
searchForm.start_time = searchForm.dateRange[0]
searchForm.end_time = searchForm.dateRange[1]
} else {
searchForm.start_time = ''
searchForm.end_time = ''
}
pagination.page = 1 pagination.page = 1
getTableData() getTableData()
} }

View File

@@ -35,7 +35,7 @@
:total="pagination.total" :total="pagination.total"
:marginTop="10" :marginTop="10"
:actions="getActions" :actions="getActions"
:actionsWidth="160" :actionsWidth="250"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
> >
@@ -740,10 +740,10 @@
refundList.value = res.data.items || [] refundList.value = res.data.items || []
pagination.total = res.data.total || 0 pagination.total = res.data.total || 0
} }
} catch (error: any) { } catch (error: any) {
console.error(error) console.error(error)
ElMessage.error(error?.message || '重新提交失败') ElMessage.error(error?.message || '重新提交失败')
} finally { } finally {
loading.value = false loading.value = false
} }
} }