项目关闭后其他按钮优化

This commit is contained in:
weibl
2025-12-02 11:08:51 +08:00
parent 628d8a6120
commit e94349937b
2 changed files with 75 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
>
<template #leftOptions>
<el-button
:disabled="freeze"
icon="plus"
@click="openDialog('add')"
type="primary"
@@ -72,11 +73,24 @@ const PREFIX = env.VITE_API_PREFIX_PROJECT;
const { PROJECT_FILE_TYPE } = useDict('PROJECT_FILE_TYPE');
const props = defineProps<{
projectId: number;
projectName: string;
projectUuid: string;
}>();
const props = defineProps({
projectId: {
type: Number,
default: 0,
},
projectName: {
type: String,
default: '',
},
projectUuid: {
type: String,
default: '',
},
freeze: {
type: Boolean,
default: false,
},
});
const isEditDialog = ref(false);

View File

@@ -15,10 +15,29 @@
</div>
<div class="top-icons">
<el-button link @click="goProjectListFun">返回列表</el-button>
<el-button :disable="currentProjectInfo.exeStatus === PROJECT_EXE_STATUS_CODE.CLOSED" icon="setting" @click="openEditBasicDialogFun">项目设置</el-button>
<el-button icon="operation" @click="openEditNodeDialogFun">阶段设置</el-button>
<el-button icon="calendar" @click="openAddTaskDialogFun">仿真策划</el-button>
<el-button
:disabled="currentProjectInfo.exeStatus === PROJECT_EXE_STATUS_CODE.CLOSED"
icon="setting"
@click="openEditBasicDialogFun"
>
项目设置
</el-button>
<el-button
:disabled="currentProjectInfo.exeStatus === PROJECT_EXE_STATUS_CODE.CLOSED"
icon="operation"
@click="openEditNodeDialogFun"
>
阶段设置
</el-button>
<el-button
:disabled="currentProjectInfo.exeStatus === PROJECT_EXE_STATUS_CODE.CLOSED"
icon="calendar"
@click="openAddTaskDialogFun"
>
仿真策划
</el-button>
<el-popconfirm
v-if="currentProjectInfo.exeStatus === PROJECT_EXE_STATUS_CODE.COMPLETED"
title="项目关闭后,项目中的数据就无法再变更,确认是否关闭?"
@confirm="closeProject"
>
@@ -32,10 +51,15 @@
<!-- 标签页区域 -->
<el-tabs v-model="activeTab" type="card">
<el-tab-pane label="任务列表" name="taskList">
<loadcase ref="loadcaseRef" v-if="projectUuid" :projectUuid="projectUuid"/>
<loadcase
ref="loadcaseRef"
v-if="projectUuid"
:projectUuid="projectUuid"
@getPhaseList="getPhaseListFun"
/>
</el-tab-pane>
<el-tab-pane label="团队成员" name="teamMembers">
<teamMember v-if="projectUuid" :nodeLevel1Uuid="projectUuid"/>
<teamMember v-if="projectUuid" :nodeLevel1Uuid="projectUuid" />
</el-tab-pane>
<el-tab-pane label="统计分析" name="statAnalysis"></el-tab-pane>
<el-tab-pane label="项目文件" name="projectFiles">
@@ -44,10 +68,16 @@
:projectId="currentProjectInfo.id"
:projectUuid="currentProjectInfo.uuid"
:projectName="projectName"
freeze
/>
</el-tab-pane>
<el-tab-pane label="项目详情" name="projectDetail">
<baseInfo ref="basePageRef" @update:projectInfo="updateProjectInfo" v-if="projectUuid" :nodeId="projectUuid"/>
<baseInfo
ref="basePageRef"
@update:projectInfo="updateProjectInfo"
v-if="projectUuid"
:nodeId="projectUuid"
/>
</el-tab-pane>
</el-tabs>
</div>
@@ -165,7 +195,11 @@ const openEditNodeDialogFun = () => {
const showTaskDialog = ref(false);
const openAddTaskDialogFun = () => {
showTaskDialog.value = true;
if (phaseListLength.value === 0) {
ElMessage.warning('请先创建阶段');
} else {
showTaskDialog.value = true;
}
};
const currentProjectInfo = reactive<any>({
id: '',
@@ -185,7 +219,7 @@ const currentProjectInfo = reactive<any>({
memberList: [],
});
const updateProjectInfo = (projectInfo:any) => {
const updateProjectInfo = (projectInfo: any) => {
for (const key in currentProjectInfo) {
currentProjectInfo[key] = projectInfo[key];
}
@@ -208,7 +242,7 @@ const updateProjectInfo = (projectInfo:any) => {
// }
// };
const updateCurrentProjectBaseInfo = (projectInfo:any) => {
const updateCurrentProjectBaseInfo = (projectInfo: any) => {
for (const key in currentProjectInfo) {
currentProjectInfo[key] = projectInfo[key];
}
@@ -217,7 +251,7 @@ const updateCurrentProjectBaseInfo = (projectInfo:any) => {
const loadcaseRef = ref();
const completeFun = (page:string) => {
const completeFun = (page: string) => {
console.log('index completeFun', page);
if (page === 'projectBasePage') {
basePageRef.value.refresh();
@@ -231,8 +265,10 @@ const completeFun = (page:string) => {
}
};
const closeProject = async() => {
const res:any = await editNodeApi({ editNodeList: [{ uuid: props.projectUuid, exeStatus: PROJECT_EXE_STATUS_CODE.CLOSED }] });
const closeProject = async () => {
const res: any = await editNodeApi({
editNodeList: [{ uuid: props.projectUuid, exeStatus: PROJECT_EXE_STATUS_CODE.CLOSED }],
});
if (res && res.code === 200) {
ElMessage.success('关闭项目成功!');
} else {
@@ -240,6 +276,12 @@ const closeProject = async() => {
}
};
const phaseListLength = ref(0);
const getPhaseListFun = (length: number) => {
phaseListLength.value = length;
};
// if (route.query?.nodeId) {
// projectUuid.value = route.query?.nodeId;
// projectName.value = route.query?.nodeName;
@@ -260,11 +302,11 @@ const closeProject = async() => {
.app-container {
padding: 16px;
}
.select-content{
.select-content {
width: 500px;
display: flex;
align-items: center;
span{
span {
display: inline-block;
width: 100px;
white-space: nowrap;