ItemBean.ets
679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { ItemDTO } from './ItemDTO';
import { Action } from './programme/Action';
import { Pic } from './programme/Pic';
/**
* 绑定到组件comp/view的数据Bean
*/
@Observed
export abstract class ItemBean {
action?: Action; // 事件行为
pics?: Pic
/**
* 是否被曝光
*/
exposed: boolean;
/**
* 曝光位置
*/
position: string;
constructor(dto?: ItemDTO) {
if (dto) {
this.action = dto.action
this.pics = dto.pics
}
this.exposed = false
this.position = "0"
}
public setAction(action: Action): void {
this.action = action
}
public getAction(): Action {
return this.action ?? {} as Action
}
}