bianjunhui 2 روز پیش
والد
کامیت
0cab939316

+ 12 - 0
application/admin/view/functional/deal/add.html

@@ -46,6 +46,18 @@
             <ul class="row list-inline faupload-preview" id="p-image_m"></ul>
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('位置')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-location" class="form-control" name="row[location]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('排序')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" class="form-control" name="row[weigh]" type="text">
+        </div>
+    </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 12 - 0
application/admin/view/functional/deal/edit.html

@@ -52,6 +52,18 @@
             <ul class="row list-inline faupload-preview" id="p-image_m"></ul>
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('位置')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-location" class="form-control" name="row[location]" type="text" value="{$row.location|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('排序')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-weigh" class="form-control" name="row[weigh]" type="text" value="{$row.weigh|htmlentities}">
+        </div>
+    </div>
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 7 - 2
public/assets/js/backend/functional/deal.js

@@ -10,6 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     edit_url: 'functional/deal/edit',
                     del_url: 'functional/deal/del',
                     multi_url: 'functional/deal/multi',
+                    dragsort_url: 'ajax/weigh',
                     import_url: 'functional/deal/import',
                     table: 'functional_del',
                 }
@@ -21,16 +22,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
                 pk: 'id',
-                sortName: 'id',
+                sortName: 'weigh',
+                pagination: false,
+                commonSearch: false,
+                search: false,
                 columns: [
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'name', title: __('名称'), operate: 'LIKE'},
-                        {field: 'description', title: __('Description'), operate: 'LIKE'},
+                        {field: 'location', title: __('位置'), operate: 'LIKE'},
                         {field: 'url', title: __('Url'), operate: 'LIKE', formatter: Table.api.formatter.url},
                         {field: 'image', title: __('PC端图片'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                         {field: 'image_m', title: __('M端图片'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        {field: 'weigh', title: __('排序'), operate: false},
                         {field: 'status', title: __('状态'), formatter: Table.api.formatter.status},
 
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}