山东雷驰
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
17 KiB

!function(){function e(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||t(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),e}(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{AVcX:function(r,i,a){"use strict";a.r(i),a.d(i,"BasicModule",function(){return W});var c=a("PCNd"),s=a("tyNb"),l=a("mrSG"),u=a("R0Ic"),d=a("0EQZ"),f=a("FvrZ"),h=a("0IaG"),p=a("8yBR"),v=a("fXoL"),b=a("bUwk"),m=a("Xi3o"),g=a("Olgc"),_=a("ofXK"),w=a("bTqV"),y=a("Xa2L"),S=a("bSwM"),k=a("NFeN"),O=a("sYmb");function x(e,t){1&e&&(v.Ub(0,"div",7),v.Pb(1,"mat-spinner"),v.Tb())}function C(e,t){if(1&e){var r=v.Vb();v.Ub(0,"mat-tree-node"),v.Pb(1,"button",11),v.Ub(2,"mat-checkbox",12),v.bc("change",function(){v.wc(r);var e=t.$implicit;return v.fc(2).toggle(e)}),v.Hc(3),v.gc(4,"translate"),v.Tb(),v.Tb()}if(2&e){var n=t.$implicit,i=v.fc(2);v.Cb(2),v.lc("checked",i.selection.isSelected(n.data.id)),v.Cb(1),v.Ic(v.hc(4,2,n.data.header))}}function T(e,t){if(1&e){var r=v.Vb();v.Ub(0,"mat-nested-tree-node"),v.Ub(1,"div"),v.Ub(2,"button",13),v.Ub(3,"mat-icon"),v.Hc(4),v.Tb(),v.Tb(),v.Ub(5,"mat-checkbox",14),v.bc("change",function(){v.wc(r);var e=t.$implicit;return v.fc(2).toggle(e)}),v.Hc(6),v.gc(7,"translate"),v.Tb(),v.Tb(),v.Ub(8,"div",15),v.Qb(9,16),v.Tb(),v.Tb()}if(2&e){var n=t.$implicit,i=v.fc(2);v.Cb(4),v.Ic(i.ctrl.isExpanded(n)?"expand_more":"chevron_right"),v.Cb(1),v.lc("checked",i.selected(n,!1))("indeterminate",i.selected(n,!0)),v.Cb(1),v.Ic(v.hc(7,5,n.data.header)),v.Cb(2),v.lc("@expand",i.ctrl.isExpanded(n)?"expanded":"collapsed")}}function j(e,t){if(1&e&&(v.Ub(0,"mat-tree",8),v.Fc(1,C,5,4,"mat-tree-node",9),v.Fc(2,T,10,7,"mat-nested-tree-node",10),v.Tb()),2&e){var r=v.fc();v.lc("dataSource",r.tree)("treeControl",r.ctrl),v.Cb(2),v.lc("matTreeNodeDefWhen",r.expandable)}}var I,U=((I=function(){function r(i,o,a,c,s){var u=this;n(this,r),this._id=i,this._httpService=o,this._i18nService=a,this._toastService=c,this._dialogRef=s,this._loading=!0,this.expandable=function(e,t){var r;return null===(r=t.children)||void 0===r?void 0:r.length},this.selected=function(e,t){if(u._tree.data){var r=u._ctrl.getDescendants(e),n=r.some(function(e){return u._selection.isSelected(e.data.id)});return t&&n&&(n=!r.every(function(e){return u._selection.isSelected(e.data.id)})),n}},this.toggle=function(t){var r,n;u._selection.toggle(t.data.id);var i=u._ctrl.getDescendants(t);i.length&&(u._selection.isSelected(t.data.id)?(r=u._selection).select.apply(r,e(i.map(function(e){return e.data.id}))):(n=u._selection).deselect.apply(n,e(i.map(function(e){return e.data.id}))));for(var o=t.parent;o;)u._selection.isSelected(o.data.id)?u.selected(o,!1)||u._selection.deselect(o.data.id):u.selected(o,!1)&&u._selection.select(o.data.id),o=o.parent},this.save=function(){return Object(l.a)(u,void 0,void 0,regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:void 0!==this._httpService.post("roles/".concat(this._id,"/menu"),this._selection.selected).catch(function(e){return Object(l.a)(t,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.status,t.next=410===t.t0?3:422===t.t0?5:7;break;case 3:return this._toastService.show(this._i18nService.translate("routes.basic.role.error.gone."+(null===(n=null===(r=e.error)||void 0===r?void 0:r.propertyName)||void 0===n?void 0:n.toLowerCase()))),this._dialogRef.close({success:!1}),t.abrupt("break",8);case 5:return this._toastService.show(this._i18nService.translate("shared.notification.fail")),this._dialogRef.close({success:!1}),t.abrupt("break",8);case 7:this._dialogRef.close({success:!1});case 8:case"end":return t.stop()}},t,this)}))})&&(this._toastService.show(this._i18nService.translate("shared.notification.success")),this._dialogRef.close({success:!0}));case 1:case"end":return e.stop()}},e,this)}))},this._ctrl=new f.j(function(e){return e.children}),this._tree=new p.d,this._selection=new d.c(!0),this._httpService.get("roles/".concat(this._id,"/menu")).then(function(r){var n,i,o;if(null===(i=r.menu.children)||void 0===i?void 0:i.length)for(var a=e(r.menu.children),c=function(){var t=a.pop();(null===(o=t.children)||void 0===o?void 0:o.length)&&(t.children.forEach(function(e){return e.parent=t}),a.push.apply(a,e(t.children)))};a.length;)c();(n=u._selection).select.apply(n,e(r.permission)),u._tree.data=r.menu.children;var s,l=function(e,r){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=t(e))||r&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}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 a,c=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw a}}}}(u._tree.data);try{for(l.s();!(s=l.n()).done;){var d=s.value;u._ctrl.expandDescendants(d)}}catch(f){l.e(f)}finally{l.f()}u._loading=!1})}return o(r,[{key:"loading",get:function(){return this._loading}},{key:"ctrl",get:function(){return this._ctrl}},{key:"tree",get:function(){return this._tree}},{key:"selection",get:function(){return this._selection}}]),r}()).\u0275fac=function(e){return new(e||I)(v.Ob(h.a),v.Ob(b.a),v.Ob(m.a),v.Ob(g.a),v.Ob(h.g))},I.\u0275cmp=v.Ib({type:I,selectors:[["app-basic-role-menu"]],decls:16,vars:15,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["class","loading",4,"ngIf","ngIfElse"],["$tree",""],["mat-dialog-actions","","align","end"],["mat-button","","color","primary",3,"click"],["mat-button","","mat-dialog-close","","cdkFocusInitial",""],[1,"loading"],[3,"dataSource","treeControl"],[4,"matTreeNodeDef"],[4,"matTreeNodeDef","matTreeNodeDefWhen"],["mat-icon-button","","disabled",""],[3,"checked","change"],["mat-icon-button","","matTreeNodeToggle",""],[3,"checked","indeterminate","change"],[1,"mat-nested-tree-node-children"],["matTreeNodeOutlet",""]],template:function(e,t){if(1&e&&(v.Ub(0,"h2",0),v.Hc(1),v.gc(2,"translate"),v.Tb(),v.Ub(3,"div",1),v.Fc(4,x,2,0,"div",2),v.Fc(5,j,3,3,"ng-template",null,3,v.Gc),v.Tb(),v.Ub(7,"div",4),v.Ub(8,"button",5),v.bc("click",function(){return t.save()}),v.Hc(9),v.gc(10,"uppercase"),v.gc(11,"translate"),v.Tb(),v.Ub(12,"button",6),v.Hc(13),v.gc(14,"uppercase"),v.gc(15,"translate"),v.Tb(),v.Tb()),2&e){var r=v.uc(6);v.Cb(1),v.Ic(v.hc(2,5,"routes.basic.role.menu")),v.Cb(3),v.lc("ngIf",t.loading)("ngIfElse",r),v.Cb(5),v.Ic(v.hc(10,7,v.hc(11,9,"shared.dialog.ok"))),v.Cb(4),v.Ic(v.hc(14,11,v.hc(15,13,"shared.dialog.cancel")))}},directives:[h.h,h.e,_.n,h.c,w.a,h.d,y.b,p.b,p.f,p.e,S.b,p.a,p.h,k.a,p.g],pipes:[O.d,_.v],styles:[".loading[_ngcontent-%COMP%]{display:flex;padding:50px 0;justify-content:center}.mat-nested-tree-node-children[_ngcontent-%COMP%]{padding-left:24px;overflow:hidden}.mat-dialog-content[_ngcontent-%COMP%]{padding:0 16px}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"],data:{animation:[Object(u.m)("expand",[Object(u.j)("collapsed",Object(u.k)({height:"0"})),Object(u.j)("expanded",Object(u.k)({height:"*"})),Object(u.l)("collapsed <=> expanded",Object(u.e)("200ms cubic-bezier(.4, 0, .2, 1)"))])]}}),I),R=a("S+vS"),M=a("TmDA"),N=a("Qu3c"),$=["$crud"];function P(e,t){if(1&e){var r=v.Vb();v.Ub(0,"button",3),v.bc("click",function(){v.wc(r);var e=t.$implicit;return v.fc().menu(e.id)}),v.gc(1,"translate"),v.Ub(2,"mat-icon"),v.Hc(3,"menu"),v.Tb(),v.Tb()}2&e&&v.mc("matTooltip",v.hc(1,1,"routes.basic.role.menu"))}var A,F=((A=function(){function e(t,r,i){var o=this;n(this,e),this._dialogService=t,this._i18nService=r,this._toastService=i,this.error=function(e){var t,r,n,i;switch(e.status){case 409:return o._toastService.show(o._i18nService.translate("routes.basic.role.error.conflict."+(null===(r=null===(t=e.error)||void 0===t?void 0:t.propertyName)||void 0===r?void 0:r.toLowerCase()))),!1;case 410:return o._toastService.show(o._i18nService.translate("routes.basic.role.error.gone."+(null===(i=null===(n=e.error)||void 0===n?void 0:n.propertyName)||void 0===i?void 0:i.toLowerCase()))),!0;case 422:return o._toastService.show(o._i18nService.translate("shared.notification.fail")),!0;default:return!0}},this.menu=function(e){return Object(l.a)(o,void 0,void 0,regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._dialogService.open(U,{data:e});case 2:(r=t.sent)&&!r.success&&this._template.refresh();case 4:case"end":return t.stop()}},t,this)}))}}return o(e,[{key:"ngAfterViewInit",value:function(){var e=this;setTimeout(function(){e._defination=[{id:"name",header:"routes.basic.role.name",filter:{field:"text"},editor:{field:"text",required:!0}},{id:"remark",header:"routes.basic.role.remark",editor:{field:"text"}}]})}},{key:"defination",get:function(){return this._defination}}]),e}()).\u0275fac=function(e){return new(e||A)(v.Ob(R.a),v.Ob(m.a),v.Ob(g.a))},A.\u0275cmp=v.Ib({type:A,selectors:[["app-basic-role"]],viewQuery:function(e,t){var r;1&e&&v.Oc($,!0),2&e&&v.tc(r=v.cc())&&(t._template=r.first)},decls:4,vars:4,consts:[[3,"defination","api","row-operation-template","error"],["$crud",""],["$menu",""],["mat-icon-button","",3,"matTooltip","click"]],template:function(e,t){if(1&e&&(v.Ub(0,"crud-template",0,1),v.Fc(2,P,4,3,"ng-template",null,2,v.Gc),v.Tb()),2&e){var r=v.uc(3);v.lc("defination",t.defination)("api","roles")("row-operation-template",r)("error",t.error)}},directives:[M.a,w.a,N.c,k.a],pipes:[O.d],styles:[""]}),A),L=a("FFMq"),q=a("hZOD"),D=["$crud"],E=["$role"];function H(e,t){1&e&&(v.Hc(0),v.gc(1,"join"),v.gc(2,"field")),2&e&&v.Ic(v.hc(1,1,v.ic(2,3,t.$implicit.role,"name")))}function V(e,t){if(1&e){var r=v.Vb();v.Ub(0,"button",4),v.bc("click",function(){v.wc(r);var e=t.$implicit;return v.fc().password(e.id)}),v.gc(1,"translate"),v.Ub(2,"mat-icon"),v.Hc(3,"lock_open"),v.Tb(),v.Tb()}2&e&&v.mc("matTooltip",v.hc(1,1,"routes.basic.user.password"))}var G,Q,X,Z,z=[{path:"role",component:F},{path:"user",component:(Q=function(){function e(t,r,i,o){var a=this;n(this,e),this._dialogService=t,this._httpService=r,this._i18nService=i,this._toastService=o,this.error=function(e){var t,r,n,i;switch(e.status){case 409:return a._toastService.show(a._i18nService.translate("routes.basic.user.error.conflict."+(null===(r=null===(t=e.error)||void 0===t?void 0:t.propertyName)||void 0===r?void 0:r.toLowerCase()))),!1;case 410:return a._toastService.show(a._i18nService.translate("routes.basic.user.error.gone."+(null===(i=null===(n=e.error)||void 0===n?void 0:n.propertyName)||void 0===i?void 0:i.toLowerCase()))),!0;case 422:return a._toastService.show(a._i18nService.translate("shared.notification.fail")),!0;default:return!0}},this.password=function(e){return Object(l.a)(a,void 0,void 0,regeneratorRuntime.mark(function t(){var r=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._dialogService.confirm(this._i18nService.translate("shared.notification.confirm"));case 2:if(t.t0=t.sent,!t.t0){t.next=5;break}t.t0=void 0!==this._httpService.delete("users/".concat(e,"/password")).catch(function(e){return Object(l.a)(r,void 0,void 0,regeneratorRuntime.mark(function t(){var r,n;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.status,t.next=410===t.t0?3:422===t.t0?5:6;break;case 3:return this._toastService.show(this._i18nService.translate("routes.basic.user.error.gone."+(null===(n=null===(r=e.error)||void 0===r?void 0:r.propertyName)||void 0===n?void 0:n.toLowerCase()))),this._template.refresh(),t.abrupt("break",6);case 5:this._toastService.show(this._i18nService.translate("shared.notification.fail"));case 6:case"end":return t.stop()}},t,this)}))});case 5:if(t.t1=t.t0,!t.t1){t.next=8;break}this._toastService.show(this._i18nService.translate("shared.notification.success"));case 8:case"end":return t.stop()}},t,this)}))}}return o(e,[{key:"ngAfterViewInit",value:function(){return Object(l.a)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._httpService.get("roles");case 2:t=e.sent,this._defination=[{id:"name",header:"routes.basic.user.name",filter:{field:"text"},editor:{field:"text",required:!0}},{id:"account",header:"routes.basic.user.account",filter:{field:"text"},editor:{field:"text",required:!0}},{id:"role",header:"routes.basic.user.role",template:this._role,sortable:!1,filter:{field:"select",range:t.items},editor:{field:"multi-select",range:t.items,convertor:function(e){return e.map(function(e){return e.id})}}}];case 4:case"end":return e.stop()}},e,this)}))}},{key:"defination",get:function(){return this._defination}}]),e}(),Q.\u0275fac=function(e){return new(e||Q)(v.Ob(R.a),v.Ob(b.a),v.Ob(m.a),v.Ob(g.a))},Q.\u0275cmp=v.Ib({type:Q,selectors:[["app-basic-user"]],viewQuery:function(e,t){var r;1&e&&(v.Oc(D,!0),v.Oc(E,!0)),2&e&&(v.tc(r=v.cc())&&(t._template=r.first),v.tc(r=v.cc())&&(t._role=r.first))},decls:6,vars:4,consts:[[3,"defination","api","row-operation-template","error"],["$crud",""],["$role",""],["$password",""],["mat-icon-button","",3,"matTooltip","click"]],template:function(e,t){if(1&e&&(v.Ub(0,"crud-template",0,1),v.Fc(2,H,3,6,"ng-template",null,2,v.Gc),v.Fc(4,V,4,3,"ng-template",null,3,v.Gc),v.Tb()),2&e){var r=v.uc(5);v.lc("defination",t.defination)("api","users")("row-operation-template",r)("error",t.error)}},directives:[M.a,w.a,N.c,k.a],pipes:[L.a,q.a,O.d],styles:[""]}),Q)},{path:"item",component:(G=function(){function t(r,i,o,a){var c=this;n(this,t),this._dialogService=r,this._httpService=i,this._i18nService=o,this._toastService=a,this._pkColumn="itemlistcode",this._dfs=function(t){var r,n=[];if(null==t?void 0:t.length)for(var i=e(t.reverse());i.length;){var o=i.pop();n.push(o),(null===(r=o.children)||void 0===r?void 0:r.length)&&i.push.apply(i,e(o.children.reverse()))}return n},this.error=function(e){var t,r,n,i;switch(e.status){case 409:return c._toastService.show(c._i18nService.translate("routes.basic.item.error.conflict."+(null===(r=null===(t=e.error)||void 0===t?void 0:t.propertyName)||void 0===r?void 0:r.toLowerCase()))),!1;case 410:return c._toastService.show(c._i18nService.translate("routes.basic.item.error.gone."+(null===(i=null===(n=e.error)||void 0===n?void 0:n.propertyName)||void 0===i?void 0:i.toLowerCase()))),!0;case 422:return c._toastService.show(c._i18nService.translate("shared.notification.fail")),!1;default:return!0}}}return o(t,[{key:"ngAfterViewInit",value:function(){return Object(l.a)(this,void 0,void 0,regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this._defination=[{id:"code",header:"routes.basic.item.code",editor:{field:"text",required:!0},filter:{field:"text"}},{id:"name",header:"routes.basic.item.name",editor:{field:"text",required:!0},filter:{field:"text"}}],this._api="items";case 1:case"end":return e.stop()}},e,this)}))}},{key:"defination",get:function(){return this._defination}},{key:"api",get:function(){return this._api}},{key:"pkColumn",get:function(){return this._pkColumn}}]),t}(),G.\u0275fac=function(e){return new(e||G)(v.Ob(R.a),v.Ob(b.a),v.Ob(m.a),v.Ob(g.a))},G.\u0275cmp=v.Ib({type:G,selectors:[["app-item"]],decls:2,vars:4,consts:[[3,"defination","error","api","query"],["$crud",""]],template:function(e,t){1&e&&v.Pb(0,"crud-template",0,1),2&e&&v.lc("defination",t.defination)("error",t.error)("api",t.api)("query","name=qualityState")},directives:[M.a],styles:[".indent[_ngcontent-%COMP%]{padding-left:16px}.tooltip-ul[_ngcontent-%COMP%]{margin-top:-8px;margin-bottom:0;padding-left:0;list-style-type:disc;list-style-position:inside}.tooltip-ul[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#fff}.mat-dialog-content[_ngcontent-%COMP%] .mat-progress-bar[_ngcontent-%COMP%] + p[_ngcontent-%COMP%]{margin-top:12px}.mat-dialog-actions[_ngcontent-%COMP%]{margin-right:-8px}"]}),G)}],B=((X=function e(){n(this,e)}).\u0275mod=v.Mb({type:X}),X.\u0275inj=v.Lb({factory:function(e){return new(e||X)},imports:[[s.h.forChild(z)],s.h]}),X),J=a("95ze"),W=((Z=function e(){n(this,e)}).\u0275mod=v.Mb({type:Z}),Z.\u0275inj=v.Lb({factory:function(e){return new(e||Z)},imports:[[c.a,B,J.a]]}),Z)}}])}();