|
|
@ -588,68 +588,72 @@ export class ProcessingGroupModal extends React.Component<{ store: ProcessingGro
|
|
|
|
//确认删除
|
|
|
|
//确认删除
|
|
|
|
private DelAlertConfirm = () =>
|
|
|
|
private DelAlertConfirm = () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//为了保持节点展开 删除完毕后将父节点选中
|
|
|
|
CommandWrap(() =>
|
|
|
|
let needSelectedCategory: string[] = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//只选中左边的项时 删除左边选中的
|
|
|
|
|
|
|
|
if (this.props.store.selectedRightNodeSet.size === 0 && this.props.store.selectedGroupSet.size === 0 && this.props.store.selectedObjectSet.size === 0 && this.props.store.selectedLeftNodeSet.size > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (let gname of this.props.store.selectedLeftNodeSet)
|
|
|
|
//为了保持节点展开 删除完毕后将父节点选中
|
|
|
|
|
|
|
|
let needSelectedCategory: string[] = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//只选中左边的项时 删除左边选中的
|
|
|
|
|
|
|
|
if (this.props.store.selectedRightNodeSet.size === 0 && this.props.store.selectedGroupSet.size === 0 && this.props.store.selectedObjectSet.size === 0 && this.props.store.selectedLeftNodeSet.size > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.pgCategoryMap.delete(gname);
|
|
|
|
for (let gname of this.props.store.selectedLeftNodeSet)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.pgCategoryMap.delete(gname);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.props.store.processGroupCategory = this.props.store.processGroupCategory.filter((g) => !this.props.store.selectedLeftNodeSet.has(g));
|
|
|
|
|
|
|
|
this.setState({ nodes: this.parseNodes() });
|
|
|
|
|
|
|
|
this.props.store.selectedLeftNodeSet.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.props.store.processGroupCategory = this.props.store.processGroupCategory.filter((g) => !this.props.store.selectedLeftNodeSet.has(g));
|
|
|
|
|
|
|
|
this.setState({ nodes: this.parseNodes() });
|
|
|
|
|
|
|
|
this.props.store.selectedLeftNodeSet.clear();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除加工组
|
|
|
|
//删除加工组
|
|
|
|
for (let g of this.props.store.selectedGroupSet)
|
|
|
|
for (let g of this.props.store.selectedGroupSet)
|
|
|
|
{
|
|
|
|
|
|
|
|
this.DelGroup(g);
|
|
|
|
|
|
|
|
needSelectedCategory.push(g.Name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.props.store.selectedGroupSet.clear();
|
|
|
|
|
|
|
|
//删除组类别
|
|
|
|
|
|
|
|
for (let c of this.props.store.selectedRightNodeSet)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (let g of app.Database.ProcessingGroupTable.Objects)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (g.IsErase)
|
|
|
|
this.DelGroup(g);
|
|
|
|
continue;
|
|
|
|
needSelectedCategory.push(g.Name);
|
|
|
|
if (g.Name === c)
|
|
|
|
|
|
|
|
this.DelGroup(g);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.props.store.selectedGroupSet.clear();
|
|
|
|
//检查组类别下的模块加工组
|
|
|
|
//删除组类别
|
|
|
|
for (let ndpg of this.props.store.tempPgs)
|
|
|
|
for (let c of this.props.store.selectedRightNodeSet)
|
|
|
|
{
|
|
|
|
|
|
|
|
let title = ndpg.nodeName.match(/(?<=>)(.*)/g)[0].trim();
|
|
|
|
|
|
|
|
if (this.props.store.selectedRightNodeSet.has(title))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
AppToaster.show({
|
|
|
|
for (let g of app.Database.ProcessingGroupTable.Objects)
|
|
|
|
message: `加工组${ndpg.nodeName}跟随模块生成,无法删除!`,
|
|
|
|
{
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
if (g.IsErase)
|
|
|
|
timeout: 1000,
|
|
|
|
continue;
|
|
|
|
});
|
|
|
|
if (g.Name === c)
|
|
|
|
|
|
|
|
this.DelGroup(g);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//检查组类别下的模块加工组
|
|
|
|
|
|
|
|
for (let ndpg of this.props.store.tempPgs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let title = ndpg.nodeName.match(/(?<=>)(.*)/g)[0].trim();
|
|
|
|
|
|
|
|
if (this.props.store.selectedRightNodeSet.has(title))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
|
|
|
message: `加工组${ndpg.nodeName}跟随模块生成,无法删除!`,
|
|
|
|
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
|
|
|
|
timeout: 1000,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let nd of this.props.store.selectedTempPgs)
|
|
|
|
for (let nd of this.props.store.selectedTempPgs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let title = nd.nodeName.match(/(?<=>)(.*)/g)[0].trim();
|
|
|
|
let title = nd.nodeName.match(/(?<=>)(.*)/g)[0].trim();
|
|
|
|
if (!this.props.store.selectedRightNodeSet.has(title))
|
|
|
|
if (!this.props.store.selectedRightNodeSet.has(title))
|
|
|
|
AppToaster.show({
|
|
|
|
AppToaster.show({
|
|
|
|
message: `加工组${nd.nodeName}跟随模块生成,无法删除!`,
|
|
|
|
message: `加工组${nd.nodeName}跟随模块生成,无法删除!`,
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
timeout: 1000,
|
|
|
|
timeout: 1000,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.props.store.selectedTempPgs = [];
|
|
|
|
this.props.store.selectedTempPgs = [];
|
|
|
|
this.props.store.selectedRightNodeSet.clear();
|
|
|
|
this.props.store.selectedRightNodeSet.clear();
|
|
|
|
for (let c of needSelectedCategory)
|
|
|
|
for (let c of needSelectedCategory)
|
|
|
|
this.props.store.selectedRightNodeSet.add(c);
|
|
|
|
this.props.store.selectedRightNodeSet.add(c);
|
|
|
|
this.setState({ nodes: this.parseNodes(), canAlertOpen1: false });
|
|
|
|
this.setState({ nodes: this.parseNodes(), canAlertOpen1: false });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, "删除加工组");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
//使选中的实体亮显
|
|
|
|
//使选中的实体亮显
|
|
|
|
private ShowGroups = () =>
|
|
|
|
private ShowGroups = () =>
|
|
|
|