fix:bug修复,优化项目列表界面
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
import { downloadFileById } from '@/utils/file';
|
||||
import { get, post } from './index';
|
||||
// import { get, post } from './index';
|
||||
import { ElNotification, ElButton } from 'element-plus';
|
||||
import { h } from 'vue';
|
||||
import { get, post } from '@/api/request';
|
||||
|
||||
const env = import.meta.env;
|
||||
const PREFIX = env.VITE_API_PREFIX_APPLICATION;
|
||||
|
||||
// 获取电脑机器码
|
||||
export const getdeviceuuidApi = async () => {
|
||||
const res = await get('/getdeviceuuid');
|
||||
const res = await get(`${PREFIX}getdeviceuuid`);
|
||||
return res;
|
||||
};
|
||||
|
||||
// 启动应用
|
||||
export const execApi = async (params: any) => {
|
||||
const res = await get(`/exec?path=${params.path}¶m=${params.param}`);
|
||||
const res = await get(`${PREFIX}exec`, params);
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -21,7 +25,7 @@ export const execApi = async (params: any) => {
|
||||
* @returns
|
||||
*/
|
||||
export const checklocalresourceApi = async (params: any) => {
|
||||
const res = await post('/checklocalresource', params);
|
||||
const res = await post(`${PREFIX}checklocalresource`, params);
|
||||
return res;
|
||||
};
|
||||
|
||||
@@ -31,29 +35,27 @@ export const checklocalresourceApi = async (params: any) => {
|
||||
* @returns
|
||||
*/
|
||||
export const submittaskApi = async (params: any) => {
|
||||
const res = await post('/submittask', params);
|
||||
const res = await post(`${PREFIX}submittask`, params);
|
||||
return res;
|
||||
};
|
||||
|
||||
/**
|
||||
* 取消本地任务接口
|
||||
* @param params
|
||||
* @param params taskid
|
||||
* @returns
|
||||
*/
|
||||
export const canceltaskApi = async (params: any) => {
|
||||
const res = await get(`/canceltask?taskid=${params.taskId}`);
|
||||
const res = await get(`${PREFIX}canceltask`, params);
|
||||
return res;
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询本地任务日志接口
|
||||
* @param params
|
||||
* @param params taskid logfile page lines
|
||||
* @returns
|
||||
*/
|
||||
export const querytasklogApi = async (params: any) => {
|
||||
const res = await get(
|
||||
`/querytasklog?taskid=${params.taskId}&logfile=${params.logFile}&page=${params.page}&lines=${params.lines}`
|
||||
);
|
||||
const res = await get(`${PREFIX}querytasklog`, params);
|
||||
return res;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ const service = axios.create({
|
||||
// baseURL: 'https://localhost:8443/api',
|
||||
timeout: 60000,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
// 'Content-Type': 'application/json;charset=utf-8;',
|
||||
// 'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Content-Type': 'application/json;charset=utf-8;',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@ export default [
|
||||
name: 'Project',
|
||||
icon: Icons['Monitor'],
|
||||
children: [
|
||||
{
|
||||
title: '项目总览',
|
||||
path: '/project/projectOverview',
|
||||
name: 'projectOverview',
|
||||
component: () => import('@/views/task/projectOverview/index.vue'),
|
||||
},
|
||||
// {
|
||||
// title: '项目总览',
|
||||
// path: '/project/projectOverview',
|
||||
// name: 'projectOverview',
|
||||
// component: () => import('@/views/task/projectOverview/index.vue'),
|
||||
// },
|
||||
{
|
||||
title: '项目列表',
|
||||
path: '/project/projectList',
|
||||
|
||||
@@ -30,12 +30,12 @@ export default [
|
||||
name: 'Project',
|
||||
icon: Icons['Monitor'],
|
||||
children: [
|
||||
{
|
||||
title: '项目总览',
|
||||
path: '/project/projectOverview',
|
||||
name: 'projectOverview',
|
||||
component: () => import('@/views/task/projectOverview/index.vue'),
|
||||
},
|
||||
// {
|
||||
// title: '项目总览',
|
||||
// path: '/project/projectOverview',
|
||||
// name: 'projectOverview',
|
||||
// component: () => import('@/views/task/projectOverview/index.vue'),
|
||||
// },
|
||||
{
|
||||
title: '项目列表',
|
||||
path: '/project/projectList',
|
||||
|
||||
@@ -285,6 +285,7 @@
|
||||
ref="baseUploadTableRef"
|
||||
:actionList="uploadActionList"
|
||||
:hidePagination="true"
|
||||
:full-height="true"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-upload
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
:height="700"
|
||||
@close="closeFun"
|
||||
show-footer
|
||||
:zIndex="100"
|
||||
>
|
||||
<div class="page-inner">
|
||||
<el-tabs v-model="activeTab">
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<div class="gl-page-content-full" v-if="!showProjectDetailVisible">
|
||||
<div class="gl-page-content-full" v-if="!showProjectDetailVisible && !projectsDetailWindow">
|
||||
<div class="project-table-list">
|
||||
<BaseTable
|
||||
listTitle="项目数据"
|
||||
v-model:viewType="viewType"
|
||||
showIndex
|
||||
showCheckbox
|
||||
ref="baseTableRef"
|
||||
tableName="NODE_LIST_LEVEL1"
|
||||
:api="nodeListApi"
|
||||
@@ -94,6 +95,9 @@
|
||||
<el-button icon="plus" @click="openProjectInfoDiaFun('create')" type="primary">
|
||||
{{ $t('项目列表.新增') }}
|
||||
</el-button>
|
||||
<el-button type="primary" v-if="viewType === 'list'" @click="shwoProjectsFun"
|
||||
>查看</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
title="手动同步EP项目"
|
||||
v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])"
|
||||
@@ -142,6 +146,12 @@
|
||||
:projectUuid="currentProject.uuid"
|
||||
@goBack="showProjectDetailVisible = false"
|
||||
></ProjectDetail>
|
||||
|
||||
<projectOverview
|
||||
v-if="projectsDetailWindow"
|
||||
:projectUuid="projectUuids"
|
||||
@close="projectsDetailWindow = false"
|
||||
></projectOverview>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -169,6 +179,7 @@ import { ElMessageBox } from 'element-plus';
|
||||
import { PROJECT_EXE_STATUS_CODE } from '@/utils/enum/project';
|
||||
// import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
|
||||
// import { getUserId, getUserTenantId } from '@/utils/user';
|
||||
import projectOverview from '@/views/task/projectOverview/index.vue';
|
||||
|
||||
export interface IUserInfo {
|
||||
id: number;
|
||||
@@ -403,6 +414,22 @@ const getImgPathFun = (fileId: any) => {
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
const projectUuids = ref<any>([]);
|
||||
const projectsDetailWindow = ref(false);
|
||||
const shwoProjectsFun = () => {
|
||||
const projects: any = baseTableRef.value.tableRef.getCheckboxRecords(true) || [];
|
||||
projectUuids.value = [];
|
||||
if (projects.length) {
|
||||
projectUuids.value = projects.map((item: any) => {
|
||||
return item.uuid;
|
||||
});
|
||||
projectsDetailWindow.value = true;
|
||||
} else {
|
||||
ElMessage.warning('请选择一个或多个项目查看项目内容');
|
||||
}
|
||||
console.log(projects, 'projects');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-form inline :model="filterParamFormData">
|
||||
<el-form-item label="项目">
|
||||
<!-- <el-form-item label="项目">
|
||||
<el-select
|
||||
class="select-style200"
|
||||
v-model="filterParamFormData.projectNodeId"
|
||||
@@ -54,7 +54,7 @@
|
||||
:value="item.uuid"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="展开">
|
||||
<el-select
|
||||
class="select-style100"
|
||||
@@ -71,8 +71,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary">搜索</el-button>
|
||||
<el-button>清空</el-button>
|
||||
<el-button type="primary" @click="returnListFun">返回列表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -455,6 +454,7 @@
|
||||
:taskId="currentTaskInfo.id"
|
||||
:current-task-info="currentTaskInfo"
|
||||
@closeFn="showTaskDetailDialog = false"
|
||||
:show-approval="false"
|
||||
@updateFn="updateTaskInfoFun"
|
||||
>
|
||||
</taskDetail>
|
||||
@@ -483,17 +483,20 @@ import { poolCategoryTypeOptions } from '@/utils/project';
|
||||
import dictLabel from '@/components/common/treeCaseTable/dictLabel.vue';
|
||||
import uploadImg from '@/components/common/table/uploadImg.vue';
|
||||
import taskDetail from '@/views/task/projectDetail/components/taskDetail.vue';
|
||||
import {
|
||||
getChildrenNodeListApi,
|
||||
modifyNodeTaskPerformanceApi,
|
||||
queryNodeListApi,
|
||||
} from '@/api/project/node';
|
||||
import { modifyNodeTaskPerformanceApi } from '@/api/project/node';
|
||||
|
||||
const props = defineProps({
|
||||
projectUuid: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['close']);
|
||||
const baseTableRef = ref();
|
||||
const tableLoading = ref(false);
|
||||
const editMode = ref(false);
|
||||
const filterParamFormData = reactive({
|
||||
projectNodeId: '',
|
||||
const filterParamFormData = reactive<any>({
|
||||
projectNodeId: [],
|
||||
phaseNodeId: '',
|
||||
expandType: 'all',
|
||||
});
|
||||
@@ -532,8 +535,8 @@ const getTaskTreeListFun = async () => {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
const param = {
|
||||
projectNodeId: filterParamFormData.projectNodeId || '',
|
||||
phaseNodeId: filterParamFormData.phaseNodeId || '',
|
||||
projectNodeId: filterParamFormData.projectNodeId || [],
|
||||
// phaseNodeId: filterParamFormData.phaseNodeId || '',
|
||||
tagMap: tagMap.value,
|
||||
};
|
||||
|
||||
@@ -613,50 +616,6 @@ const updateTaskInfoFun = async (info: any) => {
|
||||
showTaskDetailDialog.value = false;
|
||||
};
|
||||
|
||||
const projectList = ref<any>([]);
|
||||
const queryProjectListFun = async () => {
|
||||
const param: any = {
|
||||
current: 1,
|
||||
size: 99999,
|
||||
nodeType: 'project',
|
||||
exeStatus: 1,
|
||||
};
|
||||
|
||||
try {
|
||||
const res: any = await queryNodeListApi(param);
|
||||
if (res && res.code === 200) {
|
||||
projectList.value = res.data.data;
|
||||
if (!filterParamFormData.projectNodeId) {
|
||||
filterParamFormData.projectNodeId = projectList.value[0].uuid;
|
||||
phaseList.value = [];
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error, 'error');
|
||||
}
|
||||
};
|
||||
const phaseList = ref<any>([]);
|
||||
|
||||
const getNodeDetailFun = async () => {
|
||||
const param = {
|
||||
current: 1,
|
||||
size: 999,
|
||||
nodeType: 'phase',
|
||||
nodeId: filterParamFormData.projectNodeId,
|
||||
};
|
||||
try {
|
||||
const res: any = await getChildrenNodeListApi(param);
|
||||
if (res && res.code === 200) {
|
||||
phaseList.value = res.data;
|
||||
if (!filterParamFormData.phaseNodeId) {
|
||||
filterParamFormData.phaseNodeId = phaseList.value[0].uuid;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error, 'error');
|
||||
}
|
||||
};
|
||||
|
||||
const expandTypeList = ref([
|
||||
{
|
||||
label: '全部',
|
||||
@@ -741,23 +700,16 @@ const getexpandKeysFun = (list: any, nodeType: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const changeSelectFun = async (flag: any) => {
|
||||
filterParamFormData.expandType = 'all';
|
||||
|
||||
if (flag === NODE_TYPE.PROJECT) {
|
||||
phaseList.value = [];
|
||||
filterParamFormData.phaseNodeId = '';
|
||||
if (filterParamFormData.projectNodeId) {
|
||||
await getNodeDetailFun();
|
||||
}
|
||||
}
|
||||
await getTaskTreeListFun();
|
||||
expandTreeFun();
|
||||
const returnListFun = () => {
|
||||
emits('close');
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await queryProjectListFun();
|
||||
await getNodeDetailFun();
|
||||
// await queryProjectListFun();
|
||||
// await getNodeDetailFun();
|
||||
if (props.projectUuid) {
|
||||
filterParamFormData.projectNodeId = props.projectUuid;
|
||||
}
|
||||
await getTaskTreeListFun();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
:params="searchParams"
|
||||
:api="getTaskListByDemandIdApi"
|
||||
hideSpecialSearch
|
||||
@show="showTaskDetailFun"
|
||||
></TaskTable>
|
||||
</div>
|
||||
<template #footer>
|
||||
@@ -26,15 +27,25 @@
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
<taskDetail
|
||||
v-if="showTaskDetailDialog"
|
||||
:taskId="currentTaskInfo.id"
|
||||
:currentTaskInfo="currentTaskInfo"
|
||||
@closeFn="showTaskDetailDialog = false"
|
||||
:showApproval="false"
|
||||
:show-footer="false"
|
||||
>
|
||||
</taskDetail>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
// import { ElMessage } from 'element-plus';
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import TaskTable from './taskTable.vue';
|
||||
import { getTaskListByDemandIdApi } from '@/api/project/task';
|
||||
import { getIdMap } from '../../projectDetail/components/project';
|
||||
import taskDetail from '@/views/task/projectDetail/components/taskDetail.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
showDialog: boolean;
|
||||
@@ -43,6 +54,8 @@ const props = defineProps<{
|
||||
phaseUid: string;
|
||||
}>();
|
||||
|
||||
const showTaskDetailDialog = ref(false);
|
||||
|
||||
const searchParams = computed(() => {
|
||||
return { demandId: props.demandUid, type: 2, idMap: getIdMap(props.projectUid, props.phaseUid) };
|
||||
});
|
||||
@@ -61,6 +74,12 @@ const closeFun = () => {
|
||||
emits('update:showDialog', false);
|
||||
};
|
||||
|
||||
const currentTaskInfo = ref({ id: '', uuid: '' });
|
||||
const showTaskDetailFun = (row: any) => {
|
||||
showTaskDetailDialog.value = true;
|
||||
currentTaskInfo.value = row;
|
||||
};
|
||||
|
||||
// const nextPageFun = () => {
|
||||
// if (hasSameValue()) return;
|
||||
// emits('update:currentProjectBaseInfo', { ...tableFormRef.value.getFormDataFun(), nodeType: NODE_TYPE.PROJECT });
|
||||
|
||||
Reference in New Issue
Block a user