芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/adminpanel/js/4182.10836e2d.js
"use strict";(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[4182],{8815:(e,t,s)=>{s.r(t),s.d(t,{default:()=>P});var r=s(9835),o=s(6970);const i={class:"flex column full-height"};function a(e,t,s,a,u,l){const n=(0,r.up)("Trash"),h=(0,r.up)("q-tooltip"),p=(0,r.up)("q-btn"),d=(0,r.up)("Add"),c=(0,r.up)("q-toolbar"),g=(0,r.up)("team-group-icon"),I=(0,r.up)("q-item-section"),m=(0,r.up)("standard-list"),E=(0,r.up)("router-view"),C=(0,r.up)("ConfirmDialog"),G=(0,r.up)("q-splitter"),_=(0,r.up)("main-layout");return(0,r.wg)(),(0,r.j4)(_,null,{default:(0,r.w5)((()=>[(0,r.Wm)(G,{"after-class":"q-splitter__right-panel",class:"full-height full-width",modelValue:u.listSplitterWidth,"onUpdate:modelValue":t[0]||(t[0]=e=>u.listSplitterWidth=e),limits:[10,30]},{before:(0,r.w5)((()=>[(0,r._)("div",i,[(0,r.Wm)(c,{class:"col-auto q-py-sm list-border"},{default:(0,r.w5)((()=>[(0,r.Wm)(p,{flat:"",color:"grey-8",size:"mg","no-wrap":"",disable:0===u.checkedIds.length,onClick:l.askDeleteCheckedGroups},{default:(0,r.w5)((()=>[(0,r.Wm)(n),(0,r._)("span",null,(0,o.zw)(l.countLabel),1),(0,r.Wm)(h,null,{default:(0,r.w5)((()=>[(0,r.Uk)((0,o.zw)(e.$t("COREWEBCLIENT.ACTION_DELETE")),1)])),_:1})])),_:1},8,["disable","onClick"]),(0,r.Wm)(p,{flat:"",color:"grey-8",size:"mg",onClick:l.routeCreateGroup},{default:(0,r.w5)((()=>[(0,r.Wm)(d),(0,r.Wm)(h,null,{default:(0,r.w5)((()=>[(0,r.Uk)((0,o.zw)(e.$t("ADMINPANELWEBCLIENT.ACTION_CREATE_ENTITY_GROUP")),1)])),_:1})])),_:1},8,["onClick"])])),_:1}),(0,r.Wm)(m,{class:"col-grow list-border",items:u.groupItems,selectedItem:u.selectedGroupId,loading:u.loadingGroups,search:u.search,page:u.page,pagesCount:l.pagesCount,noItemsText:"ADMINPANELWEBCLIENT.INFO_NO_ENTITIES_GROUP",noItemsFoundText:"ADMINPANELWEBCLIENT.INFO_NO_ENTITIES_FOUND_GROUP",ref:"groupList",onRoute:l.route,onCheck:l.afterCheck},{"right-icon":(0,r.w5)((e=>[(0,r.Wm)(I,{side:""},{default:(0,r.w5)((()=>[(0,r.Wm)(g,{size:24,color:e.color},null,8,["color"])])),_:2},1024)])),_:1},8,["items","selectedItem","loading","search","page","pagesCount","noItemsText","noItemsFoundText","onRoute","onCheck"])])])),after:(0,r.w5)((()=>[(0,r.Wm)(E,{onGroupCreated:l.handleCreateGroup,onCancelCreate:l.route,onDeleteGroup:l.askDeleteGroup,deletingIds:u.deletingIds},null,8,["onGroupCreated","onCancelCreate","onDeleteGroup","deletingIds"])])),default:(0,r.w5)((()=>[(0,r.Wm)(C,{ref:"confirmDialog"},null,512)])),_:1},8,["modelValue"])])),_:1})}s(9665);var u=s(4409),l=s.n(u),n=s(9336),h=s(1427),p=s(4089),d=s(2456),c=s(1088),g=s(4168),I=s(3517),m=s(1797),E=s(7466),C=s(4598),G=s(4465);const _={name:"Groups",components:{MainLayout:g.Z,ConfirmDialog:I.Z,StandardList:m.Z,Add:E.Z,TeamGroupIcon:C.Z,Trash:G.Z},data(){return{groups:[],selectedGroupId:0,loadingGroups:!1,totalCount:0,search:"",page:1,limit:c.Z.getEntitiesPerPage(),groupItems:[],checkedIds:[],justCreatedId:0,deletingIds:[],listSplitterWidth:p.Z.pInt(localStorage.getItem("aurora_admin_groups_splitter-width"),20)}},computed:{currentTenantId(){return this.$store.getters["tenants/getCurrentTenantId"]},allGroups(){const e=this.$store.getters["groups/getGroups"];return p.Z.pArray(e[this.currentTenantId])},pagesCount(){return Math.ceil(this.totalCount/this.limit)},countLabel(){const e=this.checkedIds.length;return e>0?e:""}},watch:{$route(e,t){this.parseRoute()},currentTenantId(){"/groups"!==this.$route.path&&this.$router.push("/groups"),this.requestGroups()},allGroups(){this.populate(),this.justCreatedId&&this.allGroups.find((e=>e.id===this.justCreatedId))&&(this.groups.find((e=>e.id===this.justCreatedId))&&this.route(this.justCreatedId),this.justCreatedId=0)},groups(){this.groups?this.groupItems=this.groups.map((e=>({id:e.id,title:e.name,checked:!1,disableCheck:e.isTeam,showRightIcon:e.isTeam}))):this.groupItems=[]},listSplitterWidth(){localStorage.setItem("aurora_admin_groups_splitter-width",this.listSplitterWidth)}},mounted(){this.requestGroups(),this.parseRoute(),this.populate()},methods:{requestGroups(){this.$store.dispatch("groups/requestGroups",{tenantId:this.currentTenantId})},parseRoute(){if("/groups/create"===this.$route.path)this.selectedGroupId=0;else{const e=p.Z.pString(this.$route?.params?.search),t=p.Z.pPositiveInt(this.$route?.params?.page);this.search===e&&this.page===t&&0===this.justCreatedId||(this.search=e,this.page=t,this.populate());const s=p.Z.pNonNegativeInt(this.$route?.params?.id);this.selectedGroupId!==s&&(this.selectedGroupId=s)}},populate(){const e=this.search.toLowerCase(),t=""===e?this.allGroups:this.allGroups.filter((t=>-1!==t.name.toLowerCase().indexOf(e)));this.totalCount=t.length;const s=this.limit*(this.page-1);this.groups=t.slice(s,s+this.limit)},route(e=0){const t=this.$refs?.groupList?.enteredSearch||"",s=""!==t?`/search/${t}`:"";let r=this.$refs?.groupList?.selectedPage||1;this.search!==t&&(r=1);const o=r>1?`/page/${r}`:"",i=e>0?`/id/${e}`:"",a="/groups"+s+o+i;a!==this.$route.path&&this.$router.push(a)},routeCreateGroup(){this.$router.push("/groups/create")},handleCreateGroup(e){this.justCreatedId=e,this.route(),this.requestGroups()},afterCheck(e){this.checkedIds=e},askDeleteGroup(e){this.askDeleteGroups([e])},askDeleteCheckedGroups(){this.askDeleteGroups(this.checkedIds)},askDeleteGroups(e){if(l().isFunction(this?.$refs?.confirmDialog?.openDialog)){const t=1===e.length?this.groups.find((t=>t.id===e[0])):null,s=t?t.name:"";this.$refs.confirmDialog.openDialog({title:s,message:this.$tc("ADMINPANELWEBCLIENT.CONFIRM_DELETE_GROUP_PLURAL",e.length),okHandler:this.deleteGroups.bind(this,e)})}},deleteGroups(e){this.deletingIds=e,this.loadingGroups=!0,d.Z.sendRequest({moduleName:"Core",methodName:"DeleteGroups",parameters:{IdList:e,Type:"Group"}}).then((t=>{if(this.deletingIds=[],this.loadingGroups=!1,!0===t){h.Z.showReport(this.$tc("ADMINPANELWEBCLIENT.REPORT_DELETE_ENTITIES_GROUP_PLURAL",e.length));const t=-1!==e.indexOf(this.selectedGroupId),s=this.$refs?.groupList?.selectedPage||1,r=this.groups.length===e.length&&s>1;r&&l().isFunction(this.$refs?.groupList?.decreasePage)?this.$refs.groupList.decreasePage():t?(this.route(),this.populate()):this.populate()}else h.Z.showError(this.$tc("ADMINPANELWEBCLIENT.ERROR_DELETE_ENTITIES_GROUP_PLURAL",e.length));this.requestGroups()}),(t=>{this.deletingIds=[],this.loadingGroups=!1,h.Z.showError(n.Z.getTextFromResponse(t,this.$tc("ADMINPANELWEBCLIENT.ERROR_DELETE_ENTITIES_GROUP_PLURAL",e.length))),this.requestGroups()}))}}};var T=s(1639),f=s(7498),L=s(1663),N=s(8879),w=s(6858),k=s(1233),R=s(9984),D=s.n(R);const $=(0,T.Z)(_,[["render",a]]),P=$;D()(_,"components",{QSplitter:f.Z,QToolbar:L.Z,QBtn:N.Z,QTooltip:w.Z,QItemSection:k.Z})}}]);