"use strict";(self["webpackChunkx_php_admin"]=self["webpackChunkx_php_admin"]||[]).push([[826],{2826:function(e,l,a){a.r(l),a.d(l,{default:function(){return f}});var i=a(6252);const t={class:"left-panel"},s={class:"right-panel"},o={class:"right-panel-search"},n=["onClick"],d={class:"input-mask"},r=["value"];function c(e,l,a,c,u,p){const m=(0,i.up)("el-input"),h=(0,i.up)("el-header"),w=(0,i.up)("x-menu-item"),f=(0,i.up)("el-main"),g=(0,i.up)("el-container"),k=(0,i.up)("el-aside"),b=(0,i.up)("el-button"),y=(0,i.up)("el-table-column"),v=(0,i.up)("el-avatar"),C=(0,i.up)("el-popconfirm"),_=(0,i.up)("el-button-group"),W=(0,i.up)("xTable"),x=(0,i.up)("save-dialog"),$=(0,i.up)("x-user"),D=(0,i.up)("el-drawer"),T=(0,i.Q2)("loading");return(0,i.wg)(),(0,i.iD)(i.HY,null,[(0,i.Wm)(g,null,{default:(0,i.w5)((()=>[(0,i.wy)(((0,i.wg)(),(0,i.j4)(k,{width:"180px",class:"hidden-sm-and-down"},{default:(0,i.w5)((()=>[(0,i.Wm)(g,null,{default:(0,i.w5)((()=>[(0,i.Wm)(h,null,{default:(0,i.w5)((()=>[(0,i.Wm)(m,{placeholder:"输入关键字进行过滤",modelValue:u.groupFilterText,"onUpdate:modelValue":l[0]||(l[0]=e=>u.groupFilterText=e),clearable:""},null,8,["modelValue"])])),_:1}),(0,i.Wm)(f,{class:"nopadding"},{default:(0,i.w5)((()=>[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(u.leftSides,((l,a)=>((0,i.wg)(),(0,i.j4)(w,{key:a,label:l.name,num:l.num,"icon-class":l.iconClass,"icon-color":l.color,select:e.leftType==l.infoType,onClick:a=>e.sideClick(l)},null,8,["label","num","icon-class","icon-color","select","onClick"])))),128))])),_:1})])),_:1})])),_:1})),[[T,u.showGrouploading]]),(0,i.Wm)(g,null,{default:(0,i.w5)((()=>[(0,i.Wm)(h,null,{default:(0,i.w5)((()=>[(0,i._)("div",t,[(0,i.Wm)(b,{type:"primary",icon:"el-icon-plus",onClick:p.add},null,8,["onClick"]),(0,i.Wm)(b,{type:"danger",plain:"",icon:"el-icon-delete",disabled:0==u.selection.length,onClick:p.batch_del},null,8,["disabled","onClick"]),(0,i.Wm)(b,{type:"primary",plain:"",disabled:0==u.selection.length},{default:(0,i.w5)((()=>[(0,i.Uk)("分配角色")])),_:1},8,["disabled"]),(0,i.Wm)(b,{type:"primary",plain:"",disabled:0==u.selection.length},{default:(0,i.w5)((()=>[(0,i.Uk)("密码重置")])),_:1},8,["disabled"])]),(0,i._)("div",s,[(0,i._)("div",o,[(0,i.Wm)(m,{modelValue:u.search.name,"onUpdate:modelValue":l[1]||(l[1]=e=>u.search.name=e),placeholder:"登录账号 / 姓名",clearable:""},null,8,["modelValue"]),(0,i.Wm)(b,{type:"primary",icon:"el-icon-search",onClick:p.upsearch},null,8,["onClick"])])])])),_:1}),(0,i.Wm)(f,{class:"nopadding"},{default:(0,i.w5)((()=>[(0,i.Wm)(W,{ref:"table",onSelectionChange:p.selectionChange,api:u.userlistApi,stripe:"",remoteSort:"",remoteFilter:""},{default:(0,i.w5)((()=>[(0,i.Wm)(y,{type:"selection",width:"50"}),(0,i.Wm)(y,{label:"UID",prop:"uid",width:"80",sortable:"custom"}),(0,i.Wm)(y,{label:"头像",width:"200","column-key":"filterAvatar",filters:[{text:"已上传",value:"1"},{text:"未上传",value:"0"}]},{default:(0,i.w5)((e=>[(0,i._)("div",{class:"xavatar",onClick:l=>p.getUser(e.row)},[(0,i.Wm)(v,{src:e.row.avatar,size:"small"},{default:(0,i.w5)((()=>[(0,i.Uk)("空")])),_:2},1032,["src"]),(0,i._)("label",d,[(0,i._)("input",{class:"el-input__inner",type:"text",readonly:"",value:e.row.nickname||e.row.username},null,8,r)])],8,n)])),_:1}),(0,i.Wm)(y,{label:"所属角色",prop:"groupName",width:"200",sortable:"custom"}),(0,i.Wm)(y,{label:"加入时间",prop:"date",width:"170",sortable:"regdate"}),(0,i.Wm)(y,{label:"操作",fixed:"right",align:"right",width:"160"},{default:(0,i.w5)((e=>[(0,i.Wm)(_,null,{default:(0,i.w5)((()=>[(0,i.Wm)(b,{text:"",type:"primary",size:"small",onClick:l=>p.table_show(e.row,e.$index)},{default:(0,i.w5)((()=>[(0,i.Uk)("查看")])),_:2},1032,["onClick"]),(0,i.Wm)(b,{text:"",type:"primary",size:"small",onClick:l=>p.table_edit(e.row,e.$index)},{default:(0,i.w5)((()=>[(0,i.Uk)("编辑")])),_:2},1032,["onClick"]),(0,i.Wm)(C,{title:"确定删除吗?",onConfirm:l=>p.table_del(e.row,e.$index)},{reference:(0,i.w5)((()=>[(0,i.Wm)(b,{text:"",type:"primary",size:"small"},{default:(0,i.w5)((()=>[(0,i.Uk)("删除")])),_:1})])),_:2},1032,["onConfirm"])])),_:2},1024)])),_:1})])),_:1},8,["onSelectionChange","api"])])),_:1})])),_:1})])),_:1}),u.dialog.save?((0,i.wg)(),(0,i.j4)(x,{key:0,ref:"saveDialog",onSuccess:p.handleSuccess,onClosed:l[2]||(l[2]=e=>u.dialog.save=!1)},null,8,["onSuccess"])):(0,i.kq)("",!0),u.visible?((0,i.wg)(),(0,i.j4)(D,{key:1,"with-header":!1,"append-to-body":"true",modelValue:u.visible,"onUpdate:modelValue":l[5]||(l[5]=e=>u.visible=e),size:1e3,"show-close":!1,style:{overflow:"initial"},"destroy-on-close":"",onClosed:l[6]||(l[6]=l=>{u.visible=!1,e.$emit("closed")})},{default:(0,i.w5)((()=>[(0,i.Wm)(b,{type:"danger",onClick:l[3]||(l[3]=e=>u.visible=!1),class:"userdrawerclose",icon:"el-icon-close"}),(0,i.Wm)($,{modelValue:u.copiedData,"onUpdate:modelValue":l[4]||(l[4]=e=>u.copiedData=e)},null,8,["modelValue"])])),_:1},8,["modelValue"])):(0,i.kq)("",!0)],64)}var u=a(516),p=a(7926),m={name:"user",components:{xMenuItem:p.Z,saveDialog:u["default"]},data(){return{dialog:{save:!1},showGrouploading:!1,visible:!1,groupFilterText:"",userlistApi:"user/index/lists",group:[],copiedData:{},selection:[],leftSides:[{name:"今日需联系线索",color:"#2362FB",iconClass:"wk wk-leads",infoType:"todayLeads",num:10,hidden:!1},{name:"今日需联系客户",color:"#2362FB",iconClass:"wk wk-customer",infoType:"todayCustomer",num:0,hidden:!1},{name:"今日需联系商机",color:"#2362FB",iconClass:"wk wk-business",infoType:"todayBusiness",num:0,hidden:!1},{name:"分配给我的线索",color:"#704AFD",iconClass:"wk wk-leads",infoType:"followLeads",num:0,hidden:!1},{name:"分配给我的客户",color:"#19B5F6",iconClass:"wk wk-s-seas",infoType:"followCustomer",num:0,hidden:!1},{name:"待进入公海的客户",color:"#26D4DA",iconClass:"wk wk-seas",infoType:"putInPoolRemind",num:0,hidden:!1},{name:"待审核合同",color:"#FD5B4A",iconClass:"wk wk-contract",infoType:"checkContract",num:0,hidden:!1},{name:"待审核回款",color:"#FFB940",iconClass:"wk wk-receivables",infoType:"checkReceivables",num:0,hidden:!1},{name:"待回款提醒",color:"#27BA4A",iconClass:"wk wk-bell",infoType:"remindReceivablesPlan",num:0,hidden:!1},{name:"即将到期的合同",color:"#FF7A38",iconClass:"wk wk-contract",infoType:"endContract",num:0,hidden:!1},{name:"待回访合同",color:"#ff9232",iconClass:"wk wk-house",infoType:"returnVisitRemind",num:0,hidden:!1},{name:"待审核发票",color:"#ff9232",iconClass:"wk wk-invoice",infoType:"checkInvoice",num:0,hidden:!1}],search:{name:null}}},watch:{groupFilterText(e){this.$refs.group.filter(e)}},mounted(){this.getGroup()},methods:{getUser(e){this.visible=!0,this.copiedData=e},add(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open()}))},table_edit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").setData(e)}))},table_show(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("show").setData(e)}))},async table_del(e,l){var a={id:e.id},i=await this.$api.demo.post.post(a);200==i.code?(this.$refs.table.tableData.splice(l,1),this.$message.success("删除成功")):this.$alert(i.message,"提示",{type:"error"})},async batch_del(){this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`,"提示",{type:"warning"}).then((()=>{const e=this.$loading();this.selection.forEach((e=>{this.$refs.table.tableData.forEach(((l,a)=>{e.id===l.id&&this.$refs.table.tableData.splice(a,1)}))})),e.close(),this.$message.success("操作成功")})).catch((()=>{}))},selectionChange(e){this.selection=e},async getGroup(){this.showGrouploading=!0;var e=await this.$http.get("user/index/typeList");this.showGrouploading=!1,this.group=e.data},groupFilterNode(e,l){return!e||-1!==l.label.indexOf(e)},groupClick(e){var l={groupId:e.id};this.$refs.table.reload(l)},upsearch(){this.$refs.table.upData(this.search)},handleSuccess(e,l){"add"==l?(e.id=(new Date).getTime(),this.$refs.table.tableData.unshift(e)):"edit"==l&&this.$refs.table.tableData.filter((l=>l.id===e.id)).forEach((l=>{Object.assign(l,e)}))}}},h=a(3744);const w=(0,h.Z)(m,[["render",c],["__scopeId","data-v-39809aea"]]);var f=w}}]);