merge
This commit is contained in:
@@ -23,14 +23,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flow-view-box" v-loading="contentLoading">
|
||||
<div id="flow-view-content">
|
||||
</div>
|
||||
<div id="flow-view-content"></div>
|
||||
</div>
|
||||
<TeleportContainer />
|
||||
<FlowConfig v-model="drawerVisible" :nodeAttribute="nodeAttribute"></FlowConfig>
|
||||
<FlowConfig v-model:drawerVisible="drawerVisible" :nodeAttribute="nodeAttribute"></FlowConfig>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { getTeleport } from '@antv/x6-vue-shape';
|
||||
import { queryFlowTemplateDetailApi, queryFlowTemplateVersionApi } from '@/api/capability/flow';
|
||||
@@ -74,8 +72,8 @@ const nodeAttribute = ref();
|
||||
|
||||
const drawerVisible = ref(false);
|
||||
|
||||
const getFlowVersionOptions = async() => {
|
||||
const params:any = {};
|
||||
const getFlowVersionOptions = async () => {
|
||||
const params: any = {};
|
||||
if (props.flowUuid) {
|
||||
params.code = props.flowUuid;
|
||||
params.type = 0;
|
||||
@@ -83,7 +81,7 @@ const getFlowVersionOptions = async() => {
|
||||
params.code = props.flowCode;
|
||||
params.type = 1;
|
||||
}
|
||||
const res:any = await queryFlowTemplateVersionApi(params);
|
||||
const res: any = await queryFlowTemplateVersionApi(params);
|
||||
if (res.code === 200) {
|
||||
flowVersionOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
@@ -107,9 +105,9 @@ const changeVersionFun = () => {
|
||||
|
||||
const contentLoading = ref(false);
|
||||
|
||||
const getFlowDetail = async(uuid:string) => {
|
||||
const getFlowDetail = async (uuid: string) => {
|
||||
contentLoading.value = true;
|
||||
const res:any = await queryFlowTemplateDetailApi({ uuid: uuid, status: 1 });
|
||||
const res: any = await queryFlowTemplateDetailApi({ uuid: uuid, status: 1 });
|
||||
if (res.code === 200) {
|
||||
if (res.data.viewContent.length > 50) {
|
||||
const dataJson = JSON.parse(res.data.viewContent);
|
||||
@@ -127,7 +125,7 @@ const getFlowDetail = async(uuid:string) => {
|
||||
}
|
||||
};
|
||||
|
||||
const initGraph = async() => {
|
||||
const initGraph = async () => {
|
||||
graph.value = new Graph({
|
||||
panning: {
|
||||
enabled: true,
|
||||
@@ -146,12 +144,21 @@ const initGraph = async() => {
|
||||
background: {
|
||||
color: '#F2F7FA',
|
||||
},
|
||||
connecting: {
|
||||
connector: { name: 'smooth' },
|
||||
connectionPoint: 'anchor',
|
||||
allowBlank: false,
|
||||
snap: { radius: 20 },
|
||||
allowEdge: false,
|
||||
allowLoop: false,
|
||||
highlight: true,
|
||||
},
|
||||
});
|
||||
registerCustomNode();
|
||||
const nodeList = await getNodeList();
|
||||
createNode(nodeList, graph.value);
|
||||
|
||||
graph.value.on('node:click', ({ node }:any) => {
|
||||
graph.value.on('node:click', ({ node }: any) => {
|
||||
console.log('click node', node);
|
||||
if (node.data.isApp) {
|
||||
nodeAttribute.value = node.data;
|
||||
@@ -160,7 +167,7 @@ const initGraph = async() => {
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async() => {
|
||||
onMounted(async () => {
|
||||
setTimeout(async () => {
|
||||
await initGraph();
|
||||
if (props.type === 'review') {
|
||||
@@ -186,16 +193,14 @@ onMounted(async() => {
|
||||
// console.log('e', e);
|
||||
// });
|
||||
});
|
||||
|
||||
</script>
|
||||
<style lang="scss" >
|
||||
<style lang="scss">
|
||||
.flow-view-box {
|
||||
height: calc(100% - 40px);
|
||||
|
||||
}
|
||||
#header-box {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
margin-bottom: var(--margin-medium);
|
||||
}
|
||||
#header-box {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
margin-bottom: var(--margin-medium);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -14,16 +14,12 @@ let selectNode: any = null;
|
||||
export const initNodeEvents = (graph: any) => {
|
||||
graph.on('node:mouseenter', () => {
|
||||
const container = document.getElementById(FLOW_CREATE_ID)!;
|
||||
const ports = container.querySelectorAll(
|
||||
'.x6-port-body'
|
||||
) as NodeListOf<SVGElement>;
|
||||
const ports = container.querySelectorAll('.x6-port-body') as NodeListOf<SVGElement>;
|
||||
showPorts(ports, true);
|
||||
});
|
||||
graph.on('node:mouseleave', () => {
|
||||
const container = document.getElementById(FLOW_CREATE_ID)!;
|
||||
const ports = container.querySelectorAll(
|
||||
'.x6-port-body'
|
||||
) as NodeListOf<SVGElement>;
|
||||
const ports = container.querySelectorAll('.x6-port-body') as NodeListOf<SVGElement>;
|
||||
showPorts(ports, false);
|
||||
});
|
||||
graph.on('node:selected', () => {
|
||||
@@ -31,21 +27,18 @@ export const initNodeEvents = (graph: any) => {
|
||||
// const flowElement = document.getElementById('flow-create-content') as HTMLElement;
|
||||
// flowElement.tabIndex = -1;
|
||||
// flowElement.focus();
|
||||
|
||||
});
|
||||
graph.on('node:unselected', ({ node }:any) => {
|
||||
graph.on('node:unselected', ({ node }: any) => {
|
||||
console.log('unselected node', node);
|
||||
node.removeTools();
|
||||
const container = document.getElementById(FLOW_CREATE_ID)!;
|
||||
const ports = container.querySelectorAll(
|
||||
'.x6-port-body'
|
||||
) as NodeListOf<SVGElement>;
|
||||
const ports = container.querySelectorAll('.x6-port-body') as NodeListOf<SVGElement>;
|
||||
showPorts(ports, false);
|
||||
drawerVisible.value = false;
|
||||
selectNode = null;
|
||||
});
|
||||
|
||||
graph.on('node:click', ({ node }:any) => {
|
||||
graph.on('node:click', ({ node }: any) => {
|
||||
console.log('click node', node, node.data);
|
||||
if (node.data.isApp) {
|
||||
drawerVisible.value = true;
|
||||
@@ -73,6 +66,24 @@ export const initNodeEvents = (graph: any) => {
|
||||
},
|
||||
});
|
||||
});
|
||||
graph.on('edge:click', ({ edge }: any) => {
|
||||
// graph.cleanSelection();
|
||||
edge.addTools({
|
||||
name: 'boundary',
|
||||
args: {
|
||||
padding: 5,
|
||||
attrs: {
|
||||
// fill: '#7c68fc',
|
||||
stroke: '#333',
|
||||
'stroke-width': 0.5,
|
||||
'fill-opacity': 0.2,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
graph.on('edge:unselected', ({ edge }: any) => {
|
||||
edge.removeTools();
|
||||
});
|
||||
};
|
||||
|
||||
export const useNodeEvents = () => {
|
||||
@@ -128,12 +139,15 @@ const zoomOutFun = (graph: any) => {
|
||||
const xAlign = (graph: any) => {
|
||||
const nodes = graph.getSelectedCells();
|
||||
if (nodes.length > 2) {
|
||||
nodes.sort((a:any, b:any) => {
|
||||
nodes.sort((a: any, b: any) => {
|
||||
return a.position().x - b.position().x;
|
||||
});
|
||||
const xLength = nodes[1].position().x - nodes[0].position().x - nodes[0].size().width;
|
||||
for (let index = 2; index < nodes.length; index++) {
|
||||
nodes[index].position(nodes[index - 1].position().x + nodes[index - 1].size().width + xLength, nodes[index].position().y);
|
||||
nodes[index].position(
|
||||
nodes[index - 1].position().x + nodes[index - 1].size().width + xLength,
|
||||
nodes[index].position().y
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ElMessage.warning('请框选超过 2 个节点!');
|
||||
@@ -185,7 +199,7 @@ export const nodeAttribute = reactive<any>({
|
||||
pageConfigList: [],
|
||||
});
|
||||
|
||||
export const updateNodeAttribute = (val:any) => {
|
||||
export const updateNodeAttribute = (val: any) => {
|
||||
for (const key in val) {
|
||||
nodeAttribute[key] = val[key];
|
||||
}
|
||||
@@ -193,4 +207,3 @@ export const updateNodeAttribute = (val:any) => {
|
||||
selectNode.setData(nodeAttribute);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="comp-content">
|
||||
|
||||
<!-- <el-button @click="openTaskDetailDialogFun()">
|
||||
测试打开任务详情
|
||||
</el-button> -->
|
||||
@@ -10,13 +9,15 @@
|
||||
:data="tableList"
|
||||
readonly
|
||||
:loading="tableLoading"
|
||||
:specialActionList="[{
|
||||
title: '查看详情',
|
||||
type: 'primary',
|
||||
click: (row: any) => {
|
||||
openTaskDetailDialogFun(row);
|
||||
:specialActionList="[
|
||||
{
|
||||
title: '查看详情',
|
||||
type: 'primary',
|
||||
click: (row: any) => {
|
||||
openTaskDetailDialogFun(row);
|
||||
},
|
||||
},
|
||||
}]"
|
||||
]"
|
||||
>
|
||||
<template #otherLeftOptions>
|
||||
<el-form label-width="60">
|
||||
@@ -43,7 +44,6 @@
|
||||
@click="openTaskDetailDialogFun(row)"
|
||||
>查看详情</el-button>
|
||||
</template> -->
|
||||
|
||||
</loadCaseTable>
|
||||
|
||||
<!-- <loadcase-pro-table
|
||||
@@ -118,6 +118,8 @@ const props = defineProps<{
|
||||
projectUuid: string;
|
||||
}>();
|
||||
|
||||
const emits = defineEmits(['getPhaseList']);
|
||||
|
||||
const tableList = ref<any[]>([]);
|
||||
const tableLoading = ref(false);
|
||||
const phaseUuid = ref<any>('');
|
||||
@@ -165,9 +167,11 @@ const getPhaseListApi = async () => {
|
||||
// console.log('nodeLevel2ListOptions', nodeLevel2ListOptions.value);
|
||||
if (phaseListOptions.value.length) {
|
||||
// 没选中阶段 或者 选中了阶段但是不在阶段列表中
|
||||
if (!phaseListOptions.value.some(item => {
|
||||
return phaseUuid.value === item.value;
|
||||
})) {
|
||||
if (
|
||||
!phaseListOptions.value.some((item) => {
|
||||
return phaseUuid.value === item.value;
|
||||
})
|
||||
) {
|
||||
phaseUuid.value = phaseListOptions.value[0].value;
|
||||
updatePhaseUuid(phaseListOptions.value[0].value);
|
||||
}
|
||||
@@ -175,6 +179,7 @@ const getPhaseListApi = async () => {
|
||||
} else {
|
||||
phaseListOptions.value = [];
|
||||
}
|
||||
emits('getPhaseList', phaseListOptions.value.length);
|
||||
};
|
||||
|
||||
const showTaskDetailDialog = ref(false);
|
||||
@@ -188,14 +193,14 @@ const openTaskDetailDialogFun = (row?: any) => {
|
||||
showTaskDetailDialog.value = true;
|
||||
};
|
||||
|
||||
const updateTaskInfoFun = async (info:any) => {
|
||||
const { flag, data }:any = info;
|
||||
const updateTaskInfoFun = async (info: any) => {
|
||||
const { flag, data }: any = info;
|
||||
|
||||
console.log(flag, 'flag');
|
||||
console.log(data, 'data');
|
||||
|
||||
if (flag === 'info') {
|
||||
const res:any = await modifyNodeTaskPerformanceApi({
|
||||
const res: any = await modifyNodeTaskPerformanceApi({
|
||||
addNodeList: [],
|
||||
editNodeList: [data],
|
||||
deleteNodeList: [],
|
||||
@@ -209,7 +214,6 @@ const updateTaskInfoFun = async (info:any) => {
|
||||
}
|
||||
|
||||
showTaskDetailDialog.value = false;
|
||||
|
||||
};
|
||||
|
||||
const refreshPhaseList = () => {
|
||||
@@ -242,11 +246,10 @@ defineExpose({
|
||||
refreshPhaseList,
|
||||
getTaskTreeList,
|
||||
});
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.export-btn {
|
||||
margin-right: var(--margin-small)
|
||||
margin-right: var(--margin-small);
|
||||
}
|
||||
.comp-content {
|
||||
height: 100%;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<!-- 我确认的 -->
|
||||
<div class="gl-page-content">
|
||||
<demandTable
|
||||
:row-config="{keyField:'uuid'}"
|
||||
:row-config="{ keyField: 'uuid' }"
|
||||
showCheckbox
|
||||
showIndex
|
||||
ref="tableRef"
|
||||
tableName="SIMULATION_TASK_DEMAND_CONFIRM"
|
||||
:params="{type:1}"
|
||||
:params="{ type: 1 }"
|
||||
:api="demandListApi"
|
||||
exportFileName="我确认的需求"
|
||||
>
|
||||
@@ -23,51 +23,11 @@
|
||||
</div>
|
||||
</template>
|
||||
</demandTable>
|
||||
<!-- <BaseTable
|
||||
showCheckbox
|
||||
showIndex
|
||||
tableName="SIMULATION_TASK_DEMAND_CONFIRM"
|
||||
:params="{type:1}"
|
||||
:api="demandListApi"
|
||||
:searchLimitNum="3"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-button type="primary" @click="bachSendVisible = true">批量分发</el-button>
|
||||
</template>
|
||||
<template #demandStatus="{row}">
|
||||
{{ DEMAND_STATUS_MAP[row.demandStatus as keyof typeof DEMAND_STATUS_MAP] }}
|
||||
</template>
|
||||
<template #achieveStatus="{row}">
|
||||
{{ TASK_CALCULATE_STATUS_OBJ[row.achieveStatus as keyof typeof DEMAND_STATUS_MAP] || '未分析' }}
|
||||
</template>
|
||||
<template #progress="{ row }">
|
||||
{{ row.progress }}%
|
||||
</template>
|
||||
<template #approvalStatus="{ row }">
|
||||
{{ row.approvalStatus || '未审批' }}
|
||||
</template>
|
||||
<template #attachment="{ row }">
|
||||
<el-link type="primary" @click="seeAttachments(row.id)">附件</el-link>
|
||||
</template>
|
||||
<template #projectId="{ row }">
|
||||
{{ row.projectName }}
|
||||
</template>
|
||||
<template #phaseId="{ row }">
|
||||
{{ row.phaseName }}
|
||||
</template>
|
||||
<template #demandType="{row}">
|
||||
{{ DEMAND_TYPE.O[row.demandType] }}
|
||||
</template>
|
||||
<template #simType="{row}">
|
||||
{{ disposeSimType(row.demandType,row.simType) }}
|
||||
</template>
|
||||
<template #tableActions="{ row }">
|
||||
<div class="gl-table-actions">
|
||||
<el-link type="primary" @click="sendTaskFun(row)">分发</el-link>
|
||||
</div>
|
||||
</template>
|
||||
</BaseTable> -->
|
||||
<batchSendTask v-if="bachSendVisible" :checkedList="checkedList" v-model:diaVisible="bachSendVisible"></batchSendTask>
|
||||
<batchSendTask
|
||||
v-if="bachSendVisible"
|
||||
:checkedList="checkedList"
|
||||
v-model:diaVisible="bachSendVisible"
|
||||
></batchSendTask>
|
||||
<Dialog
|
||||
v-model="sendVisible"
|
||||
:loading="loadingInterface"
|
||||
@@ -86,7 +46,7 @@
|
||||
v-model="sendForm.insertIndex"
|
||||
:data="indexTreeData"
|
||||
node-key="uuid"
|
||||
:props="{label:'nodeName',value:'uuid'}"
|
||||
:props="{ label: 'nodeName', value: 'uuid' }"
|
||||
default-expand-all
|
||||
:render-after-expand="false"
|
||||
>
|
||||
@@ -105,26 +65,40 @@
|
||||
<el-select
|
||||
class="loadcase-lib"
|
||||
:teleported="false"
|
||||
v-model='sendForm.currentLoadcaseLib'
|
||||
:props="{label:'poolName', value:'value'}"
|
||||
v-model="sendForm.currentLoadcaseLib"
|
||||
:props="{ label: 'poolName', value: 'value' }"
|
||||
value-key="poolName"
|
||||
:fit-input-width="true"
|
||||
@change="changeLoadcaseLibFun"
|
||||
>
|
||||
<el-option v-for="item in loadcaseLibList" :key="item.value" :label="item.poolName" :value="item" />
|
||||
<el-option
|
||||
v-for="item in loadcaseLibList"
|
||||
:key="item.value"
|
||||
:label="item.poolName"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本:" prop="currentLoadcaseLibVersion" v-if="insertTaskMode === 'lib'">
|
||||
<el-form-item
|
||||
label="版本:"
|
||||
prop="currentLoadcaseLibVersion"
|
||||
v-if="insertTaskMode === 'lib'"
|
||||
>
|
||||
<el-select
|
||||
class="version"
|
||||
:teleported="false"
|
||||
v-model='sendForm.currentLoadcaseLibVersion'
|
||||
:props="{label:'poolVersion', value:'value'}"
|
||||
v-model="sendForm.currentLoadcaseLibVersion"
|
||||
:props="{ label: 'poolVersion', value: 'value' }"
|
||||
value-key="poolVersion"
|
||||
:fit-input-width="true"
|
||||
@change="changeLoadcaseVersionFun"
|
||||
>
|
||||
<el-option v-for="item in loadcaseLibVersionList" :key="item.value" :label="item.poolVersion" :value="item" />
|
||||
<el-option
|
||||
v-for="item in loadcaseLibVersionList"
|
||||
:key="item.value"
|
||||
:label="item.poolVersion"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- {{ insertTaskMode }}
|
||||
@@ -142,7 +116,7 @@
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="flex items-center">
|
||||
<img class="loadcase-img" src="@/assets/imgs/projectTree/loadcase.png" alt="">
|
||||
<img class="loadcase-img" src="@/assets/imgs/projectTree/loadcase.png" alt="" />
|
||||
<span>{{ item.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
@@ -170,10 +144,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="仿真执行人:" prop="eMemberList">
|
||||
<UserSelect
|
||||
v-model="sendForm.eMemberList"
|
||||
:multiple="true"
|
||||
/>
|
||||
<UserSelect v-model="sendForm.eMemberList" :multiple="true" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <TableForm ref="tableFormRef" tableName="SIMULATION_TASK_DEMAND_CONFIRM" >
|
||||
@@ -185,7 +156,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
<attachments :demandId="demandInfo.id" v-model:visible="attachmentsVisible" ></attachments>
|
||||
<attachments :demandId="demandInfo.id" v-model:visible="attachmentsVisible"></attachments>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -196,7 +167,11 @@ import { demandListApi, issuedTaskApi } from '@/api/project/demand';
|
||||
import attachments from '@/views/task/simulationTask/components/attachments.vue';
|
||||
// import { CommonStore } from '@/stores/common';
|
||||
import UserSelect from '@/components/common/userSelect/index.vue';
|
||||
import { getAllTaskPoolApi, getTaskPoolLoadcasesApi, getTaskPoolVersionsApi } from '@/api/task/taskpool';
|
||||
import {
|
||||
getAllTaskPoolApi,
|
||||
getTaskPoolLoadcasesApi,
|
||||
getTaskPoolVersionsApi,
|
||||
} from '@/api/task/taskpool';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import demandTable from '../components/demandTable.vue';
|
||||
import { getTaskTreeFun } from '../../projectDetail/components/projectApi';
|
||||
@@ -242,7 +217,7 @@ const insertTaskMode = ref('lib');
|
||||
const loadcaseLibList = ref<any[]>([]);
|
||||
const loadcaseLibVersionList = ref();
|
||||
|
||||
const changeLoadcaseLibFun = (lib:any) => {
|
||||
const changeLoadcaseLibFun = (lib: any) => {
|
||||
sendForm.currentLoadcaseLib = lib;
|
||||
queryLoadcaseLibVersionsFun();
|
||||
};
|
||||
@@ -268,7 +243,7 @@ const queryLoadcaseLibVersionsFun = async () => {
|
||||
const req = {
|
||||
poolName: sendForm.currentLoadcaseLib.poolName,
|
||||
};
|
||||
const res:any = await getTaskPoolVersionsApi(req);
|
||||
const res: any = await getTaskPoolVersionsApi(req);
|
||||
if (res.code === 200 && res.data && Array.isArray(res.data) && res.data.length > 0) {
|
||||
loadcaseLibVersionList.value = res.data;
|
||||
if (loadcaseLibVersionList.value.length > 0) {
|
||||
@@ -289,45 +264,31 @@ const getLoadcaseList = async () => {
|
||||
version: sendForm.currentLoadcaseLibVersion.poolVersion,
|
||||
});
|
||||
if (res.code === 200) {
|
||||
libTaskList.value = res.data.map((item:any) => {
|
||||
libTaskList.value = res.data.map((item: any) => {
|
||||
return {
|
||||
label: item.nodeName,
|
||||
value: item,
|
||||
};
|
||||
})
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const sendFormRef = ref();
|
||||
|
||||
const sendFormRules = reactive<any>({
|
||||
insertIndex: [
|
||||
{ required: true, message: '请选择上层节点', trigger: 'change' },
|
||||
],
|
||||
currentLoadcaseLib: [
|
||||
{ required: true, message: '请选择工况库', trigger: 'change' },
|
||||
],
|
||||
currentLoadcaseLibVersion: [
|
||||
{ required: true, message: '请选择工况库版本', trigger: 'change' },
|
||||
],
|
||||
chooseTaskList: [
|
||||
{ required: true, message: '请选择分发的任务', trigger: 'change' },
|
||||
],
|
||||
eMemberList: [
|
||||
{ required: true, message: '请选择仿真执行人', trigger: 'change' },
|
||||
],
|
||||
taskName: [
|
||||
{ required: true, message: '请填写任务名称', trigger: 'blur' },
|
||||
],
|
||||
insertIndex: [{ required: true, message: '请选择上层节点', trigger: 'change' }],
|
||||
currentLoadcaseLib: [{ required: true, message: '请选择工况库', trigger: 'change' }],
|
||||
currentLoadcaseLibVersion: [{ required: true, message: '请选择工况库版本', trigger: 'change' }],
|
||||
chooseTaskList: [{ required: true, message: '请选择分发的任务', trigger: 'change' }],
|
||||
eMemberList: [{ required: true, message: '请选择仿真执行人', trigger: 'change' }],
|
||||
taskName: [{ required: true, message: '请填写任务名称', trigger: 'blur' }],
|
||||
});
|
||||
|
||||
const taskTreeRef = ref();
|
||||
|
||||
const sendTaskConfirmFun = () => {
|
||||
console.log('1234', 1234);
|
||||
sendFormRef.value.validate(async(valid: boolean) => {
|
||||
sendFormRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
// if (insertTaskMode.value === 'lib') {
|
||||
// if (sendForm.chooseTaskList.value.length === 0) {
|
||||
@@ -339,14 +300,14 @@ const sendTaskConfirmFun = () => {
|
||||
console.log('taskTreeRef', taskTreeRef.value.getCurrentNode());
|
||||
console.log('sendForm', sendForm);
|
||||
const parentNodeInfo = taskTreeRef.value.getCurrentNode();
|
||||
const tagProperty:{[key: string]: any;} = {};
|
||||
tagSortList.forEach((item:any) => {
|
||||
const tagProperty: { [key: string]: any } = {};
|
||||
tagSortList.forEach((item: any) => {
|
||||
tagProperty[item] = parentNodeInfo[item] ? parentNodeInfo[item].split(',') : [];
|
||||
});
|
||||
let params = {};
|
||||
const pMemberListStr = getMemberListIds(sendForm.pMemberList);
|
||||
if (insertTaskMode.value === 'lib') {
|
||||
const addTaskList = sendForm.chooseTaskList.map((item:any) => {
|
||||
const addTaskList = sendForm.chooseTaskList.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
...tagProperty,
|
||||
@@ -363,20 +324,22 @@ const sendTaskConfirmFun = () => {
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
addNodeList: [{
|
||||
nodeName: sendForm.taskName,
|
||||
nodeId: parentNodeInfo.uuid,
|
||||
...tagProperty,
|
||||
beginTime: sendForm.beginTime,
|
||||
endTime: sendForm.endTime,
|
||||
pMemberList: pMemberListStr,
|
||||
eMemberList: sendForm.eMemberList,
|
||||
}],
|
||||
addNodeList: [
|
||||
{
|
||||
nodeName: sendForm.taskName,
|
||||
nodeId: parentNodeInfo.uuid,
|
||||
...tagProperty,
|
||||
beginTime: sendForm.beginTime,
|
||||
endTime: sendForm.endTime,
|
||||
pMemberList: pMemberListStr,
|
||||
eMemberList: sendForm.eMemberList,
|
||||
},
|
||||
],
|
||||
demandId: sendForm.uuid,
|
||||
idMap: getIdMap(sendForm.projectId, sendForm.phaseId),
|
||||
};
|
||||
}
|
||||
const res:any = await issuedTaskApi({ reqList: [params] });
|
||||
const res: any = await issuedTaskApi({ reqList: [params] });
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('任务分发成功!');
|
||||
closeSendFun();
|
||||
@@ -390,19 +353,35 @@ const sendTaskConfirmFun = () => {
|
||||
|
||||
const indexTreeData = ref<any[]>([]);
|
||||
|
||||
const sendTaskFun = async(row:any) => {
|
||||
const sendTaskFun = async (row: any) => {
|
||||
console.log('row', row);
|
||||
sendVisible.value = true;
|
||||
|
||||
insertTaskMode.value = 'lib';
|
||||
sendForm.insertIndex = '';
|
||||
sendForm.currentLoadcaseLib = '';
|
||||
sendForm.currentLoadcaseLibVersion = '';
|
||||
sendForm.chooseTaskList = [];
|
||||
sendForm.taskName = '';
|
||||
sendForm.beginTime = '';
|
||||
sendForm.endTime = '';
|
||||
sendForm.eMemberList = '';
|
||||
|
||||
const taskTree = await getTaskTreeFun(row.projectId, row.phaseId);
|
||||
indexTreeData.value = filterTask(taskTree);
|
||||
console.log('indexTreeData', indexTreeData.value);
|
||||
await queryPoolListFun();
|
||||
|
||||
// for (const key in sendForm) {
|
||||
// sendForm[key] = '';
|
||||
// }
|
||||
|
||||
for (const key in row) {
|
||||
if (key !== 'eMemberList') {
|
||||
sendForm[key] = row[key];
|
||||
}
|
||||
}
|
||||
|
||||
sendForm.taskName = row.demandName;
|
||||
sendForm.eMemberList = getMemberListIds(row.eMemberList);
|
||||
console.log('sendForm', sendForm, row);
|
||||
@@ -416,15 +395,17 @@ const batchSendFun = () => {
|
||||
return ElMessage.warning('请勾选需要分发的需求!');
|
||||
}
|
||||
bachSendVisible.value = true;
|
||||
console.log('tableRef.value.tableRef.getCheckboxRecords()', tableRef.value.tableRef.tableRef.getCheckboxRecords());
|
||||
console.log(
|
||||
'tableRef.value.tableRef.getCheckboxRecords()',
|
||||
tableRef.value.tableRef.tableRef.getCheckboxRecords()
|
||||
);
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.loadcase-img {
|
||||
width: 18px;
|
||||
vertical-align: text-bottom;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.loadcase-img {
|
||||
width: 18px;
|
||||
vertical-align: text-bottom;
|
||||
margin-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user