Kaynağa Gözat

查询优化

RuoYi 6 yıl önce
ebeveyn
işleme
7d733d868c

+ 9 - 6
src/main/resources/static/ruoyi/js/ry-ui.js

@@ -51,11 +51,12 @@
         		}; 
             },
             // 搜索
-            search: function(form) {
+            search: function(formId) {
+            	var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
     		    var params = $("#bootstrap-table").bootstrapTable('getOptions');
     		    params.queryParams = function(params) {
     		        var search = {};
-    		        $.each($("#" + form).serializeArray(), function(i, field) {
+    		        $.each($("#" + currentId).serializeArray(), function(i, field) {
     		            search[field.name] = field.value;
     		        });
     		        search.pageSize = params.limit;
@@ -68,9 +69,10 @@
     		    $("#bootstrap-table").bootstrapTable('refresh', params);
     		},
     		// 下载
-    		exportExcel: function(form) {
+    		exportExcel: function(formId) {
+    			var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
     			$.modal.loading("正在导出数据,请稍后...");
-    			$.post($.table._option.exportUrl, $("#" + form).serializeArray(), function(result) {
+    			$.post($.table._option.exportUrl, $("#" + currentId).serializeArray(), function(result) {
     				if (result.code == web_status.SUCCESS) {
     			        window.location.href = ctx + "common/download?fileName=" + result.msg + "&delete=" + true;
     				} else {
@@ -132,9 +134,10 @@
                 $.treeTable._treeTable = treeTable;
             },
             // 条件查询
-            search: function(form) {
+            search: function(formId) {
+            	var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
             	var params = {};
-            	$.each($("#" + form).serializeArray(), function(i, field) {
+            	$.each($("#" + currentId).serializeArray(), function(i, field) {
             		params[field.name] = field.value;
 		        });
             	$.treeTable._treeTable.bootstrapTreeTable('refresh', params);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
src/main/resources/static/ruoyi/js/ry-ui.min.js


+ 2 - 2
src/main/resources/templates/monitor/job/job.html

@@ -24,8 +24,8 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/monitor/job/jobLog.html

@@ -30,8 +30,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/monitor/logininfor/logininfor.html

@@ -30,8 +30,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 1 - 1
src/main/resources/templates/monitor/online/online.html

@@ -18,7 +18,7 @@
 								操作人员:<input type="text" name="loginName"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/monitor/operlog/operlog.html

@@ -30,8 +30,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/system/config/config.html

@@ -29,8 +29,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 1 - 1
src/main/resources/templates/system/dept/dept.html

@@ -20,7 +20,7 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/system/dict/data/data.html

@@ -26,8 +26,8 @@
 								      </select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/system/dict/type/type.html

@@ -30,8 +30,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 1 - 1
src/main/resources/templates/system/menu/menu.html

@@ -20,7 +20,7 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							</li>
 						</ul>
 					</div>

+ 1 - 1
src/main/resources/templates/system/notice/notice.html

@@ -23,7 +23,7 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/system/post/post.html

@@ -24,8 +24,8 @@
 								</select>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 2 - 2
src/main/resources/templates/system/role/role.html

@@ -30,8 +30,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>

+ 3 - 3
src/main/resources/templates/system/user/user.html

@@ -55,8 +55,8 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+							    <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()"><i class="fa fa-download"></i>&nbsp;下载</a>
 							</li>
 						</ul>
 					</div>
@@ -170,7 +170,7 @@
 					tree.expandNode(treeNode);
 					$("#deptId").val(treeNode.id);
 					$("#parentId").val(treeNode.pId);
-					$.table.search($('form').attr('id'));
+					$.table.search();
 				}}
 			}, tree, loadTree = function(){
 				$.get(ctx + "system/dept/treeData", function(data) {

+ 1 - 1
src/main/resources/templates/tool/gen/gen.html

@@ -23,7 +23,7 @@
 								<input type="text" class="layui-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
 							</li>
 							<li>
-								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
+								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
 							</li>
 						</ul>
 					</div>

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor