Commit 6567b4fa authored by 邓超's avatar 邓超

fix: 修改规则函数选中写入

parent d39f8ca4
Pipeline #64616 passed with stages
......@@ -46,13 +46,14 @@ const RuleConfig = props => {
console.log(prop, treeNode);
if (!treeNode.node.children) {
insert(treeNode.node.key);
insert(`{${treeNode.node.key}}`);
}
setCurrentSelectId(prop[0]);
};
const insert = text => {
let rangeIndex = document.getElementById('ruleText').selectionStart;
setRule(`${rule.slice(0, rangeIndex)} {${text}} ${rule.slice(rangeIndex)}`);
// console.log(document.getElementById('ruleText').hasFocus());
setRule(`${rule.slice(0, rangeIndex)} ${text} ${rule.slice(rangeIndex)}`);
rangeIndex += text.toString().length;
ruleText.current.focus();
document.getElementById('ruleText').setSelectionRange(rangeIndex, rangeIndex); // 重新定位光标
......
......@@ -133,6 +133,7 @@ const FlowChart = props => {
});
// 监听节点拖拽到画布事件
diagram.addDiagramListener('externalobjectsdropped', e => {
afterNodes.current = new Map([]);
const list = JSON.parse(diagram.model.toJson()).nodeDataArray;
console.log(list, 'list');
let newNum;
......@@ -199,7 +200,13 @@ const FlowChart = props => {
let linkDataArray = [];
// 处理老数据,让老数据可以正常展示
limitFinshNodes.current = new Set([]);
nodeDataArray = currentFlowData.Nodes.map((item, index) => {
if (item.FlowTimerList.length > 0) {
item.FlowTimerList.forEach(ele => {
limitFinshNodes.current.add(ele.EndNode);
});
}
let obj;
obj = item;
obj.key = item.NodeId;
......@@ -253,7 +260,13 @@ const FlowChart = props => {
// 修改复制后节点内容
diagram.model.copyNodeDataFunction = (obj, model) => {
let copyObj = lodash.cloneDeep(obj);
console.log(copyObj, 'copyObj');
copyObj.FlowTimerList.forEach(item => {
item.key = item.ID;
delete item.ID;
});
delete copyObj.ActivityId;
delete copyObj.FlowNodeExtendId;
return copyObj;
};
// 修改复制后线内容
......
......@@ -41,7 +41,7 @@ const FlowModal = props => {
notification.success({
message: '提示',
duration: 3,
description: '编辑成功',
description: modalType === 'add' ? '新增成功' : '编辑成功',
});
onSubumit();
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment