页面美化,隐藏搜索字段成弹窗形式
This commit is contained in:
parent
eaec8547aa
commit
7246e8dc99
|
@ -1,208 +1,280 @@
|
|||
<template>
|
||||
<div class="equipment-search-container">
|
||||
<a-card class="search-card" :bordered="false">
|
||||
<template #title>
|
||||
<div class="search-title">
|
||||
<!-- 搜索按钮 -->
|
||||
<div class="search-trigger">
|
||||
<a-button type="primary" @click="showSearchModal = true">
|
||||
<template #icon>
|
||||
<IconSearch />
|
||||
<span>设备搜索</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
搜索设备
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
<a-form layout="inline" :model="searchForm">
|
||||
<div class="search-row">
|
||||
<a-form-item label="设备名称">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentName"
|
||||
placeholder="请输入设备名称"
|
||||
allow-clear
|
||||
style="width: 200px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- 搜索弹窗 -->
|
||||
<a-modal
|
||||
v-model:visible="showSearchModal"
|
||||
title="设备搜索"
|
||||
width="1000px"
|
||||
:footer="false"
|
||||
@cancel="handleCancel"
|
||||
class="search-modal"
|
||||
>
|
||||
<div class="search-content">
|
||||
<a-form layout="vertical" :model="searchForm" class="search-form">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="设备名称">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentName"
|
||||
placeholder="请输入设备名称"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="设备类型">
|
||||
<a-select
|
||||
v-model="searchForm.equipmentType"
|
||||
:options="equipmentTypeOptions"
|
||||
placeholder="请选择设备类型"
|
||||
allow-clear
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="设备状态">
|
||||
<a-select
|
||||
v-model="searchForm.equipmentStatus"
|
||||
:options="equipmentStatusOptions"
|
||||
placeholder="请选择设备状态"
|
||||
allow-clear
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="设备类型">
|
||||
<a-select
|
||||
v-model="searchForm.equipmentType"
|
||||
:options="equipmentTypeOptions"
|
||||
placeholder="请选择设备类型"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="位置状态">
|
||||
<a-select
|
||||
v-model="searchForm.locationStatus"
|
||||
:options="locationStatusOptions"
|
||||
placeholder="请选择位置状态"
|
||||
allow-clear
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="健康状态">
|
||||
<a-select
|
||||
v-model="searchForm.healthStatus"
|
||||
:options="healthStatusOptions"
|
||||
placeholder="请选择健康状态"
|
||||
allow-clear
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="使用状态">
|
||||
<a-select
|
||||
v-model="searchForm.useStatus"
|
||||
:options="useStatusOptions"
|
||||
placeholder="请选择使用状态"
|
||||
allow-clear
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="设备状态">
|
||||
<a-select
|
||||
v-model="searchForm.equipmentStatus"
|
||||
:options="equipmentStatusOptions"
|
||||
placeholder="请选择设备状态"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="使用部门/人">
|
||||
<a-input
|
||||
v-model="searchForm.usingDepartment"
|
||||
placeholder="请输入使用部门/人"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="负责人">
|
||||
<a-input
|
||||
v-model="searchForm.responsiblePerson"
|
||||
placeholder="请输入负责人"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="维护人员">
|
||||
<a-input
|
||||
v-model="searchForm.maintenancePerson"
|
||||
placeholder="请输入维护人员"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="位置状态">
|
||||
<a-select
|
||||
v-model="searchForm.locationStatus"
|
||||
:options="locationStatusOptions"
|
||||
placeholder="请选择位置状态"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="序列号">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentSn"
|
||||
placeholder="请输入序列号"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="资产编号">
|
||||
<a-input
|
||||
v-model="searchForm.assetCode"
|
||||
placeholder="请输入资产编号"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="品牌">
|
||||
<a-input
|
||||
v-model="searchForm.brand"
|
||||
placeholder="请输入品牌"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<div class="search-row">
|
||||
<a-form-item label="健康状态">
|
||||
<a-select
|
||||
v-model="searchForm.healthStatus"
|
||||
:options="healthStatusOptions"
|
||||
placeholder="请选择健康状态"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="设备型号">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentModel"
|
||||
placeholder="请输入设备型号"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="物理位置">
|
||||
<a-input
|
||||
v-model="searchForm.physicalLocation"
|
||||
placeholder="请输入物理位置"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="供应商">
|
||||
<a-input
|
||||
v-model="searchForm.supplierName"
|
||||
placeholder="请输入供应商"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="使用部门/人">
|
||||
<a-input
|
||||
v-model="searchForm.usingDepartment"
|
||||
placeholder="请输入使用部门/人"
|
||||
allow-clear
|
||||
style="width: 200px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="8">
|
||||
<a-form-item label="发票">
|
||||
<a-input
|
||||
v-model="searchForm.invoice"
|
||||
placeholder="请输入发票"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="条码">
|
||||
<a-input
|
||||
v-model="searchForm.barcode"
|
||||
placeholder="请输入条码"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="库存条码">
|
||||
<a-input
|
||||
v-model="searchForm.inventoryBarcode"
|
||||
placeholder="请输入库存条码"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="发票">
|
||||
<a-input
|
||||
v-model="searchForm.invoice"
|
||||
placeholder="请输入发票"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="规格型号">
|
||||
<a-input
|
||||
v-model="searchForm.specification"
|
||||
placeholder="请输入规格型号"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="资产备注">
|
||||
<a-input
|
||||
v-model="searchForm.assetRemark"
|
||||
placeholder="请输入资产备注"
|
||||
allow-clear
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item label="条码">
|
||||
<a-input
|
||||
v-model="searchForm.barcode"
|
||||
placeholder="请输入条码"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
<div class="search-row">
|
||||
<a-form-item label="序列号">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentSn"
|
||||
placeholder="请输入序列号"
|
||||
allow-clear
|
||||
style="width: 200px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="资产编号">
|
||||
<a-input
|
||||
v-model="searchForm.assetCode"
|
||||
placeholder="请输入资产编号"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="品牌">
|
||||
<a-input
|
||||
v-model="searchForm.brand"
|
||||
placeholder="请输入品牌"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="负责人">
|
||||
<a-input
|
||||
v-model="searchForm.responsiblePerson"
|
||||
placeholder="请输入负责人"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
<div class="search-row">
|
||||
<a-form-item label="使用状态">
|
||||
<a-select
|
||||
v-model="searchForm.useStatus"
|
||||
:options="useStatusOptions"
|
||||
placeholder="请选择使用状态"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="设备型号">
|
||||
<a-input
|
||||
v-model="searchForm.equipmentModel"
|
||||
placeholder="请输入设备型号"
|
||||
allow-clear
|
||||
style="width: 200px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="物理位置">
|
||||
<a-input
|
||||
v-model="searchForm.physicalLocation"
|
||||
placeholder="请输入物理位置"
|
||||
allow-clear
|
||||
style="width: 200px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="供应商">
|
||||
<a-input
|
||||
v-model="searchForm.supplierName"
|
||||
placeholder="请输入供应商"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@input="debouncedSearch"
|
||||
/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
<div class="search-actions">
|
||||
<a-button type="primary" :loading="loading" @click="handleSearch">
|
||||
<template #icon>
|
||||
<IconSearch />
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button style="margin-left: 8px" @click="handleReset">
|
||||
<template #icon>
|
||||
<IconRefresh />
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
</div>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<!-- 搜索操作按钮 -->
|
||||
<div class="search-actions">
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleSearch" :loading="loading">
|
||||
<template #icon>
|
||||
<IconSearch />
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button @click="handleReset">
|
||||
<template #icon>
|
||||
<IconRefresh />
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
<a-button @click="handleCancel">
|
||||
取消
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</a-form>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from 'vue'
|
||||
import { reactive, ref } from 'vue'
|
||||
import { IconRefresh, IconSearch } from '@arco-design/web-vue/es/icon'
|
||||
import type { EquipmentPageQuery } from '@/types/equipment.d'
|
||||
|
||||
|
@ -220,6 +292,9 @@ const emit = defineEmits<{
|
|||
reset: []
|
||||
}>()
|
||||
|
||||
// 弹窗控制
|
||||
const showSearchModal = ref(false)
|
||||
|
||||
// 防抖函数
|
||||
// eslint-disable-next-line ts/no-unsafe-function-type
|
||||
const debounce = (func: Function, delay: number) => {
|
||||
|
@ -303,6 +378,7 @@ const handleSearch = () => {
|
|||
console.log('🔍 EquipmentSearch - 搜索表单数据:', searchForm)
|
||||
console.log('🔍 EquipmentSearch - 发送的搜索参数:', { ...searchForm })
|
||||
emit('search', { ...searchForm })
|
||||
showSearchModal.value = false
|
||||
}
|
||||
|
||||
const handleReset = () => {
|
||||
|
@ -315,43 +391,106 @@ const handleReset = () => {
|
|||
emit('reset')
|
||||
}
|
||||
|
||||
const handleCancel = () => {
|
||||
showSearchModal.value = false
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
reset: handleReset,
|
||||
getSearchForm: () => ({ ...searchForm }),
|
||||
showModal: () => { showSearchModal.value = true },
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.equipment-search-container {
|
||||
.search-card {
|
||||
.search-trigger {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 500;
|
||||
.search-modal {
|
||||
.arco-modal-header {
|
||||
padding: 20px 24px 16px;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
|
||||
.arco-modal-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
}
|
||||
|
||||
.arco-modal-body {
|
||||
padding: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.search-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
|
||||
.search-content {
|
||||
.search-form {
|
||||
.arco-form-item {
|
||||
margin-bottom: 0;
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.arco-form-item-label {
|
||||
font-weight: 500;
|
||||
color: var(--color-text-1);
|
||||
margin-bottom: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.arco-input,
|
||||
.arco-select {
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--color-border);
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--color-primary-light-3);
|
||||
}
|
||||
|
||||
&:focus,
|
||||
&.arco-input-focus,
|
||||
&.arco-select-focus {
|
||||
border-color: var(--color-primary);
|
||||
box-shadow: 0 0 0 2px rgba(var(--primary-6), 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.arco-input-inner {
|
||||
padding: 8px 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.arco-select-view {
|
||||
padding: 8px 12px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.arco-select-arrow {
|
||||
color: var(--color-text-3);
|
||||
}
|
||||
|
||||
.arco-input-inner::placeholder {
|
||||
color: var(--color-text-3);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.arco-input-clear-btn {
|
||||
color: var(--color-text-3);
|
||||
|
||||
&:hover {
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.search-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 16px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
margin-top: 32px;
|
||||
padding-top: 24px;
|
||||
border-top: 1px solid var(--color-border);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,23 +1,114 @@
|
|||
<template>
|
||||
<div class="equipment-center-container">
|
||||
<!-- 搜索组件 -->
|
||||
<EquipmentSearch
|
||||
:loading="loading"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
/>
|
||||
<!-- 页面头部 -->
|
||||
<div class="page-header">
|
||||
<div class="header-content">
|
||||
<div class="header-left">
|
||||
<div class="page-title">
|
||||
<IconDesktop style="font-size: 24px; margin-right: 12px; color: var(--color-primary);" />
|
||||
<h1>设备中心</h1>
|
||||
</div>
|
||||
<div class="page-description">
|
||||
管理和监控企业设备资产,包括设备信息、状态跟踪、维护记录等
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<a-space>
|
||||
<EquipmentSearch
|
||||
:loading="loading"
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
/>
|
||||
<a-button type="primary" @click="handleAdd" size="large">
|
||||
<template #icon>
|
||||
<IconPlus />
|
||||
</template>
|
||||
新增设备
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<!-- 统计卡片 -->
|
||||
<div class="stats-container">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="6">
|
||||
<a-card class="stat-card" :bordered="false">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
||||
<IconDesktop />
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-number">{{ pagination.total }}</div>
|
||||
<div class="stat-label">设备总数</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-card class="stat-card" :bordered="false">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
|
||||
<IconCheckCircle />
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-number">{{ getNormalCount() }}</div>
|
||||
<div class="stat-label">正常设备</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-card class="stat-card" :bordered="false">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);">
|
||||
<IconClockCircle />
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-number">{{ getInUseCount() }}</div>
|
||||
<div class="stat-label">使用中</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-card class="stat-card" :bordered="false">
|
||||
<div class="stat-content">
|
||||
<div class="stat-icon" style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);">
|
||||
<IconExclamationCircle />
|
||||
</div>
|
||||
<div class="stat-info">
|
||||
<div class="stat-number">{{ getMaintenanceCount() }}</div>
|
||||
<div class="stat-label">维护中</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<a-card class="table-card" :bordered="false">
|
||||
<template #title>
|
||||
<div class="card-title">
|
||||
<span>设备中心</span>
|
||||
<a-button type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<IconPlus />
|
||||
</template>
|
||||
新增设备
|
||||
</a-button>
|
||||
<span>设备列表</span>
|
||||
<div class="table-actions">
|
||||
<a-space>
|
||||
<a-button type="text" @click="refreshData">
|
||||
<template #icon>
|
||||
<IconRefresh />
|
||||
</template>
|
||||
刷新
|
||||
</a-button>
|
||||
<a-button type="text" @click="exportData">
|
||||
<template #icon>
|
||||
<IconDownload />
|
||||
</template>
|
||||
导出
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -129,7 +220,16 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, reactive, ref, watch } from 'vue'
|
||||
import { Modal } from '@arco-design/web-vue'
|
||||
import { IconPlus, IconRefresh, IconSearch } from '@arco-design/web-vue/es/icon'
|
||||
import {
|
||||
IconPlus,
|
||||
IconRefresh,
|
||||
IconSearch,
|
||||
IconDesktop,
|
||||
IconCheckCircle,
|
||||
IconClockCircle,
|
||||
IconExclamationCircle,
|
||||
IconDownload
|
||||
} from '@arco-design/web-vue/es/icon'
|
||||
import message from '@arco-design/web-vue/es/message'
|
||||
import DeviceModal from './components/DeviceModal.vue'
|
||||
import EquipmentSearch from './components/EquipmentSearch.vue'
|
||||
|
@ -637,6 +737,33 @@ const handleReturn = async (record: EquipmentResp) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 统计函数
|
||||
const getNormalCount = () => {
|
||||
return tableData.value.filter(item => item.equipmentStatus === 'normal').length
|
||||
}
|
||||
|
||||
const getInUseCount = () => {
|
||||
return tableData.value.filter(item => item.useStatus === '1').length
|
||||
}
|
||||
|
||||
const getMaintenanceCount = () => {
|
||||
return tableData.value.filter(item =>
|
||||
item.equipmentStatus === 'repair' ||
|
||||
item.locationStatus === 'repair'
|
||||
).length
|
||||
}
|
||||
|
||||
// 刷新数据
|
||||
const refreshData = () => {
|
||||
loadData()
|
||||
message.success('数据已刷新')
|
||||
}
|
||||
|
||||
// 导出数据
|
||||
const exportData = () => {
|
||||
message.info('导出功能开发中...')
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (record: EquipmentResp) => {
|
||||
// 检查设备状态,提供更详细的确认信息
|
||||
|
@ -725,22 +852,152 @@ onMounted(() => {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.equipment-center-container {
|
||||
padding: 16px;
|
||||
background: #f5f5f5;
|
||||
padding: 24px;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
min-height: 100vh;
|
||||
|
||||
.search-card {
|
||||
margin-bottom: 16px;
|
||||
// 页面头部样式
|
||||
.page-header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.header-left {
|
||||
.page-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
color: var(--color-text-1);
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
}
|
||||
|
||||
.page-description {
|
||||
color: var(--color-text-3);
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
|
||||
.header-right {
|
||||
.arco-space {
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 统计卡片样式
|
||||
.stats-container {
|
||||
margin-bottom: 24px;
|
||||
|
||||
.stat-card {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
|
||||
.stat-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 16px;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.stat-info {
|
||||
flex: 1;
|
||||
|
||||
.stat-number {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
color: var(--color-text-1);
|
||||
line-height: 1;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: var(--color-text-3);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 表格卡片样式
|
||||
.table-card {
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
||||
overflow: hidden;
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 24px;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
|
||||
span {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
|
||||
.table-actions {
|
||||
.arco-space {
|
||||
gap: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.arco-table {
|
||||
.arco-table-th {
|
||||
background: var(--color-fill-2);
|
||||
font-weight: 600;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
|
||||
.arco-table-td {
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.arco-table-tr:hover {
|
||||
background: var(--color-fill-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 状态点样式
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
|
@ -759,5 +1016,71 @@ onMounted(() => {
|
|||
.scrapped-dot {
|
||||
background-color: #ff4d4f;
|
||||
}
|
||||
|
||||
// 标签样式优化
|
||||
.arco-tag {
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
// 按钮样式优化
|
||||
.arco-btn {
|
||||
border-radius: 8px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
// 分页样式优化
|
||||
.arco-pagination {
|
||||
margin-top: 24px;
|
||||
justify-content: center;
|
||||
|
||||
.arco-pagination-item {
|
||||
border-radius: 6px;
|
||||
margin: 0 4px;
|
||||
|
||||
&.arco-pagination-item-active {
|
||||
background: var(--color-primary);
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 768px) {
|
||||
padding: 16px;
|
||||
|
||||
.page-header {
|
||||
padding: 16px;
|
||||
|
||||
.header-content {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 16px;
|
||||
|
||||
.header-right {
|
||||
width: 100%;
|
||||
|
||||
.arco-space {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.stats-container {
|
||||
.arco-col {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue