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
3.1 KiB
1 lines
3.1 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3898c1a0"],{4642:function(t,e,n){"use strict";n("5dad")},"5dad":function(t,e,n){},9334:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"divBox"},[n("el-card",[n("div",{staticClass:"mb20"},[n("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.onAdd(0)}}},[t._v("添加菜单")])],1),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small","row-key":"menu_id","highlight-current-row":"","default-expand-all":!1,"tree-props":{children:"children",hasChildren:"hasChildren"}}},[n("el-table-column",{attrs:{label:"菜单名称","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.menu_name+" [ "+e.row.menu_id+" ]"))])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"route",label:"菜单地址","min-width":"150"}}),t._v(" "),n("el-table-column",{attrs:{label:"菜单图标","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(t){return[n("div",{staticClass:"listPic"},[n("i",{class:"el-icon-"+t.row.icon,staticStyle:{"font-size":"20px"}})])]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"create_time",label:"创建时间","min-width":"150"}}),t._v(" "),n("el-table-column",{attrs:{label:"操作","min-width":"120",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"text",size:"small",disabled:t.isChecked},on:{click:function(n){return t.onAdd(e.row.menu_id)}}},[t._v("添加子菜单")]),t._v(" "),n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return t.onEdit(e.row.menu_id)}}},[t._v("编辑")]),t._v(" "),n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return t.handleDelete(e.row.menu_id,e.$index)}}},[t._v("删除")])]}}])})],1)],1)],1)},i=[],s=(n("c5f6"),n("8593")),l={name:"Menu",data:function(){return{isChecked:!1,listLoading:!0,tableData:{data:[],total:0},tableFrom:{page:1,limit:20}}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(s["M"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(t){this.tableData.page=t,this.getList()},handleSizeChange:function(t){this.tableData.limit=t,this.getList()},onAdd:function(t){var e=this,n={};Number(t)>0&&(n.formData={pid:t}),this.$modalForm(Object(s["K"])(),n).then((function(){e.getList(),e.$store.dispatch("user/getMenus")}))},onEdit:function(t){var e=this;this.$modalForm(Object(s["N"])(t)).then((function(){e.getList(),e.$store.dispatch("user/getMenus")}))},handleDelete:function(t,e){var n=this;this.$modalSure("删除菜单吗").then((function(){Object(s["L"])(t).then((function(t){var e=t.message;n.$message.success(e),n.getList()})).catch((function(t){var e=t.message;n.$message.error(e)}))}))}}},o=l,r=(n("4642"),n("2877")),c=Object(r["a"])(o,a,i,!1,null,"16c15202",null);e["default"]=c.exports}}]); |