| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[43],{493:function(t,e,n){},618:function(t,e,n){"use strict";n(493)},734:function(t,e,n){"use strict";n.r(e);n(24);var r=n(7),o=(n(40),{name:"user_cards_list",data:function(){return{list:[],menuDialog:!1,actDialog:!1,loading:!1,outerVisible:!1,addDialog:!1,editDialog:!1,infoDialog:!1,add_form:{id:0,name:""},info:{},menuData:[],actData:[]}},mounted:function(){this.getList()},methods:{formAdd:function(){var t=this;this.$post("/api/admin/admin_group/add",this.add_form).then((function(e){e&&1===e.status&&(t.getList(),t.$message.success("操作成功"),t.addDialog=!1,t.add_form.id=0,t.add_form.name="",t.editDialog=!1)}))},form:function(){},del:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$post("/api/admin/admin_group/del",{id:t});case 2:(r=n.sent)&&1===r.status&&(e.$message({type:"success",message:"操作成功!"}),e.getList());case 4:case"end":return n.stop()}}),n)})))()},delData:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e.$confirm("确定删除后将不可逆, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.del(t.id)})).catch((function(){e.$message({type:"info",message:"已取消"})}));case 1:case"end":return n.stop()}}),n)})))()},editGroup:function(t){var form=this.add_form;form.id=t.id,form.name=t.name,this.addDialog=!0},addGroup:function(){var form=this.add_form;form.id="",form.name="",this.addDialog=!0},menuDialogShow:function(t){this.menuDialog=!0,this.menuData=[],this.getMenuData(t.id)},actDialogShow:function(t){this.actDialog=!0,this.actData=[],this.getActData(t.id)},getList:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$post("/api/admin/admin_group/list");case 2:(n=e.sent)&&1===n.status&&(t.list=n.data.list||[]);case 4:case"end":return e.stop()}}),e)})))()},closeMenu:function(t,e){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){var data,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return data={type:e,id:t.id,url:t.url},r.next=3,n.$post("/api/admin/admin_group/close_menu",data);case 3:(o=r.sent)&&1===o.status&&(n.$message({type:"success",message:"操作成功!"}),n.getMenuData(t.id));case 5:case"end":return r.stop()}}),r)})))()},getMenuData:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){var data,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return data={id:t},n.next=3,e.$post("/api/admin/admin_group/menu",data);case 3:(r=n.sent)&&1===r.status&&(e.menuData=r.data.list||[]);case 5:case"end":return n.stop()}}),n)})))()},getActData:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){var data,r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return data={id:t},n.next=3,e.$post("/api/admin/user_auth/list",data);case 3:(r=n.sent)&&1===r.status&&(e.actData=r.data.list||[]);case 5:case"end":return n.stop()}}),n)})))()},closeActMenu:function(t,e){var n=this;return Object(r.a)(regeneratorRuntime.mark((function r(){var data,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return data={type:e,id:t.id,url:t.url},r.next=3,n.$post("/api/admin/user_auth/close_menu",data);case 3:(o=r.sent)&&1===o.status&&(n.$message({type:"success",message:"操作成功!"}),n.getActData(t.id));case 5:case"end":return r.stop()}}),r)})))()}}}),c=(n(618),n(4)),component=Object(c.a)(o,(function(){var t=this,e=t._self._c;t._self._setupProxy;return e("div",[e("el-button",{staticStyle:{"margin-top":"15px","margin-right":"30px",float:"left"},attrs:{type:"primary"},on:{click:function(e){return t.addGroup()}}},[t._v("添加角色")]),t._v(" "),e("div",{staticStyle:{clear:"both"}}),t._v(" "),e("div",{staticStyle:{"margin-bottom":"15px"}}),t._v(" "),e("div",[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[e("el-table-column",{attrs:{prop:"name",label:"角色名称",width:"220px"}}),t._v(" "),e("el-table-column",{attrs:{prop:"uid",label:"操作",width:"450px"},scopedSlots:t._u([{key:"default",fn:function(n){return[e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.delData(n.row)}}},[t._v("删除角色")]),t._v(" "),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.editGroup(n.row)}}},[t._v("编辑角色")]),t._v(" "),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.menuDialogShow(n.row)}}},[t._v("菜单管理")]),t._v(" "),e("el-button",{attrs:{type:"text"},on:{click:function(e){return t.actDialogShow(n.row)}}},[t._v("操作权限")])]}}])})],1)],1),t._v(" "),e("el-dialog",{attrs:{title:"角色管理",visible:t.addDialog,width:"400px"},on:{"update:visible":function(e){t.addDialog=e}}},[e("el-form",{attrs:{model:t.add_form,"label-width":"70px"}},[e("el-form-item",{attrs:{label:"角色名称"}},[e("el-input",{attrs:{autocomplete:"off"},model:{value:t.add_form.name,callback:function(e){t.$set(t.add_form,"name",e)},expression:"add_form.name"}})],1)],1),t._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{attrs:{size:"medium"},on:{click:function(e){t.addDialog=!1}}},[t._v("取消")]),t._v(" "),e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:t.formAdd}},[t._v("确定")])],1)],1),t._v(" "),e("el-dialog",{attrs:{title:"权限菜单",visible:t.menuDialog,"custom-class":"mall_list","lock-scroll":"",width:"70%"},on:{"update:visible":function(e){t.menuDialog=e}}},[e("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:t.menuData,border:"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[e("el-table-column",{attrs:{prop:"title",label:"权限名称"}}),t._v(" "),e("el-table-column",{attrs:{prop:"show",label:"访问权限"},scopedSlots:t._u([{key:"default",fn:function(n){return["1"==n.row.show?e("span",{staticStyle:{color:"red",cursor:"pointer"},on:{click:function(e){return t.closeMenu(n.row,1)}}},[t._v("已禁用")]):e("span",{staticStyle:{color:"green",cursor:"pointer"},on:{click:function(e){return t.closeMenu(n.row,2)}}},[t._v("已开启")])]}}])})],1)],1),t._v(" "),e("el-dialog",{attrs:{title:"操作权限",visible:t.actDialog,"custom-class":"mall_list","lock-scroll":"",width:"70%"},on:{"update:visible":function(e){t.actDialog=e}}},[e("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:t.actData,border:"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[e("el-table-column",{attrs:{prop:"title",label:"权限名称"}}),t._v(" "),e("el-table-column",{attrs:{prop:"show",label:"访问权限"},scopedSlots:t._u([{key:"default",fn:function(n){return["1"==n.row.show?e("span",{staticStyle:{color:"red",cursor:"pointer"},on:{click:function(e){return t.closeActMenu(n.row,2)}}},[t._v("已禁用")]):e("span",{staticStyle:{color:"green",cursor:"pointer"},on:{click:function(e){return t.closeActMenu(n.row,1)}}},[t._v("已开启")])]}}])})],1)],1)],1)}),[],!1,null,"d26e983a",null);e.default=component.exports}}]);
|