(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d30b9"],{"5aa8":function(a,e,t){"use strict";t.r(e);var l=function(){var a=this,e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"}},[t("a-row",{attrs:{gutter:48}},[t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:"角色ID"}},[t("a-input",{attrs:{placeholder:"请输入"}})],1)],1),t("a-col",{attrs:{md:8,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{attrs:{placeholder:"请选择","default-value":"0"}},[t("a-select-option",{attrs:{value:"0"}},[e._v("全部")]),t("a-select-option",{attrs:{value:"1"}},[e._v("关闭")]),t("a-select-option",{attrs:{value:"2"}},[e._v("运行中")])],1)],1)],1),t("a-col",{attrs:{md:8,sm:24}},[t("span",{staticClass:"table-page-search-submitButtons"},[t("a-button",{attrs:{type:"primary"}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"}},[e._v("重置")])],1)])],1)],1)],1),t("s-table",{attrs:{columns:e.columns,data:e.loadData},scopedSlots:e._u([{key:"actions",fn:function(a,l){return t("span",{},e._l(l.actionList,(function(a,l){return t("a-tag",{key:l},[e._v(e._s(a.describe))])})),1)}},{key:"status",fn:function(a){return t("span",{},[e._v("\n "+e._s(e._f("statusFilter")(a))+"\n ")])}},{key:"action",fn:function(a,l){return t("span",{},[t("a",{on:{click:function(a){return e.handleEdit(l)}}},[e._v("编辑")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-dropdown",[t("a",{staticClass:"ant-dropdown-link"},[e._v("\n 更多 "),t("a-icon",{attrs:{type:"down"}})],1),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",[t("a",{attrs:{href:"javascript:;"}},[e._v("详情")])]),t("a-menu-item",[t("a",{attrs:{href:"javascript:;"}},[e._v("禁用")])]),t("a-menu-item",[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])],1)],1)],1)}}])}),t("a-modal",{attrs:{title:"操作",width:800},on:{ok:e.handleOk},model:{value:e.visible,callback:function(a){e.visible=a},expression:"visible"}},[t("a-form",{attrs:{autoFormCreate:function(e){a.form=e}}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"唯一识别码",hasFeedback:"",validateStatus:"success"}},[t("a-input",{attrs:{placeholder:"唯一识别码",id:"no",disabled:"disabled"},model:{value:e.mdl.id,callback:function(a){e.$set(e.mdl,"id",a)},expression:"mdl.id"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"权限名称",hasFeedback:"",validateStatus:"success"}},[t("a-input",{attrs:{placeholder:"起一个名字",id:"permission_name"},model:{value:e.mdl.name,callback:function(a){e.$set(e.mdl,"name",a)},expression:"mdl.name"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"状态",hasFeedback:"",validateStatus:"warning"}},[t("a-select",{model:{value:e.mdl.status,callback:function(a){e.$set(e.mdl,"status",a)},expression:"mdl.status"}},[t("a-select-option",{attrs:{value:"1"}},[e._v("正常")]),t("a-select-option",{attrs:{value:"2"}},[e._v("禁用")])],1)],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"描述",hasFeedback:""}},[t("a-textarea",{attrs:{rows:5,placeholder:"...",id:"describe"},model:{value:e.mdl.describe,callback:function(a){e.$set(e.mdl,"describe",a)},expression:"mdl.describe"}})],1),t("a-divider"),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"赋予权限",hasFeedback:""}},[t("a-select",{staticStyle:{width:"100%"},attrs:{mode:"multiple",allowClear:!0},model:{value:e.mdl.actions,callback:function(a){e.$set(e.mdl,"actions",a)},expression:"mdl.actions"}},e._l(e.permissionList,(function(a,l){return t("a-select-option",{key:l,attrs:{value:a.value}},[e._v(e._s(a.label))])})),1)],1)],1)],1)],1)},s=[],n=t("e8c4"),o={name:"TableList",components:{STable:n["a"]},data:function(){var a=this;return{description:"列表使用场景:后台管理中的权限管理以及角色管理,可用于基于 RBAC 设计的角色权限控制,颗粒度细到每一个操作类型。",visible:!1,labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},form:null,mdl:{},advanced:!1,queryParam:{},columns:[{title:"唯一识别码",dataIndex:"id"},{title:"权限名称",dataIndex:"name"},{title:"可操作权限",dataIndex:"actions",scopedSlots:{customRender:"actions"}},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"操作",width:"150px",dataIndex:"action",scopedSlots:{customRender:"action"}}],permissionList:null,loadData:function(e){return a.$http.get("/api/permission",{params:Object.assign(e,a.queryParam)}).then((function(a){var e=a.result;return e.data.map((function(a){return a.actionList=JSON.parse(a.actionData),a})),e}))},selectedRowKeys:[],selectedRows:[]}},filters:{statusFilter:function(a){var e={1:"正常",2:"禁用"};return e[a]}},created:function(){this.loadPermissionList()},methods:{loadPermissionList:function(){var a=this;new Promise((function(a){var e=[{label:"新增",value:"add",defaultChecked:!1},{label:"查询",value:"get",defaultChecked:!1},{label:"修改",value:"update",defaultChecked:!1},{label:"列表",value:"query",defaultChecked:!1},{label:"删除",value:"delete",defaultChecked:!1},{label:"导入",value:"import",defaultChecked:!1},{label:"导出",value:"export",defaultChecked:!1}];setTimeout(a(e),1500)})).then((function(e){a.permissionList=e}))},handleEdit:function(a){this.mdl=Object.assign({},a),this.visible=!0},handleOk:function(){},onChange:function(a,e){this.selectedRowKeys=a,this.selectedRows=e},toggleAdvanced:function(){this.advanced=!this.advanced}},watch:{}},r=o,i=t("2877"),d=Object(i["a"])(r,l,s,!1,null,null,null);e["default"]=d.exports}}]);