Browse Source

init

master
zsmj1994 5 years ago
parent
commit
7ef97efa84
  1. 2
      README.md
  2. BIN
      screenshots/demo.gif
  3. 11
      src/index.js
  4. 29
      src/model.js
  5. 44
      src/view.js

2
README.md

@ -1,3 +1,5 @@
# directory-external-item # directory-external-item
目录面板详细信息编辑拓展额外项 目录面板详细信息编辑拓展额外项
![](./screenshots/demo.gif)

BIN
screenshots/demo.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

11
src/index.js

@ -0,0 +1,11 @@
!(function() {
BI.config("dec.provider.directory", function(provider) {
provider.inject({
externalDetailItems: [
{
type: "dec.demo"
}
]
});
});
})();

29
src/model.js

@ -0,0 +1,29 @@
!(function() {
var Store = BI.inherit(Fix.Model, {
state: function() {
return {
carrierInfo: {
carrierType: "depost",
pending: false
},
entityInfo: {
entityType: "entry",
entityId: null,
privilegeDetailBeanList: null
}
};
},
childContext: ["carrierInfo", "entityInfo"],
actions: {
changeEntityInfo: function(cardInfo) {
this.model.entityInfo = BI.extend({}, this.model.entityInfo, {
entityId: cardInfo.id
});
}
}
});
BI.model("dec.model.demo", Store);
})();

44
src/view.js

@ -0,0 +1,44 @@
!(function() {
var Demo = BI.inherit(BI.Widget, {
props: {
height: 600
},
_store: function() {
return BI.Models.getModel("dec.model.demo");
},
render: function() {
return {
type: "bi.vtape",
items: [
{
el: {
type: "bi.label",
textAlign: "left",
hgap: 10,
text: "权限详情"
},
height: 30
},
{
el: {
type: "dec.authority.quick.config.pane"
}
}
]
};
},
getValue: function() {
// 额外组件如果无需返回值,返回空对象
return {};
},
populate: function(cardInfo) {
this.store.changeEntityInfo(cardInfo);
}
});
BI.shortcut("dec.demo", Demo);
})();
Loading…
Cancel
Save