"use strict";(self["webpackChunkX_PHP_Admin"]=self["webpackChunkX_PHP_Admin"]||[]).push([[49],{7049:function(e,t,l){l.r(t),l.d(t,{default:function(){return _}});var s=l(6252);const a={class:"left-panel"},i=(0,s._)("div",{class:"image-slot"}," 无图 ",-1),r=["value"];function o(e,t,l,o,n,u){const d=(0,s.up)("x-select-filter"),c=(0,s.up)("el-card"),p=(0,s.up)("el-button"),h=(0,s.up)("el-header"),y=(0,s.up)("el-table-column"),g=(0,s.up)("x-status-indicator"),m=(0,s.up)("el-image"),w=(0,s.up)("el-badge"),f=(0,s.up)("el-popconfirm"),v=(0,s.up)("el-button-group"),k=(0,s.up)("x-table"),_=(0,s.up)("el-main"),b=(0,s.up)("el-container"),x=(0,s.up)("save-dialog"),D=(0,s.Q2)("auths");return(0,s.wg)(),(0,s.iD)(s.HY,null,[(0,s.Wm)(_,null,{default:(0,s.w5)((()=>[(0,s.Wm)(c,{shadow:"never"},{default:(0,s.w5)((()=>[(0,s.Wm)(d,{data:n.data,"selected-values":n.selectedValues,"label-width":80,onOnChange:u.change},null,8,["data","selected-values","onOnChange"])])),_:1}),(0,s.Wm)(c,{class:"userlose",shadow:"never",style:{"margin-top":"10px"}},{default:(0,s.w5)((()=>[(0,s.Wm)(b,null,{default:(0,s.w5)((()=>[(0,s.wy)(((0,s.wg)(),(0,s.j4)(h,null,{default:(0,s.w5)((()=>[(0,s._)("div",a,[(0,s.Wm)(p,{type:"primary",icon:"el-icon-plus",onClick:u.add},null,8,["onClick"])])])),_:1})),[[D,["user.group"]]]),(0,s.Wm)(_,{class:"nopadding"},{default:(0,s.w5)((()=>[(0,s.Wm)(k,{api:n.api,hideDo:!0,size:"large",stripe:"",ref:"table",params:n.filterData,hidePagination:!0},{default:(0,s.w5)((()=>[(0,s.Wm)(y,{prop:"id",fixed:"",sortable:"",label:"GroupID",align:"center",width:"120"}),(0,s.Wm)(y,{prop:"title",label:"名称",width:"180"}),(0,s.Wm)(y,{prop:"alias",label:"别名",width:"180"}),(0,s.Wm)(y,{prop:"alias",label:"用户数量",width:"180"}),(0,s.Wm)(y,{prop:"status",label:"状态",width:"90"},{default:(0,s.w5)((e=>[1==e.row.status?((0,s.wg)(),(0,s.j4)(g,{key:0,pulse:"",type:"success",label:"开启"})):(0,s.kq)("",!0),0==e.row.status?((0,s.wg)(),(0,s.j4)(g,{key:1,pulse:"",type:"info",label:"关闭"})):(0,s.kq)("",!0)])),_:1}),"member"==n.filterData.type?((0,s.wg)(),(0,s.j4)(y,{key:0,prop:"anicount",label:"积分",width:"100"})):(0,s.kq)("",!0),"member"==n.filterData.type?((0,s.wg)(),(0,s.j4)(y,{key:1,prop:"anicount",label:"主图",width:"100"},{default:(0,s.w5)((e=>[(0,s.Wm)(m,{"preview-src-list":[e.row.image.url],"preview-teleported":!0,"hide-on-click-modal":"true",lazy:"true",style:{width:"30px",height:"30px"},fit:"cover",src:e.row.image.url},{error:(0,s.w5)((()=>[i])),_:2},1032,["preview-src-list","src"])])),_:1})):(0,s.kq)("",!0),"system"==n.filterData.type?((0,s.wg)(),(0,s.j4)(y,{key:2,prop:"aid",label:"控制台模块",width:"120"},{default:(0,s.w5)((e=>[(0,s.Wm)(w,{value:e.row.authority.grid?e.row.authority.grid.length:0,type:"warning"},null,8,["value"])])),_:1})):(0,s.kq)("",!0),"system"==n.filterData.type?((0,s.wg)(),(0,s.j4)(y,{key:3,prop:"aid",label:"菜单",width:"80"},{default:(0,s.w5)((e=>[(0,s.Wm)(w,{value:e.row.authority.menu?e.row.authority.menu.length:0,type:"primary"},null,8,["value"])])),_:1})):(0,s.kq)("",!0),(0,s.Wm)(y,{prop:"message",label:"备注"},{default:(0,s.w5)((e=>[(0,s._)("input",{class:"el-input__inner",type:"text",readonly:"",value:e.row.message},null,8,r)])),_:1}),(0,s.Wm)(y,{label:"操作",fixed:"right",align:"right",width:"200"},{default:(0,s.w5)((e=>[(0,s.Wm)(v,null,{default:(0,s.w5)((()=>[(0,s.Wm)(p,{text:"",type:"primary",size:"small",onClick:t=>u.group_show(e.row,e.$index)},{default:(0,s.w5)((()=>[(0,s.Uk)("查看")])),_:2},1032,["onClick"]),(0,s.wy)(((0,s.wg)(),(0,s.j4)(p,{text:"",type:"primary",size:"small",onClick:t=>u.group_edit(e.row,e.$index)},{default:(0,s.w5)((()=>[(0,s.Uk)("编辑")])),_:2},1032,["onClick"])),[[D,["user.group"]]]),(0,s.Wm)(f,{title:"确定删除吗?",onConfirm:t=>u.group_del(e.row,e.$index)},{reference:(0,s.w5)((()=>[(0,s.wy)(((0,s.wg)(),(0,s.j4)(p,{text:"",type:"primary",size:"small"},{default:(0,s.w5)((()=>[(0,s.Uk)("删除")])),_:1})),[[D,["user.group"]]])])),_:2},1032,["onConfirm"])])),_:2},1024)])),_:1})])),_:1},8,["api","params"])])),_:1})])),_:1})])),_:1})])),_:1}),n.dialog.save?((0,s.wg)(),(0,s.j4)(x,{key:0,ref:"saveDialog",onSuccess:u.handleSaveSuccess,onClosed:t[0]||(t[0]=e=>n.dialog.save=!1)},null,8,["onSuccess"])):(0,s.kq)("",!0)],64)}var n=l(3577);const u={class:"x-select-filter"},d={key:0,class:"x-select-filter__no-data"},c={class:"x-select-filter__item-options"},p=["onClick"];function h(e,t,l,a,i,r){const o=(0,s.up)("el-icon");return(0,s.wg)(),(0,s.iD)("div",u,[l.data.length<=0?((0,s.wg)(),(0,s.iD)("div",d," 暂无数据 ")):(0,s.kq)("",!0),((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(l.data,(e=>((0,s.wg)(),(0,s.iD)("div",{key:e.key,class:"x-select-filter__item"},[(0,s._)("div",{class:"x-select-filter__item-title",style:(0,n.j5)({width:l.labelWidth+"px"})},[(0,s._)("label",null,(0,n.zw)(e.title)+":",1)],4),(0,s._)("div",c,[(0,s._)("ul",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.options,(t=>((0,s.wg)(),(0,s.iD)("li",{class:(0,n.C_)({active:i.selected[e.key]&&i.selected[e.key].includes(t.value)}),key:t.value,onClick:l=>r.select(t,e)},[t.icon?((0,s.wg)(),(0,s.j4)(o,{key:0},{default:(0,s.w5)((()=>[((0,s.wg)(),(0,s.j4)((0,s.LL)(t.icon)))])),_:2},1024)):(0,s.kq)("",!0),(0,s._)("span",null,(0,n.zw)(t.label),1)],10,p)))),128))])])])))),128))])}l(7658);var y={props:{data:{type:Array,default:()=>[]},selectedValues:{type:Object,default:()=>({})},labelWidth:{type:Number,default:80},outputValueTypeToArray:{type:Boolean,default:!1}},data(){return{selected:{}}},watch:{data(e){e.forEach((e=>{this.selected[e.key]=this.selectedValues[e.key]||Array.isArray(e.options)&&e.options.length?[e.options[0].value]:[]}))}},computed:{selectedString(){var e=JSON.parse(JSON.stringify(this.selected));for(var t in e)e[t]=e[t].join(",");return e}},mounted(){this.data.forEach((e=>{this.selected[e.key]=this.selectedValues[e.key]||Array.isArray(e.options)&&e.options.length?[e.options[0].value]:[]}))},methods:{select(e,t){if(t.multiple)e.value===t.options[0].value?this.selected[t.key]=[e.value]:this.selected[t.key].includes(e.value)?(this.selected[t.key].splice(this.selected[t.key].findIndex((t=>t===e.value)),1),0==this.selected[t.key].length&&(this.selected[t.key]=[t.options[0].value])):(this.selected[t.key].push(e.value),this.selected[t.key].includes(t.options[0].value)&&this.selected[t.key].splice(this.selected[t.key].findIndex((e=>e===t.options[0].value)),1));else{if(this.selected[t.key].includes(e.value))return!1;this.selected[t.key]=[e.value]}this.change()},change(){this.outputValueTypeToArray?this.$emit("onChange",this.selected):this.$emit("onChange",this.selectedString)}}},g=l(3744);const m=(0,g.Z)(y,[["render",h],["__scopeId","data-v-087a57ae"]]);var w=m,f=l(9297),v={name:"selectFilter",components:{xSelectFilter:w,saveDialog:f["default"]},data(){return{data:[{title:"用户组",key:"type",options:[{label:"系统管理组",value:"system",icon:"el-icon-flag"},{label:"用户等级套餐组",value:"member",icon:"el-icon-bottom-left"},{label:"自定义会员组",value:"default",icon:"el-icon-circle-close"}]}],selectedValues:{type:["system"]},filterData:{type:"system"},search:{},dialog:{save:!1,permission:!1},api:"user/group/lists"}},computed:{filteredItems(){return this.items.filter((e=>"Category A"===e.category))}},mounted(){},methods:{handleSaveSuccess(){this.$refs.table.refresh()},add(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open().setData({type:this.filterData.type})}))},group_edit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").setData(e)}))},group_show(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("show").setData(e)}))},permission(){this.dialog.permission=!0,this.$nextTick((()=>{this.$refs.permissionDialog.open()}))},async group_del(e){var t={id:e.id},l=await this.$http.post("user/group/delete",t);if(200==l.code)return this.$refs.table.refresh(),this.$message.success("删除成功"),!1;this.$alert(l.message,"提示",{type:"error"})},change(e){this.filterData=e,this.$refs.table.reload(this.filterData)},changeSwitch(e,t){t.status="1"==t.status?"0":"1",t.$switch_status=!0,setTimeout((()=>{delete t.$switch_status,t.status=e,this.$message.success("操作成功")}),500)}}};const k=(0,g.Z)(v,[["render",o]]);var _=k}}]);