2018-06-15 23:03:24 +08:00
|
|
|
import computed from "ember-addons/ember-computed-decorators";
|
2015-09-16 04:45:01 +08:00
|
|
|
|
2015-08-12 00:27:07 +08:00
|
|
|
export default Ember.Controller.extend({
|
2018-07-20 02:33:11 +08:00
|
|
|
queryParams: ["start_date", "end_date", "category_id", "group_id"],
|
2016-02-03 10:29:51 +08:00
|
|
|
|
2018-06-15 23:03:24 +08:00
|
|
|
@computed("model.type")
|
2018-07-20 02:33:11 +08:00
|
|
|
reportOptions(type) {
|
2018-08-02 06:40:59 +08:00
|
|
|
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
|
2016-04-21 15:33:23 +08:00
|
|
|
|
2018-07-20 02:33:11 +08:00
|
|
|
if (type === "top_referred_topics") {
|
|
|
|
options.table.limit = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return options;
|
2016-02-03 10:29:51 +08:00
|
|
|
},
|
2015-07-04 00:58:13 +08:00
|
|
|
|
2018-07-26 01:16:35 +08:00
|
|
|
@computed("category_id", "group_id", "start_date", "end_date")
|
2018-07-27 13:22:00 +08:00
|
|
|
filters(categoryId, groupId, startDate, endDate) {
|
2018-07-26 01:16:35 +08:00
|
|
|
return {
|
|
|
|
categoryId,
|
|
|
|
groupId,
|
|
|
|
startDate,
|
|
|
|
endDate
|
|
|
|
};
|
|
|
|
},
|
2015-09-16 04:45:01 +08:00
|
|
|
|
2018-07-26 01:16:35 +08:00
|
|
|
actions: {
|
|
|
|
onParamsChange(params) {
|
|
|
|
this.setProperties({
|
|
|
|
start_date: params.startDate,
|
|
|
|
category_id: params.categoryId,
|
|
|
|
group_id: params.groupId,
|
|
|
|
end_date: params.endDate
|
|
|
|
});
|
2013-09-17 02:08:55 +08:00
|
|
|
}
|
2013-03-18 03:02:36 +08:00
|
|
|
}
|
2014-06-10 23:54:38 +08:00
|
|
|
});
|