Просмотр исходного кода

修复拷贝、粘贴或剪切脚本时,会影响到表单和流程设计元素的问题

huqi 5 лет назад
Родитель
Сommit
0923512322

+ 3 - 0
o2web/source/x_component_process_FormDesigner/Main.js

@@ -90,6 +90,7 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
         if (this.shortcut) {
             if (this.form) {
                 //           if (this.form.isFocus){
+                if (!this.form.node.contains(document.activeElement)) return false;
                 if (this.form.currentSelectedModule) {
                     var module = this.form.currentSelectedModule;
                     if (module.moduleType != "form" && module.moduleName.indexOf("$") == -1) {
@@ -120,6 +121,7 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
         if (this.shortcut) {
             if (this.form) {
                 //          if (this.form.isFocus){
+                if (!this.form.node.contains(document.activeElement)) return false;
                 if (this.form.currentSelectedModule) {
                     var module = this.form.currentSelectedModule;
                     if (module.moduleType != "form" && module.moduleName.indexOf("$") == -1) {
@@ -139,6 +141,7 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
     pasteModule: function(){
         if (this.shortcut) {
             if (this.form) {
+                if (!this.form.node.contains(document.activeElement)) return false;
                 //    if (this.form.isFocus){
                 if (MWF.clipboard.data) {
                     if (MWF.clipboard.data.type == "form") {

+ 2 - 2
o2web/source/x_component_process_FormDesigner/Module/Form.js

@@ -395,7 +395,7 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 			this.getTemplateData(className, function(data){
 				var moduleData = Object.clone(data);
 				json = Object.merge(moduleData, json);
-				var module = new MWF["FC"+json.type](this);
+				module = new MWF["FC"+json.type](this);
 				module.load(json, dom, parent);
 			}.bind(this), false);
 			return module;
@@ -405,7 +405,7 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 			this.getTemplateData(className, function(data){
 				var moduleData = Object.clone(data);
 				json = Object.merge(moduleData, json);
-				var module = new MWF["FCDiv"](this);
+				module = new MWF["FCDiv"](this);
 				module.load(json, dom, parent);
 			}.bind(this), false);
 			return module;

+ 4 - 1
o2web/source/x_component_process_ProcessDesigner/Main.js

@@ -102,6 +102,7 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
         if (this.shortcut) {
             if (this.process) {
                 //       if (this.process.isFocus){
+                if (!this.paperInNode.contains(document.activeElement)) return false;
                 if (this.process.selectedActivitys.length) {
                     var activitys = [];
                     var routes = [];
@@ -159,6 +160,8 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
     pasteModule: function(){
         if (this.process){
             //        if (this.process.isFocus){
+            if (!this.paperInNode.contains(document.activeElement)) return false;
+
             if (MWF.clipboard.data){
                 if (MWF.clipboard.data.type=="process"){
                     var bakData = Object.clone(this.process.process);
@@ -808,4 +811,4 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
             MWF.release(this.process);
         }
     }
-});
+});