merge
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<slot name="otherLeftOptions"></slot>
|
||||
<div v-if="!readonly">
|
||||
<el-button
|
||||
v-if="props.showAddCategoryButton"
|
||||
:icon="Plus"
|
||||
@click="addRowFun(NODE_TYPE.CATEGORY)"
|
||||
:disabled="addNodeDisabled[NODE_TYPE.CATEGORY]"
|
||||
@@ -233,6 +234,8 @@ interface Props {
|
||||
needTagKey?: boolean; // 是否需要处理tagKey
|
||||
showNodeCompleteNum?: boolean; // 是否显示节点完成数量
|
||||
checkMethod?: any; // 处理勾选逻辑
|
||||
showAddCategoryButton?: boolean; // 是否显示添加分类按钮
|
||||
allowRootAddTask?: boolean; // 是否允许在根节点添加任务
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -263,6 +266,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
needTagKey: false,
|
||||
showNodeCompleteNum: false,
|
||||
checkMethod: null,
|
||||
showAddCategoryButton: true,
|
||||
allowRootAddTask: false,
|
||||
});
|
||||
|
||||
if (props?.checkMethod) {
|
||||
@@ -522,7 +527,11 @@ const canAddChildFun = (checkRowData: any, nodeType: string) => {
|
||||
}
|
||||
let canAdd = true;
|
||||
if (checkRowData.length === 0) {
|
||||
canAdd = canAddChild({ nodeType: NODE_TYPE.ROOT }, nodeType);
|
||||
if (props.allowRootAddTask && nodeType === NODE_TYPE.TASK) {
|
||||
canAdd = true;
|
||||
} else {
|
||||
canAdd = canAddChild({ nodeType: NODE_TYPE.ROOT }, nodeType);
|
||||
}
|
||||
} else if (checkRowData.length === 1) {
|
||||
canAdd = canAddChild(checkRowData[0], nodeType);
|
||||
} else {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ref, computed } from 'vue';
|
||||
import { queryFlowTemplateApi } from '@/api/capability/flow';
|
||||
import { getAllTaskPoolApi, getTaskPoolApi } from '@/api/task/taskpool';
|
||||
import { FLOW_TEMPLATE_PUBLIC_STATUS, FLOW_USE_STATUS } from '@/utils/enum/flow';
|
||||
import { filterExcludeStandardScene } from '@/utils/node';
|
||||
|
||||
interface Template {
|
||||
templateName?: string;
|
||||
@@ -16,16 +17,24 @@ const fetchPoolData = async () => {
|
||||
if (poolRes.code !== 200 || !Array.isArray(poolRes.data) || poolRes.data.length === 0) {
|
||||
return { pools: [], versions: [], data: null };
|
||||
}
|
||||
const pools = poolRes.data.reverse().map((pool: any) => {
|
||||
return {
|
||||
...pool,
|
||||
versions: (pool.versions || []).reverse().map((v: string) => ({
|
||||
poolName: pool.poolName,
|
||||
poolVersion: v,
|
||||
value: v,
|
||||
})),
|
||||
};
|
||||
});
|
||||
const pools = poolRes.data
|
||||
.filter(filterExcludeStandardScene)
|
||||
.reverse()
|
||||
.map((pool: any) => {
|
||||
return {
|
||||
...pool,
|
||||
versions: (pool.versions || []).reverse().map((v: string) => ({
|
||||
poolName: pool.poolName,
|
||||
poolVersion: v,
|
||||
value: v,
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
if (pools.length === 0) {
|
||||
return { pools: [], versions: [], data: null };
|
||||
}
|
||||
|
||||
const firstPool = pools[0];
|
||||
|
||||
if (!Array.isArray(firstPool.versions) || firstPool.versions.length === 0) {
|
||||
|
||||
@@ -234,6 +234,11 @@ export default [
|
||||
path: '/competenceCenter/condition',
|
||||
name: 'CompetenceCenterCondition',
|
||||
},
|
||||
{
|
||||
title: '标准场景库',
|
||||
path: '/competenceCenter/standardScene',
|
||||
name: 'CompetenceCenterStandardScene',
|
||||
},
|
||||
{
|
||||
title: '仿真指标库',
|
||||
path: '/competenceCenter/indicator',
|
||||
|
||||
@@ -256,6 +256,13 @@ export default [
|
||||
name: 'CompetenceCenterCondition',
|
||||
component: () => import('@/views/competenceCenter/condition/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '标准场景库',
|
||||
path: '/competenceCenter/standardScene',
|
||||
name: 'CompetenceCenterStandardScene',
|
||||
component: () =>
|
||||
import('@/tenants/lyric/views/competenceCenter/standardScene/index.vue'),
|
||||
},
|
||||
{
|
||||
title: '仿真指标库',
|
||||
path: '/competenceCenter/indicator',
|
||||
|
||||
1262
src/tenants/lyric/views/competenceCenter/standardScene/index.vue
Normal file
1262
src/tenants/lyric/views/competenceCenter/standardScene/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -443,17 +443,17 @@ export const collectNodeCodes = (nodes: TreeNode[], excludeFakeId?: string): str
|
||||
return codes;
|
||||
};
|
||||
|
||||
export const FIXED_POOL_NAME = '标准场景库';
|
||||
export const STANDARD_SCENE_POOL_NAME = '标准场景库';
|
||||
|
||||
export const VIRTUAL_NODE_NAME = '__VIRTUAL_ROOT__';
|
||||
export const VIRTUAL_NODE_CODE = '__VIRTUAL__';
|
||||
|
||||
export const filterExcludeStandardScene = (pool: any): boolean => {
|
||||
return pool.poolName !== FIXED_POOL_NAME;
|
||||
return pool.poolName !== STANDARD_SCENE_POOL_NAME;
|
||||
};
|
||||
|
||||
export const filterOnlyStandardScene = (pool: any): boolean => {
|
||||
return pool.poolName === FIXED_POOL_NAME;
|
||||
return pool.poolName === STANDARD_SCENE_POOL_NAME;
|
||||
};
|
||||
|
||||
export const filterVirtualNode = (tree: any[]): any[] => {
|
||||
|
||||
@@ -57,10 +57,12 @@ import type { Pool } from './types.ts';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
filterFn?: (pool: Pool) => boolean;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
modelValue: false,
|
||||
filterFn: undefined,
|
||||
});
|
||||
|
||||
const emits = defineEmits(['update:modelValue', 'confirm']);
|
||||
@@ -87,7 +89,13 @@ const queryListFun = async () => {
|
||||
const req = { bCurrent: false };
|
||||
const res: any = await getAllTaskPoolApi(req);
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
poolList.value = res.data.reverse();
|
||||
let list = res.data.reverse();
|
||||
|
||||
if (props.filterFn) {
|
||||
list = list.filter(props.filterFn);
|
||||
}
|
||||
|
||||
poolList.value = list;
|
||||
} else {
|
||||
poolList.value = [];
|
||||
}
|
||||
|
||||
@@ -199,7 +199,11 @@
|
||||
detail="{}"
|
||||
@confirm="onAddPoolConfirmFun"
|
||||
/>
|
||||
<DelPoolModal v-model="delPoolModalVisible" @confirm="onDelPoolConfirmFun" />
|
||||
<DelPoolModal
|
||||
v-model="delPoolModalVisible"
|
||||
:filterFn="filterExcludeStandardScene"
|
||||
@confirm="onDelPoolConfirmFun"
|
||||
/>
|
||||
<ImportPoolModal
|
||||
v-model="importPoolModalVisible"
|
||||
:poolList="poolList"
|
||||
@@ -224,6 +228,7 @@ import {
|
||||
getNodeExtras,
|
||||
canAddChild,
|
||||
extractLeafNodesWithParentTypes,
|
||||
filterExcludeStandardScene,
|
||||
} from '@/utils/node';
|
||||
import { poolNodeExtraPropPickMap } from '@/utils/enum/node';
|
||||
import {
|
||||
@@ -1033,6 +1038,8 @@ const dict = computed(() => ({
|
||||
department: commonStore.getDictData('DEPARTMENT_LIST').A,
|
||||
section: commonStore.getDictData('SECTION_LIST').A,
|
||||
group: commonStore.getDictData('GROUP_LIST').A,
|
||||
sceneType: commonStore.getDictData('SCENE_TYPE').A,
|
||||
algorithm: commonStore.getDictData('SIMULATION_ALGORITHM').A,
|
||||
}));
|
||||
const getFilterColumnsFun = async () => {
|
||||
const res: any = await getFormConfigureApi({ formName: 'TASK_POOL' });
|
||||
|
||||
@@ -330,7 +330,13 @@
|
||||
<script lang="ts" setup>
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { computed, nextTick, onMounted, ref } from 'vue';
|
||||
import { canAddChild, transformPoolNodesToTree, flatNode } from '@/utils/node';
|
||||
import {
|
||||
canAddChild,
|
||||
transformPoolNodesToTree,
|
||||
flatNode,
|
||||
STANDARD_SCENE_POOL_NAME,
|
||||
filterVirtualNode,
|
||||
} from '@/utils/node';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
@@ -1163,7 +1169,13 @@ const queryTaskPoolFun = async () => {
|
||||
};
|
||||
const res: any = await getTaskPoolApi(req);
|
||||
if (res.code === 200 && res.data.poolBrief && res.data && res.data.nodes) {
|
||||
leftPoolTableDataList.value = transformPoolNodesToTree(res.data.nodes);
|
||||
let tree = transformPoolNodesToTree(res.data.nodes);
|
||||
|
||||
if (currentLoadcaseLib.value.poolName === STANDARD_SCENE_POOL_NAME) {
|
||||
tree = filterVirtualNode(tree);
|
||||
}
|
||||
|
||||
leftPoolTableDataList.value = tree;
|
||||
nextTick(() => {
|
||||
// 待修改
|
||||
// leftPoolTableRef.value?.changeLevel('全部展开');
|
||||
@@ -1220,6 +1232,8 @@ const uploadExcelFileFun = async (file: any) => {
|
||||
department: commonStore.getDictData('DEPARTMENT_LIST').A,
|
||||
section: commonStore.getDictData('SECTION_LIST').A,
|
||||
group: commonStore.getDictData('GROUP_LIST').A,
|
||||
sceneType: commonStore.getDictData('SCENE_TYPE').A,
|
||||
algorithm: commonStore.getDictData('SIMULATION_ALGORITHM').A,
|
||||
};
|
||||
const req = {
|
||||
poolName: '外部临时表单',
|
||||
|
||||
Reference in New Issue
Block a user