From 0a6e493f95a0376a0dfdd3cafca747f4ad048b19 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 27 Apr 2021 17:12:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A4=BA=E4=BE=8B=EF=BC=88?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=88=97=E6=8B=96=E6=8B=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/controller/DemoTableController.java | 17 +++- .../bootstrap-table-reorder.js | 11 +++ .../reorder-columns/jquery.dragtable.js | 23 +++++ .../main/resources/static/ruoyi/css/ry-ui.css | 38 ++++++++- .../templates/demo/table/reorderColumns.html | 84 +++++++++++++++++++ .../table/{reorder.html => reorderRows.html} | 4 +- .../src/main/resources/templates/include.html | 8 +- .../resources/templates/index-topnav.html | 3 +- .../src/main/resources/templates/index.html | 3 +- 9 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.js create mode 100644 ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/jquery.dragtable.js create mode 100644 ruoyi-admin/src/main/resources/templates/demo/table/reorderColumns.html rename ruoyi-admin/src/main/resources/templates/demo/table/{reorder.html => reorderRows.html} (93%) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java index e110ec3c..82c53ceb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/controller/DemoTableController.java @@ -259,12 +259,21 @@ public class DemoTableController extends BaseController } /** - * 表格拖拽操作 + * 表格行拖拽操作 */ - @GetMapping("/reorder") - public String reorder() + @GetMapping("/reorderRows") + public String reorderRows() { - return prefix + "/reorder"; + return prefix + "/reorderRows"; + } + + /** + * 表格列拖拽操作 + */ + @GetMapping("/reorderColumns") + public String reorderColumns() + { + return prefix + "/reorderColumns"; } /** diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.js new file mode 100644 index 00000000..fc6de672 --- /dev/null +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder.js @@ -0,0 +1,11 @@ + +/** + * bootstrap-table - An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation) + * + * @version v1.18.2 + * @homepage https://bootstrap-table.com + * @author wenzhixin (http://wenzhixin.net.cn/) + * @license MIT + */ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jQuery)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(t),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=function(t){return t&&t.Math==Math&&t},u=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a=function(t){try{return!!t()}catch(t){return!0}},c=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),f={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,s={f:l&&!f.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:f},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},d={}.toString,h=function(t){return d.call(t).slice(8,-1)},y="".split,v=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?y.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},b=function(t){return v(g(t))},m=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!m(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!m(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!m(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!m(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},O={}.hasOwnProperty,S=function(t,e){return O.call(t,e)},j=u.document,T=m(j)&&m(j.createElement),R=function(t){return T?j.createElement(t):{}},x=!c&&!a((function(){return 7!=Object.defineProperty(R("div"),"a",{get:function(){return 7}}).a})),E=Object.getOwnPropertyDescriptor,A={f:c?E:function(t,e){if(t=b(t),e=w(e,!0),x)try{return E(t,e)}catch(t){}if(S(t,e))return p(!s.f.call(t,e),t[e])}},C=function(t){if(!m(t))throw TypeError(String(t)+" is not an object");return t},P=Object.defineProperty,k={f:c?P:function(t,e,r){if(C(t),e=w(e,!0),C(r),x)try{return P(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},I=c?function(t,e,r){return k.f(t,e,p(1,r))}:function(t,e,r){return t[e]=r,t},_=function(t,e){try{I(u,t,e)}catch(r){u[t]=e}return e},M="__core-js_shared__",V=u[M]||_(M,{}),D=Function.toString;"function"!=typeof V.inspectSource&&(V.inspectSource=function(t){return D.call(t)});var F,N,L,$=V.inspectSource,q=u.WeakMap,B="function"==typeof q&&/native code/.test($(q)),H=o((function(t){(t.exports=function(t,e){return V[t]||(V[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.1",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),W=0,z=Math.random(),G=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++W+z).toString(36)},X=H("keys"),K=function(t){return X[t]||(X[t]=G(t))},Q={},U=u.WeakMap;if(B){var Y=V.state||(V.state=new U),J=Y.get,Z=Y.has,tt=Y.set;F=function(t,e){return e.facade=t,tt.call(Y,t,e),e},N=function(t){return J.call(Y,t)||{}},L=function(t){return Z.call(Y,t)}}else{var et=K("state");Q[et]=!0,F=function(t,e){return e.facade=t,I(t,et,e),e},N=function(t){return S(t,et)?t[et]:{}},L=function(t){return S(t,et)}}var rt,nt,ot={set:F,get:N,has:L,enforce:function(t){return L(t)?N(t):F(t,{})},getterFor:function(t){return function(e){var r;if(!m(e)||(r=N(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},it=o((function(t){var e=ot.get,r=ot.enforce,n=String(String).split("String");(t.exports=function(t,e,o,i){var a,c=!!i&&!!i.unsafe,f=!!i&&!!i.enumerable,l=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||S(o,"name")||I(o,"name",e),(a=r(o)).source||(a.source=n.join("string"==typeof e?e:""))),t!==u?(c?!l&&t[e]&&(f=!0):delete t[e],f?t[e]=o:I(t,e,o)):f?t[e]=o:_(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||$(this)}))})),ut=u,at=function(t){return"function"==typeof t?t:void 0},ct=function(t,e){return arguments.length<2?at(ut[t])||at(u[t]):ut[t]&&ut[t][e]||u[t]&&u[t][e]},ft=Math.ceil,lt=Math.floor,st=function(t){return isNaN(t=+t)?0:(t>0?lt:ft)(t)},pt=Math.min,dt=function(t){return t>0?pt(st(t),9007199254740991):0},ht=Math.max,yt=Math.min,vt=function(t){return function(e,r,n){var o,i=b(e),u=dt(i.length),a=function(t,e){var r=st(t);return r<0?ht(r+e,0):yt(r,e)}(n,u);if(t&&r!=r){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},gt={includes:vt(!0),indexOf:vt(!1)}.indexOf,bt=function(t,e){var r,n=b(t),o=0,i=[];for(r in n)!S(Q,r)&&S(n,r)&&i.push(r);for(;e.length>o;)S(n,r=e[o++])&&(~gt(i,r)||i.push(r));return i},mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],wt=mt.concat("length","prototype"),Ot={f:Object.getOwnPropertyNames||function(t){return bt(t,wt)}},St={f:Object.getOwnPropertySymbols},jt=ct("Reflect","ownKeys")||function(t){var e=Ot.f(C(t)),r=St.f;return r?e.concat(r(t)):e},Tt=function(t,e){for(var r=jt(e),n=k.f,o=A.f,i=0;i=74)&&(rt=zt.match(/Chrome\/(\d+)/))&&(nt=rt[1]);var Qt=nt&&+nt,Ut=Bt("species"),Yt=function(t){return Qt>=51||!a((function(){var e=[];return(e.constructor={})[Ut]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Jt=Bt("isConcatSpreadable"),Zt=9007199254740991,te="Maximum allowed index exceeded",ee=Qt>=51||!a((function(){var t=[];return t[Jt]=!1,t.concat()[0]!==t})),re=Yt("concat"),ne=function(t){if(!m(t))return!1;var e=t[Jt];return void 0!==e?!!e:Mt(t)};_t({target:"Array",proto:!0,forced:!ee||!re},{concat:function(t){var e,r,n,o,i,u=Vt(this),a=Wt(u,0),c=0;for(e=-1,n=arguments.length;eZt)throw TypeError(te);for(r=0;r=Zt)throw TypeError(te);Dt(a,c++,i)}return a.length=c,a}});var oe=function(t,e,r){if(function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function")}(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},ie=[].push,ue=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,u=7==t,a=5==t||i;return function(c,f,l,s){for(var p,d,h=Vt(c),y=v(h),g=oe(f,l,3),b=dt(y.length),m=0,w=s||Wt,O=e?w(c,b):r||u?w(c,0):void 0;b>m;m++)if((a||m in y)&&(d=g(p=y[m],m,h),t))if(e)O[m]=d;else if(d)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:ie.call(O,p)}else switch(t){case 4:return!1;case 7:ie.call(O,p)}return i?-1:n||o?o:O}},ae={forEach:ue(0),map:ue(1),filter:ue(2),some:ue(3),every:ue(4),find:ue(5),findIndex:ue(6),filterOut:ue(7)},ce=Object.defineProperty,fe={},le=function(t){throw t},se=function(t,e){if(S(fe,t))return fe[t];e||(e={});var r=[][t],n=!!S(e,"ACCESSORS")&&e.ACCESSORS,o=S(e,0)?e[0]:le,i=S(e,1)?e[1]:void 0;return fe[t]=!!r&&!a((function(){if(n&&!c)return!0;var t={length:-1};n?ce(t,1,{enumerable:!0,get:le}):t[1]=1,r.call(t,o,i)}))},pe=ae.filter,de=Yt("filter"),he=se("filter");_t({target:"Array",proto:!0,forced:!de||!he},{filter:function(t){return pe(this,t,arguments.length>1?arguments[1]:void 0)}});var ye,ve=Object.keys||function(t){return bt(t,mt)},ge=c?Object.defineProperties:function(t,e){C(t);for(var r,n=ve(e),o=n.length,i=0;o>i;)k.f(t,r=n[i++],e[r]);return t},be=ct("document","documentElement"),me=K("IE_PROTO"),we=function(){},Oe=function(t){return" + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/reorder.html b/ruoyi-admin/src/main/resources/templates/demo/table/reorderRows.html similarity index 93% rename from ruoyi-admin/src/main/resources/templates/demo/table/reorder.html rename to ruoyi-admin/src/main/resources/templates/demo/table/reorderRows.html index 8c40c4da..c283846e 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/reorder.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/reorderRows.html @@ -1,13 +1,13 @@ - +
-

按住表格拖拽

+

按住表格行拖拽

diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index 44f93614..7ac8bf6a 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -170,12 +170,18 @@
- +
+ +
+ + +
+
diff --git a/ruoyi-admin/src/main/resources/templates/index-topnav.html b/ruoyi-admin/src/main/resources/templates/index-topnav.html index 201fcb18..0e85cab7 100644 --- a/ruoyi-admin/src/main/resources/templates/index-topnav.html +++ b/ruoyi-admin/src/main/resources/templates/index-topnav.html @@ -137,7 +137,8 @@
  • 表格父子视图
  • 表格图片预览
  • 动态增删改查
  • -
  • 表格拖拽操作
  • +
  • 表格行拖拽操作
  • +
  • 表格列拖拽操作
  • 表格列宽拖动
  • 表格行内编辑
  • 主子表提交
  • diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index c6ca96fa..b684e9b6 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -118,7 +118,8 @@
  • 表格父子视图
  • 表格图片预览
  • 动态增删改查
  • -
  • 表格拖拽操作
  • +
  • 表格行拖拽操作
  • +
  • 表格列拖拽操作
  • 表格列宽拖动
  • 表格行内编辑
  • 主子表提交