北京经济技术开发区经开区虚拟城市项目-【前端】-Web
lixuliang
2024-09-14 c7187e038c284acc051a439c5eda16582bdb9b7a
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
layui.use(['element', 'form', 'upload', 'slider', 'colorpicker', 'laydate'], function () {
    var $ = layui.jquery
        , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
    var form = layui.form;
    var upload = layui.upload;
    var slider = layui.slider;
    var colorpicker = layui.colorpicker;
    var configStyle = parent.configStyle;
    var sgworld = parent.sgworld;
 
    //表单赋值
    colorpicker.render({
        elem: '#test-form'
        , color: '#1c97f5'
        , done: function (color) {
            if(color==""){
                color="#ffffff";
            }
            $('#test-form-input').val(color);
        }
    });
    //表单赋值2
    colorpicker.render({
        elem: '#test-form2'
        , color: '#1c97f5'
        , done: function (color) {
            if(color==""){
                color="#ffffff";
            }
        }
    });
 
    var firstColor = {
        see: null,
        noSee: null
    };
 
    if (!parent.SYFX_visible_color || !parent.SYFX_notVisible_color) {
        if (configStyle && configStyle.syfx_nosee) {
            firstColor.noSee = configStyle.syfx_nosee;
            var unVisible_color = sgworld._cesium.Color.fromCssColorString(configStyle.syfx_nosee);
            parent.SYFX_notVisible_color = {
                r: unVisible_color.red,
                g: unVisible_color.green,
                b: unVisible_color.blue,
                hex: configStyle.syfx_nosee
            };
        } else {
            firstColor.noSee = '#ff0000';
            parent.SYFX_notVisible_color = {r: 1.0, g: 0.0, b: 0.0, hex: '#ff0000'};
        }
 
        if (configStyle && configStyle.syfx_see) {
            firstColor.see = configStyle.syfx_see;
            var visible_color = sgworld._cesium.Color.fromCssColorString(configStyle.syfx_see);
            parent.SYFX_visible_color = {
                r: visible_color.red,
                g: visible_color.green,
                b: visible_color.blue,
                hex: configStyle.syfx_see
            };
        } else {
            firstColor.see = '#00ff00';
            parent.SYFX_visible_color = {r: 0.0, g: 1.0, b: 0.0, hex: '#00ff00'};
        }
    } else {
        firstColor.noSee = parent.SYFX_notVisible_color.hex;
        firstColor.see = parent.SYFX_visible_color.hex;
    }
    $('#visibleArea-input').val(firstColor.see);
    $('#unVisibleArea-input').val(firstColor.noSee);
 
    //表单赋值
    colorpicker.render({
        elem: '#visibleArea'
        , color: firstColor.see
        , done: function (color) {
            if(color==""){
                color="#ffffff";
            }
            $('#visibleArea-input').val(color);
            var visible_color = sgworld._cesium.Color.fromCssColorString(color);
            parent.SYFX_visible_color = {
                r: visible_color.red,
                g: visible_color.green,
                b: visible_color.blue,
                hex: color
            };
        }
    });
 
 
    //表单赋值2
    colorpicker.render({
        elem: '#unVisibleArea'
        , color: firstColor.noSee
        , done: function (color) {
            if(color==""){
                color="#ffffff";
            }
            $('#unVisibleArea-input').val(color);
            var unVisible_color = sgworld._cesium.Color.fromCssColorString(color);
            parent.SYFX_notVisible_color = {
                r: unVisible_color.red,
                g: unVisible_color.green,
                b: unVisible_color.blue,
                hex: color
            };
        }
    });
 
    //自定义颜色
    slider.render({
        elem: '#slideTest15'
        , theme: '#1E9FFF' //主题色
    });
    slider.render({
        elem: '#slideTest16'
        , theme: '#1E9FFF' //主题色
    });
    slider.render({
        elem: '#slideTest17'
        , theme: '#1E9FFF' //主题色
    });
    slider.render({
        elem: '#slideTest18'
        , theme: '#1E9FFF' //主题色
    });
    slider.render({
        elem: '#slideTest19'
        , theme: '#1E9FFF' //主题色
    });
 
});