From 7acf7ad6948e3e952173a2551ea4a92a8ff56c35 Mon Sep 17 00:00:00 2001 From: suerprisePlus <15810472099@163.com> Date: 星期四, 06 六月 2024 19:36:48 +0800 Subject: [PATCH] 1 --- public/CimSDK/Workers/prop/jb_prop.html | 142 +++++++++++++++++++++++++++++++++++------------ 1 files changed, 106 insertions(+), 36 deletions(-) diff --git a/public/CimSDK/Workers/prop/jb_prop.html b/public/CimSDK/Workers/prop/jb_prop.html index 4a1af08..bdb48d9 100644 --- a/public/CimSDK/Workers/prop/jb_prop.html +++ b/public/CimSDK/Workers/prop/jb_prop.html @@ -5,7 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> - <title>灞炴��</title> + <title>Property</title> <link rel="stylesheet" href="../layui/css/layui.css"> <style> html, @@ -77,46 +77,47 @@ .outline { display: none; } + .layui-colorpicker-main-input input.layui-input{ + width:135px; + } </style> </head> <body> <div id="Attribute" style="margin:0 10px;"> <div class="attrTitle"> - <legend>鏍峰紡淇℃伅</legend> - <!-- <button type="button" class="layui-btn layui-btn-danger removeGraphic" onclick="removeGraphic()">绉婚櫎</button> --> + <legend id="styleInfo"></legend> </div> <!--璐村湴绾�--> <div class="props GroundPolyline" style="display: none"> <form class="layui-form" action=""> <div class="layui-form-item"> - <label class="layui-form-label">绫诲瀷</label> - <div class="layui-input-block" style="line-height: 38px;"> - 璐村湴绾� + <label class="layui-form-label" id="labelLineType"></label> + <div class="layui-input-block" style="line-height: 38px;" id="clampToGroundLine"> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">鍚嶇О</label> + <label class="layui-form-label" id="labelLineName"></label> <div class="layui-input-block"> - <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="璐村湴绾�" + <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputLineName" value="" class="layui-input"> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">绾垮</label> + <label class="layui-form-label" id="labelLineWidth"></label> <div class="layui-input-block"> <input type="text" name="width" lay-verify="title" autocomplete="off" placeholder="0" onkeyup="value=value.replace(/[^\d\.]/g,'')" class="layui-input"> </div> </div> <div class="layui-form-item" style="height: 40px;"> - <label class="layui-form-label">濉厖鑹�</label> - <div class="layui-input-block"> + <label class="layui-form-label" id="labelLineFillColor"></label> + <div class="layui-input-block" onclick="changeLanguage()"> <div id="colorchk-GroundPolyline" style="display: inline-block;margin-top: 2px;"></div> </div> </div> <div class="layui-form-item" style="position:relative;border: 1px #fff solid;"> - <label class="layui-form-label">濉厖閫忔槑搴�</label> + <label class="layui-form-label" id="labelLineFillAlpha"></label> <div class="layui-input-block" style="position: absolute;top: 16px"> <div id="opacity-GroundPolyline" class="demo-slider"></div> </div> @@ -127,26 +128,25 @@ <div class="props GroundPolygon" style="display: none"> <form class="layui-form" action=""> <div class="layui-form-item"> - <label class="layui-form-label">绫诲瀷</label> - <div class="layui-input-block" style="line-height: 38px;"> - 璐村湴闈� + <label class="layui-form-label" id="labelPolygonType"></label> + <div class="layui-input-block" style="line-height: 38px;" id="clampToGroundPolygon"> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">鍚嶇О</label> + <label class="layui-form-label" id="labelPolygonName"></label> <div class="layui-input-block"> - <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="璐村湴闈�" + <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputPolygonName" value="" class="layui-input"> </div> </div> <div class="layui-form-item" style="height: 40px;"> - <label class="layui-form-label">濉厖鑹�</label> - <div class="layui-input-block"> + <label class="layui-form-label" id="labelPolygonFillColor"></label> + <div class="layui-input-block" onclick="changeLanguage()"> <div id="colorchk-GroundPolygon" style="display: inline-block;margin-top: 2px;"></div> </div> </div> <div class="layui-form-item" style="position:relative;border: 1px #fff solid;"> - <label class="layui-form-label">濉厖閫忔槑搴�</label> + <label class="layui-form-label" id="labelPolygonFillAlpha"></label> <div class="layui-input-block" style="position: absolute;top: 16px"> <div id="opacity-GroundPolygon" class="demo-slider"></div> </div> @@ -157,52 +157,51 @@ <div class="props ExtrudedPolygon" style="display: none"> <form class="layui-form" action=""> <div class="layui-form-item"> - <label class="layui-form-label">绫诲瀷</label> - <div class="layui-input-block" style="line-height: 38px;"> - 鎷変几闈� + <label class="layui-form-label" id="labelExtrudeType"></label> + <div class="layui-input-block" style="line-height: 38px;" id="extrudePolygon"> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">鍚嶇О</label> + <label class="layui-form-label" id="labelExtrudeName"></label> <div class="layui-input-block"> - <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" value="鎷変几闈�" + <input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="0" id="inputExtrudeName" value="" class="layui-input"> </div> </div> <div class="layui-form-item" style="height: 40px;"> - <label class="layui-form-label">濉厖鑹�</label> - <div class="layui-input-block"> + <label class="layui-form-label" id="labelExtrudeFillColor"></label> + <div class="layui-input-block" onclick="changeLanguage()"> <div id="colorchk-ExtrudedPolygon" style="display: inline-block;margin-top: 2px;"></div> </div> </div> <div class="layui-form-item" style="position:relative"> - <label class="layui-form-label">濉厖閫忔槑搴�</label> + <label class="layui-form-label" id="labelExtrudeFillAlpha"></label> <div class="layui-input-block" style="position: absolute;top: 16px"> <div id="opacity-ExtrudedPolygon" class="demo-slider"></div> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label">鎷変几楂樺害</label> + <label class="layui-form-label" id="labelExtrudeHeight"></label> <div class="layui-input-block"> <input type="text" name="height" lay-verify="title" autocomplete="off" placeholder="0" onkeyup="value=value.replace(/[^\d\.]/g,'')" class="layui-input"> </div> </div> <div class="layui-form-item" style="border: 1px #fff solid;"> - <label class="layui-form-label">鏄惁鏄剧ず杈规</label> + <label class="layui-form-label" id="labelShowBorder"></label> <div class="layui-input-block"> <input type="checkbox" lay-skin="switch" id="showExtrudedPolygonOutline" - lay-filter="showExtrudedPolygonOutline" title="寮�鍏�"> + lay-filter="showExtrudedPolygonOutline" lay-text=""> </div> </div> <div class="layui-form-item outline" style="height: 40px;border-top: none;"> - <label class="layui-form-label">杈规鑹�</label> - <div class="layui-input-block"> + <label class="layui-form-label" id="labelBorderColor"></label> + <div class="layui-input-block" onclick="changeLanguage()"> <div id="colorchk-ExtrudedPolygon2" style="display: inline-block;margin-top: 2px;"></div> </div> </div> <div class="layui-form-item outline" style="position:relative;border: 1px #fff solid;"> - <label class="layui-form-label">杈规閫忔槑搴�</label> + <label class="layui-form-label" id="labelBorderAlpha"></label> <div class="layui-input-block" style="position: absolute;top: 16px"> <div id="opacity-ExtrudedPolygon2" class="demo-slider"></div> </div> @@ -217,6 +216,42 @@ var PopupData = parent.SmartEarthPopupData; var type = PopupData.propType; var editGraphic = PopupData.editGraphic; + function changeLanguage() { + var elementClear = document.getElementsByClassName("layui-btn layui-btn-sm") + if(elementClear.length === 2 ){ + elementClear[0].innerText = `${Viewer.language.COMMON_CLEAR}` + elementClear[1].innerText = `${Viewer.language.COMMON_CONFIRM}` + } + } + document.getElementById("styleInfo").innerText = `${Viewer.language.SG_STYLE_INFO}` + //璐村湴绾� + document.getElementById("labelLineType").innerText = `${Viewer.language.SG_PROP_TYPE}` + document.getElementById("clampToGroundLine").innerText = `${Viewer.language.SG_CLAMP_TO_GROUND_LINE}` + document.getElementById("labelLineName").innerText = `${Viewer.language.SG_PROP_NAME}` + document.getElementById("inputLineName").setAttribute('value',`${Viewer.language.SG_CLAMP_TO_GROUND_LINE}`) + document.getElementById("labelLineWidth").innerText = `${Viewer.language.SG_PROP_LINE_WIDTH}` + document.getElementById("labelLineFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` + document.getElementById("labelLineFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` + //璐村湴闈� + document.getElementById("labelPolygonType").innerText = `${Viewer.language.SG_PROP_TYPE}` + document.getElementById("clampToGroundPolygon").innerText = `${Viewer.language.SG_CLAMP_TO_GROUND_POLYGON}` + document.getElementById("labelPolygonName").innerText = `${Viewer.language.SG_PROP_NAME}` + document.getElementById("inputPolygonName").setAttribute('value',`${Viewer.language.SG_CLAMP_TO_GROUND_POLYGON}`) + document.getElementById("labelPolygonFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` + document.getElementById("labelPolygonFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` + //鎷変几闈� + document.getElementById("labelExtrudeType").innerText = `${Viewer.language.SG_PROP_TYPE}` + document.getElementById("extrudePolygon").innerText = `${Viewer.language.SG_EXTRUDE_POLYGON}` + document.getElementById("labelExtrudeName").innerText = `${Viewer.language.SG_PROP_NAME}` + document.getElementById("inputExtrudeName").setAttribute('value',`${Viewer.language.SG_EXTRUDE_POLYGON}`) + document.getElementById("labelExtrudeFillColor").innerText = `${Viewer.language.SG_PROP_FILL_COLOR}` + document.getElementById("labelExtrudeFillAlpha").innerText = `${Viewer.language.SG_PROP_FILL_ALPHA}` + document.getElementById("labelExtrudeHeight").innerText = `${Viewer.language.SG_EXTRUDE_HEIGHT}` + document.getElementById("labelShowBorder").innerText = `${Viewer.language.SG_PROP_SHOW_BORDER}` + document.getElementById("labelBorderColor").innerText = `${Viewer.language.SG_PROP_BORDER_COLOR}` + document.getElementById("labelBorderAlpha").innerText = `${Viewer.language.SG_PROP_BORDER_ALPHA}` + document.getElementById("showExtrudedPolygonOutline").setAttribute("lay-text", `${Viewer.language.SG_ON_OR_OFF}`) + !editGraphic && (editGraphic = {}); if (editGraphic.graphic && editGraphic.graphic.material && editGraphic.graphic.material.color && editGraphic.graphic.material.color._value) { getFillColor(editGraphic.graphic.material.color._value); @@ -367,7 +402,19 @@ var value = $(this).val().replace(/[^\d\.]/g, ''); if (value === '' || value === '.') return; if (editGraphic.graphic && editGraphic.graphic.width) { + if(editGraphic.graphic.customData){ + editGraphic.graphic.customData.forEach(element => { + if(element.polyline) { + element.polyline.width = parseFloat(value); + } + if(element.polygon){ + element.polygon.width = parseFloat(value); + } + + }); + } else { editGraphic.graphic.width = parseFloat(value); + } } }); @@ -377,7 +424,18 @@ , max: 100 //鏈�澶у�� , value: editGraphic.alpha , change: function (value) { + if(editGraphic.graphic.customData){ + editGraphic.graphic.customData.forEach(element => { + if(element.polyline) { + element.polyline.material._color._value.alpha = value / 100; + } + if(element.polygon){ + element.polygon.material._color._value.alpha = value / 100; + } + }); + } else { editGraphic.graphic.material._color._value.alpha = value / 100; + } } }); @@ -385,9 +443,21 @@ elem: '#colorchk-GroundPolyline' , color: (editGraphic && editGraphic.fillColor) || '#ff0000' //璁剧疆榛樿鑹� , done: function (color) { - editGraphic.fillColor = color; + editGraphic.fillColor = color; + editGraphic.graphic.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); + if(editGraphic.graphic.customData){ + editGraphic.graphic.customData.forEach(element => { + if(element.polyline) { + element.polyline.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); + } + if(element.polygon){ + element.polygon.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); + } + }); + } else { editGraphic.graphic.material.color.setValue(new Cesium.Color.fromCssColorString(editGraphic.fillColor).withAlpha(editGraphic.alpha / 100)); - } + } + } }); } -- Gitblit v1.9.3