广州市综治平台前端
xusd
3 days ago 9cbfaa22c35822e4f2f985907fce5da4c9ef7ac9
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
/*
 * @Company: hugeInfo
 * @Author: ldh
 * @Date: 2022-05-17 11:29:47
 * @LastEditTime: 2022-05-17 15:00:42
 * @LastEditors: ldh
 * @Version: 1.0.0
 * @Description: sop组件状态集
 */
class sopStatus {
    constructor() {
        this.visible = false;
        this.type = undefined;
        this.handleVisible = null;
        this.handleSetType = null;
    }
 
    // sop显隐
    setVisibleFunc(func) {
        let that = this;
        this.handleVisible = (visible) => {
            that.visible = typeof visible === 'boolean' ? visible : !that.visible;
            func(that.visible);
        };
    }
 
    // 设置sop的type
    setDataTypeFunc(func) {
        let that = this;
        this.handleSetType = (type) => {
            that.type = type;
            func(that.type);
        };
    }
}
 
export default new sopStatus();