sd-data-grid 1.2.30 → 1.2.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("sd-data-grid",[],e):"object"==typeof exports?exports["sd-data-grid"]=e():t["sd-data-grid"]=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=18)}([function(t,e){function r(t,e){var r=t[1]||"",i=t[3];if(!i)return r;if(e&&"function"==typeof btoa){var o=a(i);return[r].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([o]).join("\n")}return[r].join("\n")}function a(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var a=r(e,t);return e[2]?"@media "+e[2]+"{"+a+"}":a}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var a={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(a[o]=!0)}for(i=0;i<t.length;i++){var n=t[i];"number"==typeof n[0]&&a[n[0]]||(r&&!n[2]?n[2]=r:r&&(n[2]="("+n[2]+") and ("+r+")"),e.push(n))}},e}},function(t,e,r){function a(t){for(var e=0;e<t.length;e++){var r=t[e],a=c[r.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](r.parts[i]);for(;i<r.parts.length;i++)a.parts.push(o(r.parts[i]));a.parts.length>r.parts.length&&(a.parts.length=r.parts.length)}else{for(var n=[],i=0;i<r.parts.length;i++)n.push(o(r.parts[i]));c[r.id]={id:r.id,refs:1,parts:n}}}}function i(){var t=document.createElement("style");return t.type="text/css",u.appendChild(t),t}function o(t){var e,r,a=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(a){if(h)return m;a.parentNode.removeChild(a)}if(g){var o=f++;a=p||(p=i()),e=n.bind(null,a,o,!1),r=n.bind(null,a,o,!0)}else a=i(),e=s.bind(null,a),r=function(){a.parentNode.removeChild(a)};return e(t),function(a){if(a){if(a.css===t.css&&a.media===t.media&&a.sourceMap===t.sourceMap)return;e(t=a)}else r()}}function n(t,e,r,a){var i=r?"":a.css;if(t.styleSheet)t.styleSheet.cssText=v(e,i);else{var o=document.createTextNode(i),n=t.childNodes;n[e]&&t.removeChild(n[e]),n.length?t.insertBefore(o,n[e]):t.appendChild(o)}}function s(t,e){var r=e.css,a=e.media,i=e.sourceMap;if(a&&t.setAttribute("media",a),i&&(r+="\n/*# sourceURL="+i.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var d=r(22),c={},u=l&&(document.head||document.getElementsByTagName("head")[0]),p=null,f=0,h=!1,m=function(){},g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,r){h=r;var i=d(t,e);return a(i),function(e){for(var r=[],o=0;o<i.length;o++){var n=i[o],s=c[n.id];s.refs--,r.push(s)}e?(i=d(t,e),a(i)):i=[];for(var o=0;o<r.length;o++){var s=r[o];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete c[s.id]}}}};var v=function(){var t=[];return function(e,r){return t[e]=r,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e,r,a,i,o){var n,s=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(n=t,s=t.default);var d="function"==typeof s?s.options:s;e&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0),r&&(d.functional=!0),i&&(d._scopeId=i);var c;if(o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):a&&(c=a),c){var u=d.functional,p=u?d.render:d.beforeCreate;u?(d._injectStyles=c,d.render=function(t,e){return c.call(e),p(t,e)}):d.beforeCreate=p?[].concat(p,c):[c]}return{esModule:n,exports:s,options:d}}},function(t,e,r){"use strict";var a=r(25);e.a={data:function(){return{customShowList:[],showModal:!1,modalStatus:!1,dataGridLoad:!1,comModelProps:null,comModel:null,modelShowFields:null,dataGridColumns:[],gridData:[],queryFields:[],hiddenQueryFields:[],filterFields:{},pageNo:1,pageSize:10,pageSizeOpts:[10,20,50,100],labelWidth:120,totalNum:0,orderKey:[],orderType:[],quickFilter:[],batch_select:[],multiColSetShow:!1,column:[],slotColumn:[],funcAuth:[],showOper:!0,hasRowOper:!1,headOper:[],headOperBatch:[],rowOper:[],rowOperBatch:[],iframeUrl:"",iframeComponent:"",gridExportOptStatus:!1,gridExportDataStatus:!1,gridExportDataRequestParams:null,gridDataRequestParams:null,gridPrintOptStatus:!1,gridPrintDataStatus:!1,gridPrintDataRequestParams:null,modalId:"",modalTitle:"",modalWidth:1e3,modalHeight:600,searchShow:!1,pageSearch:!0,showCheckbox:!1,loading:!0,dataGridId:"",clearCache:"",browsePerm:!0,dataGridWidth:0,dataGridHeight:-1,searchType:"01",errorMsg:"",dbType:"",exportMaxCount:0}},mixins:[a.a],methods:{query_grid_data:function(t){var e=this;this.loading=!0,t&&(this.pageNo=t);var r=this.getGridRequestParams();console.log(r,"params"),this.$store.dispatch("postRequest",{url:"/bsp-com/com/datagrid/getQueryPageData",params:r}).then(function(t){if(t.success&&(e.beforeRender?e.beforeRender(t).then(function(t){t.success&&e.initRenderData(t.rows,t.total)}):e.initRenderData(t.rows,t.total),e.comModel.groupStat&&e.comModel.groupStatField&&t.group&&e.quickFilter))try{e.quickFilter[0].forEach(function(e){t.group[e.groupStatField]&&(t.group[e.groupStatField][e.groupMatchValue]?e.groupNum=t.group[e.groupStatField][e.groupMatchValue]:e.groupNum=0)})}catch(t){console.log("分组统计异常:",t)}})},getGridRequestParams:function(){var t=this,e={modelId:this.comModel.mark,pageNo:this.pageNo,pageSize:this.pageSize,browsePerm:this.browsePerm},r=[],a=this.build_query_condis(),i=this.build_filter_condis();i.length>0&&(r=r.concat(i)),a.length>0&&(r=r.concat(a)),r.length>0&&(e.condis=JSON.stringify(r));var o=this.get_quick_filter();o&&""!==o&&(e.quickFilterSql=o);var n=[];return this.orderKey.length>0&&this.orderKey.forEach(function(e){var r=t.chineseSort[e];r?n.push(r):n.push(e)}),e.sortName=n.join(","),e.sortType=this.orderType.join(","),Object.keys(this.extendParams).length>0?e.extendParams=JSON.stringify(this.extendParams):Object.keys(this.params).length>0&&(e.extendParams=JSON.stringify(this.params)),e},initRenderData:function(t,e){this.gridData=t,this.totalNum=e;var r=this.modelShowFields.filter(function(t){return t.attachProps&&JSON.parse(t.attachProps)&&JSON.parse(t.attachProps)._disabled});this.gridData&&this.gridData.length>0&&this.gridData.forEach(function(t){r.forEach(function(e){JSON.parse(e.attachProps)._disabledValue==t[e.name.toLowerCase()]&&(t._disabled=!0)})}),this.batch_select=[],this.loading=!1},refreshGrid:function(t){this.query_grid_data(t)},get_quick_filter:function(){var t=[];return this.quickFilter.forEach(function(e){var r=[];e.forEach(function(t){"1"===t.isDefault&&t.filterSql&&r.push(t.filterSql)}),r.length>0&&t.push(r.join(" or "))}),t.join(" and ")},build_query_condis:function(){var t=[],e=this.queryFields.concat(),r=this;if(this.hiddenQueryFields.length>0){var a=[],i=Object.assign({},this.$route.query,this.params),o={user:this.$store.getters.sessionUser,req:i};this.hiddenQueryFields.forEach(function(t){var e=Object.assign({},t),i=e.defaultValue?e.defaultValue.trim():"",n=r.template(i,o);""!==n&&(e.searchValue=n),e.startDefault&&(e.start=r.template(e.startDefault.trim(),o)),e.endDefault&&(e.end=r.template(e.endDefault.trim(),o)),a.push(e)}),a.length>0&&e.push(a)}return e.forEach(function(e){e.forEach(function(e){if("between"===e.opName){if(e.start){var r={name:e.name,op:">=",value:e.start,valueType:e.valueType};t.push(r)}if(e.end){var a=e.end;16===a.length&&"datetime"===e.valueType?a+=":59":14===a.length&&"datetime"===e.valueType&&(a+=":59:59");var i={name:e.name,op:"<=",value:a,valueType:e.valueType};t.push(i)}}else if(e.searchValue instanceof Array){if(e.searchValue.length>0){var o={name:e.name,op:"dicmultiple",value:e.searchValue.join(","),valueType:e.valueType};t.push(o)}}else if(e.searchValue){var n={name:e.name,op:e.opName,value:e.searchValue,valueType:e.valueType};e.isDicMultiple&&(n.op="dicmultiple"),t.push(n)}})}),t},build_filter_condis:function(){var t={};Object.assign(t,this.filterFields);var e=[];for(var r in t){if(t[r].length>0){var a="=";t[r].length>1&&(a="dicmultiple");var i={name:r,op:a,value:t[r].join(","),valueType:"string"};e.push(i)}}return e},on_batch_select:function(t){this.batch_select=t},isAuth:function(t){return!t||""===t}}}},function(t,e,r){"use strict";/*!
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("sd-data-grid",[],e):"object"==typeof exports?exports["sd-data-grid"]=e():t["sd-data-grid"]=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(a){if(r[a])return r[a].exports;var i=r[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,a){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=18)}([function(t,e){function r(t,e){var r=t[1]||"",i=t[3];if(!i)return r;if(e&&"function"==typeof btoa){var o=a(i);return[r].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([o]).join("\n")}return[r].join("\n")}function a(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var a=r(e,t);return e[2]?"@media "+e[2]+"{"+a+"}":a}).join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var a={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(a[o]=!0)}for(i=0;i<t.length;i++){var n=t[i];"number"==typeof n[0]&&a[n[0]]||(r&&!n[2]?n[2]=r:r&&(n[2]="("+n[2]+") and ("+r+")"),e.push(n))}},e}},function(t,e,r){function a(t){for(var e=0;e<t.length;e++){var r=t[e],a=c[r.id];if(a){a.refs++;for(var i=0;i<a.parts.length;i++)a.parts[i](r.parts[i]);for(;i<r.parts.length;i++)a.parts.push(o(r.parts[i]));a.parts.length>r.parts.length&&(a.parts.length=r.parts.length)}else{for(var n=[],i=0;i<r.parts.length;i++)n.push(o(r.parts[i]));c[r.id]={id:r.id,refs:1,parts:n}}}}function i(){var t=document.createElement("style");return t.type="text/css",u.appendChild(t),t}function o(t){var e,r,a=document.querySelector('style[data-vue-ssr-id~="'+t.id+'"]');if(a){if(h)return m;a.parentNode.removeChild(a)}if(g){var o=f++;a=p||(p=i()),e=n.bind(null,a,o,!1),r=n.bind(null,a,o,!0)}else a=i(),e=s.bind(null,a),r=function(){a.parentNode.removeChild(a)};return e(t),function(a){if(a){if(a.css===t.css&&a.media===t.media&&a.sourceMap===t.sourceMap)return;e(t=a)}else r()}}function n(t,e,r,a){var i=r?"":a.css;if(t.styleSheet)t.styleSheet.cssText=v(e,i);else{var o=document.createTextNode(i),n=t.childNodes;n[e]&&t.removeChild(n[e]),n.length?t.insertBefore(o,n[e]):t.appendChild(o)}}function s(t,e){var r=e.css,a=e.media,i=e.sourceMap;if(a&&t.setAttribute("media",a),i&&(r+="\n/*# sourceURL="+i.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var l="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!l)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var d=r(22),c={},u=l&&(document.head||document.getElementsByTagName("head")[0]),p=null,f=0,h=!1,m=function(){},g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,r){h=r;var i=d(t,e);return a(i),function(e){for(var r=[],o=0;o<i.length;o++){var n=i[o],s=c[n.id];s.refs--,r.push(s)}e?(i=d(t,e),a(i)):i=[];for(var o=0;o<r.length;o++){var s=r[o];if(0===s.refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete c[s.id]}}}};var v=function(){var t=[];return function(e,r){return t[e]=r,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e,r,a,i,o){var n,s=t=t||{},l=typeof t.default;"object"!==l&&"function"!==l||(n=t,s=t.default);var d="function"==typeof s?s.options:s;e&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0),r&&(d.functional=!0),i&&(d._scopeId=i);var c;if(o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=c):a&&(c=a),c){var u=d.functional,p=u?d.render:d.beforeCreate;u?(d._injectStyles=c,d.render=function(t,e){return c.call(e),p(t,e)}):d.beforeCreate=p?[].concat(p,c):[c]}return{esModule:n,exports:s,options:d}}},function(t,e,r){"use strict";var a=r(25);e.a={data:function(){return{customShowList:[],showModal:!1,modalStatus:!1,dataGridLoad:!1,comModelProps:null,comModel:null,modelShowFields:null,dataGridColumns:[],gridData:[],queryFields:[],hiddenQueryFields:[],filterFields:{},pageNo:1,pageSize:10,pageSizeOpts:[10,20,50,100],labelWidth:120,totalNum:0,orderKey:[],orderType:[],quickFilter:[],batch_select:[],multiColSetShow:!1,column:[],slotColumn:[],funcAuth:[],showOper:!0,hasRowOper:!1,headOper:[],headOperBatch:[],rowOper:[],rowOperBatch:[],iframeUrl:"",iframeComponent:"",gridExportOptStatus:!1,gridExportDataStatus:!1,gridExportDataRequestParams:null,gridDataRequestParams:null,gridPrintOptStatus:!1,gridPrintDataStatus:!1,gridPrintDataRequestParams:null,modalId:"",modalTitle:"",modalWidth:1e3,modalHeight:600,searchShow:!1,pageSearch:!0,showCheckbox:!1,loading:!0,dataGridId:"",clearCache:"",browsePerm:!0,dataGridWidth:0,dataGridHeight:-1,searchType:"01",errorMsg:"",dbType:"",exportMaxCount:0}},mixins:[a.a],methods:{query_grid_data:function(t){var e=this;this.loading=!0,t&&(this.pageNo=t);var r=this.getGridRequestParams();console.log(r,"params"),this.$emit("returnParams",r),this.$store.dispatch("postRequest",{url:"/bsp-com/com/datagrid/getQueryPageData",params:r}).then(function(t){if(t.success&&(e.beforeRender?e.beforeRender(t).then(function(t){t.success&&e.initRenderData(t.rows,t.total)}):e.initRenderData(t.rows,t.total),e.comModel.groupStat&&e.comModel.groupStatField&&t.group&&e.quickFilter))try{e.quickFilter[0].forEach(function(e){t.group[e.groupStatField]&&(t.group[e.groupStatField][e.groupMatchValue]?e.groupNum=t.group[e.groupStatField][e.groupMatchValue]:e.groupNum=0)})}catch(t){console.log("分组统计异常:",t)}})},getGridRequestParams:function(){var t=this,e={modelId:this.comModel.mark,pageNo:this.pageNo,pageSize:this.pageSize,browsePerm:this.browsePerm},r=[],a=this.build_query_condis(),i=this.build_filter_condis();i.length>0&&(r=r.concat(i)),a.length>0&&(r=r.concat(a)),r.length>0&&(e.condis=JSON.stringify(r));var o=this.get_quick_filter();o&&""!==o&&(e.quickFilterSql=o);var n=[];return this.orderKey.length>0&&this.orderKey.forEach(function(e){var r=t.chineseSort[e];r?n.push(r):n.push(e)}),e.sortName=n.join(","),e.sortType=this.orderType.join(","),Object.keys(this.extendParams).length>0?e.extendParams=JSON.stringify(this.extendParams):Object.keys(this.params).length>0&&(e.extendParams=JSON.stringify(this.params)),e},initRenderData:function(t,e){this.gridData=t,this.totalNum=e;var r=this.modelShowFields.filter(function(t){return t.attachProps&&JSON.parse(t.attachProps)&&JSON.parse(t.attachProps)._disabled});this.gridData&&this.gridData.length>0&&this.gridData.forEach(function(t){r.forEach(function(e){JSON.parse(e.attachProps)._disabledValue==t[e.name.toLowerCase()]&&(t._disabled=!0)})}),this.batch_select=[],this.loading=!1},refreshGrid:function(t){this.query_grid_data(t)},get_quick_filter:function(){var t=[];return this.quickFilter.forEach(function(e){var r=[];e.forEach(function(t){"1"===t.isDefault&&t.filterSql&&r.push(t.filterSql)}),r.length>0&&t.push(r.join(" or "))}),t.join(" and ")},build_query_condis:function(){var t=[],e=this.queryFields.concat(),r=this;if(this.hiddenQueryFields.length>0){var a=[],i=Object.assign({},this.$route.query,this.params),o={user:this.$store.getters.sessionUser,req:i};this.hiddenQueryFields.forEach(function(t){var e=Object.assign({},t),i=e.defaultValue?e.defaultValue.trim():"",n=r.template(i,o);""!==n&&(e.searchValue=n),e.startDefault&&(e.start=r.template(e.startDefault.trim(),o)),e.endDefault&&(e.end=r.template(e.endDefault.trim(),o)),a.push(e)}),a.length>0&&e.push(a)}return e.forEach(function(e){e.forEach(function(e){if("between"===e.opName){if(e.start){var r={name:e.name,op:">=",value:e.start,valueType:e.valueType};t.push(r)}if(e.end){var a=e.end;16===a.length&&"datetime"===e.valueType?a+=":59":14===a.length&&"datetime"===e.valueType&&(a+=":59:59");var i={name:e.name,op:"<=",value:a,valueType:e.valueType};t.push(i)}}else if(e.searchValue instanceof Array){if(e.searchValue.length>0){var o={name:e.name,op:"dicmultiple",value:e.searchValue.join(","),valueType:e.valueType};t.push(o)}}else if(e.searchValue){var n={name:e.name,op:e.opName,value:e.searchValue,valueType:e.valueType};e.isDicMultiple&&(n.op="dicmultiple"),t.push(n)}})}),t},build_filter_condis:function(){var t={};Object.assign(t,this.filterFields);var e=[];for(var r in t){if(t[r].length>0){var a="=";t[r].length>1&&(a="dicmultiple");var i={name:r,op:a,value:t[r].join(","),valueType:"string"};e.push(i)}}return e},on_batch_select:function(t){this.batch_select=t},isAuth:function(t){return!t||""===t}}}},function(t,e,r){"use strict";/*!
2
2
  * @jsmini/type 0.9.2 (https://github.com/jsmini/type)
3
3
  * API https://github.com/jsmini/type/blob/master/doc/api.md
4
4
  * Copyright 2017-2019 jsmini. All Rights Reserved