/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/adminold/export/js/chunk-35c50d2e.b35977f2.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-35c50d2e"],{4133:function(t,e,r){"use strict";r("5024")},5024:function(t,e,r){},"6f24":function(t,e,r){t.exports=r.p+"img/print.e7689f41.svg"},"9fd3":function(t,e,r){t.exports=r.p+"img/json.9091035b.svg"},ae96:function(t,e,r){t.exports=r.p+"img/excel.aed56ccb.svg"},ff6e:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.model?n("div",[n("ACard",{ref:"tblCard",staticClass:"overflow-auto",scopedSlots:t._u([{key:"cover",fn:function(){return[n("ASpin",{attrs:{spinning:t.loading}},[n("div",{staticClass:"grid grid-cols-1 md:grid-cols-5 gap-4 p-2"},[n("div",{staticClass:"md:col-span-3 grid grid-cols-1 md:grid-cols-5 gap-4 items-center"},[t.model._noSearch?t._e():n("a-input-search",{staticClass:"md:col-span-4",attrs:{placeholder:"عبارت مورد نظر برای جستجو را وارد کنید","enter-button":"جستجو"},on:{search:t.onSearch}}),t.model._noFilters?t._e():n("AButton",{attrs:{type:t.getFilterType},on:{click:t.toggleVisibleFilter}},[n("div",{staticClass:"flex items-center"},[n("feather-icon",{staticClass:"mr-4",attrs:{icon:"FilterIcon","svg-classes":"h-4 w-4 color-grey cursor-pointer"}}),t.query&&t.query.filters.length>0?n("div",[t._v("\n\n "+t._s(t.query.filters.length)+"\n فیلتر\n ")]):n("div",[t._v("\n فیلتر ها\n ")])],1)])],1),t.visibleDownload?n("div",{staticClass:"filter-backdrop p-4"},[n("feather-icon",{staticClass:"ml-4",attrs:{icon:"XIcon","svg-classes":"h-4 w-4 color-grey cursor-pointer"},on:{click:t.toggleVisibleDownload}}),n("AAlert",{scopedSlots:t._u([{key:"message",fn:function(){return[t._v("\n لیست فعلی را می توانید در یکی از قالب های زیر دریافت کنید.\n ")]},proxy:!0}],null,!1,1929663516)}),n("div",{staticClass:"grid grid-cols-1 md:grid-cols-3 p-8"},[n("div",{staticClass:"flex items-center justify-center flex-col cursor-pointer",on:{click:function(e){return t.fetch("json")}}},[n("img",{staticClass:"mb-4",staticStyle:{"max-height":"45px"},attrs:{src:t.jsonIcon?t.jsonIcon:r("529b")}}),t._v("\n خروجی json\n ")]),n("div",{staticClass:"flex items-center justify-center flex-col cursor-pointer",on:{click:function(e){return t.fetch("excel")}}},[n("img",{staticClass:"mb-4",staticStyle:{"max-height":"45px"},attrs:{src:t.excelIcon?t.excelIcon:r("529b")}}),t._v("\n خروجی اکسل\n ")]),n("div",{staticClass:"flex items-center justify-center flex-col cursor-pointer",on:{click:function(e){return t.fetch("print")}}},[n("img",{staticClass:"mb-4",staticStyle:{"max-height":"45px"},attrs:{src:t.printIcon?t.printIcon:r("529b")}}),t._v("\n خروجی پرینت\n ")])])],1):t._e(),t.activeFilter?n("div",{staticClass:"filter-backdrop p-4"},[n("div",[n("div",{staticClass:"flex items-center mb-4"},[n("feather-icon",{staticClass:"ml-4",attrs:{icon:"XIcon","svg-classes":"h-4 w-4 color-grey cursor-pointer"},on:{click:t.toggleVisibleFilter}}),n("div",{staticClass:"font-bold"},[t._v("\n فیلتر ها\n ")])],1),t.query?n("div",t._l(t.query.filters,(function(e,r){return n("div",{key:e.id,staticClass:"mb-4"},[n("XFilterRow",{attrs:{id:e.id,value:e,index:r,"col-filters":t.getColsFilter,"is-first":r<1},on:{remove:t.removeFilter,input:t.filterChange}})],1)})),0):t._e(),n("div",{staticClass:"flex items-center justify-center"},[n("AButton",{attrs:{type:"primary",ghost:""},on:{click:t.addFilterRow}},[t._v("\n افزودن ردیف جدید\n ")]),n("div",{staticClass:"flex-1"}),t.query?n("AButton",{attrs:{type:"primary",disabled:0==t.query.filters.length},on:{click:t.doFilter}},[t._v("\n انجام فیلتر\n ")]):t._e()],1),n("ADivider",{attrs:{orientation:"left"}},[t._v("\n مرتب سازی\n ")]),n("div",{staticClass:"md:flex gap-4"},[n("ARadioGroup",{staticClass:"ml-4",model:{value:t.sortDirection,callback:function(e){t.sortDirection=e},expression:"sortDirection"}},[n("ARadioButton",{attrs:{value:"asc"}},[t._v("\n صعودی\n ")]),n("ARadioButton",{attrs:{value:"desc"}},[t._v("\n نزولی\n ")])],1),n("ASelect",{staticStyle:{"min-width":"250px"},attrs:{placeholder:"مرتب سازی","allow-clear":""},model:{value:t.sort,callback:function(e){t.sort=e},expression:"sort"}},t._l(t.model.getSortFields(),(function(e,r){return n("ASelectOption",{key:r,attrs:{value:e.key}},[t._v("\n "+t._s(e.title)+"\n ")])})),1),n("div",{staticClass:"flex-1"}),n("AButton",{staticClass:"bg-primary",attrs:{type:"primary"},on:{click:t.doFilter}},[t._v("\n بروزرسانی\n ")])],1)],1)]):t._e(),t.model._noSettings?t._e():n("div",{staticClass:"flex justify-end gap-4 items-center md:col-span-2"},[n("feather-icon",{attrs:{icon:t.getFullIcon,"svg-classes":"w-5 h-5 cursor-pointer text-primary"},on:{click:t.fullScreen}}),n("ADropdown",{attrs:{trigger:["hover"]}},[n("div",{staticClass:"p-2",staticStyle:{"min-width":"250px"},attrs:{slot:"overlay"},slot:"overlay"},[n("ACard",{attrs:{"body-style":{padding:"8px"}},on:{click:function(e){return e.stopPropagation(),t.noThings.apply(null,arguments)}}},[t._v("\n ستون های جدول\n "),n("ADivider",{staticClass:"my-2"}),n("div",{staticClass:"flex flex-col items-start",staticStyle:{"max-height":"150px",overflow:"auto"}},[n("Draggable",{model:{value:t.cols,callback:function(e){t.cols=e},expression:"cols"}},t._l(t.cols,(function(e,r){return n("div",{key:r,staticClass:"flex items-start"},[n("feather-icon",{staticClass:"mr-0",attrs:{icon:"MoreVerticalIcon","svg-classes":"h-4 w-4 color-grey cursor-pointer"}}),n("feather-icon",{staticStyle:{position:"relative",left:"9px"},attrs:{icon:"MoreVerticalIcon","svg-classes":"h-4 w-4 color-grey cursor-pointer"}}),n("ACheckbox",{model:{value:e.show,callback:function(r){t.$set(e,"show",r)},expression:"item.show"}},[t._v("\n "+t._s(e.title)+"\n ")])],1)})),0)],1)],1)],1),n("feather-icon",{attrs:{icon:"SettingsIcon","svg-classes":"w-5 h-5 cursor-pointer refresh-btn text-primary"}})],1),n("feather-icon",{attrs:{icon:"RotateCwIcon","svg-classes":"w-5 h-5 refresh-btn cursor-pointer text-primary"},on:{click:t.fetch}}),n("feather-icon",{attrs:{icon:"DownloadIcon","svg-classes":"w-5 h-5 cursor-pointer text-primary"},on:{click:t.showDownload}})],1)]),n("a-table",{ref:"tbl",attrs:{"indent-size":5,pagination:!1,locale:t.locale,columns:t.visibleCols,"data-source":t.data,"row-key":"id"},on:{change:t.change},scopedSlots:t._u([t._l(t.customRender,(function(e,r){return{key:e,fn:function(i,o,s){return[n("TableRowSlot",{key:r,attrs:{index:s,value:i,record:o,item:e,defaultValue:t.defaultVlues[e],defaultFilter:t.modelDefaultFilters[e]}},[t._t(e,null,{text:i,record:o,index:s})],2)]}}}))],null,!0)},[n("div",{attrs:{slot:"footer"},slot:"footer"},[n("div",{staticClass:"grid grid-cols-1 md:grid-cols-2 gap-4"},[n("div",{staticClass:"flex-1"},[t.query.total?n("div",[n("span",[t._v(t._s(t.query.total))]),t._v("\n رکورد یافت شد.\n ")]):t._e()]),n("APagination",{attrs:{dir:"rtl","show-less-items":"","show-size-changer":"","page-size-options":["5","10","20"],"page-size":t.query.limit,"default-current":1,total:t.query.total},on:{"update:pageSize":function(e){return t.$set(t.query,"limit",e)},"update:page-size":function(e){return t.$set(t.query,"limit",e)},change:t.changePage,showSizeChange:t.changePage},scopedSlots:t._u([{key:"buildOptionText",fn:function(e){return[n("div",{attrs:{dir:"rtl"}},[n("span",[t._v(" "+t._s(e.value)+" ")]),n("span",[t._v("رکورد")])])]}}],null,!1,166335086),model:{value:t.query.page,callback:function(e){t.$set(t.query,"page",e)},expression:"query.page"}})],1)])])],1)]},proxy:!0}],null,!1,539594065)})],1):t._e()},i=[],o=(r("8e6e"),r("456d"),r("ac4d"),r("8a81"),r("5df3"),r("1c4c"),r("7f7f"),r("6b54"),r("96cf"),r("1da1")),s=r("ade3"),l=(r("ac6a"),r("386d"),r("6762"),r("2fdb"),r("f559"),r("55dd"),r("b76a")),a=r.n(l),c=r("e6f7");function u(t){t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen()}function f(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()}var d=r("6f24"),h=r.n(d),p=r("ae96"),v=r.n(p),m=r("9fd3"),g=r.n(m),y=r("04c5"),b=r("8114"),w=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[t._t("default",(function(){return[t.value?[t._v("\n "+t._s(t._f("dynamicFilter")(t.value,t.defaultFilter||"none"))+"\n ")]:[t._v("\n "+t._s(t.defaultValue||"")+"\n ")]]}),{text:t.value,record:t.record,index:t.index})],2)},x=[],S=(r("c5f6"),{name:"tableRowSlot",props:{value:[Object,String,Number],record:[Object,String,Number],index:[Object,String,Number],item:[Object,String,Number],defaultValue:[Object,String,Number],defaultFilter:[Object,String,Number]}}),q=S,F=r("2877"),_=Object(F["a"])(q,w,x,!1,null,"61a2058e",null),C=_.exports;r("20d6");function k(t,e){var r="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=j(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}function j(t,e){if(t){if("string"===typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var D={props:{defaultFilters:{type:Array,required:!1}},data:function(){return{loadingVar:!1,serverMode:"laravel"}},watch:{model:function(){this.fetch()}},computed:{loading:{get:function(){return"laravel"==this.serverMode?this.loadingVar:this.$store.state.loading},set:function(t){return"laravel"==this.serverMode?this.loadingVar=t:this.$store.commit("setLoading",t)}},defaultVlues:function(){var t={};return this.model.cols.filter((function(t){return t.scopedSlots&&t.scopedSlots.customRender&&t.defaultValue})).map((function(e){return t[e.scopedSlots.customRender]=e.defaultValue})),t},modelDefaultFilters:function(){var t={};return this.model.cols.filter((function(t){return t.scopedSlots&&t.scopedSlots.customRender&&t.defaultFilter})).map((function(e){return t[e.scopedSlots.customRender]=e.defaultFilter})),t}},methods:{getDataUsage:function(t){var e="laravel"==this.serverMode?{data:t.rows,query:t.query}:{data:t.rows[0],query:Object.assign(this.query,{limit:10,total:t.count,page:t.page})};return this.$emit("query",t.query),e},setDefaultFilters:function(){var t=this;if(this.defaultFilters){var e,r=k(this.defaultFilters);try{var n=function(){var r=e.value,n=t.query.filters.findIndex((function(t){return t.field===r.field&&t.value===r.value}));-1===n&&t.query.filters.push(r)};for(r.s();!(e=r.n()).done;)n()}catch(l){r.e(l)}finally{r.f()}}if(this.model.defaultFilters){var i,o=k(this.model.defaultFilters);try{var s=function(){var e=i.value,r=t.query.filters.findIndex((function(t){return t.field===e.field&&t.value===e.value}));-1===r&&t.query.filters.push(e)};for(o.s();!(i=o.n()).done;)s()}catch(l){o.e(l)}finally{o.f()}}}}},A=r("bb36");function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){Object(s["a"])(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function V(t,e){var r="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=$(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw o}}}}function $(t,e){if(t){if("string"===typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var z={name:"XTable",mixins:[D],components:{XFilterRow:b["a"],Draggable:a.a,TableRowSlot:C,FeatherIcon:y["a"]},props:{model:{type:c["a"].default}},data:function(){return{data:[],jsonIcon:g.a,excelIcon:v.a,printIcon:h.a,lastHashStringFilter:void 0,query:{search:void 0,filters:[],total:0,limit:10,page:1},locale:{emptyText:"هیج رکوردی یافت نشد."},activeFilter:!1,full:!1,sort:void 0,sortDirection:"asc",colSelector:!1,visibleDownload:!1}},computed:{order:{set:function(){},get:function(){if(this.sort){var t="asc"===this.sortDirection?"+":"-";return"".concat(t).concat(this.sort)}}},getFilterType:function(){return this.query&&this.query.filters&&this.query.filters.length,"primary"},getFullIcon:function(){return this.full,"ion:resize-outline"},customRender:function(){return this.model?this.model.cols.filter((function(t){return t.scopedSlots&&t.scopedSlots.customRender})).map((function(t){return t.scopedSlots.customRender})):void 0},filterIcons:function(){return this.model?this.model.cols.filter((function(t){return t.scopedSlots&&t.scopedSlots.filterIcon})).map((function(t){return t.scopedSlots.filterIcon})):void 0},cols:{get:function(){return this.model?this.model.cols:[]},set:function(t){return this.model&&(this.model.cols=t),!1}},getColsFilter:function(){return this.cols.filter((function(t){return t.filtered}))},visibleCols:function(){return this.cols.filter((function(t){return t.show}))}},mounted:function(){this.fetch()},methods:{getFilters:function(){return this.query.filters},showDownload:function(){this.visibleDownload=!0},doFilter:function(){this.activeFilter=!1,this.fetch()},removeFilter:function(t){this.$delete(this.query.filters,t),this.$forceUpdate()},filterChange:function(t){this.query.filters[t.index]=t},calcHash:function(){},addFilterRow:function(){this.query||(this.query={}),this.query.filters||(this.query.filters=[]);var t=parseFloat("".concat(this.query.filters.length,".").concat(Math.floor(1e3*Math.random())));this.query.filters.push({id:t}),this.$forceUpdate()},toggleVisibleFilter:function(){this.activeFilter=!this.activeFilter},toggleVisibleDownload:function(){this.visibleDownload=!this.visibleDownload},hasFiltered:function(t){var e,r=V(this.query);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(t.startsWith(n.field))return!0}}catch(i){r.e(i)}finally{r.f()}return!1},change:function(t,e,r){if(r){var n=r.columnKey,i=r.order;this.query.order=["".concat("ascend"==i?"-":"+").concat(n)]}this.fetch()},changePage:function(t){this.query=Object.assign(this.query,{page:t}),this.fetch()},fullScreen:function(){if(this.full)return f(),void(this.full=!1);u(this.$refs.tblCard.$el),this.full=!0},requestData:function(t){this.query.order=this.order,this.setDefaultFilters(),this.query.filters=this.query.filters.filter((function(t){return t.value||["null","nn"].includes(t.op)||0==t.value}));var e=this.visibleCols.map((function(t){return t.key})),r={},n=JSON.stringify(this.query.filters);return this.query.search&&(n+=this.query.search),n!=this.lastHashStringFilter&&(this.query.page=1),this.lastHashStringFilter=n,this.visibleCols.forEach((function(t){return r[t.key]=t.title})),R(R({},this.query),{},t?{op:t,select:e,titles:r,report_title:this.model?this.model.title:void 0}:{select:e,titles:r,report_title:this.model?this.model.title:void 0})},fetch:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(e){var r,n,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,this.loading=!0,!this.model){t.next=13;break}return t.next=5,A["c"].post(this.model.url,this.requestData(e));case 5:if(r=t.sent,n=r.data,"excel"!==e&&"json"!==e&&"print"!==e){t.next=10;break}return window.open(n.url),t.abrupt("return");case 10:i=this.getDataUsage(n),this.data=i.data,this.query=i.query;case 13:t.next=19;break;case 15:throw t.prev=15,t.t0=t["catch"](0),console.log(t.t0),t.t0;case 19:return t.prev=19,this.loading=!1,this.visibleDownload=!1,t.finish(19);case 23:case"end":return t.stop()}}),t,this,[[0,15,19,23]])})));function e(e){return t.apply(this,arguments)}return e}(),noThings:function(){},getFilterData:function(){},onSearch:function(t){this.query.search=t,this.fetch()},showColSelector:function(){this.colSelector=!this.colSelector}}},E=z,T=(r("4133"),Object(F["a"])(E,n,i,!1,null,"29c02ed1",null));e["a"]=T.exports}}]); //# sourceMappingURL=chunk-35c50d2e.b35977f2.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure