From ee4d94defe7cc7f36f87aebf2e9efed38ba93a40 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期二, 14 十一月 2023 16:44:18 +0800
Subject: [PATCH] 优化

---
 guns-vip-main/src/main/webapp/pages/modular/kb/formula/formulaView.html |   10 ++++++++--
 guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js  |   30 ++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js b/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
index ea5d056..ab0d4c3 100644
--- a/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
+++ b/guns-vip-main/src/main/webapp/assets/modular/kb/formula/formulaView.js
@@ -28,6 +28,36 @@
             {field: 'operationType', sort: true, title: '绫诲瀷'},
         ]];
     };
+    $('#imgs').click(function (){
+        console.log("11111111111111");
+        var img = new Image();
+        img.src = "http://localhost:8081/img/9f2f070828381f30fdf1be0da9014c086f06f0ad.jpg";
+        // var height = img.height; //鑾峰彇鍥剧墖楂樺害
+        // var width = img.width; //鑾峰彇鍥剧墖瀹藉害
+        var height = 500; //鑾峰彇鍥剧墖楂樺害
+        var width = 800; //鑾峰彇鍥剧墖瀹藉害
+        if (height > 1000 || width > 800) {
+            height = height / 1.5;
+            width = width / 1.5;
+        }
+        var imgHtml = "<img src='http://localhost:8081/img/9f2f070828381f30fdf1be0da9014c086f06f0ad.jpg' style='width: " + width + "px;height:" + height + "px'/>";
+        layer.open({
+            type: 1,
+            offset: 'auto',
+            area: [width + 'px', height + 'px'],
+            shadeClose: true,//鐐瑰嚮澶栧洿鍏抽棴寮圭獥
+            scrollbar: true,//涓嶇幇瀹炴粴鍔ㄦ潯
+            title: false, //涓嶆樉绀烘爣棰�
+            content: imgHtml, //鎹曡幏鐨勫厓绱狅紝娉ㄦ剰锛氭渶濂借鎸囧畾鐨勫厓绱犺瀛樻斁鍦╞ody鏈�澶栧眰锛屽惁鍒欏彲鑳借鍏跺畠鐨勭浉瀵瑰厓绱犳墍褰卞搷
+            cancel: function () {
+
+            }
+        });
+        console.log(height);
+        console.log(width);
+
+    });
+
 
 
     initLineInfo();
diff --git a/guns-vip-main/src/main/webapp/pages/modular/kb/formula/formulaView.html b/guns-vip-main/src/main/webapp/pages/modular/kb/formula/formulaView.html
index b701efb..3e67fa9 100644
--- a/guns-vip-main/src/main/webapp/pages/modular/kb/formula/formulaView.html
+++ b/guns-vip-main/src/main/webapp/pages/modular/kb/formula/formulaView.html
@@ -115,14 +115,15 @@
                     <i class="layui-icon layui-icon-rate-solid"></i>鍥剧墖
                 </div>
                 <div class="layui-card-body">
-                    <img id="imgs" width="320px" height="270px">
+<!--                    <img id="imgs" width="320px" height="270px">-->
+                    <img id="imgs" class="img-thumbnail">
                     <button type="button" class="layui-btn layui-btn-primary" id="clear">鍏ョ珯</button>
                 </div>
             </div>
 
         </div>
 </div>
-<!--    <img id="imgs" width="400px" height="380px">-->
+
     <style>
     .orderInfo {
         margin-bottom: 5px;  /* 璁剧疆鎹㈣鍚庣殑涓嬭竟璺� */
@@ -131,5 +132,10 @@
         display: flex; /* 浣跨敤 Flex 甯冨眬 */
         align-items: center; /* 灏嗗瓙鍏冪礌鍨傜洿灞呬腑瀵归綈 */
     }
+    .img-thumbnail {
+        width: 320px;
+        height: auto;
+        transition: all 0.3s ease;
+    }
 </style>
 @}
\ No newline at end of file

--
Gitblit v1.9.3