فهرست منبع

修复单报告页面 图片无法拖拽的问题

insomniaLee 5 سال پیش
والد
کامیت
41bf190100

+ 0 - 1
src/main/resources/static/js/agg_report_new.js

@@ -9,7 +9,6 @@ $(function () {
 });
 
 initMaster=function (masterId) {
-    console.log("zhixing")
     $('.nodes').html("");
     $('.links').html(""); // clear content of node, in order to refresh
     function createImg(src) {

+ 56 - 0
src/main/resources/static/js/single_report.js

@@ -0,0 +1,56 @@
+$(function () {
+    initSingle();
+});
+
+initSingle=function () {
+    $('.nodes').html("");
+    $('.links').html(""); // clear content of node, in order to refresh
+    function createImg(src) {
+        var $img = $('<img />')
+        $img.attr("src", src);
+        $img.attr("class", "my-img-thumbnail pointer to-delete");
+        $img.on("click", function (){
+            showimage(src);
+        });
+        return $img;
+    }
+    $(".to-add").on("dragend", function (e) {
+
+        var src = $(e.target).attr("src");
+        if (images.indexOf(src) < 0) {
+
+            images.push(src);
+
+            var $img = createImg(src);
+            $img.on("dragend", function (e) {
+                var src = $(e.target).attr("src");
+                var idx = images.indexOf(src);
+                if (idx >= 0) {
+                    images.splice(idx, 1);
+                }
+
+                $(e.target).remove();
+            });
+
+
+            $("#new-report-img").append($img)
+        }
+    });
+
+
+
+    $('.sup-collapse').click(function () {
+        var dupTitle = $(this).parents('li').find('.sup-title');
+        dupTitle.toggle();
+    });
+
+    var color = {
+        1: '#E36402',
+        2: '#1995CF',
+        3 : '#FFC000',
+        2.1: '#FFC000'
+    };
+
+    var urlParams = new URLSearchParams(window.location.search);
+
+}

+ 1 - 1
src/main/resources/templates/single_report.html

@@ -357,7 +357,7 @@
     }
 </script>
 <script src="https://d3js.org/d3.v4.min.js"></script>
-<script type="text/javascript" src="/static/js/agg_report_new.js"></script>
+<script type="text/javascript" src="/static/js/single_report.js"></script>
 <script type="text/javascript" src="/static/js/jqcloud-1.0.4.min.js"></script>
 <!--<script type="text/javascript" src="/static/js/partload.js"></script>-->
 <script type="text/javascript" xmlns:th="http://www.thymeleaf.org" th:inline="javascript">