merge
This commit is contained in:
@@ -15,7 +15,11 @@
|
||||
/>
|
||||
<span v-else class="plain-label">
|
||||
<template v-if="selectedTemplates.length === 1">
|
||||
<el-icon class="view" @click="previewFlow(selectedTemplates[0].uuid)" :title="$t('通用.预览')">
|
||||
<el-icon
|
||||
class="view"
|
||||
@click="previewFlow(selectedTemplates[0].uuid)"
|
||||
:title="$t('通用.预览')"
|
||||
>
|
||||
<View />
|
||||
</el-icon>
|
||||
<OverflowTooltip :content="selectedTemplates[0].templateName" max-width="120px" />
|
||||
|
||||
@@ -113,7 +113,7 @@ const cascaderProps: CascaderProps = {
|
||||
if (!node?.data?.dataType) {
|
||||
res = await dataListDirApi({
|
||||
parentDirId: node?.data.parentId || '',
|
||||
dirType: DIR_TYPE.KNOWLEDGE
|
||||
dirType: DIR_TYPE.KNOWLEDGE,
|
||||
});
|
||||
if (res?.code === 200) {
|
||||
list = res.data.map((item: any) => {
|
||||
@@ -163,7 +163,10 @@ const fetchChildren = async (parentId: string, parentNodeData?: any) => {
|
||||
}));
|
||||
}
|
||||
}
|
||||
const res2: any = await dataListDirApi({ parentDirId: parentId || '', dirType: DIR_TYPE.KNOWLEDGE });
|
||||
const res2: any = await dataListDirApi({
|
||||
parentDirId: parentId || '',
|
||||
dirType: DIR_TYPE.KNOWLEDGE,
|
||||
});
|
||||
if (res2?.code === 200) {
|
||||
return res2.data.map((item: any) => ({
|
||||
...item,
|
||||
|
||||
@@ -138,7 +138,7 @@ watch(
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const resetFun = () => {
|
||||
|
||||
@@ -79,7 +79,7 @@ interface Props {
|
||||
modelValue?: PoolInfo[];
|
||||
editable?: boolean;
|
||||
layout?: 'horizontal' | 'vertical';
|
||||
disabled?: boolean
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:actionList="actionList"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div v-if="showFilter">
|
||||
<!-- <div v-if="showFilter">
|
||||
<el-select v-model="currentId" class="select-style">
|
||||
<el-option
|
||||
v-for="item in taskRunList"
|
||||
@@ -24,7 +24,9 @@
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
<el-button>上传文件</el-button>
|
||||
<el-button type="primary">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<span>{{ getfileType(row) }}</span>
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
<template>
|
||||
<div class="task-performance-page">
|
||||
<div class="task-curve-page-left">
|
||||
<div class="task-run-box">
|
||||
<el-tree
|
||||
ref="taskRunRef"
|
||||
:data="runTreeData"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
check-strictly
|
||||
@check-change="handleCheckChangeFun"
|
||||
/>
|
||||
</div>
|
||||
<div class="task-curve-box">
|
||||
<div class="current-box-title">对比曲线</div>
|
||||
<div class="curve-list">
|
||||
<div class="curve-list-item" v-for="item in curveList" :key="item.id">
|
||||
<span>{{ item.originalName }}</span>
|
||||
<div>
|
||||
<span>图</span>
|
||||
<el-input
|
||||
class="input-style"
|
||||
size="small"
|
||||
v-model="item.num"
|
||||
@change="handleChangeNumFun"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BaseTable
|
||||
tableName="TASK_CANVAS_FILE"
|
||||
ref="baseTableRef"
|
||||
:api="getSimulationTaskFilesApi"
|
||||
:params="{
|
||||
uuid: taskId,
|
||||
fileBizType: FILE_TYPE.CANVAS_FILE,
|
||||
fileName: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
}"
|
||||
:actionList="actionList"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<el-button @click="showTableDataCurveFun">显示曲线</el-button>
|
||||
<el-button>上传文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<span>{{ getfileType(row) }}</span>
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
<span>{{ row.formatFileSize }}</span>
|
||||
</template>
|
||||
<!-- <template #num="{ row, column }">
|
||||
图 <el-input class="w50" v-model="row[column.field]"></el-input>
|
||||
</template> -->
|
||||
</BaseTable>
|
||||
</div>
|
||||
<div class="task-curve-page-right">
|
||||
<div class="task-curve-page-right" v-if="showCsv">
|
||||
<div class="task-curve-right-operate">
|
||||
<span>列数:</span>
|
||||
<el-input
|
||||
@@ -64,6 +64,8 @@ import { ref, onMounted, reactive } from 'vue';
|
||||
import { getSimulationTaskFilesApi, getCSVDataApi } from '@/api/data/data';
|
||||
import { initEcharts } from '../common/echartCard/echartsOptions';
|
||||
import { FILE_TYPE } from '@/utils/enum/file';
|
||||
import { downloadFileById } from '@/utils/file';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
|
||||
const props = defineProps({
|
||||
taskId: {
|
||||
@@ -73,8 +75,8 @@ const props = defineProps({
|
||||
});
|
||||
const runTreeData = ref<any>([]);
|
||||
const curveList = ref<any>([]);
|
||||
const taskRunRef = ref();
|
||||
|
||||
const baseTableRef = ref();
|
||||
const showCsv = ref(false);
|
||||
const filterForm = reactive<any>({
|
||||
lineNum: 2,
|
||||
});
|
||||
@@ -95,63 +97,46 @@ const getTaskRunDataFun = () => {
|
||||
// ElMessage.success('获取任务算例数据' + props.taskId);
|
||||
};
|
||||
|
||||
const selectTreeData = ref<any>([]);
|
||||
const handleCheckChangeFun = () => {
|
||||
// ElMessage.success('选择了' + data.label);
|
||||
selectTreeData.value = taskRunRef.value.getCheckedNodes();
|
||||
console.log(selectTreeData.value, 'selectTreeData.value');
|
||||
|
||||
getCheckedNodesCurveFun();
|
||||
const getfileType = (data: any) => {
|
||||
const fileType = data.originalName.split('.').pop();
|
||||
return fileType;
|
||||
};
|
||||
|
||||
const curveNumData = ref<any>([]);
|
||||
|
||||
// 获取勾选的算例下的曲线文件
|
||||
const getCheckedNodesCurveFun = async () => {
|
||||
curveList.value = [
|
||||
// { name: '曲线1', id: 1, num: 1 },
|
||||
// { name: '曲线2', id: 2, num: 1 },
|
||||
// { name: '曲线3', id: 3, num: 1 },
|
||||
// { name: '曲线4', id: 4, num: 1 },
|
||||
// { name: '曲线5', id: 5, num: 1 },
|
||||
// { name: '曲线6', id: 6, num: 1 },
|
||||
// { name: '曲线7', id: 7, num: 1 },
|
||||
// { name: '曲线8', id: 8, num: 1 },
|
||||
// { name: '曲线9', id: 9, num: 1 },
|
||||
// { name: '曲线10', id: 10, num: 1 },
|
||||
// { name: '曲线11', id: 11, num: 1 },
|
||||
];
|
||||
const actionList = ref([
|
||||
{
|
||||
title: '下载',
|
||||
type: 'primary',
|
||||
click: (row: any) => {
|
||||
// const downloadUrl = `${env.VITE_API_FILE_URL}/data/downloadFile?fileId=${row.id}`;
|
||||
// window.open(downloadUrl, '_blank');
|
||||
downloadFileById(row.id);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const res: any = await getSimulationTaskFilesApi({
|
||||
uuid: props.taskId,
|
||||
fileBizType: FILE_TYPE.CANVAS_FILE,
|
||||
fileName: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
current: 1,
|
||||
size: 1000,
|
||||
const showTableDataCurveFun = () => {
|
||||
showCsv.value = false;
|
||||
const { tableData } = baseTableRef.value.tableRef.getTableData();
|
||||
|
||||
curveList.value = tableData.map((item: any, index: any) => {
|
||||
return {
|
||||
...item,
|
||||
num: index + 1,
|
||||
};
|
||||
});
|
||||
|
||||
if (res && res.code === 200) {
|
||||
curveList.value = res.data?.data?.map((item: any, index: any) => {
|
||||
return {
|
||||
...item,
|
||||
num: index + 1,
|
||||
};
|
||||
});
|
||||
|
||||
curveList.value = curveList.value.filter((item: any) => {
|
||||
return item.originalName.endsWith('.csv');
|
||||
});
|
||||
}
|
||||
curveList.value = curveList.value.filter((item: any) => {
|
||||
return item.originalName.endsWith('.csv');
|
||||
});
|
||||
|
||||
if (curveList.value.length) {
|
||||
showCsv.value = true;
|
||||
const list = curveList.value.map((item: any) => item.num);
|
||||
curveNumData.value = Array.from(new Set(list));
|
||||
getCommonNumCurveFun();
|
||||
}
|
||||
|
||||
console.log(curveNumData.value, 'curveNumData.value');
|
||||
};
|
||||
|
||||
const handleChangeNumFun = () => {
|
||||
@@ -269,17 +254,18 @@ onMounted(() => {
|
||||
.task-performance-page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
justify-content: space-between;
|
||||
// justify-content: space-between;
|
||||
|
||||
// :deep(.is-disabled) {
|
||||
// display: none;
|
||||
// }
|
||||
|
||||
.task-curve-page-left {
|
||||
width: 35%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
|
||||
.task-run-box {
|
||||
@@ -366,5 +352,9 @@ onMounted(() => {
|
||||
margin-left: 5px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.w50 {
|
||||
width: 50px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:actionList="actionList"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div v-if="showFilter">
|
||||
<!-- <div v-if="showFilter">
|
||||
<el-select v-model="currentId" class="select-style">
|
||||
<el-option
|
||||
v-for="item in taskRunList"
|
||||
@@ -24,7 +24,10 @@
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<el-button>上传文件</el-button>
|
||||
<el-button type="primary">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<span>{{ getfileType(row) }}</span>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
:actionList="actionList"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div v-if="showFilter">
|
||||
<!-- <div v-if="showFilter">
|
||||
<el-select v-model="currentId" class="select-style">
|
||||
<el-option
|
||||
v-for="item in taskRunList"
|
||||
@@ -24,7 +24,10 @@
|
||||
:key="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<el-button>上传文件</el-button>
|
||||
<el-button type="primary">下载文件</el-button>
|
||||
</template>
|
||||
<template #type="{ row }">
|
||||
<span>{{ getfileType(row) }}</span>
|
||||
|
||||
@@ -24,11 +24,13 @@ initThemeColor();
|
||||
|
||||
const app = createApp(App);
|
||||
|
||||
import permission from '@/utils/permission';
|
||||
|
||||
// 全局引入图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
app.component(key, component);
|
||||
}
|
||||
|
||||
app.directive('permission', permission);
|
||||
app.use(createPinia());
|
||||
app.use(router);
|
||||
app.use(VxeUIAll);
|
||||
|
||||
@@ -329,6 +329,12 @@ export default [
|
||||
name: 'systemLogs',
|
||||
component: () => import('@/views/system/logs/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '权限管理',
|
||||
path: '/system/permission',
|
||||
name: 'systemPermission',
|
||||
component: () => import('@/views/system/permission/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '动态表格',
|
||||
path: '/system/dynamicTable',
|
||||
|
||||
@@ -329,6 +329,12 @@ export default [
|
||||
name: 'systemLogs',
|
||||
component: () => import('@/views/system/logs/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '权限管理',
|
||||
path: '/system/permission',
|
||||
name: 'systemPermission',
|
||||
component: () => import('@/views/system/permission/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '动态表格',
|
||||
path: '/system/dynamicTable',
|
||||
|
||||
@@ -100,7 +100,7 @@ watch(
|
||||
initData();
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const initData = () => {
|
||||
|
||||
@@ -353,12 +353,14 @@ const searchFun = (data: object) => {
|
||||
searchParams.value = cloneDeep(data);
|
||||
searchParams.value.searchType = 1;
|
||||
searchParams.value.parentDirId = memoryFolder.value?.id || '';
|
||||
searchParams.value.dirType = DIR_TYPE.ANIMATION;
|
||||
};
|
||||
const resetFun = (data: object) => {
|
||||
isSearching.value = false;
|
||||
currentFolder.value = memoryFolder.value;
|
||||
searchParams.value = cloneDeep(data);
|
||||
searchParams.value.fileId = currentFolder.value?.id || '';
|
||||
searchParams.value.dirType = DIR_TYPE.ANIMATION;
|
||||
};
|
||||
const refreshTableFun = async () => {
|
||||
baseTableRef.value?.resetFun();
|
||||
|
||||
@@ -89,6 +89,7 @@ const lang = {
|
||||
配置管理: 'Configuration Management',
|
||||
用户组管理: 'User Group Management',
|
||||
日志管理: 'Log Management',
|
||||
权限管理: 'Permission Management',
|
||||
动态表格: 'Dynamic Table',
|
||||
工作负载: 'Work Load',
|
||||
},
|
||||
|
||||
@@ -88,6 +88,7 @@ const lang = {
|
||||
配置管理: '配置管理',
|
||||
用户组管理: '用户组管理',
|
||||
日志管理: '日志管理',
|
||||
权限管理: '权限管理',
|
||||
动态表格: '动态表格',
|
||||
工作负载: '工作负载',
|
||||
},
|
||||
|
||||
22
src/utils/permission.ts
Normal file
22
src/utils/permission.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import type { Directive } from 'vue';
|
||||
|
||||
const permission: Directive = {
|
||||
mounted(el: HTMLElement & { disabled?: boolean }, binding) {
|
||||
const { value } = binding;
|
||||
// permissionList 存在本地,用的时候从localStorage取
|
||||
const permissionList = ['button:add', 'button:edit', 'button:delete'];
|
||||
|
||||
if (typeof value === 'string' && value) {
|
||||
const hasPermission = permissionList.includes(value);
|
||||
|
||||
if (!hasPermission) {
|
||||
el.disabled = true;
|
||||
// el.classList.add('is-disabled');
|
||||
}
|
||||
} else {
|
||||
throw new Error('need permission key! Like v-permission="\'button:add\'"');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default permission;
|
||||
@@ -115,7 +115,7 @@ watch(
|
||||
form.bNewVersion = false;
|
||||
form.versionType = 0;
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const onApproveChangeFun = (data: any) => {
|
||||
|
||||
@@ -74,7 +74,7 @@ watch(
|
||||
form.value.name = '';
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const resetFun = () => {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-model="visible"
|
||||
:diaTitle="$t('工况库.删除库')"
|
||||
:width="500"
|
||||
:height="600"
|
||||
>
|
||||
<Dialog v-model="visible" :diaTitle="$t('工况库.删除库')" :width="500" :height="600">
|
||||
<template #default>
|
||||
<div v-loading="queryLoading" class="pool-wrapper">
|
||||
<div class="pool-list">
|
||||
@@ -79,7 +74,7 @@ watch(
|
||||
poolList.value = [];
|
||||
queryListFun();
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
const poolList: Ref<Pool[]> = ref([]);
|
||||
const queryLoading = ref(false);
|
||||
|
||||
@@ -87,7 +87,7 @@ watch(
|
||||
if (val) {
|
||||
resetFun();
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const resetFun = () => {
|
||||
|
||||
@@ -390,12 +390,14 @@ const searchFun = (data: object) => {
|
||||
searchParams.value = cloneDeep(data);
|
||||
searchParams.value.searchType = 1;
|
||||
searchParams.value.parentDirId = memoryFolder.value?.id || '';
|
||||
searchParams.value.dirType = DIR_TYPE.KNOWLEDGE;
|
||||
};
|
||||
const resetFun = (data: object) => {
|
||||
isSearching.value = false;
|
||||
currentFolder.value = memoryFolder.value;
|
||||
searchParams.value = cloneDeep(data);
|
||||
searchParams.value.fileId = currentFolder.value?.id || '';
|
||||
searchParams.value.dirType = DIR_TYPE.KNOWLEDGE;
|
||||
};
|
||||
const refreshTableFun = async () => {
|
||||
baseTableRef.value?.resetFun();
|
||||
|
||||
4
src/views/system/permission/index.vue
Normal file
4
src/views/system/permission/index.vue
Normal file
@@ -0,0 +1,4 @@
|
||||
<!-- 权限管理 -->
|
||||
<template>
|
||||
<div>权限管理</div>
|
||||
</template>
|
||||
@@ -89,7 +89,7 @@ import { ref, reactive, onMounted } from 'vue';
|
||||
defineProps({
|
||||
projectCurrentInfo: {
|
||||
type: Object,
|
||||
default: () => { },
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['filterParamChangeFun', 'expandTree']);
|
||||
@@ -103,6 +103,7 @@ const filterFormData = reactive({
|
||||
attribution: 'personal',
|
||||
taskType: 'all',
|
||||
expendType: 'all',
|
||||
projectCode: '',
|
||||
});
|
||||
|
||||
const dropdownList = ref([
|
||||
@@ -149,14 +150,10 @@ const getProjectTypeFun = async (val?: any) => {
|
||||
filterFormData.ProjectType = val;
|
||||
} else {
|
||||
filterFormData.ProjectType = projectTypeList.value[0]?.dictValue;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
projectTypeList.value = [];
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -176,13 +173,18 @@ const getProjectListFun = async (val?: any) => {
|
||||
if (projectList.value.length) {
|
||||
if (val) {
|
||||
filterFormData.projectName = val;
|
||||
filterFormData.projectCodeName = projectList.value.find((item: any) => {
|
||||
return item.uuid === filterFormData.projectName;
|
||||
})?.nodeName || '';
|
||||
|
||||
filterFormData.projectCodeName =
|
||||
projectList.value.find((item: any) => {
|
||||
return item.uuid === filterFormData.projectName;
|
||||
})?.nodeName || '';
|
||||
filterFormData.projectCode =
|
||||
projectList.value.find((item: any) => {
|
||||
return item.uuid === filterFormData.projectName;
|
||||
})?.nodeCode || '';
|
||||
} else {
|
||||
filterFormData.projectName = projectList.value[0].uuid;
|
||||
filterFormData.projectCodeName = projectList.value[0].nodeName;
|
||||
filterFormData.projectCode = projectList.value[0].nodeCode;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -194,7 +196,6 @@ const getProjectListFun = async (val?: any) => {
|
||||
const pheseList = ref<any>([]);
|
||||
|
||||
const getPhaseListFun = async (val?: any) => {
|
||||
|
||||
if (filterFormData.projectName) {
|
||||
const res: any = await getChildrenNodeListApi({
|
||||
current: 1,
|
||||
@@ -211,7 +212,6 @@ const getPhaseListFun = async (val?: any) => {
|
||||
filterFormData.phaseName = pheseList.value[0].uuid;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
pheseList.value = [];
|
||||
filterFormData.phaseName = '';
|
||||
@@ -225,20 +225,23 @@ const projectInfoChangeFun = async (flag: any) => {
|
||||
if (flag === 'projectType') {
|
||||
filterFormData.projectName = '';
|
||||
filterFormData.projectCodeName = '';
|
||||
filterFormData.projectCode = '';
|
||||
filterFormData.phaseName = '';
|
||||
await getProjectListFun();
|
||||
await getPhaseListFun();
|
||||
}
|
||||
if (flag === 'projectName') {
|
||||
filterFormData.phaseName = '';
|
||||
await getPhaseListFun();
|
||||
}
|
||||
localStorage.setItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM', JSON.stringify(filterFormData));
|
||||
emits('filterParamChangeFun', filterFormData);
|
||||
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
const filterData = JSON.parse(localStorage.getItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM') as string);
|
||||
const filterData = JSON.parse(
|
||||
localStorage.getItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM') as string
|
||||
);
|
||||
if (filterData) {
|
||||
await getProjectTypeFun(filterData?.ProjectType);
|
||||
await getProjectListFun(filterData?.projectName);
|
||||
@@ -247,10 +250,8 @@ onMounted(async () => {
|
||||
await getProjectTypeFun();
|
||||
await getProjectListFun();
|
||||
await getPhaseListFun();
|
||||
|
||||
}
|
||||
projectInfoChangeFun('null');
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
@close="showCreateRunReporteWindow = false"
|
||||
:current-node-info="rightClickNodeInfo"
|
||||
:parent-node-info="rightClickNodeParentInfo"
|
||||
:workspace-info="workspaceNodeInfo"
|
||||
></createRunReport>
|
||||
</div>
|
||||
<Teleport to="body">
|
||||
@@ -387,6 +388,9 @@ const nodeChangeClickFun = (data: any, node: any) => {
|
||||
const rightClickNodeInfo = ref<any>(null);
|
||||
const rightClickNode = ref<any>(null);
|
||||
const rightClickNodeParentInfo = ref<any>(null);
|
||||
|
||||
const workspaceNodeInfo = ref<any>({});
|
||||
|
||||
// 右键菜单
|
||||
const rowRightClickFun = (e: any, data: any, node: any) => {
|
||||
// clearTreeMenuFun();
|
||||
@@ -394,8 +398,11 @@ const rowRightClickFun = (e: any, data: any, node: any) => {
|
||||
console.log('1234', data);
|
||||
console.log('1234', node);
|
||||
rightClickNodeInfo.value = data;
|
||||
rightClickNodeInfo.value.parentName = node.parent.data.nodeName;
|
||||
|
||||
rightClickNode.value = data;
|
||||
rightClickNodeParentInfo.value = node.parent.data;
|
||||
getSpecifyLevelNodeData(node, NODE_TYPE.WORKSPACE);
|
||||
if (
|
||||
rightClickNodeInfo.value.nodeType != NODE_TYPE.TASK &&
|
||||
rightClickNodeInfo.value.nodeType != NODE_TYPE.RUN
|
||||
@@ -446,6 +453,17 @@ const rowRightClickFun = (e: any, data: any, node: any) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
// 获取工况树上指定节点的上层第一个对应类型的节点信息
|
||||
const getSpecifyLevelNodeData = (node: any, type: any) => {
|
||||
if (node.data.nodeType === type) {
|
||||
workspaceNodeInfo.value = node.data;
|
||||
} else {
|
||||
if (node?.parent) {
|
||||
getSpecifyLevelNodeData(node?.parent, type);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const clearTreeMenuFun = () => {
|
||||
// rightClickNodeInfo.value = null;
|
||||
const menuElement = document.getElementById('fileMenu' + tableId.value) as HTMLElement;
|
||||
@@ -649,7 +667,6 @@ const restoreSelectionFun = () => {
|
||||
};
|
||||
|
||||
const setCurrentNodeStatusFun = (status: any) => {
|
||||
|
||||
currentNodeInfo.value.status = status;
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<el-input class="w180" v-model="reportFormData.workspace"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分析类型:">
|
||||
<el-select class="w185" v-model="reportFormData.taskType" @change="taskTypeChangeFun">
|
||||
<el-select class="w180" v-model="reportFormData.taskType" @change="taskTypeChangeFun">
|
||||
<el-option
|
||||
v-for="item in taskTypeList"
|
||||
:key="item.value"
|
||||
@@ -48,7 +48,7 @@
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<el-tooltip
|
||||
<!-- <el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
:content="
|
||||
@@ -57,7 +57,7 @@
|
||||
placement="top-start"
|
||||
>
|
||||
<el-icon class="ml5"><InfoFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="报告版本:">
|
||||
<el-input class="w180" v-model="reportFormData.reportVer"></el-input>
|
||||
@@ -114,6 +114,7 @@
|
||||
<template v-for="item in resultImgList" :key="item.id">
|
||||
<div class="img-item" v-if="item.show">
|
||||
<el-checkbox v-model="item.checkImg" class="check-style" size="large" />
|
||||
<!-- :preview-src-list="[item.url]" -->
|
||||
<el-image
|
||||
class="img-style"
|
||||
title="点击预览图片"
|
||||
@@ -121,7 +122,6 @@
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="[item.url]"
|
||||
show-progress
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
@@ -145,11 +145,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import taskPerformance from '@/components/taskDetail/taskPerformance.vue';
|
||||
import { generateReportApi, listSimulationKeyResultApi } from '@/api/project/run';
|
||||
import { getUserData } from '@/utils/user';
|
||||
|
||||
const env = import.meta.env;
|
||||
|
||||
@@ -162,6 +163,10 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
workspaceInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['close']);
|
||||
@@ -302,30 +307,57 @@ const taskTypeChangeFun = () => {
|
||||
};
|
||||
|
||||
const showIMgFileList = () => {
|
||||
const list = taskTypeImgFileMap.value[reportFormData.taskType];
|
||||
|
||||
for (let i = 0; i < resultImgList.value.length; i++) {
|
||||
resultImgList.value[i].checkImg = false;
|
||||
|
||||
if (list.includes(resultImgList.value[i].name)) {
|
||||
resultImgList.value[i].show = true;
|
||||
} else {
|
||||
resultImgList.value[i].show = false;
|
||||
}
|
||||
resultImgList.value[i].show = true;
|
||||
}
|
||||
|
||||
console.log(resultImgList.value, 'resultImgList.value');
|
||||
|
||||
// const imgs = resultImgList.value.filter((item: any) => {
|
||||
// return list.includes(item.name);
|
||||
// });
|
||||
|
||||
// return imgs;
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.currentNodeInfo,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
const runInfo = newVal;
|
||||
console.log(runInfo, 'runInfo');
|
||||
|
||||
const projectInfo = JSON.parse(
|
||||
localStorage.getItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM') as string
|
||||
);
|
||||
reportFormData.reportName = '算例报告_' + dayjs().format('YYYY_MM_DD_HH_mm');
|
||||
reportFormData.applicants = getUserData().nickname;
|
||||
reportFormData.date = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
reportFormData.loadcaseName = runInfo.parentName;
|
||||
reportFormData.projectNum = projectInfo?.projectCode;
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.workspaceInfo,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
const nodeInfo = newVal;
|
||||
|
||||
console.log(nodeInfo, 'nodeInfo');
|
||||
|
||||
reportFormData.workspaceNum = nodeInfo.nodeCode;
|
||||
reportFormData.workspace = nodeInfo.nodeName;
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
console.log(props.parentNodeInfo, 'parentNodeInfo');
|
||||
|
||||
await queryDirDataFun();
|
||||
reportFormData.reportName = '算例报告_' + dayjs().format('YYYY_MM_DD_HH_mm');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user