surprise
2023-12-05 6ecef4176f6d9df60cd1a753a36e09cd96bce9b8
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export default {
    methods: {
        // 编辑
        editWfs(editType, editData) {
            let value = Cesium.defaultValue(this.data[this.data.class][editType], this.data[editType])
            if (value === undefined && this.polygonLabel) {
                value = this.data.point[editType]
            }
            let data = {}
            if (editType === 'pointType') {
                if (this.pointType === 'label') {
                    data = {
                        text: this.data.text,
                        image: ''
                    }
                } else if (this.pointType === 'billboard') {
                    data = {
                        image: this.data.image,
                        text: ''
                    }
                } else {
                    data = {
                        text: this.data.text,
                        image: this.data.image
                    }
                }
            } else if (editType === 'color') {
                let color = window.Cesium.Color.fromCssColorString(this.data.color);
                let alpha = color.alpha;
                color.alpha = 1;
                data = {
                    color: color.toCssHexString(),
                    alpha: alpha
                };
            } else if (editType === 'showBackground') {
                editData.bgColor = this.showBackground ? '#ff0000' : ''
            } else if (editType === 'IgnoreShelter') {
                this.IgnoreShelter ? (data.disableDepthTestDistance = "Infinity") : (data.disableDepthTestDistance = 0);
            } else if (editType === 'fontStyle') {
                this.fontStyle.includes("bold") ? data.bold = true : data.bold = false;
                this.fontStyle.includes("italic") ? data.italic = true : data.italic = false;
            } else if (editType === 'polygonLabel') {
                data.text = this.polygonLabel ? this.data.text : ''
            } else {
                data[editType] = value
            }
            Object.assign(editData, data)
            return sgworld._treeTool.addData(editData)
        },
        // 还原
        restore(wfsData) {
            wfsData.destroy();
            sgworld._treeTool.addData(this.defaultEditData);
        }
    }
}