diff --git a/demo/js/base/editor/demo.sql_editor.js b/demo/js/base/editor/demo.sql_editor.js index 8be6fdf80c..5a708adb02 100644 --- a/demo/js/base/editor/demo.sql_editor.js +++ b/demo/js/base/editor/demo.sql_editor.js @@ -9,6 +9,7 @@ Demo.SQLEditor = BI.inherit(BI.Widget, { var self = this; this.formula = BI.createWidget({ type : 'bi.sql_editor', + supportParam: true, width : 300, height : 200, value : "select * from DEMO_CONTRACT where 合同类型 = ${长期协议} and 购买数量 = sum([1,2,3,4])" diff --git a/dist/base.js b/dist/base.js index b3c12851c8..c616285d28 100644 --- a/dist/base.js +++ b/dist/base.js @@ -21077,7 +21077,8 @@ BI.SQLEditor = BI.inherit(BI.Widget, { value: "", lineHeight: 2, showHint: true, - supportFunction: false + supportFunction: false, + supportParam: false }); }, _init: function () { @@ -21201,14 +21202,14 @@ BI.SQLEditor = BI.inherit(BI.Widget, { }, setValue: function (v) { - var self = this, result; + var self = this, result, o = this.options; this.refresh(); self.editor.setValue(""); result = this._analyzeContent(v || ""); BI.each(result, function (i, item) { var fieldRegx = /\$[\{][^\}]*[\}]/; var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { + if (BI.isNotEmptyArray(str) && o.supportParam) { self.insertParam(str[0].substring(2, item.length - 1)); } else { self.insertString(item); diff --git a/dist/bundle.js b/dist/bundle.js index 07b85ca46d..fa54ab5750 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -46855,7 +46855,8 @@ BI.SQLEditor = BI.inherit(BI.Widget, { value: "", lineHeight: 2, showHint: true, - supportFunction: false + supportFunction: false, + supportParam: false }); }, _init: function () { @@ -46979,14 +46980,14 @@ BI.SQLEditor = BI.inherit(BI.Widget, { }, setValue: function (v) { - var self = this, result; + var self = this, result, o = this.options; this.refresh(); self.editor.setValue(""); result = this._analyzeContent(v || ""); BI.each(result, function (i, item) { var fieldRegx = /\$[\{][^\}]*[\}]/; var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { + if (BI.isNotEmptyArray(str) && o.supportParam) { self.insertParam(str[0].substring(2, item.length - 1)); } else { self.insertString(item); diff --git a/dist/demo.js b/dist/demo.js index 9e088bdd5c..0ddcded728 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -843,6 +843,7 @@ Demo.SQLEditor = BI.inherit(BI.Widget, { var self = this; this.formula = BI.createWidget({ type : 'bi.sql_editor', + supportParam: true, width : 300, height : 200, value : "select * from DEMO_CONTRACT where 合同类型 = ${长期协议} and 购买数量 = sum([1,2,3,4])" diff --git a/dist/fineui.js b/dist/fineui.js index 307efcfdba..fe12250fcc 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -48549,7 +48549,8 @@ BI.SQLEditor = BI.inherit(BI.Widget, { value: "", lineHeight: 2, showHint: true, - supportFunction: false + supportFunction: false, + supportParam: false }); }, _init: function () { @@ -48673,14 +48674,14 @@ BI.SQLEditor = BI.inherit(BI.Widget, { }, setValue: function (v) { - var self = this, result; + var self = this, result, o = this.options; this.refresh(); self.editor.setValue(""); result = this._analyzeContent(v || ""); BI.each(result, function (i, item) { var fieldRegx = /\$[\{][^\}]*[\}]/; var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { + if (BI.isNotEmptyArray(str) && o.supportParam) { self.insertParam(str[0].substring(2, item.length - 1)); } else { self.insertString(item); diff --git a/src/base/sql/editor.sql.js b/src/base/sql/editor.sql.js index f4c4815dec..1870c4a185 100644 --- a/src/base/sql/editor.sql.js +++ b/src/base/sql/editor.sql.js @@ -8,7 +8,8 @@ BI.SQLEditor = BI.inherit(BI.Widget, { value: "", lineHeight: 2, showHint: true, - supportFunction: false + supportFunction: false, + supportParam: false }); }, _init: function () { @@ -132,14 +133,14 @@ BI.SQLEditor = BI.inherit(BI.Widget, { }, setValue: function (v) { - var self = this, result; + var self = this, result, o = this.options; this.refresh(); self.editor.setValue(""); result = this._analyzeContent(v || ""); BI.each(result, function (i, item) { var fieldRegx = /\$[\{][^\}]*[\}]/; var str = item.match(fieldRegx); - if (BI.isNotEmptyArray(str)) { + if (BI.isNotEmptyArray(str) && o.supportParam) { self.insertParam(str[0].substring(2, item.length - 1)); } else { self.insertString(item);