0929
This commit is contained in:
@ -24,6 +24,9 @@
|
||||
<!-- 筛选栏 -->
|
||||
<div class="filter-bar">
|
||||
<div class="filter-container">
|
||||
<div class="filter-item">
|
||||
<el-input v-model="keyword" placeholder="关键字(标题/描述/创建人/编号)" clearable @keyup.enter="handleSearch" />
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<el-select v-model="workOrderType" placeholder="工单类型" clearable>
|
||||
<el-option label="全部类型" value="all"></el-option>
|
||||
@ -55,6 +58,7 @@
|
||||
</div>
|
||||
<div class="filter-actions">
|
||||
<el-button type="primary" icon="Search" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||
<el-button icon="Refresh" class="create-btn" @click="resetFilters">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -509,6 +513,7 @@ import ImageUpload from '@/components/ImageUpload/index.vue';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
|
||||
// 筛选条件
|
||||
const keyword = ref('');
|
||||
const workOrderType = ref('all');
|
||||
const workOrderStatus = ref('all');
|
||||
const priority = ref('all');
|
||||
@ -750,6 +755,18 @@ const pagedTableData = computed(() => {
|
||||
// 筛选逻辑
|
||||
let filteredData = [...rawTableData.value];
|
||||
|
||||
if (keyword.value && keyword.value.trim()) {
|
||||
const kw = keyword.value.trim();
|
||||
filteredData = filteredData.filter((item) => {
|
||||
return (
|
||||
(item.title && item.title.includes(kw)) ||
|
||||
(item.description && item.description.includes(kw)) ||
|
||||
(item.creator && item.creator.includes(kw)) ||
|
||||
(item.orderNo && item.orderNo.includes(kw))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (workOrderType.value !== 'all') {
|
||||
// 转换筛选条件为显示文本进行匹配
|
||||
let typeText = '';
|
||||
@ -862,6 +879,16 @@ const handleSearch = () => {
|
||||
currentPage.value = 1; // 重置到第一页
|
||||
};
|
||||
|
||||
// 重置筛选
|
||||
const resetFilters = () => {
|
||||
keyword.value = '';
|
||||
workOrderType.value = 'all';
|
||||
workOrderStatus.value = 'all';
|
||||
priority.value = 'all';
|
||||
createDate.value = '';
|
||||
currentPage.value = 1;
|
||||
};
|
||||
|
||||
// 分页事件
|
||||
const handleSizeChange = (val) => {
|
||||
pageSize.value = val;
|
||||
@ -1763,46 +1790,7 @@ const handleCloseDetailDialog = () => {
|
||||
}
|
||||
|
||||
/* 导航栏样式 */
|
||||
.navigation-tabs {
|
||||
display: flex;
|
||||
margin-bottom: 20px;
|
||||
background-color: #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.nav-tab {
|
||||
padding: 12px 24px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
border-right: 1px solid #f0f0f0;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nav-tab:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.nav-tab:hover {
|
||||
color: #409eff;
|
||||
background-color: #ecf5ff;
|
||||
}
|
||||
|
||||
.nav-tab.active {
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
|
||||
}
|
||||
|
||||
.nav-tab {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
/* 已注释的导航栏样式移除 */
|
||||
|
||||
/* 弹窗样式 */
|
||||
.create-dialog {
|
||||
|
||||
Reference in New Issue
Block a user