fineui是帆软报表和BI产品线所使用的前端框架。
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.

235 lines
7.0 KiB

8 years ago
Demo.Button = BI.inherit(BI.Widget, {
props: {
8 years ago
baseCls: "demo-button"
8 years ago
},
render: function () {
7 years ago
var items = [{
el: {
type: "bi.button",
text: "一般按钮",
level: "common",
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示成功状态按钮",
level: "success",
height: 30
}
},
8 years ago
{
el: {
7 years ago
type: "bi.button",
text: "表示警告状态的按钮",
level: "warning",
8 years ago
height: 30
}
}, {
el: {
type: "bi.button",
text: "表示错误状态的按钮",
level: "error",
height: 30
}
8 years ago
}, {
el: {
7 years ago
type: "bi.button",
text: "表示忽略状态的按钮",
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "普通灰化按钮",
8 years ago
disabled: true,
7 years ago
level: "success",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "忽略状态灰化按钮",
8 years ago
disabled: true,
7 years ago
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "带图标的按钮",
// level: 'ignore',
7 years ago
iconCls: "close-font",
8 years ago
height: 30
}
8 years ago
}, {
el: {
7 years ago
type: "bi.button",
text: "一般按钮",
8 years ago
block: true,
7 years ago
level: "common",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "表示成功状态按钮",
8 years ago
block: true,
7 years ago
level: "success",
8 years ago
height: 30
}
},
{
el: {
7 years ago
type: "bi.button",
text: "表示警告状态的按钮",
8 years ago
block: true,
7 years ago
level: "warning",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "表示忽略状态的按钮",
8 years ago
block: true,
7 years ago
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "普通灰化按钮",
8 years ago
block: true,
disabled: true,
7 years ago
level: "success",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "忽略状态灰化按钮",
8 years ago
block: true,
disabled: true,
7 years ago
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "带图标的按钮",
8 years ago
block: true,
7 years ago
// level: 'ignore',
7 years ago
iconCls: "close-font",
8 years ago
height: 30
}
8 years ago
}, {
el: {
7 years ago
type: "bi.button",
text: "一般按钮",
8 years ago
clear: true,
7 years ago
level: "common",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "表示成功状态按钮",
8 years ago
clear: true,
7 years ago
level: "success",
8 years ago
height: 30
}
},
{
el: {
7 years ago
type: "bi.button",
text: "表示警告状态的按钮",
8 years ago
clear: true,
7 years ago
level: "warning",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "表示忽略状态的按钮",
8 years ago
clear: true,
7 years ago
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "普通灰化按钮",
8 years ago
clear: true,
disabled: true,
7 years ago
level: "success",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "忽略状态灰化按钮",
8 years ago
clear: true,
disabled: true,
7 years ago
level: "ignore",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.button",
text: "带图标的按钮",
8 years ago
clear: true,
7 years ago
// level: 'ignore',
7 years ago
iconCls: "close-font",
8 years ago
height: 30
}
}, {
el: {
7 years ago
type: "bi.text_button",
text: "文字按钮",
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)",
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "幽灵按钮(common)灰化",
disabled: true,
ghost: true,
height: 30
}
}, {
el: {
type: "bi.button",
text: "弹出bubble",
bubble: function () {
return BI.parseInt(Math.random() * 100) % 10 + "提示"
},
handler: function () {
BI.Msg.toast("1111");
},
height: 30
}
8 years ago
}
];
// BI.each(items, function (i, item) {
// item.el.handler = function () {
// BI.Msg.alert("按钮", this.options.text);
// };
// });
8 years ago
return {
8 years ago
type: "bi.left",
scrolly: true,
8 years ago
vgap: 100,
8 years ago
hgap: 20,
items: items
7 years ago
};
8 years ago
}
});
8 years ago
BI.shortcut("demo.button", Demo.Button);