页面美化,隐藏搜索字段成弹窗形式
This commit is contained in:
parent
eaec8547aa
commit
7246e8dc99
|
@ -1,208 +1,280 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="equipment-search-container">
|
<div class="equipment-search-container">
|
||||||
<a-card class="search-card" :bordered="false">
|
<!-- 搜索按钮 -->
|
||||||
<template #title>
|
<div class="search-trigger">
|
||||||
<div class="search-title">
|
<a-button type="primary" @click="showSearchModal = true">
|
||||||
|
<template #icon>
|
||||||
<IconSearch />
|
<IconSearch />
|
||||||
<span>设备搜索</span>
|
</template>
|
||||||
</div>
|
搜索设备
|
||||||
</template>
|
</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a-form layout="inline" :model="searchForm">
|
<!-- 搜索弹窗 -->
|
||||||
<div class="search-row">
|
<a-modal
|
||||||
<a-form-item label="设备名称">
|
v-model:visible="showSearchModal"
|
||||||
<a-input
|
title="设备搜索"
|
||||||
v-model="searchForm.equipmentName"
|
width="1000px"
|
||||||
placeholder="请输入设备名称"
|
:footer="false"
|
||||||
allow-clear
|
@cancel="handleCancel"
|
||||||
style="width: 200px"
|
class="search-modal"
|
||||||
@input="debouncedSearch"
|
>
|
||||||
/>
|
<div class="search-content">
|
||||||
</a-form-item>
|
<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-row :gutter="24">
|
||||||
<a-select
|
<a-col :span="8">
|
||||||
v-model="searchForm.equipmentType"
|
<a-form-item label="位置状态">
|
||||||
:options="equipmentTypeOptions"
|
<a-select
|
||||||
placeholder="请选择设备类型"
|
v-model="searchForm.locationStatus"
|
||||||
allow-clear
|
:options="locationStatusOptions"
|
||||||
style="width: 150px"
|
placeholder="请选择位置状态"
|
||||||
@change="debouncedSearch"
|
allow-clear
|
||||||
/>
|
@change="debouncedSearch"
|
||||||
</a-form-item>
|
/>
|
||||||
|
</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-row :gutter="24">
|
||||||
<a-select
|
<a-col :span="8">
|
||||||
v-model="searchForm.equipmentStatus"
|
<a-form-item label="使用部门/人">
|
||||||
:options="equipmentStatusOptions"
|
<a-input
|
||||||
placeholder="请选择设备状态"
|
v-model="searchForm.usingDepartment"
|
||||||
allow-clear
|
placeholder="请输入使用部门/人"
|
||||||
style="width: 150px"
|
allow-clear
|
||||||
@change="debouncedSearch"
|
@input="debouncedSearch"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</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-row :gutter="24">
|
||||||
<a-select
|
<a-col :span="8">
|
||||||
v-model="searchForm.locationStatus"
|
<a-form-item label="序列号">
|
||||||
:options="locationStatusOptions"
|
<a-input
|
||||||
placeholder="请选择位置状态"
|
v-model="searchForm.equipmentSn"
|
||||||
allow-clear
|
placeholder="请输入序列号"
|
||||||
style="width: 150px"
|
allow-clear
|
||||||
@change="debouncedSearch"
|
@input="debouncedSearch"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</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-row :gutter="24">
|
||||||
<a-form-item label="健康状态">
|
<a-col :span="8">
|
||||||
<a-select
|
<a-form-item label="设备型号">
|
||||||
v-model="searchForm.healthStatus"
|
<a-input
|
||||||
:options="healthStatusOptions"
|
v-model="searchForm.equipmentModel"
|
||||||
placeholder="请选择健康状态"
|
placeholder="请输入设备型号"
|
||||||
allow-clear
|
allow-clear
|
||||||
style="width: 150px"
|
@input="debouncedSearch"
|
||||||
@change="debouncedSearch"
|
/>
|
||||||
/>
|
</a-form-item>
|
||||||
</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-row :gutter="24">
|
||||||
<a-input
|
<a-col :span="8">
|
||||||
v-model="searchForm.usingDepartment"
|
<a-form-item label="发票">
|
||||||
placeholder="请输入使用部门/人"
|
<a-input
|
||||||
allow-clear
|
v-model="searchForm.invoice"
|
||||||
style="width: 200px"
|
placeholder="请输入发票"
|
||||||
@input="debouncedSearch"
|
allow-clear
|
||||||
/>
|
@input="debouncedSearch"
|
||||||
</a-form-item>
|
/>
|
||||||
|
</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-row :gutter="24">
|
||||||
<a-input
|
<a-col :span="12">
|
||||||
v-model="searchForm.invoice"
|
<a-form-item label="规格型号">
|
||||||
placeholder="请输入发票"
|
<a-input
|
||||||
allow-clear
|
v-model="searchForm.specification"
|
||||||
style="width: 150px"
|
placeholder="请输入规格型号"
|
||||||
@input="debouncedSearch"
|
allow-clear
|
||||||
/>
|
@input="debouncedSearch"
|
||||||
</a-form-item>
|
/>
|
||||||
|
</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
|
<div class="search-actions">
|
||||||
v-model="searchForm.barcode"
|
<a-space>
|
||||||
placeholder="请输入条码"
|
<a-button type="primary" @click="handleSearch" :loading="loading">
|
||||||
allow-clear
|
<template #icon>
|
||||||
style="width: 150px"
|
<IconSearch />
|
||||||
@input="debouncedSearch"
|
</template>
|
||||||
/>
|
搜索
|
||||||
</a-form-item>
|
</a-button>
|
||||||
</div>
|
<a-button @click="handleReset">
|
||||||
|
<template #icon>
|
||||||
<div class="search-row">
|
<IconRefresh />
|
||||||
<a-form-item label="序列号">
|
</template>
|
||||||
<a-input
|
重置
|
||||||
v-model="searchForm.equipmentSn"
|
</a-button>
|
||||||
placeholder="请输入序列号"
|
<a-button @click="handleCancel">
|
||||||
allow-clear
|
取消
|
||||||
style="width: 200px"
|
</a-button>
|
||||||
@input="debouncedSearch"
|
</a-space>
|
||||||
/>
|
</div>
|
||||||
</a-form-item>
|
</a-form>
|
||||||
|
</div>
|
||||||
<a-form-item label="资产编号">
|
</a-modal>
|
||||||
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { IconRefresh, IconSearch } from '@arco-design/web-vue/es/icon'
|
import { IconRefresh, IconSearch } from '@arco-design/web-vue/es/icon'
|
||||||
import type { EquipmentPageQuery } from '@/types/equipment.d'
|
import type { EquipmentPageQuery } from '@/types/equipment.d'
|
||||||
|
|
||||||
|
@ -220,6 +292,9 @@ const emit = defineEmits<{
|
||||||
reset: []
|
reset: []
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
// 弹窗控制
|
||||||
|
const showSearchModal = ref(false)
|
||||||
|
|
||||||
// 防抖函数
|
// 防抖函数
|
||||||
// eslint-disable-next-line ts/no-unsafe-function-type
|
// eslint-disable-next-line ts/no-unsafe-function-type
|
||||||
const debounce = (func: Function, delay: number) => {
|
const debounce = (func: Function, delay: number) => {
|
||||||
|
@ -303,6 +378,7 @@ const handleSearch = () => {
|
||||||
console.log('🔍 EquipmentSearch - 搜索表单数据:', searchForm)
|
console.log('🔍 EquipmentSearch - 搜索表单数据:', searchForm)
|
||||||
console.log('🔍 EquipmentSearch - 发送的搜索参数:', { ...searchForm })
|
console.log('🔍 EquipmentSearch - 发送的搜索参数:', { ...searchForm })
|
||||||
emit('search', { ...searchForm })
|
emit('search', { ...searchForm })
|
||||||
|
showSearchModal.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
|
@ -315,43 +391,106 @@ const handleReset = () => {
|
||||||
emit('reset')
|
emit('reset')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
showSearchModal.value = false
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
reset: handleReset,
|
reset: handleReset,
|
||||||
getSearchForm: () => ({ ...searchForm }),
|
getSearchForm: () => ({ ...searchForm }),
|
||||||
|
showModal: () => { showSearchModal.value = true },
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.equipment-search-container {
|
.equipment-search-container {
|
||||||
.search-card {
|
.search-trigger {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.search-title {
|
.search-modal {
|
||||||
display: flex;
|
.arco-modal-header {
|
||||||
align-items: center;
|
padding: 20px 24px 16px;
|
||||||
gap: 8px;
|
border-bottom: 1px solid var(--color-border);
|
||||||
font-weight: 500;
|
|
||||||
|
.arco-modal-title {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--color-text-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.arco-modal-body {
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.search-row {
|
.search-content {
|
||||||
display: flex;
|
.search-form {
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 16px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
|
|
||||||
.arco-form-item {
|
.arco-form-item {
|
||||||
margin-bottom: 0;
|
margin-bottom: 20px;
|
||||||
flex: 0 0 auto;
|
|
||||||
|
.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 {
|
.search-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 16px;
|
margin-top: 32px;
|
||||||
padding-top: 16px;
|
padding-top: 24px;
|
||||||
border-top: 1px solid #f0f0f0;
|
border-top: 1px solid var(--color-border);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,23 +1,114 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="equipment-center-container">
|
<div class="equipment-center-container">
|
||||||
<!-- 搜索组件 -->
|
<!-- 页面头部 -->
|
||||||
<EquipmentSearch
|
<div class="page-header">
|
||||||
:loading="loading"
|
<div class="header-content">
|
||||||
@search="handleSearch"
|
<div class="header-left">
|
||||||
@reset="handleReset"
|
<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">
|
<a-card class="table-card" :bordered="false">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<span>设备中心</span>
|
<span>设备列表</span>
|
||||||
<a-button type="primary" @click="handleAdd">
|
<div class="table-actions">
|
||||||
<template #icon>
|
<a-space>
|
||||||
<IconPlus />
|
<a-button type="text" @click="refreshData">
|
||||||
</template>
|
<template #icon>
|
||||||
新增设备
|
<IconRefresh />
|
||||||
</a-button>
|
</template>
|
||||||
|
刷新
|
||||||
|
</a-button>
|
||||||
|
<a-button type="text" @click="exportData">
|
||||||
|
<template #icon>
|
||||||
|
<IconDownload />
|
||||||
|
</template>
|
||||||
|
导出
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -129,7 +220,16 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, reactive, ref, watch } from 'vue'
|
import { onMounted, reactive, ref, watch } from 'vue'
|
||||||
import { Modal } from '@arco-design/web-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 message from '@arco-design/web-vue/es/message'
|
||||||
import DeviceModal from './components/DeviceModal.vue'
|
import DeviceModal from './components/DeviceModal.vue'
|
||||||
import EquipmentSearch from './components/EquipmentSearch.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) => {
|
const handleDelete = async (record: EquipmentResp) => {
|
||||||
// 检查设备状态,提供更详细的确认信息
|
// 检查设备状态,提供更详细的确认信息
|
||||||
|
@ -725,22 +852,152 @@ onMounted(() => {
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.equipment-center-container {
|
.equipment-center-container {
|
||||||
padding: 16px;
|
padding: 24px;
|
||||||
background: #f5f5f5;
|
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||||
min-height: 100vh;
|
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 {
|
.table-card {
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
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 {
|
.status-dot {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
|
@ -759,5 +1016,71 @@ onMounted(() => {
|
||||||
.scrapped-dot {
|
.scrapped-dot {
|
||||||
background-color: #ff4d4f;
|
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>
|
</style>
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue