1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9fbf1e76"],{"4fef":function(e,t,a){"use strict";a.r(t);var i=a("ade3"),s=a("5530");a("4e82"),a("e9c4"),a("a9e3");t["default"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var e=this;this.$nextTick((function(){e.noCreated||e.fetchData()}))},methods:{searchHandle:function(e){this.currentPage=1,this.searchForm=e,this.fetchData()},sizeChange:function(e){this.pageSize=e,this.currentPage=1,this.fetchData()},pageHandle:function(e){this.currentPage=e,this.fetchData()},sortChange:function(e){this.currentPage=1;var t=Object(s["a"])({},this.searchForm);"ascending"===e.order?t.sort=JSON.stringify(Object(i["a"])({},e.prop,"asc")):t.sort=JSON.stringify(Object(i["a"])({},e.prop,"desc")),this.searchForm=Object(s["a"])({},t),this.fetchData(t)},fetchData:function(e){var t=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};e?a=Object(s["a"])(Object(s["a"])({},a),e):this.searchForm&&(a=Object(s["a"])(Object(s["a"])({},a),this.searchForm)),this.getDataBefore&&this.getDataBefore(a),this.listLoading=!0;var i=this.apiStr.split(".");this.$api[i[0]][i[1]](a).then((function(e){return 1===t.currentPage&&(t.pageSize=e.page_size||1),t.totalRecords=e.total?Number(e.total):0,t.tableData=e.list||[],t.listLoading=!1,t.getMoreData&&t.getMoreData(e,a),e})).catch((function(e){t.listLoading=!1}))}}}}},"5e32":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("table-list",{attrs:{operationsDefaultLength:3,listLoading:e.listLoading,data:e.tableData,columns:e.listConfig,currentPage:e.currentPage,pageSize:e.pageSize,totalRecords:e.totalRecords,isAdd:!0},on:{currentChange:e.pageHandle,sizeChange:e.sizeChange,add:e.openPopup}}),a("popup-edit",{attrs:{isShow:e.isPopupShow,curObj:e.curObj},on:{close:e.closePopup}})],1)},s=[],n=(a("ed08"),a("c628")),o=a("4fef"),r={name:"xx",components:{PopupEdit:n["default"]},provide:function(){return{parentData:this}},mixins:[o["default"]],created:function(){},data:function(){return{apiStr:"base.admroleslist",searchForm:null,isPopupShow:!1,curObj:{}}},mounted:function(){this.listConfig={rows:[{label:"角色名称",prop:"name"},{label:"角色描述",prop:"description"},{label:"操作",width:230,type:"handle2",operations:[{label:"编辑",func:this.openPopup,btnType:"primary"},{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},methods:{delHandle:function(e){var t=this,a="确定要删除该角色吗?";this.$msg(a,"confirm",(function(){t.$api.base.admrolesdel({id:e.id}).then((function(e){t.$msgs("删除成功!"),t.fetchData()}))}),null,!0)},openPopup:function(e){this.curObj=e,this.isPopupShow=!0},closePopup:function(e){this.isPopupShow=!1,e&&this.fetchData()}}},c=r,l=a("2877"),u=Object(l["a"])(c,i,s,!1,null,null,null);t["default"]=u.exports},"68e2":function(e,t,a){"use strict";a("7b41")},"7b41":function(e,t,a){},c628:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:e.isShow,title:this.curObj&&this.curObj.id?"编辑角色":"添加角色",fullscreen:!1,width:"470px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(t){e.isShow=t}}},[a("base-form",{ref:"ruleForm",staticStyle:{width:"400px"},attrs:{data:e.formData,isInline:!1,labelWidth:"80px"}},[a("div",{staticClass:"scoped-tree",attrs:{slot:"otherItem"},slot:"otherItem"},[a("el-tree",{ref:"menuTree",attrs:{data:e.curData,"show-checkbox":"","node-key":"id","default-expanded-keys":e.checkedIds,"default-checked-keys":e.checkedIds,props:e.defaultProps}})],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:e.close}},[e._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(t){return e.close("confirm")}}},[e._v("确定")])],1)])],1)},s=[],n=a("2909"),o=a("5530"),r=(a("d81d"),a("a15b"),{props:{isShow:Boolean,curObj:Object},mixins:mixins,data:function(){return{formData:[],curData:[],checkedIds:[],defaultProps:{children:"children",label:"name"},loading:!0}},watch:{isShow:function(e){var t=this;if(e){var a=Object(o["a"])({},this.curObj);this.formData=[{label:"角色名称",key:"name",rules:1},{label:"角色描述",key:"description",rules:1}],this.setDefaultValue(a),this.checkedIds=a.permissions_ids||[],this.$nextTick((function(){t.$refs.menuTree.setCheckedKeys(a.permissions_ids)}))}}},created:function(){this.getMenu()},methods:{getMenu:function(){var e=this;this.$api.base.admpermissionslist().then((function(t){e.curData=Object(n["a"])(t)}))},systemChange:function(e){},close:function(e){var t=this;"confirm"===e?this.$refs["ruleForm"].$refs["baseForm"].validate((function(e){if(e){var a=t.$refs.ruleForm.baseForm,i=Object(o["a"])({},a),s="admrolesadd";t.curObj&&t.curObj.id&&(i.id=t.curObj.id,s="admrolesedit");var n=t.$refs.menuTree.getCheckedNodes(!1,!1).map((function(e){return e.id}));i.node=n.join(","),t.$api.base[s](i).then((function(e){t.$msgs("保存成功!"),t.$emit("close",i)}))}})):(this.$emit("close"),this.setDefaultValue())}}}),c=r,l=(a("68e2"),a("2877")),u=Object(l["a"])(c,i,s,!1,null,"75a0444a",null);t["default"]=u.exports}}]);
|