"use strict";(self["webpackChunkwx_manage"]=self["webpackChunkwx_manage"]||[]).push([[5385,6396],{56396:function(t,e,a){a.r(e),a.d(e,{default:function(){return c}});var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.dataFormSubmit()}}},[a("p",{staticStyle:{"text-align":"center",margin:"50px 0 20px"}},[t._v("使用 scoped-slot 自定义数据项")]),a("div",{staticStyle:{"text-align":"center"}},[a("el-transfer",{staticStyle:{"text-align":"left",display:"inline-block"},attrs:{filterable:"","left-default-checked":[2,3],"right-default-checked":[1],titles:["Source","Target"],"button-texts":["到左边","到右边"],format:{noChecked:"${total}",hasChecked:"${checked}/${total}"},data:t.data},on:{change:t.handleChange},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.option;return a("span",{},[t._v(t._s(r.key)+" - "+t._s(r.label))])}}]),model:{value:t.value4,callback:function(e){t.value4=e},expression:"value4"}},[a("el-button",{staticClass:"transfer-footer",attrs:{slot:"left-footer",size:"small"},slot:"left-footer"},[t._v("操作")]),a("el-button",{staticClass:"transfer-footer",attrs:{slot:"right-footer",size:"small"},slot:"right-footer"},[t._v("操作")])],1)],1)]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},n=[],i=(a(21703),a(89176)),o=a(62015),s={data:function(){var t=function(t,e,a){(0,i._7)(e)?a():a(new Error("请输入8位身份码(数字)"))},e=function(t,e,a){(0,i.tq)(e)?a():a(new Error("手机号格式不正确"))};return{visible:!1,roleList:[],dataForm:{id:0,dormitory:"",dormitoryNum:"",dormitoryType:0,dormitoryStatus:0},identityes:["管理员","研究生","本校老师","外校老师"],groupIdes:[],dataRule:{userName:[{required:!0,message:"学生名不能为空",trigger:"blur"}],userId:[{required:!0,message:"身份码不能为空",trigger:"blur"},{validator:t,trigger:"blur"}],studentId:[{required:!0,message:"学生学号不能为空",trigger:"blur"}],phone:[{required:!0,message:"手机号不能为空",trigger:"blur"},{validator:e,trigger:"blur"}]}}},methods:{init:function(t){var e=this;o.Z.getGroupList2(this).then((function(t){e.groupIdes=t.data.list})),this.dataForm.id=t||0,this.$http({url:this.$http.adornUrl("/sys/role/select"),method:"get",params:this.$http.adornParams()}).then((function(t){var a=t.data;e.roleList=a&&200===a.code?a.list:[]})).then((function(){e.visible=!0,e.$nextTick((function(){e.$refs["dataForm"].resetFields()}))})).then((function(){e.dataForm.id&&(console.log("this.dataForm.id",e.dataForm.id),e.$http({url:e.$http.adornUrl("/excel/info/".concat(e.dataForm.id)),method:"get",params:e.$http.adornParams()}).then((function(t){var a=t.data;console.log(a),a&&200===a.code&&(e.dataForm.dormitoryType=parseInt(a.user.dormitoryType),e.dataForm.dormitory=a.user.dormitory,e.dataForm.dormitoryNum=a.user.dormitoryNum,e.dataForm.dormitoryStatus=parseInt(a.user.dormitoryStatus))})))}))},dataFormSubmit:function(){}}},l=s,d=a(1001),u=(0,d.Z)(l,r,n,!1,null,null,null),c=u.exports},35385:function(t,e,a){a.r(e),a.d(e,{default:function(){return u}});var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"mod-user"},[a("el-form",{attrs:{inline:!0,model:t.dataForm},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getDataList()}}},[a("el-form-item",[a("a",{attrs:{href:"/static/web/a.xlsx",download:"宿舍信息模板"}},[a("el-button",{staticStyle:{margin:"0 10px"},attrs:{type:"primary"}},[t._v("下载Excel模板")])],1),a("el-upload",{ref:"upload",staticClass:"upload-demo",staticStyle:{float:"right","margin-left":"5px"},attrs:{action:"/excel/upload","on-preview":t.handlePreview,"on-success":t.uploadSuccess,"on-error":t.uploadError,"before-upload":t.beforeUpload,"on-remove":t.handleRemove,"file-list":t.fileList,accept:".xls,.xlsx","auto-upload":!1,limit:1}},[a("el-button",{attrs:{slot:"trigger",type:"primary"},slot:"trigger"},[t._v("选取文件")]),a("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"success"},on:{click:t.submitUpload}},[t._v(" 上传到服务器 ")]),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("只能上传excel文件")])],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:t.dataList,border:""},on:{"selection-change":t.selectionChangeHandle}},[a("el-table-column",{attrs:{type:"selection","header-align":"center",align:"center",width:"50"}}),a("el-table-column",{attrs:{prop:"userId","header-align":"center",align:"center",width:"80",label:"ID"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s((t.pageIndex-1)*t.pageSize+e.$index+1)+" ")]}}])}),a("el-table-column",{attrs:{prop:"name","header-align":"center",width:"100",align:"center",label:"组名"}}),a("el-table-column",{attrs:{fixed:"right","header-align":"center",align:"center",width:"150",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.isAuth("h5:user:update")?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.addOrUpdateHandle(e.row.id)}}},[t._v("修改 ")]):t._e(),t.isAuth("h5:user:delete")?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.deleteHandle(e.row.id)}}},[t._v("删除 ")]):t._e()]}}])})],1),a("el-pagination",{attrs:{"current-page":t.pageIndex,"page-sizes":[5,10,20,50,100],"page-size":t.pageSize,total:t.totalCount,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":t.sizeChangeHandle,"current-change":t.currentChangeHandle}}),t.addOrUpdateVisible?a("add-or-update",{ref:"addOrUpdate",on:{refreshDataList:t.getDataList}}):t._e()],1)},n=[],i=(a(21249),a(92222),a(69600),a(56396)),o=(a(62015),{data:function(){return{dataForm:{userName:""},temp:0,dataList:[],pageIndex:1,pageSize:5,totalCount:0,dataListLoading:!1,dataListSelections:[],addOrUpdateVisible:!1,groupIdes:[],fileList:[],loading:null}},components:{AddOrUpdate:i["default"]},activated:function(){this.getDataList()},computed:{},methods:{filterTag:function(t,e){return e.groupId===t},getgroups:function(t){try{var e=this.groupIdes;return e[t-1].text}catch(a){return"未分组"}},isIdentity:function(t){switch(t){case 1:return"管理员";case 2:return"研究生";case 3:return"本校老师";case 4:return"外校老师"}},getDataList:function(){var t=this;this.dataListLoading=!0,this.$http({url:this.$http.adornUrl("/group/pagelist"),method:"get",params:this.$http.adornParams({page:this.pageIndex,limit:this.pageSize,userId:this.dataForm.userName})}).then((function(e){var a=e.data;a&&200===a.code?(t.dataList=a.page.list,t.totalCount=a.page.totalCount):(t.dataList=[],t.totalCount=0),t.dataListLoading=!1}))},sizeChangeHandle:function(t){this.pageSize=t,this.pageIndex=1,this.getDataList()},currentChangeHandle:function(t){this.pageIndex=t,this.getDataList()},selectionChangeHandle:function(t){this.dataListSelections=t},addOrUpdateHandle:function(t){var e=this;this.addOrUpdateVisible=!0,this.$nextTick((function(){e.$refs.addOrUpdate.init(t)}))},deleteHandle:function(t){var e=this,a=t?[t]:this.dataListSelections.map((function(t){return t.id}));this.$confirm("确定对[userid=".concat(a.join(","),"]进行[").concat(t?"删除":"批量删除","]操作?"),"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$http({url:e.$http.adornUrl("/excel/delete"),method:"post",data:e.$http.adornData(a,!1)}).then((function(t){var a=t.data;a&&200===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){return e.getDataList()}}):e.$message.error(a.msg)}))})).catch((function(){}))},submitUpload:function(){var t=this;0!=this.$refs.upload.uploadFiles.length?(this.$refs.upload.submit(),this.loading=this.$loading({lock:!0,text:"文件上传中请耐心等待。。。",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"})):this.$message({message:"请选择Excel文件",type:"error",duration:1500,onClose:function(){return t.getDataList()}})},handleRemove:function(t,e){console.log(t,e)},handlePreview:function(t){console.log(t)},uploadSuccess:function(){var t=this;this.loading.close(),this.$refs.upload.clearFiles(),this.$message({message:"上传成功",type:"success",duration:1500,onClose:function(){return t.getDataList()}})},uploadError:function(){var t=this;this.$refs.upload.clearFiles(),this.$message({message:"上传失败",type:"error",duration:1500,onClose:function(){return t.getDataList()}})},beforeUpload:function(t){}}}),s=o,l=a(1001),d=(0,l.Z)(s,r,n,!1,null,null,null),u=d.exports},69600:function(t,e,a){var r=a(82109),n=a(1702),i=a(68361),o=a(45656),s=a(9341),l=n([].join),d=i!=Object,u=d||!s("join",",");r({target:"Array",proto:!0,forced:u},{join:function(t){return l(o(this),void 0===t?",":t)}})},21249:function(t,e,a){var r=a(82109),n=a(42092).map,i=a(81194),o=i("map");r({target:"Array",proto:!0,forced:!o},{map:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},62015:function(t,e,a){a(41539),a(54747),a(57658),a(68309);e["Z"]={getGroupList:function(t){t.$http({url:t.$http.adornUrl("/group/list"),method:"get",params:t.$http.adornParams()}).then((function(e){e.data.list.forEach((function(e){t.groupIdes.push({text:e.name,id:e.id,value:e.id})}))}))},getGroupList2:function(t){return t.$http({url:t.$http.adornUrl("/group/list"),method:"get",params:t.$http.adornParams()})}}}}]);