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
1.1 KiB
35 lines
1.1 KiB
class Report { |
|
constructor(report) { |
|
this.reportId = report.reportId; |
|
this.reportName = report.reportName; |
|
this.cancelDefaultLinkag = report.cancelDefaultLinkag; |
|
this.createBy = report.createBy; |
|
this.filter = report.filter; |
|
this.freeWidgetIds = report.freeWidgetIds; |
|
this.linkageGroup = report.linkageGroup; |
|
this.mobileWidgetConfig = report.mobileWidgetConfig; |
|
this.templateStyle = report.templateStyle; |
|
this.widgets = {}; |
|
for (const wId in report.widgets) { |
|
this.widgets[wId] = new Widget(report.widgets[wId]); |
|
} |
|
} |
|
|
|
/** |
|
* 找组件名是xxx的组件 |
|
* 组件名是富文本,需要解析富文本才能拿到文字信息 |
|
* 名字不应该特别复杂 |
|
*/ |
|
getWidgetByName(name) { |
|
let widget; |
|
for (const wId in this.widgets) { |
|
const w = this.widgets[wId]; |
|
if (w.getPlainWidgetName() === name) { |
|
widget = w; |
|
break; |
|
} |
|
} |
|
|
|
return widget; |
|
} |
|
} |