捕梦者基础前端框架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
5.8 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22d462"],{f794:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ele-body"},[n("el-card",{attrs:{shadow:"never"}},[n("el-form",{staticClass:"ele-form-search",attrs:{model:e.where,"label-width":"77px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.reload(t)},submit:function(e){e.preventDefault()}}},[n("el-row",{attrs:{gutter:15}},[n("el-col",{attrs:{md:6,sm:12}},[n("el-form-item",{attrs:{label:"菜单名称:"}},[n("el-input",{attrs:{placeholder:"请输入",clearable:""},model:{value:e.where.name,callback:function(t){e.$set(e.where,"name",t)},expression:"where.name"}})],1)],1),n("el-col",{attrs:{md:6,sm:12}},[n("el-form-item",{attrs:{label:"菜单地址:"}},[n("el-input",{attrs:{placeholder:"请输入",clearable:""},model:{value:e.where.path,callback:function(t){e.$set(e.where,"path",t)},expression:"where.path"}})],1)],1),n("el-col",{attrs:{md:12,sm:12}},[n("div",{staticClass:"ele-form-actions"},[n("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.reload}},[e._v("查询 ")]),n("el-button",{on:{click:e.reset}},[e._v("重置")])],1)])],1)],1),n("ele-pro-table",{ref:"table",attrs:{datasource:e.url,columns:e.columns,where:e.where,"parse-data":e.parseData,"row-key":"id",height:"calc(100vh - 265px)","default-expand-all":"","need-page":!1},scopedSlots:e._u([{key:"name",fn:function(t){var a=t.row;return[n("i",{class:a.icon}),e._v(" "+e._s(a.name)+" ")]}},{key:"menu_type",fn:function(t){var a=t.row;return[n("el-tag",{attrs:{type:["primary","info"][a.menu_type],size:"mini"}},[e._v(" "+e._s(["菜单","按钮"][a.menu_type])+" ")])]}},{key:"status",fn:function(t){var a=t.row;return[n("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(t){return e.editStatus(a)}},model:{value:a.status,callback:function(t){e.$set(a,"status",t)},expression:"row.status"}})]}},{key:"action",fn:function(t){var a=t.row;return[n("el-link",{attrs:{icon:"el-icon-plus",type:"primary",underline:!1},on:{click:function(t){return e.openEdit(null,a.id)}}},[e._v("添加 ")]),n("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(t){return e.openEdit(a)}}},[e._v("修改 ")]),n("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除吗?"},on:{confirm:function(t){return e.remove(a)}}},[n("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[e._v("删除 ")])],1)]}}])},[n("template",{slot:"toolbar"},[n("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){return e.openEdit(null)}}},[e._v("添加 ")]),n("el-button",{staticClass:"ele-btn-icon",attrs:{size:"small"},on:{click:e.expandAll}},[e._v("展开全部 ")]),n("el-button",{staticClass:"ele-btn-icon",attrs:{size:"small"},on:{click:e.foldAll}},[e._v("折叠全部 ")])],1)],2)],1),n("menu-edit",{attrs:{visible:e.showEdit,data:e.current,"menu-list":e.menuList},on:{"update:visible":function(t){e.showEdit=t},done:e.reload}})],1)},l=[],o=(n("b0c0"),n("159b"),n("9c91")),s={name:"SystemMenu",components:{MenuEdit:o["default"]},data:function(){var e=this;return{url:"/menu/index",columns:[{columnKey:"index",type:"index",width:45,align:"center",fixed:"left",showOverflowTooltip:!0},{prop:"name",label:"菜单名称",showOverflowTooltip:!0,minWidth:160,slot:"name"},{prop:"model_name",label:"接口权限",showOverflowTooltip:!0,minWidth:110},{prop:"path",label:"路由地址",showOverflowTooltip:!0,minWidth:110},{prop:"component",label:"组件路径",showOverflowTooltip:!0,minWidth:110},{prop:"authority",label:"权限标识",showOverflowTooltip:!0,minWidth:110},{prop:"sort",label:"排序",align:"center",showOverflowTooltip:!0,width:60},{prop:"hide",label:"隐藏",align:"center",showOverflowTooltip:!0,width:60,formatter:function(e,t,n){return["否","是"][n]}},{prop:"menu_type",label:"类型",align:"center",width:65,showOverflowTooltip:!0,slot:"menu_type"},{prop:"create_time",label:"创建时间",showOverflowTooltip:!0,minWidth:110,formatter:function(t,n,a){return e.$util.toDateString(a)}},{prop:"status",label:"状态",align:"center",sortable:"custom",width:80,resizable:!1,slot:"status"},{columnKey:"action",label:"操作",width:190,align:"center",resizable:!1,slot:"action"}],where:{},selection:[],current:null,showEdit:!1,menuList:[]}},methods:{parseData:function(e){return e.data=this.$util.toTreeData(e.data,"id","parent_id"),this.menuList=e.data,e},reload:function(){this.$refs.table.reload()},reset:function(){var e=this;this.where={},this.$nextTick((function(){e.reload()}))},openEdit:function(e,t){this.current=Object.assign({menu_type:0,hide:0,parent_id:t},e),this.showEdit=!0},remove:function(e){var t=this;if(e.children&&e.children.length>0)this.$message.error("请先删除子节点");else{var n=this.$loading({lock:!0});this.$http.get("/menu/delete/id/"+e.id).then((function(e){n.close(),0===e.data.code?(t.$message({type:"success",message:e.data.msg}),t.reload()):t.$message.error(e.data.msg)})).catch((function(e){n.close(),t.$message.error(e.message)}))}},editStatus:function(e){var t=this,n=this.$loading({lock:!0}),a=new FormData;a.append("status",e.status),a.append("name",e.name),a.append("id",e.id),this.$http.post("/menu/status",a).then((function(a){n.close(),0===a.data.code?t.$message({type:"success",message:a.data.msg}):(e.status=e.status?0:1,t.$message.error(a.data.msg))})).catch((function(e){n.close(),t.$message.error(e.message)}))},expandAll:function(){var e=this;this.$refs.table.data.forEach((function(t){e.$refs.table.toggleRowExpansion(t,!0)}))},foldAll:function(){var e=this;this.$refs.table.data.forEach((function(t){e.$refs.table.toggleRowExpansion(t,!1)}))}}},i=s,r=n("2877"),c=Object(r["a"])(i,a,l,!1,null,"1e5a59d8",null);t["default"]=c.exports}}]);