2 Commits 61e1d2cfb8 ... c92c22931b

Author SHA1 Message Date
  yanym c92c22931b Merge branch 'uploadFile-alert810' of http://git.dgtis.com/qxp/suishenbang-oneportal into uploadFile-alert810 1 year ago
  yanym 2adf8f7f0d 首页弹窗修改 1 year ago

+ 43 - 42
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html

@@ -86,6 +86,9 @@
             margin: 0 auto;
             width: 800px;
         }
+        .imageBox{
+            display: none;
+        }
     </style>
 </head>
 <body class="white-bg">
@@ -103,8 +106,19 @@
             <label class="col-sm-3 control-label">弹框图片:</label>
             <div class="col-sm-8">
                 <input id="input_bgUrl" name="bgUrl" type="hidden"/>
-                <div class="thumbnail slideshow_span" id="div-bgUrl" onclick="javascript:bgUpload('bg')">
-                    <i class="fa fa-plus"></i>
+                <!--<div class="thumbnail slideshow_span" id="div-bgUrl" onclick="javascript:bgUpload('bg')">-->
+                    <!--<i class="fa fa-plus"></i>-->
+                <!--</div>-->
+                <div class="imageBox">
+                    <div class="thumbBox" style="width:200px;height:200px;"></div>
+                    <div class="spinner" style="display: none">Loading...</div>
+                </div>
+                <div class="action">
+                    <div class="new-contentarea tc">
+                        <a href="javascript:void(0)" class=""><label for="avatar">选择图片</label> </a>
+                        <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
+                    </div>
+                    <input type="button" id="submitbuttonBg" onclick="upBg()" class="" value="上传"/>
                 </div>
             </div>
         </div>
@@ -180,21 +194,21 @@
     </form>
 </div>
 
-<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">
-    <div class="imageBox">
-        <div class="thumbBox" style="width:200px;height:200px;"></div>
-        <div class="spinner" style="display: none">Loading...</div>
-    </div>
-    <div class="action" style="margin: 10px auto;">
-        <div class="new-contentarea tc">
-            <a href="javascript:void(0)" class="upload-img"> <label for="avatar">选择图片</label> </a>
-            <input type="file" class="" name="avatar" id="avatar" accept="image/*"/>
-        </div>
-        <input type="button" id="submitbuttonBg" onclick="upBg()" class="btn-info Btnsty_peyton" value="上传"/>
-        <input type="button" id="submitbuttonQr" onclick="upQr()" class="btn-info Btnsty_peyton" value="上传"/>
-        <input type="button" onclick="back()" class="btn-info Btnsty_peyton " value="返回"/>
-    </div>
-</div>
+<!--<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="div2" style="display: none">-->
+    <!--<div class="imageBox">-->
+        <!--<div class="thumbBox" style="width:200px;height:200px;"></div>-->
+        <!--<div class="spinner" style="display: none">Loading...</div>-->
+    <!--</div>-->
+    <!--<div class="action" style="margin: 10px auto;">-->
+        <!--<div class="new-contentarea tc">-->
+            <!--<a href="javascript:void(0)" class="upload-img"> <label for="avatar">选择图片</label> </a>-->
+            <!--<input type="file" class="" name="avatar" id="avatar" accept="image/*"/>-->
+        <!--</div>-->
+        <!--<input type="button" id="submitbuttonBg" onclick="upBg()" class="btn-info Btnsty_peyton" value="上传"/>-->
+        <!--<input type="button" id="submitbuttonQr" onclick="upQr()" class="btn-info Btnsty_peyton" value="上传"/>-->
+        <!--<input type="button" onclick="back()" class="btn-info Btnsty_peyton " value="返回"/>-->
+    <!--</div>-->
+<!--</div>-->
 <th:block th:include="include :: footer" />
 <th:block th:include="include :: datetimepicker-js" />
 <th:block th:include="include :: bootstrap-select-js" />
@@ -204,6 +218,7 @@
     // var getCompanyListPrefix = "http://localhost:10001/wxportal-api/sysuser/searchOrg";
     var getCompanyListPrefix = "http://suishenbangtest.nipponpaint.com.cn/wxportal-api/sysuser/searchOrg";
     var cropper;
+    var photoUrl;
     var options = {
         thumbBox: '.thumbBox',
         spinner: '.spinner',
@@ -334,6 +349,13 @@
     }
 
     function upBg() {
+        var imgUrl = ctx + 'img/profile.jpg';
+        options = {
+            thumbBox: '.thumbBox',
+            spinner: '.spinner',
+            imgSrc: imgUrl
+        }
+        cropper = $('.imageBox').cropbox(options);
         var img = cropper.getBlob();
         var formdata = new FormData();
         formdata.append("file", img);
@@ -345,6 +367,7 @@
             contentType: false,
             success: function (result) {
                 if (result.code == 0) {
+                    photoUrl = result.data.url;
                     $("#input_bgUrl").val(result.data.fileName);
                     $("#div-bgUrl").html("<img src='" + result.data.url + "' style='width;100%;height:100%;'>");
                     $("#div1").show();
@@ -358,39 +381,17 @@
         })
     }
 
-    function sizeChange() {
-        size = $("#sel_magnetSize").val();
-        $("#div-bgUrl").removeClass("bg-sm");
-        $("#div-bgUrl").removeClass("bg-md");
-        $("#div-bgUrl").removeClass("bg-lg");
-        $("#imageBox").removeClass();
-        $("#thumbBox").removeClass();
-        if (size == "l" || size == "L") {
-            $("#div-bgUrl").addClass("bg-lg");
-            size = "L";
-            $("#imageBox").addClass("imageBox imageBox_L");
-            $("#thumbBox").addClass("thumbBox_L");
-        } else if (size == "m" || size == "M") {
-            $("#div-bgUrl").addClass("bg-md");
-            size = "M";
-            $("#imageBox").addClass("imageBox imageBox_M");
-            $("#thumbBox").addClass("thumbBox_M");
-        } else if (size == "s" || size == "S") {
-            $("#div-bgUrl").addClass("bg-sm");
-            size = "S";
-            $("#imageBox").addClass("imageBox imageBox_S");
-            $("#thumbBox").addClass("thumbBox_S");
-        }
-    }
-
     function submitHandler() {
         if ($.validate.form()) {
+            var alertType = $('#alertType').val();
             var contentVal = $('#alertContent').val();
             var startTime = $('#alertStartTime').val();
             var endTime = $('#alertEndTime').val();
             var alertNum = $('#alertNum').val();
             var userType = $('#userType').val().join();
             var objSubmit = {
+                alertType:alertType,
+                photoUrl:photoUrl,
                 alertContent:contentVal,
                 alertStartTime:startTime,
                 alertEndTime:endTime,

+ 5 - 0
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/configuration.html

@@ -94,6 +94,11 @@
                         return $.table.tooltip(value);
                     }
                 },
+                    {
+                        field : 'photoUrl',
+                        title : '弹框图片',
+                        width : '100px'
+                    },
                 {
                     field : 'alertStartTime', 
                     title : '开始时间'