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.

35 lines
1019 B

8 years ago
/**
* guy
*/
import { Behavior } from "./0.behavior";
import { isFunction, each } from "../2.base";
import { Single } from "@/base/single/0.single";
export class HighlightBehavior extends Behavior {
doBehavior(items) {
const args = Array.prototype.slice.call(arguments, 1),
{ rule } = this.options;
each(items, (i, item) => {
if (item instanceof Single) {
const rules = rule(item.getValue(), item);
8 years ago
7 years ago
function doBe (run) {
8 years ago
if (run === true) {
item.doHighLight && item.doHighLight(...args);
8 years ago
} else {
item.unHighLight && item.unHighLight(...args);
8 years ago
}
}
if (isFunction(rules)) {
rules(doBe);
8 years ago
} else {
doBe(rules);
8 years ago
}
} else {
item.doBehavior && item.doBehavior(...args);
8 years ago
}
7 years ago
});
8 years ago
}
}