From ebc4c778854c8d2666b1bbaf3dcba2ba00f08453 Mon Sep 17 00:00:00 2001 From: ansel0926 <ansel0926@gmail.com> Date: 星期日, 15 五月 2022 18:42:46 +0800 Subject: [PATCH] 编辑线、面,文字标记和图片标记点 --- view/project/editLabel.html | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 10 deletions(-) diff --git a/view/project/editLabel.html b/view/project/editLabel.html index 2345bcc..4bbdcba 100644 --- a/view/project/editLabel.html +++ b/view/project/editLabel.html @@ -12,6 +12,13 @@ margin-left: 30px; margin-top: 5px; } + .text2{ + float:left; + color:white; + font-size:16px; + margin-left: 30px; + margin-top: 20px; + } .labelInput { width: 150px; height: 30px; @@ -29,6 +36,24 @@ border-bottom-left-radius: 2px; background-color: rgba(63, 72, 84, 0.7); color: white; + } + .textarea{ + width: 240px; + height: 140px; + margin-left: 25px; + margin-right: 50px; + margin-top: 5px; + font-size: 16px; + text-indent: 8px; + outline: 0; + border: none; + border-color: #3b403f; + /* box-shadow: 0 2px 6px #3a3c42; */ + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; + background-color: rgba(63, 72, 84, 0.7); + color: white; + resize:none; } .my-save-btn{ margin-top: 80px; @@ -77,20 +102,20 @@ <div style="margin-top: 20px;"> <form class="layui-form" action=""> <div> - <span class="text">鍐呭</span> + <span class="text">鏍囩</span> <input id="input" class="labelInput" type="text" placeholder="杈撳叆鏂囧瓧" autocomplete="off" oninput="labelChange(event)" onporpertychange="labelChange(event)"/> </div> <div> <div style="display:inline-block;margin-top: 20px;margin-left: 30px;color:white"> - 瀛椾綋棰滆壊 + 鏍囩棰滆壊 </div> <div id="colorSelect" style="display:inline-block;margin-top: 5px;"> </div> </div> <div> <div style="display:inline-block;margin-top: 20px;margin-left: 30px;color:white"> - 瀛椾綋澶у皬 - </div> + 鏍囩澶у皬 + </div> <div style="display:inline-block;margin-top: 5px; width: 150px;"> <select id="fontsize" lay-verify="required" class="my-select" lay-filter="fontsize"> <option value="10">10</option> @@ -113,33 +138,39 @@ </div> <div> <div style="display:inline-block;margin-top: 20px;margin-left: 30px;color:white"> - 瀛椾綋 + 鏍囩瀛椾綋 </div> - <div style="display:inline-block;margin-top: 5px; margin-left:28px;;width: 150px;"> + <div style="display:inline-block;margin-top: 5px;width: 150px;"> <select id="fontfamily" lay-verify="required" class="my-select" lay-filter="fontfamily"> <option value="SimSun">瀹嬩綋</option> <option value="SimHei">榛戜綋</option> - <option value="Microsoft Yahei">寰蒋闆呴粦</option> + <option value="Microsoft">寰蒋闆呴粦</option> <option value="KaiTi">妤蜂綋</option> <option value="FangSong">浠垮畫</option> <option value="LiSu">闅朵功</option> <option value="MingLiU">缁嗘槑浣�</option> - </select> </div> </div> + <div> + <span class="text2" >鍐呭</span> + <textarea id="textarea" class="textarea" placeholder="杈撳叆鍐呭" autocomplete="off" oninput="contentChange(event)" onporpertychange="contentChange(event)"></textarea> + </div> + <!-- <button class="my-save-btn" onclick="closeframe()">瀹屾垚</button> --> </form> </div> <script> var currentLabelId - function child(id,text,fontColor,fontSize,fontfamily) { + function child(id,text,fontColor,fontSize,fontfamily,content) { currentLabelId=id layui.use(['element', 'layer', 'form','colorpicker'], function () { var element = layui.element; var form = layui.form; var colorpicker = layui.colorpicker; $("#input").val(text) + let textarea=document.getElementById("textarea") + textarea.innerHTML=content; colorpicker.render({ elem: '#colorSelect', color: fontColor, @@ -151,6 +182,7 @@ // parent.updateLabel(2,currentLabelId,color); // }, }); + fontSize=parseInt(fontSize); $("#fontsize").val(fontSize); form.on("select(fontsize)", function (data) { parent.updateLabel(3,currentLabelId,data.value); @@ -165,7 +197,9 @@ function labelChange(e) { parent.updateLabel(1,currentLabelId,$("#input").val()); } - + function contentChange(e) { + parent.updateLabel(5,currentLabelId,$("#textarea").val()); + } </script> -- Gitblit v1.9.1