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

修复流程Opinion可能的错误

unknown 5 лет назад
Родитель
Сommit
8caa03471d
1 измененных файлов с 11 добавлено и 9 удалено
  1. 11 9
      o2web/source/x_component_process_Xform/Opinion.js

+ 11 - 9
o2web/source/x_component_process_Xform/Opinion.js

@@ -364,21 +364,23 @@ MWF.xApplication.process.Xform.Opinion = MWF.APPOpinion =  new Class({
             this.searcheOpinionId = "";
         }
     },
-    searchOpinions: function(t){
+    searchOpinions: function(t) {
         var value = this.input.get("value");
         var arr = value.split(/[\n\r]/g);
         lines = arr.length;
-        value = arr[arr.length-1];
+        value = arr[arr.length - 1];
         var offsetValue = value;
         //var offsetValue = value.substr(0, value.length-t.length);
 
-        var ops = this.userOpinions.filter(function(v, i){
-            return v.contains(t) && (v!=t);
-        }.bind(this));
-        if (ops.length){
-            this.showSelectOpinionNode(ops, offsetValue, lines);
-        }else{
-            this.hideSelectOpinionNode(ops);
+        if (this.userOpinions){
+            var ops = this.userOpinions.filter(function (v, i) {
+                    return v.contains(t) && (v != t);
+                }.bind(this));
+            if (ops.length) {
+                this.showSelectOpinionNode(ops, offsetValue, lines);
+            } else {
+                this.hideSelectOpinionNode(ops);
+            }
         }
     },
     hideSelectOpinionNode: function(){