chunk-93e80a26.27f17c48.js 13 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-93e80a26"],{"07ff":function(e,t,r){"use strict";r("8ab0")},"2c61":function(e,t,r){"use strict";r.r(t),r.d(t,"getList",(function(){return n})),r.d(t,"doEdit",(function(){return s})),r.d(t,"doAdd",(function(){return o})),r.d(t,"doDelete",(function(){return i})),r.d(t,"depTree",(function(){return l})),r.d(t,"roleList",(function(){return u}));var a=r("b775");function n(e){return Object(a["default"])({url:"/base/admin",method:"get",params:e})}function s(e){return Object(a["default"])({url:"/base/admin/"+e.id,method:"put",data:e})}function o(e){return Object(a["default"])({url:"/base/admin",method:"post",data:e})}function i(e){return Object(a["default"])({url:"/base/admin/"+e,method:"delete"})}function l(e){return Object(a["default"])({url:"/base/department-tree",method:"get",params:e})}function u(e){return Object(a["default"])({url:"/base/role-lists",method:"get",params:e})}},"3cdb":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"800px"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close},scopedSlots:e._u([{key:"footer",fn:function(){return[r("el-button",{on:{click:e.close}},[e._v("取 消")]),"编辑"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(" 确 定 ")]):e._e(),"添加"==e.title?r("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v(" 添 加 ")]):e._e()]},proxy:!0}])},[e.dialogFormVisible?r("el-form",{ref:"form",attrs:{"label-width":"100px",model:e.form,rules:e.rules}},[r("el-form-item",{attrs:{label:"账户",prop:"username"}},[r("el-input",{attrs:{disabled:"添加"!=e.title},model:{value:e.form.username,callback:function(t){e.$set(e.form,"username",t)},expression:"form.username"}})],1),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{attrs:{"show-password":""},model:{value:e.form.password,callback:function(t){e.$set(e.form,"password",t)},expression:"form.password"}})],1),r("el-form-item",{attrs:{label:"确认密码",prop:"password_confirmation"}},[r("el-input",{attrs:{"show-password":""},model:{value:e.form.password_confirmation,callback:function(t){e.$set(e.form,"password_confirmation",t)},expression:"form.password_confirmation"}})],1),r("el-form-item",{attrs:{label:"姓名",prop:"name"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"头像",prop:"headimg"}},[r("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture",multiple:"","on-success":e.uploadSuccess}},[r("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s("添加"==e.title?"上传照片":"重新上传")+" ")]),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb ")])],1)],1),r("el-form-item",{attrs:{label:"角色",prop:"role_id"}},[r("el-select",{attrs:{placeholder:"请选择角色"},on:{change:e.changeRole},model:{value:e.form.role_name,callback:function(t){e.$set(e.form,"role_name",t)},expression:"form.role_name"}},e._l(e.roleData,(function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),r("el-form-item",{staticClass:"vab-quill-content",attrs:{label:"管理员介绍",required:""}},[r("tiny-mce",{attrs:{content:e.form.remark,"tiny-height":300},on:{childByValue:e.getTnyMac}})],1),r("el-form-item",{attrs:{label:"状态",prop:"status"}},[r("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[r("el-radio",{attrs:{label:1}},[e._v("正常")]),r("el-radio",{attrs:{label:0}},[e._v("暂停")])],1)],1)],1):e._e()],1)},n=[],s=r("1da1"),o=(r("96cf"),r("b0c0"),r("99af"),r("2c61")),i=r("f121"),l={name:"DepartmentManagementEdit",data:function(){return{action:"",uploadData:{file_type:"img",type:"course"},limit:1,form:{parent_id:0,status:1,parent_name:""},defaultProps:{children:"children",label:"name"},roleData:[{id:0,name:"无"}],treeData:[{id:0,name:"无"}],lazy:!1,rules:{},title:"",dialogFormVisible:!1}},created:function(){this.action=i["baseURL"]+"/base/common/upload",console.log(this.action,"action"),this.fileList=[]},methods:{getTnyMac:function(e){this.form.remark=e},showEdit:function(e){this.roleList(),this.form={status:1},e?(this.title="编辑",this.rules={username:[{required:!0,trigger:"blur",message:"请输入账号"}],name:[{required:!0,trigger:"blur",message:"请输入姓名"}],department_id:[{required:!0,trigger:"blur",message:"请选择部门"}],role_id:[{required:!0,trigger:"blur",message:"请选择角色"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}]},this.form=Object.assign({},e)):(this.title="添加",this.rules={username:[{required:!0,trigger:"blur",message:"请输入账号"}],password:[{required:!0,trigger:"blur",message:"请输入密码"}],password_confirmation:[{required:!0,trigger:"blur",message:"请再次输入密码"}],name:[{required:!0,trigger:"blur",message:"请输入姓名"}],department_id:[{required:!0,trigger:"blur",message:"请选择部门"}],role_id:[{required:!0,trigger:"blur",message:"请选择角色"}],status:[{required:!0,trigger:"blur",message:"请选择状态"}]}),this.dialogFormVisible=!0},uploadSuccess:function(e){console.log(e,"图片上传成功"),this.form.headimg=e.data.url},clearFile:function(){console.log("上传之前"),this.imageUrl=""},close:function(){this.$refs["form"].resetFields(),this.form.remark="",this.dialogFormVisible=!1,this.fileList=[]},changeRole:function(e){this.form.role_id=e,console.log(e,"----------------")},handleNodeClick:function(e){console.log(e,"选择节点"),this.$refs.selectblur.blur(),this.form.department_name=e.name,this.form.department_id=e.id,this.$forceUpdate(),console.log(this.form,"form")},save:function(){var e=this;console.log(this.form.remark,"remark"),this.$refs["form"].validate(function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=16;break}if(e.form.password_confirmation===e.form.password){t.next=4;break}return e.$message.warning("两次输入的密码不一致"),t.abrupt("return");case 4:if(e.form.remark){t.next=7;break}return e.$message.warning("请填写管理员介绍"),t.abrupt("return");case 7:return t.next=9,Object(o["doEdit"])(e.form);case 9:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.fileList=[],e.$refs["form"].resetFields(),e.close();case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},roleList:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r={status:1},t.next=3,Object(o["roleList"])(r);case 3:a=t.sent,n=a.data,e.roleData=[{id:0,name:"无"}].concat(n),console.log(n,"角色列表");case 7:case"end":return t.stop()}}),t)})))()},add:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(r){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=16;break}if(e.form.password_confirmation===e.form.password){t.next=4;break}return e.$message.warning("两次输入的密码不一致"),t.abrupt("return");case 4:if(e.form.remark){t.next=7;break}return e.$message.warning("请填写管理员介绍"),t.abrupt("return");case 7:return t.next=9,Object(o["doAdd"])(e.form);case 9:a=t.sent,n=a.message,e.$baseMessage(n,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.fileList=[],e.$refs["form"].resetFields(),e.close();case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},u=l,c=(r("552a"),r("2877")),m=Object(c["a"])(u,a,n,!1,null,null,null);t["default"]=m.exports},"552a":function(e,t,r){"use strict";r("ae8b")},5713:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"role-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:5}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")])],1),a("vab-query-form-right-panel",{attrs:{span:19}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{staticStyle:{width:"160px","margin-right":"5px"},attrs:{clearable:"",placeholder:"请输入姓名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name","string"===typeof t?t.trim():t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list},on:{"selection-change":e.setSelectRows},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:r("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{align:"center",label:"序号",sortable:"",type:"index",width:"60"}}),a("el-table-column",{attrs:{align:"center",label:"头像"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-image",{attrs:{"preview-src-list":e.imageList,src:r.headimg}})]}}])}),a("el-table-column",{attrs:{align:"center",label:"账户",prop:"username","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"姓名",prop:"name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"角色",prop:"role_name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"状态",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[1==r.status?a("el-tag",[e._v("正常")]):e._e(),0==r.status?a("el-tag",{attrs:{type:"danger"}},[e._v("暂停")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"操作","show-overflow-tooltip":"",width:"170"},scopedSlots:e._u([{key:"default",fn:function(t){var r=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.queryForm.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}}),a("edit",{ref:"edit",on:{"fetch-data":e.fetchData}})],1)},n=[],s=r("1da1"),o=r("5530"),i=(r("4de4"),r("d3b7"),r("96cf"),r("2c61")),l=r("3cdb"),u=r("2f62"),c={name:"RoleManagement",components:{Edit:l["default"]},data:function(){return{action:"",uploadData:{file_type:"file",type:"import_teacher"},list:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",selectRows:"",queryForm:{page:1,per_page:15},imageList:[],t_status:[{id:0,name:"暂停"},{id:1,name:"正常"}],detail_visable:!1,d_list:{},editForm:"",editStatus:0,authForm:{id:"",menuIds:[]}}},computed:Object(o["a"])({},Object(u["c"])({token:"user/token",language:"settings/language"})),created:function(){this.fetchData()},methods:{setSelectRows:function(e){this.selectRows=e},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDetail:function(e){this.detail_visable=!0,this.d_list=e,console.log(e,"详情")},handleDelete:function(e){var t=this;this.$baseConfirm("你确定要删除当前项吗",null,Object(s["a"])(regeneratorRuntime.mark((function r(){var a,n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(i["doDelete"])(e.id);case 2:return a=r.sent,n=a.message,t.$baseMessage(n,"success",!1,"vab-hey-message-success"),r.next=7,t.fetchData();case 7:case"end":return r.stop()}}),r)}))))},handleSizeChange:function(e){this.queryForm.per_page=e,this.fetchData()},handleCurrentChange:function(e){this.queryForm.page=e,this.fetchData()},queryData:function(){this.queryForm.page=1,this.fetchData()},fetchData:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var r,a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(i["getList"])(e.queryForm);case 3:r=t.sent,a=r.data,console.log(a,"学期列表"),e.list=a.list.filter((function(e){return 1!=e.id})),n=a.meta,e.queryForm.total=n.pagination.total,e.listLoading=!1;case 10:case"end":return t.stop()}}),t)})))()}}},m=c,d=(r("07ff"),r("2877")),f=Object(d["a"])(m,a,n,!1,null,"b3c7b502",null);t["default"]=f.exports},"8ab0":function(e,t,r){},ae8b:function(e,t,r){},f1f0:function(e,t,r){e.exports=r.p+"static/img/data_empty.475a2a1e.png"}}]);