hookehuyr

测试新增节点后动态更新ID

...@@ -973,10 +973,11 @@ export default { ...@@ -973,10 +973,11 @@ export default {
973 */ 973 */
974 function handleAfterAdd(model: myObj, type: string) { 974 function handleAfterAdd(model: myObj, type: string) {
975 // console.log('handleAfterAdd', model); 975 // console.log('handleAfterAdd', model);
976 -
977 - // TODO: 因为resize会重新绘制,所以可能需要保存操作
978 if (type === 'node') { 976 if (type === 'node') {
979 console.log(`新增节点`) 977 console.log(`新增节点`)
978 + // TODO: 测试更新ID
979 + model.id = String(new Date().getTime());
980 + editor.updateModel(model);
980 } 981 }
981 if (type === 'edge') { 982 if (type === 'edge') {
982 console.log(`新增连接线`) 983 console.log(`新增连接线`)
......