From 93f97cd78e542acf54077efba06501f3abdb2054 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= <zoujingli@qq.com>
Date: Wed, 29 Mar 2017 18:28:23 +0800
Subject: [PATCH] =?UTF-8?q?[=E5=A2=9E=E5=8A=A0]form=E5=A2=9E=E5=8A=A0data-?=
 =?UTF-8?q?search=E8=A1=8C=E4=B8=BA=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 public/static/admin/listen.js | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/public/static/admin/listen.js b/public/static/admin/listen.js
index c3a47cfaf..2e79aef73 100644
--- a/public/static/admin/listen.js
+++ b/public/static/admin/listen.js
@@ -30,6 +30,16 @@ define(['jquery', 'admin.plugs'], function () {
         return _goLoad.call(this);
     });
 
+    /*! 注册 data-serach 表单搜索行为 */
+    this.$body.on('submit', 'form[data-serach]', function () {
+        var split = this.action.indexOf('?') === -1 ? '?' : '&';
+        if ((this.method || 'get').toLowerCase() === 'get') {
+            window.location.href = '#' + parseUri(this.action + split + $(this).serialize());
+        } else {
+            $.form.load(this.action, this, 'post');
+        }
+    });
+
     /*! 注册 data-modal 事件行为 */
     this.$body.on('click', '[data-modal]', function () {
         return $.form.modal($(this).attr('data-modal'), 'open_type=modal', $(this).attr('data-title') || '编辑');
@@ -57,11 +67,11 @@ define(['jquery', 'admin.plugs'], function () {
     /*! 注册 data-update 事件行为 */
     this.$body.on('click', '[data-update]', function () {
         var id = $(this).attr('data-update') || (function () {
-            var data = [];
-            return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
-                (this.checked) && data.push(this.value);
-            }), data.join(',');
-        }).call(this);
+                var data = [];
+                return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
+                    (this.checked) && data.push(this.value);
+                }), data.join(',');
+            }).call(this);
         if (id.length < 1) {
             return $.msg.tips('请选择需要操作的数据!');
         }