chunk-88111cd8.da4df96d.js 6.0 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-88111cd8"],{"4fef":function(t,a,e){"use strict";var i=e("ade3"),n=e("5530");e("1276"),e("ac1f"),e("a9e3");a["a"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var t=this;this.$nextTick((function(){t.noCreated||t.fetchData()}))},methods:{searchHandle:function(t){this.currentPage=1,this.searchForm=t,this.fetchData()},sizeChange:function(t){this.pageSize=t,this.currentPage=1,this.fetchData()},pageHandle:function(t){this.currentPage=t,this.fetchData()},sortChange:function(t){this.currentPage=1;var a=Object(n["a"])({},this.searchForm);"ascending"===t.order?a.sort=JSON.stringify(Object(i["a"])({},t.prop,"asc")):a.sort=JSON.stringify(Object(i["a"])({},t.prop,"desc")),this.fetchData(a)},fetchData:function(t){var a=this;if(this.apiStr){var e={page:this.currentPage,page_size:this.pageSize};t?e=Object(n["a"])(Object(n["a"])({},e),t):this.searchForm&&(e=Object(n["a"])(Object(n["a"])({},e),this.searchForm)),this.getDataBefore&&this.getDataBefore(e),this.listLoading=!0;var i=this.apiStr.split(".");this.$api[i[0]][i[1]](e).then((function(t){return 1===a.currentPage&&(a.pageSize=t.page_size||1),a.totalRecords=t.total?Number(t.total):0,a.tableData=t.list||[],a.listLoading=!1,a.getMoreData&&a.getMoreData(t,e),t})).catch((function(t){a.listLoading=!1}))}}}}},e382:function(t,a,e){"use strict";e.r(a);var i=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"app-container"},[e("search-form",{attrs:{"list-loading":t.listLoading},on:{change:t.searchHandle}}),e("table-list",{attrs:{"list-loading":t.listLoading,data:t.tableData2,columns:t.listConfig,"current-page":t.currentPage,"page-size":t.pageSize,"total-records":t.totalRecords,isAdd:!0},on:{currentChange:t.pageHandle,add:t.openPopup}}),e("popup-edit",{attrs:{isShow:t.isDtlShow,curObj:t.curObj},on:{close:t.closePopup}})],1)},n=[],r=e("2909"),s=e("5530"),o=(e("d81d"),e("ed08"),function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("header-collapse",[e("base-form",{ref:"ruleForm",attrs:{slot:"content",data:t.searchData},slot:"content"},[e("div",{attrs:{slot:"footer"},slot:"footer"},[e("el-button",{staticClass:"xl-form-btn bgc1",attrs:{loading:t.listLoading,icon:"el-icon-search"},on:{click:t.searchHandle}},[t._v("查询")])],1)])],1)}),l=[],c={mixins:[],props:{listLoading:Boolean},inject:["parentData"],data:function(){return{searchData:[{label:"账号",key:"username"},{label:"昵称",key:"nickname"}]}},methods:{searchHandle:function(){var t=this.$refs.ruleForm.baseForm,a=Object(s["a"])({},t);this.$emit("change",a)}}},u=c,d=e("2877"),h=Object(d["a"])(u,o,l,!1,null,null,null),f=h.exports,p=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:this.curObj&&this.curObj.id?"编辑用户":"添加用户",fullscreen:!1,width:"470px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(a){t.isShow=a}}},[e("base-form",{ref:"ruleForm",attrs:{data:t.formData,"is-inline":!1,"label-width":"110px"}},[e("div",{attrs:{slot:"footer"},slot:"footer"},[e("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),e("el-button",{staticClass:"xl-form-btn t1",on:{click:function(a){return t.close("confirm")}}},[t._v("确定")])],1)])],1)],1)},b=[],m=(e("99af"),e("1276"),e("ac1f"),e("159b"),{components:{},mixins:Object(r["a"])(mixins),props:{isShow:Boolean,curObj:Object},inject:["parentData"],data:function(){return{formData:[],loading:!0,cObj:{},isShowMap:!1}},watch:{isShow:function(t){t&&this.getDef()}},methods:{getDef:function(){var t=Object(s["a"])({},this.curObj);console.log(t),t.avatar="".concat(t.domain).concat(t.avatar,"?url=").concat(t.avatar);this.formData=[{label:"账号",key:"username",rules:1},{label:"昵称",key:"nickname",rules:1},{label:"邮箱",key:"email"},{label:"头像",key:"avatar",type:"upload"}],this.setDefaultValue(t)},close:function(t){var a=this;"confirm"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(t){if(t){var e=a.$refs.ruleForm.baseForm,i=Object(s["a"])({},e);if(i.avatar&&i.avatar.indexOf("?")>-1){var n=i.avatar.split("?"),r=n[1].split("&");r.forEach((function(t){var a=t.split("=");"url"===a[0]&&(i.avatar=a[1])}))}a.curObj.id&&(i.id=a.curObj.id),a.$emit("close",i)}})):(this.$emit("close"),this.setDefaultValue())}}}),g=m,v=Object(d["a"])(g,p,b,!1,null,"5d42390a",null),D=v.exports,O=e("4fef"),j={enabledStateArr:[{key:"启用",val:"1"},{key:"禁用",val:"2"}]},w={name:"index",components:{SearchForm:f,PopupEdit:D},provide:function(){return{parentData:this}},mixins:[O["a"]],data:function(){return Object(s["a"])({apiStr:"user.admadminlist",searchForm:null,isDtlShow:!1,curObj:{}},j)},computed:{tableData2:function(){var t=Object(r["a"])(this.tableData);return t.map((function(t){})),t}},created:function(){},mounted:function(){this.listConfig={rows:[{label:"昵称",prop:"nickname"},{label:"账号",prop:"username"},{label:"头像",prop:"avatar",type:"img"},{label:"邮箱",prop:"email"},{label:"更新人",prop:"update_by"},{label:"更新时间",prop:"update_at"},{label:"操作",width:200,type:"handle2",operations:[{label:"编辑",func:this.openPopup,btnType:"primary"},{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},methods:{delHandle:function(t){var a=this;this.$msg("您确定要删除该用户吗?","confirm",(function(){a.$api.user.admadmindel({id:t.id}).then((function(t){a.$msgs("已删除!"),a.fetchData()}))}),null,!0)},openPopup:function(t){t&&t.id?this.curObj=t:this.curObj={},this.isDtlShow=!0},closePopup:function(t){var a=this;if(t){var e=t,i="admadminadd";t.id&&(i="admadminedit"),this.$api.user[i](Object(s["a"])({},e)).then((function(e){a.$msgs(t.id?"编辑成功":"新增成功"),a.fetchData(),a.isDtlShow=!1}))}else this.isDtlShow=!1}}},S=w,k=Object(d["a"])(S,i,n,!1,null,null,null);a["default"]=k.exports}}]);