几个插件入表功能字段修改
This commit is contained in:
@@ -386,15 +386,13 @@ const findRowWithParents = (rowIndex: number = -1) => {
|
||||
if(row){
|
||||
return {
|
||||
...row,
|
||||
scene: `${row.cause?row.cause+';':''}${currentDev.value?.deviation+';'}${row.consequence?'可能导致:'+row.consequence:''}`,
|
||||
source: 'HAZOP',
|
||||
scene: `${row.cause?row.cause+';':''}${row.effect?'可能导致:'+row.effect:''}`,
|
||||
source: 'FMEA',
|
||||
item: `${currentDev.value?.deviation}${currentNode.value?.node_name?`(${currentNode.value?.node_name})`:''}`,
|
||||
safeguards: row?.safeguards?.map((item:any) => item.name).join(';') || '',
|
||||
suggestions: row?.suggestions?.map((item:any) => item.name).join(';') || '',
|
||||
safeguards: row?.safeguards || '',
|
||||
suggestions: row?.suggestions || '',
|
||||
residual_level: row?.residual_level || '',
|
||||
to_pssr: 0,
|
||||
safes: row?.safeguards || [],
|
||||
sugs: row?.suggestions || [],
|
||||
};
|
||||
}
|
||||
return null;
|
||||
@@ -409,28 +407,23 @@ const enterToTable = (type: string, rowIndex: number = -1) => {
|
||||
const enrichedRows:any[] = [];
|
||||
nodes.value.forEach((node:any) => {
|
||||
const node_ame = node.node_name;
|
||||
node.objects.forEach((obj:any) => {
|
||||
const obj_ame = obj.obj_name;
|
||||
obj.deviations.forEach((dev:any) => {
|
||||
const deviation = dev.deviation;
|
||||
if (dev.rows && dev.rows.length > 0) {
|
||||
dev.rows.forEach((row:any) => {
|
||||
// 创建新对象,保留原 row 全部属性,并添加父级信息
|
||||
enrichedRows.push({
|
||||
...row,
|
||||
scene: `${row.cause?row.cause+';':''}${deviation?deviation+';':''}${row.consequence?'可能导致:'+row.consequence:''}`,
|
||||
source: 'HAZOP',
|
||||
item: `${deviation}${node_ame?`(${node_ame}${obj_ame?`-${obj_ame}`:''})`:''}`,
|
||||
safeguards: row?.safeguards?.map((item:any) => item.name).join(';') || '',
|
||||
suggestions: row?.suggestions?.map((item:any) => item.name).join(';') || '',
|
||||
residual_level: row?.residual_level || '',
|
||||
to_pssr: 0,
|
||||
safes: row?.safeguards || [],
|
||||
sugs: row?.suggestions || [],
|
||||
});
|
||||
node.deviations.forEach((dev:any) => {
|
||||
const deviation = dev.deviation;
|
||||
if (dev.rows && dev.rows.length > 0) {
|
||||
dev.rows.forEach((row:any) => {
|
||||
// 创建新对象,保留原 row 全部属性,并添加父级信息
|
||||
enrichedRows.push({
|
||||
...row,
|
||||
scene: `${row.cause?row.cause+';':''}${row.effect?'可能导致:'+row.effect:''}`,
|
||||
source: 'FMEA',
|
||||
item: `${deviation}${node_ame?`(${node_ame})`:''}`,
|
||||
safeguards: row?.safeguards || '',
|
||||
suggestions: row?.suggestions || '',
|
||||
residual_level: row?.residual_level || '',
|
||||
to_pssr: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
emit('toTable',type,enrichedRows);
|
||||
|
||||
Reference in New Issue
Block a user