chunk-1acc34dc.7c0957bb.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1acc34dc"],{"23ba":function(t,e,o){"use strict";o.d(e,"e",(function(){return a})),o.d(e,"a",(function(){return r})),o.d(e,"b",(function(){return i})),o.d(e,"c",(function(){return s})),o.d(e,"d",(function(){return l})),o.d(e,"f",(function(){return c}));var n=o("b775");function a(t,e,o,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return Object(n["a"])({url:"/api/v1/group/",method:"GET",params:{id:t,name:e,code:o,user_id:a,manager_id:r}})}function r(t){return Object(n["a"])({url:"/api/v1/group/",method:"POST",data:t})}function i(t){return Object(n["a"])({url:"/api/v1/group/".concat(t),method:"DELETE"})}function s(t,e){return Object(n["a"])({url:"/api/v1/group/".concat(t,"/edit"),method:"POST",data:e})}function l(t,e){return Object(n["a"])({url:"/api/v1/users/".concat(t,"/join"),method:"POST",data:e})}function c(t,e){return Object(n["a"])({url:"/api/v1/users/".concat(t,"/quit"),method:"POST",data:e})}},8229:function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("CCard",[o("CCardHeader",[t._t("header",(function(){return[o("CIcon",{attrs:{name:"cil-grid"}}),t._v(" "+t._s(t.caption)+" ")]}))],2),o("CCardBody",[o("CDataTable",{attrs:{hover:t.hover,striped:t.striped,border:t.border,small:t.small,fixed:t.fixed,items:t.items,fields:t.fields,"items-per-page":t.small?10:5,dark:t.dark,pagination:""},scopedSlots:t._u([{key:"status",fn:function(e){var n=e.item;return[o("td",[o("CBadge",{attrs:{color:t.getBadge(n.status)}},[t._v(t._s(n.status))])],1)]}}])})],1)],1)},a=[],r={name:"Table",props:{items:Array,fields:{type:Array,default:function(){return["username","registered","role","status"]}},caption:{type:String,default:"Table"},hover:Boolean,striped:Boolean,border:Boolean,small:Boolean,fixed:Boolean,dark:Boolean},methods:{getBadge:function(t){return"Active"===t?"success":"Inactive"===t?"secondary":"Pending"===t?"warning":"Banned"===t?"danger":"primary"}}},i=r,s=o("2877"),l=Object(s["a"])(i,n,a,!1,null,null,null);e["a"]=l.exports},b344:function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("CCard",[o("CCardHeader",[t._v("班级")]),o("CCardBody",[t.checkPerm("CREATE")?o("CButton",{staticStyle:{width:"100px"},attrs:{color:"primary"},on:{click:function(e){t.darkModal=!0}}},[t._v("+新建")]):t._e(),o("CButton",{staticStyle:{width:"100px","margin-left":"10px"},attrs:{color:"primary"},on:{click:function(e){t.joinModal=!0}}},[t._v("加入班级")])],1)],1),o("CModal",{attrs:{show:t.darkModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.darkModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[o("h6",{staticClass:"modal-title"},[t._v("新建班级")]),o("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.darkModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[o("CButton",{attrs:{color:"danger"},on:{click:function(e){t.darkModal=!1}}},[t._v("取消")]),o("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.createnewClass}},[t._v("新建")])]},proxy:!0}])},[o("CInput",{attrs:{label:"名称",placeholder:"请输入班级名称"},model:{value:t.newClass.name,callback:function(e){t.$set(t.newClass,"name",e)},expression:"newClass.name"}})],1),o("CCard",[o("CCardBody",[o("p",[t._v("我加入的班级")]),o("CDataTable",{attrs:{items:t.groupList,fields:t.fields,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"未加入任何班级"},cleaner:"","items-per-page":10,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"opt_details",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("CHECK")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"success",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.gotoClass(n,a)}}},[t._v(" 查看 ")])],1):t._e()]}},{key:"opt_quit",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("CHECK")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.quitClassFirstStep(n,a)}}},[t._v(" 退出 ")])],1):t._e()]}},{key:"opt_edit",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("EDIT")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.editClass(n,a)}}},[t._v(" 编辑 ")])],1):t._e()]}},{key:"opt_delete",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("DELETE")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.deleteFirstStep(n,a)}}},[t._v(" 删除 ")])],1):t._e()]}}])})],1)],1),t.checkPerm("CREATE")?o("CCard",[o("CCardBody",[o("p",[t._v("我管理的班级")]),o("CDataTable",{attrs:{items:t.groupListAdmin,fields:t.fields,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"未创建任何班级"},cleaner:"","items-per-page":10,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"opt_details",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("CHECK")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"success",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.gotoClass(n,a)}}},[t._v(" 查看 ")])],1):t._e()]}},{key:"opt_quit",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("CHECK")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.quitClassFirstStep(n,a)}}},[t._v(" 退出 ")])],1):t._e()]}},{key:"opt_edit",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("EDIT")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.editClass(n,a)}}},[t._v(" 编辑 ")])],1):t._e()]}},{key:"opt_delete",fn:function(e){var n=e.item,a=e.index;return[t.checkPerm("DELETE")?o("td",{staticClass:"py-2"},[o("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.deleteFirstStep(n,a)}}},[t._v(" 删除 ")])],1):t._e()]}}],null,!1,1835153735)})],1)],1):t._e(),o("CModal",{attrs:{show:t.deleteModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"danger"},on:{"update:show":function(e){t.deleteModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[o("h6",{staticClass:"modal-title"},[t._v("删除班级")]),o("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.deleteModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[o("CButton",{attrs:{color:"danger"},on:{click:function(e){t.deleteModal=!1}}},[t._v("取消")]),o("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:function(e){return t.deleteTarget()}}},[t._v("删除")])]},proxy:!0}])},[o("h5",[t._v("你确定删除该班级吗?")])]),o("CModal",{attrs:{show:t.editModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.editModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[o("h6",{staticClass:"modal-title"},[t._v("编辑班级名称")]),o("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.editModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[o("CButton",{attrs:{color:"danger"},on:{click:function(e){t.editModal=!1}}},[t._v("取消")]),o("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.editTarget}},[t._v("保存")])]},proxy:!0}])},[o("CInput",{attrs:{label:"名称",placeholder:"请输入班级名称"},model:{value:t.newClass.name,callback:function(e){t.$set(t.newClass,"name",e)},expression:"newClass.name"}})],1),o("CModal",{attrs:{show:t.joinModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.joinModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[o("h6",{staticClass:"modal-title"},[t._v("加入班级")]),o("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.joinModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[o("CButton",{attrs:{color:"danger"},on:{click:function(e){t.joinModal=!1}}},[t._v("取消")]),o("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.joinTarget}},[t._v("确定")])]},proxy:!0}])},[o("p",[t._v("请输入班级代码")]),o("el-input",{staticStyle:{width:"30%"},attrs:{placeholder:"班级代码"},model:{value:t.classCode,callback:function(e){t.classCode=e},expression:"classCode"}})],1),o("CModal",{attrs:{show:t.quitModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.quitModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[o("h6",{staticClass:"modal-title"},[t._v("退出班级")]),o("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.quitModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[o("CButton",{attrs:{color:"danger"},on:{click:function(e){t.quitModal=!1}}},[t._v("取消")]),o("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.quitTarget}},[t._v("确定")])]},proxy:!0}])},[o("h4",[t._v("你确定退出该班级吗?")])])],1)},a=[],r=o("8229"),i=o("23ba"),s=o("e350"),l={name:"Class",components:{CTableWrapper:r["a"]},data:function(){return{groupList:[],fields:[{key:"name",label:"名称",_style:"min-width:200px;"},{key:"code",label:"编号",_style:"min-width:200px;"},{key:"opt_details",label:"",_style:"min-width:10px;"},{key:"opt_quit",label:"",_style:"min-width:10px;"},{key:"opt_edit",label:"",_style:"min-width:10px;"},{key:"opt_delete",label:"",_style:"min-width:10px;"}],darkModal:!1,fileList:[],deleteModal:!1,editModal:!1,joinModal:!1,quitModal:!1,selectedItem:{},newClass:{},groupListAdmin:[],classCode:""}},computed:{},mounted:function(){this.getGroupList()},watch:{},methods:{deleteTarget:function(){var t=this;Object(i["b"])(this.selectedItem.id).then((function(e){t.deleteModal=!1,t.getGroupList()}))},clickRow:function(t,e,o,n){this.$router.push("/softwareInside/"+t.id)},getGroupList:function(){var t=this;Object(i["e"])("","","",localStorage.getItem("userId"),"").then((function(e){t.groupList=e,console.log(t.groupList)})),2!=localStorage.getItem("identity")&&Object(i["e"])("","","","",localStorage.getItem("userId")).then((function(e){t.groupListAdmin=e,console.log(t.groupListAdmin)}))},deleteFirstStep:function(t,e){this.deleteModal=!0,this.selectedItem=t},createnewClass:function(){var t=this,e=new FormData;e.append("name",this.newClass.name),e.append("manager_id",localStorage.getItem("userId")),Object(i["a"])(e).then((function(e){t.$message.success("新建成功"),t.darkModal=!1,t.getGroupList()}))},checkPerm:function(t){return Object(s["a"])(localStorage.getItem("identity"),t)},editClass:function(t){this.editModal=!0,this.selectedItem=t},editTarget:function(){var t=this,e=new FormData;e.append("group_name",this.newClass.name),Object(i["c"])(this.selectedItem.id,e).then((function(e){t.editModal=!1,t.getGroupList()}))},joinClassFirstStep:function(t){this.joinModal=!0,this.selectedItem=t},quitClassFirstStep:function(t){this.quitModal=!0,this.selectedItem=t},joinTarget:function(){var t=this,e=new FormData;e.append("code",this.classCode),Object(i["d"])(localStorage.getItem("userId"),e).then((function(e){t.joinModal=!1,t.getGroupList(),"加入成功"==e&&t.$message.success("加入班级成功")}))},quitTarget:function(){var t=this,e=new FormData;e.append("code",this.selectedItem.code),Object(i["f"])(localStorage.getItem("userId"),e).then((function(e){t.quitModal=!1,t.getGroupList(),"退出成功"==e&&t.$message.success("退出成功")}))},gotoClass:function(t,e){this.$router.push({path:"/class/"+t.id,params:{item:t}})}}},c=l,d=o("2877"),u=Object(d["a"])(c,n,a,!1,null,"9e0248ca",null);e["default"]=u.exports},b775:function(t,e,o){"use strict";var n=o("bc3a"),a=o.n(n),r=o("5c96");o("c0d6");a.a.defaults.withCredentials=!0;var i=a.a.create({withCredentials:!0,timeout:1e5});i.interceptors.response.use((function(t){var e=t.data;return e}),(function(t){return console.log("err"+t),t.response.data.length>1e3?Object(r["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(r["Message"])({message:t.response.data,type:"error",duration:2e4}),Promise.reject(t)})),i.interceptors.request.use((function(t){var e=window.localStorage.getItem("accessToken");return e?(t.headers.accessToken=e,t):t})),e["a"]=i},e350:function(t,e,o){"use strict";function n(t,e){var o=a[t];return o.includes(e)}o.d(e,"a",(function(){return n}));var a=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]}}]);