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' //主题色
|
});
|
|
});
|