merge
This commit is contained in:
@@ -69,3 +69,7 @@ export const editSimulationParameterApi = (params: any) => {
|
||||
export const updateSimulationParameterValuesApi = (params: any) => {
|
||||
return post(`${PREFIX}simulationParameterLibrary/updateSimulationParameterValues`, params);
|
||||
};
|
||||
// 判断下级是否有参数对象
|
||||
export const hasParameterObjectApi = (params: any) => {
|
||||
return get(`${PREFIX}simulationParameterLibrary/hasParameterObject`, params);
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<vxe-table
|
||||
ref="vxeTableRef"
|
||||
:data="tableData"
|
||||
highlight-hover-row
|
||||
height="100%"
|
||||
:row-config="{
|
||||
drag: true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- 好像已经弃用了,没有引入过这个文件 -->
|
||||
<template>
|
||||
<div class="node-info-dialog">
|
||||
<Dialog
|
||||
@@ -12,6 +13,7 @@
|
||||
ref="baseTableRef"
|
||||
tableName="NODE_LIST_LEVEL2"
|
||||
hidePagination
|
||||
fullHeight
|
||||
showIndex
|
||||
:head="headData"
|
||||
:actionList="actionList"
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
tableName="NODE_LIST_LEVEL2"
|
||||
hidePagination
|
||||
showIndex
|
||||
:data="nodeTableList"
|
||||
fullHeight
|
||||
:actionList="actionList"
|
||||
@load="loadFun"
|
||||
>
|
||||
@@ -150,19 +152,20 @@ const actionList = ref([
|
||||
// });
|
||||
|
||||
const addOrEditNode = async () => {
|
||||
loadingInterface.value = true;
|
||||
if (props.dialogType === 'create') {
|
||||
// emits('completeFun', 'nodePage');
|
||||
await addNodeDisposeFun(nodeTableList.value);
|
||||
} else {
|
||||
await editNodeDisposeFun();
|
||||
}
|
||||
if (deleteIdList.value.length > 0) {
|
||||
await deleteNodeFun();
|
||||
}
|
||||
loadingInterface.value = false;
|
||||
closeNodeListFun();
|
||||
emits('completeFun', 'phasePage');
|
||||
// 不在保存时修改,这里导致了bug977
|
||||
// loadingInterface.value = true;
|
||||
// if (props.dialogType === 'create') {
|
||||
// // emits('completeFun', 'nodePage');
|
||||
// await addNodeDisposeFun(nodeTableList.value);
|
||||
// } else {
|
||||
// await editNodeDisposeFun();
|
||||
// }
|
||||
// if (deleteIdList.value.length > 0) {
|
||||
// await deleteNodeFun();
|
||||
// }
|
||||
// loadingInterface.value = false;
|
||||
closeNodeListFun(); // 关闭阶段信息弹窗
|
||||
emits('completeFun', 'phasePage'); // 点击完成 主页的阶段列表刷新
|
||||
};
|
||||
|
||||
const addNodeDisposeFun = async (addList: any[]) => {
|
||||
@@ -312,11 +315,27 @@ const addOrEditOneNodeFun = async () => {
|
||||
return item;
|
||||
});
|
||||
}
|
||||
baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
// 即时调接口
|
||||
if (props.dialogType === 'create') {
|
||||
// emits('completeFun', 'nodePage');
|
||||
await addNodeDisposeFun(nodeTableList.value);
|
||||
} else {
|
||||
await editNodeDisposeFun();
|
||||
}
|
||||
nodeListApi(); // 刷新列表,不然新增的节点id没有入库,无法编辑和删除
|
||||
// baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
closeNodeFormFun();
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => nodeTableList.value,
|
||||
() => {
|
||||
deleteIdList.value = [];
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const validSameName = (fromData: { nodeName: string; id: any }) => {
|
||||
if (
|
||||
nodeTableList.value.some((item) => {
|
||||
@@ -331,12 +350,15 @@ const validSameName = (fromData: { nodeName: string; id: any }) => {
|
||||
|
||||
const deleteIdList = ref<Array<string>>([]);
|
||||
|
||||
const disposeDeleteListFun = ({ type, uuid }: { type: string; uuid: string }) => {
|
||||
const disposeDeleteListFun = async ({ type, uuid }: { type: string; uuid: string }) => {
|
||||
if (type !== 'add') {
|
||||
deleteIdList.value.push(uuid);
|
||||
}
|
||||
nodeTableList.value = nodeTableList.value.filter((item) => item.uuid !== uuid);
|
||||
baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
if (deleteIdList.value.length > 0) {
|
||||
await deleteNodeFun();
|
||||
}
|
||||
// nodeTableList.value = nodeTableList.value.filter((item) => item.uuid !== uuid);
|
||||
// baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
};
|
||||
|
||||
const deleteNodeFun = async () => {
|
||||
@@ -344,9 +366,10 @@ const deleteNodeFun = async () => {
|
||||
const res: any = await deleteNodeApi({ deleteNodeIdList: deleteIdList.value });
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('删除节点成功');
|
||||
deleteIdList.value = [];
|
||||
nodeListApi();
|
||||
} else {
|
||||
ElMessage.error(res.message || '删除节点失败');
|
||||
deleteIdList.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -372,7 +395,7 @@ const nodeListApi = async () => {
|
||||
} else {
|
||||
nodeTableList.value = [];
|
||||
}
|
||||
baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
// baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
};
|
||||
|
||||
// const disabledDateFun = (time:string, type:string) => {
|
||||
@@ -408,7 +431,7 @@ watch(
|
||||
if (props.dialogType === 'create') {
|
||||
if (nodeTableList.value.length === 0) {
|
||||
getDictPhaseList();
|
||||
baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
// baseTableRef.value?.setDataFun(nodeTableList.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -112,6 +112,7 @@ import AddConfigurationDia from './addConfigurationDia.vue';
|
||||
import type { TabPaneName } from 'element-plus';
|
||||
import { NODE_TYPE } from '@/utils/enum/node';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { useDict } from '@/utils/useDict';
|
||||
|
||||
interface SelectLevelItem {
|
||||
name: string;
|
||||
@@ -154,6 +155,7 @@ const editableTabs = ref<TabItem[]>([]);
|
||||
const selectLevelFormRef = ref<any>({});
|
||||
const addDiaVisible = ref<boolean>(false);
|
||||
const treeKey = ref<any>(+new Date());
|
||||
const { POOL_CATEGORY_TYPE } = useDict('POOL_CATEGORY_TYPE');
|
||||
const options = ref<any>([
|
||||
{
|
||||
label: '项目',
|
||||
@@ -163,14 +165,8 @@ const options = ref<any>([
|
||||
label: '阶段',
|
||||
value: NODE_TYPE.PHASE,
|
||||
},
|
||||
{
|
||||
label: '机台',
|
||||
value: 'machine',
|
||||
},
|
||||
{
|
||||
label: '工位',
|
||||
value: 'workspace',
|
||||
},
|
||||
// 应该读字典 POOL_CATEGORY_TYPE
|
||||
...POOL_CATEGORY_TYPE.value.A,
|
||||
]);
|
||||
|
||||
// ***************** 维度名称编辑功能 start *****************
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeFun">取消</el-button>
|
||||
<el-button type="primary" @click="onConfirmFun">确定</el-button>
|
||||
<el-button type="primary" :loading="confirmLoading" @click="onConfirmFun">确定</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</Dialog>
|
||||
@@ -33,11 +33,13 @@ const closeFun = () => {
|
||||
emits('close');
|
||||
};
|
||||
|
||||
const confirmLoading = ref(false);
|
||||
const onConfirmFun = () => {
|
||||
if (!formData.value.parameterLibraryName) {
|
||||
ElMessage.warning('请输入参数库名称!');
|
||||
return;
|
||||
} else {
|
||||
confirmLoading.value = true;
|
||||
emits('createFun', formData.value);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
<el-icon class="icon-style" v-if="data.type != 3" :size="18"><Folder /></el-icon>
|
||||
<el-icon class="icon-style" v-else :size="18"><Document /></el-icon>
|
||||
<div class="name" :title="data.name">{{ data.name }}</div>
|
||||
<div class="options">
|
||||
<!-- 审批中的节点 不允许修改删除 -->
|
||||
<div class="options" v-if="!data.shenpi">
|
||||
<div class="edit" @click="openEditFun(data)">
|
||||
<el-icon>
|
||||
<EditPen />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="del" @click="deleteParamFun(dataType[data.type])">
|
||||
<div class="del" @click="deleteParamFun(dataType[data.type], data)">
|
||||
<el-icon>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
@@ -43,7 +44,7 @@
|
||||
ref="paramTableRef"
|
||||
tableName="PARAMETER_LIST"
|
||||
hidePagination
|
||||
:actionList="actionList"
|
||||
:actionList="currentNode.shenpi ? [] : actionList"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div class="options">
|
||||
@@ -69,9 +70,14 @@
|
||||
新增参数对象
|
||||
</el-button>
|
||||
<template v-if="currentNode?.type === 3">
|
||||
<el-button type="primary" @click="openParamFun">新增参数</el-button>
|
||||
<el-button v-if="!currentNode.shenpi" type="primary" @click="openParamFun"
|
||||
>新增参数</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="objFormatFun(newParamTableData) !== objFormatFun(paramTableData)"
|
||||
v-if="
|
||||
objFormatFun(newParamTableData) !== objFormatFun(paramTableData) &&
|
||||
!currentNode.shenpi
|
||||
"
|
||||
type="primary"
|
||||
@click="updateParamFun"
|
||||
>
|
||||
@@ -101,10 +107,22 @@
|
||||
>
|
||||
<div class="info-content">
|
||||
<el-descriptions class="info-content-descriptions" :column="1" label-width="100px" border>
|
||||
<el-descriptions-item label="所属库">
|
||||
<el-descriptions-item label="名称">
|
||||
{{
|
||||
currentNode.type === 1
|
||||
? paramObjInfo?.parameterLibraryName
|
||||
: currentNode.type === 2
|
||||
? paramObjInfo?.parameterLibraryCategoryName
|
||||
: currentNode.name
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="currentNode.type !== 1" label="所属库">
|
||||
{{ paramObjInfo?.parameterLibraryName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="paramObjInfo?.parameterLibraryCategoryName" label="所属分类">
|
||||
<el-descriptions-item
|
||||
v-if="paramObjInfo?.parameterLibraryCategoryName && currentNode.type !== 2"
|
||||
label="所属分类"
|
||||
>
|
||||
{{ paramObjInfo?.parameterLibraryCategoryName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
@@ -162,6 +180,7 @@ import {
|
||||
addLibraryCategoryObjectApi,
|
||||
deleteSimulationParameterApi,
|
||||
updateSimulationParameterValuesApi,
|
||||
hasParameterObjectApi,
|
||||
} from '@/api/data/simulationParameterLibrary';
|
||||
import addParamLib from './components/addParamLib.vue';
|
||||
import addParamType from './components/addParamType.vue';
|
||||
@@ -268,7 +287,7 @@ const getSimulationParameterTreeDAtaFun = async (data?: any) => {
|
||||
|
||||
const paramObjInfo = ref<any>({});
|
||||
|
||||
// 当前节点更改
|
||||
// 当前节点 更改
|
||||
const currentChangeFun = async (data: any) => {
|
||||
currentNodeKey.value = data.nodeKey;
|
||||
currentNode.value = data;
|
||||
@@ -278,7 +297,10 @@ const currentChangeFun = async (data: any) => {
|
||||
ObjectId: data.id,
|
||||
});
|
||||
if (res && res.code === 200) {
|
||||
paramObjInfo.value = res.data || {};
|
||||
paramObjInfo.value = res.data || {
|
||||
parameterLibraryName: data.libName,
|
||||
parameterLibraryCategoryName: data.typeName,
|
||||
};
|
||||
paramTableRef.value.setDataFun(paramObjInfo.value.parameterJsonValue || []);
|
||||
paramTableData.value = paramObjInfo.value.parameterJsonValue || [];
|
||||
newParamTableData.value = cloneDeep(paramTableData.value);
|
||||
@@ -372,38 +394,58 @@ const creatLibParamObjFun = async (data: any) => {
|
||||
showParamObjVisible.value = false;
|
||||
};
|
||||
|
||||
const deleteParamFun = (flag: any) => {
|
||||
const deleteParamFun = async (flag: any, row?: any) => {
|
||||
// 如果删除的是参数,要走审批流程
|
||||
if (flag === 'param') {
|
||||
delParams.value = {
|
||||
type: currentNode.value.type,
|
||||
id: currentNode.value.id,
|
||||
// type: currentNode.value.type,
|
||||
// id: currentNode.value.id,
|
||||
type: row.type,
|
||||
id: row.id,
|
||||
};
|
||||
approveDelShow.value = true;
|
||||
return;
|
||||
}
|
||||
ElMessageBox.confirm(
|
||||
`确认要删除这个${flag === 'lib' ? '参数库' : flag === 'type' ? '参数库分类' : '参数对象'}吗?`,
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(async () => {
|
||||
const res: any = await deleteSimulationParameterApi({
|
||||
type: currentNode.value.type,
|
||||
id: currentNode.value.id,
|
||||
} else {
|
||||
// 0228需求 参数库、分类删除逻辑修改:下级有参数data=true,走审核流程;下级没有参数,直接删除
|
||||
const { data } = await hasParameterObjectApi({
|
||||
type: row.type,
|
||||
id: row.id,
|
||||
});
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('删除成功!');
|
||||
libTreeRef.value.remove(currentNode.value.nodeKey);
|
||||
currentNode.value = {};
|
||||
paramObjInfo.value = '';
|
||||
if (data) {
|
||||
// 走审核流程
|
||||
delParams.value = {
|
||||
type: row.type,
|
||||
id: row.id,
|
||||
};
|
||||
approveDelShow.value = true;
|
||||
} else {
|
||||
// 走删除流程
|
||||
ElMessageBox.confirm(
|
||||
`确认要删除这个${flag === 'lib' ? '参数库' : flag === 'type' ? '参数库分类' : '参数对象'}吗?`,
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(async () => {
|
||||
const res: any = await deleteSimulationParameterApi({
|
||||
type: currentNode.value.type,
|
||||
id: currentNode.value.id,
|
||||
});
|
||||
if (res && res.code === 200) {
|
||||
ElMessage.success('删除成功!');
|
||||
libTreeRef.value.remove(currentNode.value.nodeKey);
|
||||
currentNode.value = {};
|
||||
paramObjInfo.value = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const updateParamFun = () => {
|
||||
// dzh todo 增加审批
|
||||
const params = {
|
||||
fileId: currentNode.value.fileId,
|
||||
parameterList: newParamTableData.value,
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<BaseTable
|
||||
ref="baseTableRef"
|
||||
table-name="SIMULATION_KNOWLEDGE"
|
||||
:data="tableData"
|
||||
:hide-pagination="true"
|
||||
:full-height="true"
|
||||
:action-list="actionList"
|
||||
@@ -17,7 +18,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
import { ref, watch } from 'vue';
|
||||
import BaseTable from '@/components/common/table/baseTable.vue';
|
||||
import { getFileBaseInfoApi } from '@/api/data/data';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
@@ -83,10 +84,6 @@ watch(
|
||||
async (newVal) => {
|
||||
if (newVal && newVal?.standard) {
|
||||
await getFileBaseInfoFun(newVal);
|
||||
|
||||
nextTick(() => {
|
||||
baseTableRef.value.setDataFun(tableData.value);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
<BaseTable
|
||||
ref="baseFileTableRef"
|
||||
table-name="RUN_RESULT_FILE_TABLE"
|
||||
:data="tableData"
|
||||
:hide-pagination="true"
|
||||
:full-height="true"
|
||||
:action-list="fileActionList"
|
||||
@@ -160,7 +161,12 @@ import { ElMessage, ElMessageBox } from 'element-plus';
|
||||
import FilePreview from '@/components/common/filePreview/index.vue';
|
||||
import { getFileBaseInfoApi } from '@/api/data/data';
|
||||
import Dialog from '@/components/common/dialog/index.vue';
|
||||
import { downloadFileById, fileUploadAllocationIconFun, fileUploadAllocationTypeFun, formatFileSize } from '@/utils/file';
|
||||
import {
|
||||
downloadFileById,
|
||||
fileUploadAllocationIconFun,
|
||||
fileUploadAllocationTypeFun,
|
||||
formatFileSize,
|
||||
} from '@/utils/file';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { updateTaskStatusApi } from '@/api/project/task';
|
||||
import { FILE_TYPE } from '@/utils/enum/file';
|
||||
@@ -242,9 +248,9 @@ const showfileTableFun = async (ids: any) => {
|
||||
}
|
||||
|
||||
diaVisible.value = true;
|
||||
nextTick(() => {
|
||||
baseFileTableRef.value.setDataFun(tableData.value);
|
||||
});
|
||||
// nextTick(() => {
|
||||
// baseFileTableRef.value.setDataFun(tableData.value);
|
||||
// });
|
||||
};
|
||||
|
||||
const resultInfo = ref<any>({});
|
||||
|
||||
Reference in New Issue
Block a user