Browse Source

电视剧导入,添加loading图标

chenjz 3 years ago
parent
commit
83d9e6910e

+ 3 - 1
src/main/webapp/WEB-INF/jsp/adtheatre/index.jsp

@@ -1,8 +1,9 @@
1 1
 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
2 2
 <%@ include file="../common/common.jsp"%>
3 3
 <title>剧场数据管理</title>
4
-</head>
4
+<head></head>
5 5
 <link rel="stylesheet" type="text/css" href="${staticPath}webupload/progress.css">
6
+<link rel="stylesheet" type="text/css" href="${staticPath}webupload/loading.css">
6 7
 <link rel="stylesheet" type="text/css" href="${staticPath}/css/jquery.datetimepicker.css" />
7 8
 <body>
8 9
 <%@ include file="../common/head.jsp"%>
@@ -158,6 +159,7 @@
158 159
 <script type="text/javascript" src="${staticPath}webupload/upload.js"></script>
159 160
 <script type="text/javascript" src="${staticPath}js/common/jquery.datetimepicker.js"></script>
160 161
 <script type="text/javascript" src="${staticPath}js/adtheatre/adtheatre.js"></script>
162
+<script type="text/javascript" src="${staticPath}webupload/loading.js"></script>
161 163
 <script type="text/javascript">
162 164
 var update_flag = "${funcMap['adtheatre_update']}",delete_flag = "${funcMap['adtheatre_delete']}";
163 165
 var data_query = "${funcMap['adtheatre_data_query']}";

BIN
src/main/webapp/static/img/loading.png


+ 3 - 0
src/main/webapp/static/js/adtheatre/adtheatre.js

@@ -113,10 +113,13 @@ function delRecordBatch(){
113 113
 // 导入表格数据
114 114
 function importExcel(obj){
115 115
     $("#fileForm").submit();
116
+    loadingShow(0);
116 117
 }
117 118
 
118 119
 // 导入结果
119 120
 function excelCallback(code, msg) {
121
+    //关闭加载图标
122
+    loadingHide();
120 123
     if (code == 1) {
121 124
         // 导入成功
122 125
         alert("导入成功。", 1, function(){

+ 25 - 0
src/main/webapp/static/webupload/loading.css

@@ -0,0 +1,25 @@
1
+/*蒙版*/
2
+.loading-mask {
3
+  width: 100%;
4
+  height: 100%;
5
+  position: fixed;
6
+  top: 0;
7
+  left: 0;
8
+  right: 0;
9
+  bottom: 0;
10
+  background-color: #fff;
11
+  opacity: 0.3;
12
+  filter: alpha(opacity = 30);
13
+  z-index: 10000;
14
+}
15
+
16
+/*动态加载图片*/
17
+.loading {
18
+  position: fixed;
19
+  top: 0;
20
+  left: 0;
21
+  width: 100%;
22
+  height: 100%;
23
+  background: url(../img/loading.png) 50% 50% no-repeat;
24
+  z-index: 10010;
25
+}

+ 31 - 0
src/main/webapp/static/webupload/loading.js

@@ -0,0 +1,31 @@
1
+//增加body遮罩
2
+function maskElement(maskLevel) {
3
+	if (!maskLevel) {
4
+		maskLevel = '0';
5
+	}
6
+	if ($(".mask-level-" + maskLevel).length == 0) {
7
+		$("body").append('<div class="loading-mask mask-level-' + maskLevel + '"></div>');
8
+	}
9
+}
10
+
11
+//取消body遮罩
12
+function unmaskElement(maskLevel) {
13
+	if (!maskLevel) {
14
+		maskLevel = '0';
15
+	}
16
+	$(".mask-level-" + maskLevel).remove();
17
+}
18
+
19
+function loadingShow(isMask) {
20
+	if (isMask) {
21
+		maskElement("0");
22
+	}
23
+	if ($(".loading").length == 0) {
24
+		$("body").append('<div class="loading"></div>');
25
+	}
26
+}
27
+
28
+function loadingHide() {
29
+	unmaskElement("0");
30
+	$(".loading").remove();
31
+}