webpackJsonp([13],{pLuQ:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("mvHQ"),i=a.n(n),o=a("//Fk"),l=a.n(o),u=a("woOf"),d=a.n(u),r=a("8obM"),s={name:"accessControl",components:{SearchTableTemplate:a("NUeu").a},methods:{search:function(t,e){this.tableConfig=d()({},this.tableConfig,{btn:e}),this.searchData=d()({search:!0},{data:t})},getInfo:function(t){var e=this;return new l.a(function(a,n){Object(r.a)(t).then(function(t){console.log(t),e.dialogInputList=e.dialogInputListEdit.map(function(e){return e.value=t.data.data[e.name],e}),e.dialogConfig=d()({},e.dialogConfig,{visible:!0,saveType:"edit"}),a()}).catch(function(){return a()})})},del:function(t){var e=this;return new l.a(function(a,n){e.$confirm("是否删除?","删除",{type:"error"}).then(function(){Object(r.a)(t).then(function(t){console.log(t),a()}).catch(function(){return a()}),e.searchData=d()({},{data:e.searchData.data})}).catch(function(){return a()})})},add:function(){this.dialogInputList=this.dialogInputListAdd,this.dialogConfig=d()({},this.dialogConfig,{visible:!0,saveType:"add"})},save:function(){var t=arguments,e=this;console.log(arguments);var a=arguments[1];return new l.a(function(n,i){a.validate(function(a){a?Object(r.d)(t[0]).then(function(t){console.log(t),e.searchData=d()({},{data:e.searchData.data}),e.dialogConfig=d()({},e.dialogConfig,{visible:!1}),n()}).catch(function(){return n()}):n()})})}},data:function(){var t=this;return{formInputList:[{label:"账号",value:"",type:"text",name:"userName",module:"input"},{label:"角色",value:"",multiple:!0,module:"select",name:"state",optionList:[{label:"1",value:1},{label:"2",value:2}]}],formButtonlist:[{module:"button",title:"搜索",type:"primary",icon:"el-icon-search",loading:!1,handle:function(){t.search(arguments[0],this)}},{module:"button",title:"新增",handle:function(){t.add()}},{module:"reset",title:"重置"}],tableColumn:[{label:"姓名",prop:"_name",child:[{label:"英文",prop:"name"},{label:"中文",prop:"cname"}]},{label:"账户1",prop:"address"},{label:"账户2",prop:"date"},{label:"test",prop:"test",fixed:"right",custom:!0,width:120,button:{module:"button",title:"test",prop:"test",disabled:function(){return!(arguments[0].id%2)},handle:function(){var e=arguments,a=this;arguments[0][this.prop+"_loading"]=!0,t.getInfo(arguments[0]).then(function(){e[0][a.prop+"_loading"]=!1})}}},{label:"del",prop:"del",fixed:"right",custom:!0,width:120,button:{module:"button",title:"del",prop:"del",type:"danger",handle:function(){var e=arguments,a=this;arguments[0][this.prop+"_loading"]=!0,t.del(arguments[0]).then(function(){e[0][a.prop+"_loading"]=!1})}}}],tableConfig:{request:r.b},searchData:{},dialogInputList:[],dialogButtonlist:[{module:"reset",title:"重置",type:"text",class:"float-left"},{module:"button",title:"保存",type:"primary",width:!1,loading:!1,handle:function(){var e=this;this.loading=!0,t.save(arguments[0],arguments[1]).then(function(){e.loading=!1})}},{module:"button",title:"取消",width:!1,handle:function(){t.dialogConfig=d()({},t.dialogConfig,{visible:!1})}}],dialogConfig:{type:"input",title:"新增",visible:!1}}},created:function(){var t=[{label:"中文姓名",value:"",module:"input",name:"cname",required:!0},{label:"英文姓名",value:"",module:"input",name:"name",required:!0},{label:"地址",value:"",module:"input",name:"address",required:!0},{label:"日期",value:"",module:"date",name:"date",format:"yyyy-MM-dd",required:!0}];this.dialogInputListAdd=JSON.parse(i()(t)),this.dialogInputListEdit=JSON.parse(i()(t))}},c={render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("search-table-template",{ref:"searchTable",attrs:{formInputList:t.formInputList,formButtonlist:t.formButtonlist,tableColumn:t.tableColumn,searchData:t.searchData,tableConfig:t.tableConfig,dialogInputList:t.dialogInputList,dialogButtonlist:t.dialogButtonlist,dialogConfig:t.dialogConfig}})},staticRenderFns:[]},f=a("VU/8")(s,c,!1,null,null,null);e.default=f.exports}});