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.
|
|
|
|
|
|
|
|
|
define(function (require, exports, module) {
|
|
|
|
|
|
|
|
|
|
function MenuAdapter(id, args, pageId) {
|
|
|
|
|
|
|
|
|
|
this.id = id;
|
|
|
|
|
this.pageId = pageId;
|
|
|
|
|
|
|
|
|
|
/*组件的配置项opts*/
|
|
|
|
|
//enable: opts.simpleData,
|
|
|
|
|
//idKey: opts.idKey, //默认id
|
|
|
|
|
//pIdKey: opts.pIdKey, //默认pid
|
|
|
|
|
//rootPId: opts.rootPId
|
|
|
|
|
//
|
|
|
|
|
this.opts = args ? args.opts : {};
|
|
|
|
|
|
|
|
|
|
/*组件数据data*/
|
|
|
|
|
//data类型为Array
|
|
|
|
|
//元素结构为
|
|
|
|
|
//{
|
|
|
|
|
// id:'', //当前元素id,该名称可通过opts里的idKey来指定名称
|
|
|
|
|
// pid:'', //父id,该名称可通过opts里的pidkey来指定名称
|
|
|
|
|
// name:'' //显示内容
|
|
|
|
|
//
|
|
|
|
|
//}
|
|
|
|
|
this.data = args.data || [];
|
|
|
|
|
|
|
|
|
|
/*组件行为定义actions*/
|
|
|
|
|
this.actions = args ? args.actions : {};
|
|
|
|
|
|
|
|
|
|
/* widget viewmodel */
|
|
|
|
|
this.vmodel = {};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* avalon初始化组件时调用
|
|
|
|
|
* @return {[type]} [description]
|
|
|
|
|
*/
|
|
|
|
|
MenuAdapter.prototype.init = function () {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MenuAdapter.prototype.reset = function (nodes) {
|
|
|
|
|
if (this.vmodel.$menu) {
|
|
|
|
|
this.vmodel.$reset(nodes);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return MenuAdapter;
|
|
|
|
|
|
|
|
|
|
})
|