From 696c27e481b1c2e437c9389c1ca7c8a1c498f87e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 05 六月 2020 16:19:45 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/matCode/matCode.html   |   24 +++++++++---------------
 src/main/webapp/static/js/matCode/matCode.js |   17 +++++++++++++----
 src/main/webapp/static/image/Excel.png       |    0 
 3 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/src/main/webapp/static/image/Excel.png b/src/main/webapp/static/image/Excel.png
new file mode 100644
index 0000000..3806a2b
--- /dev/null
+++ b/src/main/webapp/static/image/Excel.png
Binary files differ
diff --git a/src/main/webapp/static/js/matCode/matCode.js b/src/main/webapp/static/js/matCode/matCode.js
index d275886..3208ba7 100644
--- a/src/main/webapp/static/js/matCode/matCode.js
+++ b/src/main/webapp/static/js/matCode/matCode.js
@@ -117,15 +117,23 @@
     });
 
     // 瀵煎叆excel
-
     upload.render({
         elem: '#uploadEx'
-        , url: baseUrl + '/matCode/import/auth' //鏀规垚鎮ㄨ嚜宸辩殑涓婁紶鎺ュ彛
+        , url: baseUrl + '/matCode/import/auth'
         , headers: {token: localStorage.getItem('token')}
-        , accept: 'file' //鏅�氭枃浠�
-        , exts: 'xls|excel|xlsx' //鍙厑璁哥殑鏂囦欢鍚庣紑
+        , accept: 'file'
+        , exts: 'xls|excel|xlsx'
+        , auto: false
+        , bindAction: '#uploadDo'
+        , choose: function(obj){
+            layui.$('#uploadDemoView').removeClass('layui-hide');
+            obj.preview(function(index, file, result){
+                console.log(file.name); //寰楀埌鏂囦欢鍚嶇О
+            });
+        }
         , done: function (res) {
             layer.msg('涓婁紶鎴愬姛');
+            limit();
         }
     })
 
@@ -225,6 +233,7 @@
                     type: 1,
                     title: '鏁版嵁瀵煎叆',
                     maxmin: true,
+                    area: [top.detailWidth, top.detailHeight],
                     shadeClose: true,
                     content: $('#importDataDiv'),
                     success: function(layero, index){
diff --git a/src/main/webapp/views/matCode/matCode.html b/src/main/webapp/views/matCode/matCode.html
index 0ededc9..61ed92c 100644
--- a/src/main/webapp/views/matCode/matCode.html
+++ b/src/main/webapp/views/matCode/matCode.html
@@ -52,23 +52,17 @@
 
 <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe>
 
+<!-- 瀵煎叆鎿嶄綔寮圭獥 -->
 <div id="importDataDiv" style="display: none">
-    <form id="uploadExcel" class="layui-form">
-        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
-            <legend>璇蜂笂浼犲悎娉曡鑼冪殑Excel鏂囦欢</legend>
-        </fieldset>
-        <div class="layui-form-item">
-            <div class="layui-input-block">
-                <button type="button" class="layui-btn" id="uploadEx"><i class="layui-icon">顧�</i>涓婁紶鏂囦欢</button>
-            </div>
+    <div class="layui-upload-drag" id="uploadEx">
+        <i class="layui-icon">顧�</i>
+        <p>鐐瑰嚮娣诲姞锛屾垨灏嗘枃浠舵嫋鎷藉埌姝ゅ</p>
+        <div class="layui-hide" id="uploadDemoView">
+            <hr>
+            <img src="../../static/image/Excel.png" alt="涓婁紶鎴愬姛鍚庢覆鏌�" style="max-width: 196px">
         </div>
-        <div class="layui-form-item">
-            <div class="layui-input-block">
-                <button class="layui-btn" lay-submit lay-filter="upload">涓婁紶</button>
-                <button type="reset" class="layui-btn layui-btn-primary">閲嶇疆</button>
-            </div>
-        </div>
-    </form>
+    </div>
+    <button class="layui-btn" id="uploadDo">寮�濮嬪鍏�</button>
 </div>
 
 </body>

--
Gitblit v1.9.1