From 13cbed46ddec3c071a54a8569022e9c1c7b662ab Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 25 Dec 2024 08:26:12 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=80=9A=E7=94=A8=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=20=E5=8E=BB=E6=8E=89=E6=97=A7=E7=89=88=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=88=97=E5=AE=BD=E6=8B=96=E5=8A=A8=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E6=96=B0=E7=89=88=E7=9A=84=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=8B=96=E5=8A=A8=E6=8F=92=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E8=B4=A7=E8=B5=84=E6=96=99=E5=87=BA=E8=B4=A7=E5=8D=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BD=9C=E4=B8=BA=E7=A4=BA=E4=BE=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AE=9E=E7=8E=B0=E8=A1=A8=E6=A0=BC=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E6=8B=96=E5=8A=A8=E5=8A=9F=E8=83=BD=EF=BC=8C=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E5=8F=97=E5=9B=BA=E5=AE=9A=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E3=80=81=E5=9B=BA=E5=AE=9A=E5=B7=A6=E5=8F=B3=E5=88=97=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E7=9A=84=E6=95=B0=E9=87=8F=E7=9A=84=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resizable/bootstrap-table-resizable.js | 69 +++++++++++++++++++ .../bootstrap-table-resizable.min.js | 10 --- .../resizable/jquery.resizableColumns.min.js | 1 - .../src/main/resources/templates/include.html | 9 +-- .../salesShippingInformationShipping.html | 6 +- 5 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js delete mode 100644 ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js new file mode 100644 index 00000000..591c6655 --- /dev/null +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js @@ -0,0 +1,69 @@ +/** + * @author: Dennis Hernández + * @webSite: http://djhvscf.github.io/Blog + * @version: v2.0.0 + */ + +const isInit = that => that.$el.data('resizableColumns') !== undefined + +const initResizable = that => { + if ( + that.options.resizable && + !that.options.cardView && + !isInit(that) && + that.$el.is(':visible') + ) { + that.$el.resizableColumns({ + store: window.store + }) + } +} + +const destroy = that => { + if (isInit(that)) { + that.$el.data('resizableColumns').destroy() + } +} + +const reInitResizable = that => { + destroy(that) + initResizable(that) +} + +$.extend($.fn.bootstrapTable.defaults, { + resizable: false +}) + +$.BootstrapTable = class extends $.BootstrapTable { + + initBody (...args) { + super.initBody(...args) + + this.$el.off('column-switch.bs.table page-change.bs.table') + .on('column-switch.bs.table page-change.bs.table', () => { + reInitResizable(this) + }) + + reInitResizable(this) + } + + toggleView (...args) { + super.toggleView(...args) + + if (this.options.resizable && this.options.cardView) { + // Destroy the plugin + destroy(this) + } + } + + resetView (...args) { + super.resetView(...args) + + if (this.options.resizable) { + // because in fitHeader function, we use setTimeout(func, 100); + setTimeout(() => { + initResizable(this) + }, 100) + } + } +} diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js b/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js deleted file mode 100644 index 5a4f71ac..00000000 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 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 n=e(t),r="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 r&&r)||function(){return this}()||Function("return this")(),c=function(t){try{return!!t()}catch(t){return!0}},f=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,s={f:l&&!a.call({1:2},1)?function(t){var e=l(this,t);return!!e&&e.enumerable}:a},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,h=function(t){return y.call(t).slice(8,-1)},b="".split,d=c((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?b.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},v=function(t){return d(g(t))},w=function(t){return"object"==typeof t?null!==t:"function"==typeof t},m=function(t,e){if(!w(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!w(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!w(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},O={}.hasOwnProperty,j=function(t,e){return O.call(t,e)},S=u.document,P=w(S)&&w(S.createElement),T=!f&&!c((function(){return 7!=Object.defineProperty((t="div",P?S.createElement(t):{}),"a",{get:function(){return 7}}).a;var t})),E=Object.getOwnPropertyDescriptor,x={f:f?E:function(t,e){if(t=v(t),e=m(e,!0),T)try{return E(t,e)}catch(t){}if(j(t,e))return p(!s.f.call(t,e),t[e])}},_=function(t){if(!w(t))throw TypeError(String(t)+" is not an object");return t},A=Object.defineProperty,M={f:f?A:function(t,e,n){if(_(t),e=m(e,!0),_(n),T)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},k=f?function(t,e,n){return M.f(t,e,p(1,n))}:function(t,e,n){return t[e]=n,t},z=function(t,e){try{k(u,t,e)}catch(n){u[t]=e}return e},R="__core-js_shared__",C=u[R]||z(R,{}),V=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(t){return V.call(t)});var D,I,B,F,L=C.inspectSource,N=u.WeakMap,$="function"==typeof N&&/native code/.test(L(N)),q=o((function(t){(t.exports=function(t,e){return C[t]||(C[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.1",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),G=0,W=Math.random(),K=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+W).toString(36)},Q=q("keys"),Y={},H=u.WeakMap;if($){var J=C.state||(C.state=new H),U=J.get,X=J.has,Z=J.set;D=function(t,e){return e.facade=t,Z.call(J,t,e),e},I=function(t){return U.call(J,t)||{}},B=function(t){return X.call(J,t)}}else{var tt=Q[F="state"]||(Q[F]=K(F));Y[tt]=!0,D=function(t,e){return e.facade=t,k(t,tt,e),e},I=function(t){return j(t,tt)?t[tt]:{}},B=function(t){return j(t,tt)}}var et,nt,rt={set:D,get:I,has:B,enforce:function(t){return B(t)?I(t):D(t,{})},getterFor:function(t){return function(e){var n;if(!w(e)||(n=I(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ot=o((function(t){var e=rt.get,n=rt.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var c,f=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,l=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||j(o,"name")||k(o,"name",e),(c=n(o)).source||(c.source=r.join("string"==typeof e?e:""))),t!==u?(f?!l&&t[e]&&(a=!0):delete t[e],a?t[e]=o:k(t,e,o)):a?t[e]=o:z(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||L(this)}))})),it=u,ut=function(t){return"function"==typeof t?t:void 0},ct=function(t,e){return arguments.length<2?ut(it[t])||ut(u[t]):it[t]&&it[t][e]||u[t]&&u[t][e]},ft=Math.ceil,at=Math.floor,lt=function(t){return isNaN(t=+t)?0:(t>0?at:ft)(t)},st=Math.min,pt=function(t){return t>0?st(lt(t),9007199254740991):0},yt=Math.max,ht=Math.min,bt=function(t){return function(e,n,r){var o,i=v(e),u=pt(i.length),c=function(t,e){var n=lt(t);return n<0?yt(n+e,0):ht(n,e)}(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},dt={includes:bt(!0),indexOf:bt(!1)}.indexOf,gt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return function(t,e){var n,r=v(t),o=0,i=[];for(n in r)!j(Y,n)&&j(r,n)&&i.push(n);for(;e.length>o;)j(r,n=e[o++])&&(~dt(i,n)||i.push(n));return i}(t,gt)}},wt={f:Object.getOwnPropertySymbols},mt=ct("Reflect","ownKeys")||function(t){var e=vt.f(_(t)),n=wt.f;return n?e.concat(n(t)):e},Ot=function(t,e){for(var n=mt(e),r=M.f,o=x.f,i=0;i=74)&&(et=Nt.match(/Chrome\/(\d+)/))&&(nt=et[1]);var Wt,Kt=nt&&+nt,Qt=Bt("species"),Yt=Bt("isConcatSpreadable"),Ht=9007199254740991,Jt="Maximum allowed index exceeded",Ut=Kt>=51||!c((function(){var t=[];return t[Yt]=!1,t.concat()[0]!==t})),Xt=(Wt="concat",Kt>=51||!c((function(){var t=[];return(t.constructor={})[Qt]=function(){return{foo:1}},1!==t[Wt](Boolean).foo}))),Zt=function(t){if(!w(t))return!1;var e=t[Yt];return void 0!==e?!!e:Mt(t)};function te(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ee(t,e){for(var n=0;nHt)throw TypeError(Jt);for(n=0;n=Ht)throw TypeError(Jt);zt(c,f++,i)}return c.length=f,c}});var ce=function(t){return void 0!==t.$el.data("resizableColumns")},fe=function(t){t.options.resizable&&!t.options.cardView&&!ce(t)&&t.$el.is(":visible")&&t.$el.resizableColumns({store:window.store})},ae=function(t){ce(t)&&t.$el.data("resizableColumns").destroy()},le=function(t){ae(t),fe(t)};n.default.extend(n.default.fn.bootstrapTable.defaults,{resizable:!1}),n.default.BootstrapTable=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&re(t,e)}(i,t);var e,n,r,o=ie(i);function i(){return te(this,i),o.apply(this,arguments)}return e=i,(n=[{key:"initBody",value:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return this.each(function(){var e=$(this),n=e.data(a.DATA_API);if(n){if("string"==typeof t)return n[t].apply(n,i)}else n=new r["default"](e,t),e.data(a.DATA_API,n)})},$.resizableColumns=r["default"]},{"./class":2,"./constants":3}],2:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var s=function(){function t(t,e){for(var i=0;i"),this.$table.before(this.$handleContainer),this.$tableHeaders.each(function(e,i){var n=t.$tableHeaders.eq(e),s=t.$tableHeaders.eq(e+1);if(0!==s.length&&!n.is(r.SELECTOR_UNRESIZABLE)&&!s.is(r.SELECTOR_UNRESIZABLE)){$("
").data(r.DATA_TH,$(i)).appendTo(t.$handleContainer)}}),this.bindEvents(this.$handleContainer,["mousedown","touchstart"],"."+r.CLASS_HANDLE,this.onPointerDown.bind(this))}},{key:"assignPercentageWidths",value:function(){var t=this;this.$tableHeaders.each(function(e,i){var n=$(i);t.setWidth(n[0],n.outerWidth()/t.$table.width()*100)})}},{key:"syncHandleWidths",value:function(){var t=this,e=this.$handleContainer;e.width(this.$table.width()),e.find("."+r.CLASS_HANDLE).each(function(e,i){var n=$(i),s=t.options.resizeFromBody?t.$table.height():t.$table.find("thead").height(),a=n.data(r.DATA_TH).outerWidth()+(n.data(r.DATA_TH).offset().left-t.$handleContainer.offset().left);n.css({left:a,height:s})})}},{key:"saveColumnWidths",value:function(){var t=this;this.$tableHeaders.each(function(e,i){var n=$(i);t.options.store&&!n.is(r.SELECTOR_UNRESIZABLE)&&t.options.store.set(t.generateColumnId(n),t.parseWidth(i))})}},{key:"restoreColumnWidths",value:function(){var t=this;this.$tableHeaders.each(function(e,i){var n=$(i);if(t.options.store&&!n.is(r.SELECTOR_UNRESIZABLE)){var s=t.options.store.get(t.generateColumnId(n));null!=s&&t.setWidth(i,s)}})}},{key:"onPointerDown",value:function(t){if(1===t.which){this.operation&&this.onPointerUp(t);var e=$(t.currentTarget);if(!e.is(r.SELECTOR_UNRESIZABLE)){var i=e.index(),n=this.$tableHeaders.eq(i).not(r.SELECTOR_UNRESIZABLE),s=this.$tableHeaders.eq(i+1).not(r.SELECTOR_UNRESIZABLE),a=this.parseWidth(n[0]),o=this.parseWidth(s[0]);this.operation={$leftColumn:n,$rightColumn:s,$currentGrip:e,startX:this.getPointerX(t),widths:{left:a,right:o},newWidths:{left:a,right:o}},this.bindEvents(this.$ownerDocument,["mousemove","touchmove"],this.onPointerMove.bind(this)),this.bindEvents(this.$ownerDocument,["mouseup","touchend"],this.onPointerUp.bind(this)),this.$handleContainer.add(this.$table).addClass(r.CLASS_TABLE_RESIZING),n.add(s).add(e).addClass(r.CLASS_COLUMN_RESIZING),this.triggerEvent(r.EVENT_RESIZE_START,[n,s,a,o],t),t.preventDefault()}}}},{key:"onPointerMove",value:function(t){var e=this.operation;if(this.operation){var i=(this.getPointerX(t)-e.startX)/this.$table.width()*100;if(0!==i){var n=e.$leftColumn[0],s=e.$rightColumn[0],a=void 0,o=void 0;return i>0?(a=this.constrainWidth(e.widths.left+(e.widths.right-e.newWidths.right)),o=this.constrainWidth(e.widths.right-i)):0>i&&(a=this.constrainWidth(e.widths.left+i),o=this.constrainWidth(e.widths.right+(e.widths.left-e.newWidths.left))),n&&this.setWidth(n,a),s&&this.setWidth(s,o),e.newWidths.left=a,e.newWidths.right=o,this.triggerEvent(r.EVENT_RESIZE,[e.$leftColumn,e.$rightColumn,a,o],t)}}}},{key:"onPointerUp",value:function(t){var e=this.operation;if(this.operation)return this.unbindEvents(this.$ownerDocument,["mouseup","touchend","mousemove","touchmove"]),this.$handleContainer.add(this.$table).removeClass(r.CLASS_TABLE_RESIZING),e.$leftColumn.add(e.$rightColumn).add(e.$currentGrip).removeClass(r.CLASS_COLUMN_RESIZING),this.syncHandleWidths(),this.saveColumnWidths(),this.operation=null,this.triggerEvent(r.EVENT_RESIZE_STOP,[e.$leftColumn,e.$rightColumn,e.newWidths.left,e.newWidths.right],t)}},{key:"destroy",value:function(){var t=this.$table,e=this.$handleContainer.find("."+r.CLASS_HANDLE);return this.unbindEvents(this.$window.add(this.$ownerDocument).add(this.$table).add(e)),e.removeData(r.DATA_TH),t.removeData(r.DATA_API),this.$handleContainer.remove(),this.$handleContainer=null,this.$tableHeaders=null,this.$table=null,t}},{key:"bindEvents",value:function(t,e,i,n){"string"==typeof e?e+=this.ns:e=e.join(this.ns+" ")+this.ns,arguments.length>3?t.on(e,i,n):t.on(e,i)}},{key:"unbindEvents",value:function(t,e){"string"==typeof e?e+=this.ns:e=null!=e?e.join(this.ns+" ")+this.ns:this.ns,t.off(e)}},{key:"triggerEvent",value:function(t,e,i){var n=$.Event(t);return n.originalEvent&&(n.originalEvent=$.extend({},i)),this.$table.trigger(n,[this].concat(e||[]))}},{key:"generateColumnId",value:function(t){return this.$table.data(r.DATA_COLUMNS_ID)+"-"+t.data(r.DATA_COLUMN_ID)}},{key:"parseWidth",value:function(t){return t?parseFloat(t.style.width.replace("%","")):0}},{key:"setWidth",value:function(t,e){e=e.toFixed(2),e=e>0?e:0,t.style.width=e+"%"}},{key:"constrainWidth",value:function(t){return void 0!=this.options.minWidth&&(t=Math.max(this.options.minWidth,t)),void 0!=this.options.maxWidth&&(t=Math.min(this.options.maxWidth,t)),t}},{key:"getPointerX",value:function(t){return 0===t.type.indexOf("touch")?(t.originalEvent.touches[0]||t.originalEvent.changedTouches[0]).pageX:t.pageX}}]),t}();i["default"]=a,a.defaults={selector:function(t){return t.find("thead").length?r.SELECTOR_TH:r.SELECTOR_TD},store:window.store,syncHandlers:!0,resizeFromBody:!0,maxWidth:null,minWidth:.01},a.count=0,e.exports=i["default"]},{"./constants":3}],3:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n="resizableColumns";i.DATA_API=n;var s="resizable-columns-id";i.DATA_COLUMNS_ID=s;var r="resizable-column-id";i.DATA_COLUMN_ID=r;var a="th";i.DATA_TH=a;var o="rc-table-resizing";i.CLASS_TABLE_RESIZING=o;var h="rc-column-resizing";i.CLASS_COLUMN_RESIZING=h;var l="rc-handle";i.CLASS_HANDLE=l;var d="rc-handle-container";i.CLASS_HANDLE_CONTAINER=d;var u="column:resize:start";i.EVENT_RESIZE_START=u;var c="column:resize";i.EVENT_RESIZE=c;var f="column:resize:stop";i.EVENT_RESIZE_STOP=f;var E="tr:first > th:visible";i.SELECTOR_TH=E;var v="tr:first > td:visible";i.SELECTOR_TD=v;var $="[data-noresize]";i.SELECTOR_UNRESIZABLE=$},{}],4:[function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(i,"__esModule",{value:!0});{var s=t("./class"),r=n(s),a=t("./adapter");n(a)}i["default"]=r["default"],e.exports=i["default"]},{"./adapter":1,"./class":2}]},{},[4]); -//# sourceMappingURL=jquery.resizableColumns.min.js.map \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/include.html b/ruoyi-admin/src/main/resources/templates/include.html index b12c9ab9..653ac2f7 100644 --- a/ruoyi-admin/src/main/resources/templates/include.html +++ b/ruoyi-admin/src/main/resources/templates/include.html @@ -217,13 +217,8 @@
- - -
- - -
- + +
diff --git a/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html b/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html index 77e60560..6ae26867 100644 --- a/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html +++ b/ruoyi-admin/src/main/resources/templates/sales/salesShippingInformationShipping/salesShippingInformationShipping.html @@ -56,12 +56,14 @@ 导出Vantritek
-
-
+ +
+
+