项目管理页面重构0.5
This commit is contained in:
parent
ddbe28886d
commit
db3e771bbc
|
|
@ -157,6 +157,12 @@
|
|||
"navigationBarTitleText": "项目管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/project/search/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "项目搜索"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/notice/list/index",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -26,28 +26,21 @@
|
|||
<!-- 筛选面板 -->
|
||||
<view class="filter-panel" v-if="showFilter">
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">客户:</text>
|
||||
<input
|
||||
class="filter-input"
|
||||
v-model="filterParams.customerName"
|
||||
placeholder="请输入客户名称"
|
||||
/>
|
||||
</view>
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">项目编号:</text>
|
||||
<input
|
||||
class="filter-input"
|
||||
v-model="filterParams.projectId"
|
||||
placeholder="请输入项目编号"
|
||||
/>
|
||||
</view>
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">项目名称:</text>
|
||||
<input
|
||||
class="filter-input"
|
||||
v-model="filterParams.projectName"
|
||||
placeholder="请输入项目名称"
|
||||
/>
|
||||
<text class="filter-label">状态:</text>
|
||||
<view class="filter-options">
|
||||
<text
|
||||
class="filter-option"
|
||||
:class="{ 'active': filterParams.status === '' }"
|
||||
@click="filterParams.status = ''"
|
||||
>全部</text>
|
||||
<text
|
||||
class="filter-option"
|
||||
v-for="tab in filterStatusTabs"
|
||||
:key="tab.value"
|
||||
:class="{ 'active': filterParams.status === tab.value }"
|
||||
@click="filterParams.status = tab.value"
|
||||
>{{ tab.label }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="filter-item">
|
||||
<text class="filter-label">成员:</text>
|
||||
|
|
@ -69,17 +62,17 @@
|
|||
<text
|
||||
class="filter-option"
|
||||
:class="{ 'active': filterParams.overdue === '' }"
|
||||
@click="filterParams.overdue = ''; handleSearch()"
|
||||
@click="filterParams.overdue = ''"
|
||||
>全部</text>
|
||||
<text
|
||||
class="filter-option"
|
||||
:class="{ 'active': filterParams.overdue === true }"
|
||||
@click="filterParams.overdue = true; handleSearch()"
|
||||
@click="filterParams.overdue = true"
|
||||
>是</text>
|
||||
<text
|
||||
class="filter-option"
|
||||
:class="{ 'active': filterParams.overdue === false }"
|
||||
@click="filterParams.overdue = false; handleSearch()"
|
||||
@click="filterParams.overdue = false"
|
||||
>否</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -251,11 +244,9 @@ const userStore = useUserStore();
|
|||
|
||||
// 筛选参数
|
||||
const filterParams = ref({
|
||||
customerName: '',
|
||||
projectId: '',
|
||||
projectName: '',
|
||||
joinUserId: '',
|
||||
overdue: '', // ''表示全部, true表示是, false表示否
|
||||
status: '', // 筛选面板中的状态筛选
|
||||
});
|
||||
|
||||
// 默认状态字典(用于字典数据尚未加载时的兜底)
|
||||
|
|
@ -310,6 +301,15 @@ const mainStatusTabs = computed(() => {
|
|||
return mainTabs;
|
||||
});
|
||||
|
||||
// 筛选面板中的其他状态(除了开发中、维护中之外的所有状态)
|
||||
const filterStatusTabs = computed(() => {
|
||||
const allTabs = statusTabs.value;
|
||||
return allTabs.filter(tab =>
|
||||
tab.value !== 'IN_PROGRESS' &&
|
||||
tab.value !== 'MAINTENANCE'
|
||||
);
|
||||
});
|
||||
|
||||
// 当字典加载完成后确保当前选中状态仍然存在
|
||||
watch(statusTabs, (tabs) => {
|
||||
if (!Array.isArray(tabs) || tabs.length === 0) {
|
||||
|
|
@ -347,22 +347,17 @@ const {
|
|||
};
|
||||
|
||||
// 添加状态筛选
|
||||
// 优先使用顶部标签的状态,如果顶部标签是"全部",则使用筛选面板中的状态
|
||||
if (activeStatusTab.value && activeStatusTab.value !== 'ALL') {
|
||||
// 根据选中的状态标签设置statusList(使用字典键值)
|
||||
requestParams.statusList = [activeStatusTab.value];
|
||||
} else if (filterParams.value.status) {
|
||||
// 如果顶部标签是"全部",且筛选面板中有选择状态,则使用筛选面板的状态
|
||||
requestParams.statusList = [filterParams.value.status];
|
||||
}
|
||||
// 如果选择"全部",则不设置statusList,显示所有状态
|
||||
// 如果都没有选择,则不设置statusList,显示所有状态
|
||||
|
||||
// 添加其他筛选条件
|
||||
if (filterParams.value.customerName) {
|
||||
requestParams.customerName = filterParams.value.customerName;
|
||||
}
|
||||
if (filterParams.value.projectId) {
|
||||
requestParams.projectId = filterParams.value.projectId;
|
||||
}
|
||||
if (filterParams.value.projectName) {
|
||||
requestParams.projectName = filterParams.value.projectName;
|
||||
}
|
||||
if (filterParams.value.joinUserId) {
|
||||
requestParams.joinUserId = filterParams.value.joinUserId;
|
||||
}
|
||||
|
|
@ -797,11 +792,9 @@ const handleSearch = () => {
|
|||
// 重置
|
||||
const handleReset = () => {
|
||||
filterParams.value = {
|
||||
customerName: '',
|
||||
projectId: '',
|
||||
projectName: '',
|
||||
joinUserId: '',
|
||||
overdue: ''
|
||||
overdue: '',
|
||||
status: ''
|
||||
};
|
||||
selectedMemberName.value = '';
|
||||
handleSearch();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user