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