You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.5 KiB

4 years ago
define(function (require, exports, module) {
function CompBottomAdapter(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]
*/
CompBottomAdapter.prototype.init = function () {
};
CompBottomAdapter.prototype.getValues = function () {
return "dsadf";
//if (this.vmodel.$getValues) {
// return this.vmodel.$getValues();
//}
//return {};
};
CompBottomAdapter.prototype.getCurrentSchemeId = function () {
if (this.vmodel.$getSchemeId) {
return this.vmodel.$getSchemeId();
}
};
CompBottomAdapter.prototype.checkEditorsRequired = function() {
if (this.vmodel.$checkEditorsRequired) {
return this.vmodel.$checkEditorsRequired();
}
};
CompBottomAdapter.prototype.setLeftValue = function(value) {
this.vmodel.$setLeftValue(value);
};
CompBottomAdapter.prototype.setFixseachPanel = function(id,value){
this.vmodel.$setFixseachPanel(id,value);
};
CompBottomAdapter.prototype.setRightValue = function(id,value){
this.vmodel.$setRightValue(id,value);
};
return CompBottomAdapter;
});