define(function (require, exports, module) { function FixSearchPanelAdapter(id, args, pageId) { this.id = id; this.pageId = pageId; /*组件的配置项opts*/ this.opts = {}; //args ? args.opts : {}; /*组件数据data*/ this.data = {}; //args ? args.data : {}; /*组件行为定义actions*/ this.actions = {}; //args ? args.actions : {}; /* widget viewmodel */ this.vmodel = {}; _init(this, args); } function _init(self, args) { _.extend(self.opts, args.opts); _.extend(self.data, args); //if (args.source.isDataSource) { // args.source.on('onBeforeSearch', function (ds, params) { // if (!self.checkEditorsRequired()) { // params.isCancle = true; // return false; // } // var values = self.getValues(); // if (ds.dataObjType == Store.Enums['DataObjType'].STOREDPROC) { // for (var key in self.vmodel.$editors) { // var col = ds.getColumn(key); // if (col) { // col.paraValue = values[key] || null; // } // } // } else { // var projectQuery = {}; // var relations = ds.getDetailRelations(); // var relationArray = []; // for (var i =0 ; i < relations.length; i+=1) { // var relation = relations[i]; // relationArray.push({ // detailDatasetName: relation.detail.dataSetName, // detailkey: relation.detailColumns.join(','), // masterKey: relation.masterColunms.join(',') // }); // } // // projectQuery.querySchemeId = self.getCurrentSchemeId(); // projectQuery.inputInfo = values; // projectQuery.tableSchema = { // detailRelation: relationArray // }; // projectQuery.funcCode = ds.funcCode; // // params.projectQuery = projectQuery; // } // }); //} _.extend(self.actions, args.actions); } /** * avalon初始化组件时调用 * @return {[type]} [description] */ FixSearchPanelAdapter.prototype.init = function () { }; FixSearchPanelAdapter.prototype.getValues = function () { return "dsadf"; //if (this.vmodel.$getValues) { // return this.vmodel.$getValues(); //} //return {}; }; FixSearchPanelAdapter.prototype.getCurrentSchemeId = function () { if (this.vmodel.$getSchemeId) { return this.vmodel.$getSchemeId(); } }; FixSearchPanelAdapter.prototype.checkEditorsRequired = function() { if (this.vmodel.$checkEditorsRequired) { return this.vmodel.$checkEditorsRequired(); } }; FixSearchPanelAdapter.prototype.setLeftValue = function(value) { this.vmodel.$setLeftValue(value) }; FixSearchPanelAdapter.prototype.getLeftValue = function() { this.vmodel.$getLeftValue() }; FixSearchPanelAdapter.prototype.setFixseachPanel = function(id,value){ this.vmodel.$setFixseachPanel(id,value); }; FixSearchPanelAdapter.prototype.setRightValue = function(value,id){ this.vmodel.$setRightValue(value,id); } return FixSearchPanelAdapter; })