9 changed files with 136 additions and 1 deletions
@ -0,0 +1,17 @@
|
||||
package com.finebi.plugin.tptj.ivan.chart.demo.amap.component; |
||||
|
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.web.struct.Component; |
||||
import com.fr.web.struct.category.ScriptPath; |
||||
|
||||
@Open |
||||
public class AmapDemo extends Component { |
||||
public static final AmapDemo KEY = new AmapDemo(); |
||||
|
||||
private AmapDemo() { |
||||
} |
||||
|
||||
public ScriptPath script() { |
||||
return ScriptPath.build("/com/finebi/plugin/tptj/ivan/chart/demo/amap/widget/bi.amap.demo.js"); |
||||
} |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.finebi.plugin.tptj.ivan.chart.demo.amap.component; |
||||
|
||||
import com.finebi.foundation.api.web.component.AssembleComponentFactory; |
||||
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||
import com.fr.web.struct.Atom; |
||||
|
||||
|
||||
/** |
||||
* 自定义组件需要注入到subject里 |
||||
* |
||||
* @author Ivan.Guo |
||||
* @version 11.0 |
||||
*/ |
||||
public class SubjectComponentProvider extends AbstractWebResourceProvider { |
||||
public SubjectComponentProvider() { |
||||
} |
||||
|
||||
@Override |
||||
public Atom attach() { |
||||
return AssembleComponentFactory.getSubjectComponent(); |
||||
} |
||||
|
||||
@Override |
||||
public Atom[] clients() { |
||||
return new Atom[]{ |
||||
AmapDemo.KEY, |
||||
}; |
||||
} |
||||
} |
@ -0,0 +1,64 @@
|
||||
!(function () { |
||||
/** |
||||
* 自定义组件需优先注入到subject里 |
||||
*/ |
||||
var Demo = BI.inherit(BI.Widget, { |
||||
|
||||
props: { |
||||
baseCls: "" |
||||
}, |
||||
|
||||
render: function () { |
||||
var self = this; |
||||
// self.options包含上次的value和setValue方法
|
||||
debugger; |
||||
return { |
||||
type: "bi.vertical", |
||||
width: 300, |
||||
items: [ |
||||
{ |
||||
el: { |
||||
type: "bi.vertical_adapt", |
||||
items: [ |
||||
{ |
||||
el: { |
||||
type: "bi.label", |
||||
text: "名称", |
||||
textAlign: "left", |
||||
}, |
||||
width: 70, |
||||
rgap: 10, |
||||
}, |
||||
{ |
||||
el: { |
||||
type: "bi.editor", |
||||
value: self.options.value, // 上次设置的value
|
||||
cls: "bi-border bi-border-radius", |
||||
width: 150, |
||||
allowClear: !1, |
||||
height: 24, |
||||
ref: function (e) { |
||||
self.myNameEditor = e; |
||||
}, |
||||
listeners: [ |
||||
{ |
||||
eventName: "EVENT_CHANGE", |
||||
action: function () { |
||||
debugger; |
||||
// 设置value的方法,调用后会刷新页面
|
||||
self.options.setValue(this.getValue()); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
tgap: 10, |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
}); |
||||
BI.shortcut("bi.amap.demo", Demo); |
||||
})(); |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue