12.1e4325c9ee59f76c4112.js 4.1 KB

1
  1. webpackJsonp([12],{gEUt:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("mvHQ"),i=n.n(a),o=n("//Fk"),l=n.n(o),u=n("woOf"),d=n.n(u),r=n("8obM"),s={name:"userControl",components:{SearchTableTemplate:n("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(n,a){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"}),n()}).catch(function(){return n()})})},del:function(t){var e=this;return new l.a(function(n,a){e.$confirm("是否删除?","删除",{type:"error"}).then(function(){Object(r.a)(t).then(function(t){console.log(t),n()}).catch(function(){return n()}),e.searchData=d()({},{data:e.searchData.data})}).catch(function(){return n()})})},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 n=arguments[1];return new l.a(function(a,i){n.validate(function(n){n?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}),a()}).catch(function(){return a()}):a()})})}},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,n=this;arguments[0][this.prop+"_loading"]=!0,t.getInfo(arguments[0]).then(function(){e[0][n.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,n=this;arguments[0][this.prop+"_loading"]=!0,t.del(arguments[0]).then(function(){e[0][n.prop+"_loading"]=!1})}}},{label:"test1",prop:"test1",fixed:"right",custom:!0,type:"expand",button:[{module:"button",title:"test1",prop:"test1",type:"info",handle:function(){arguments[0][this.prop+"_loading"]=!0}}]}],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:[]},p=n("VU/8")(s,c,!1,null,null,null);e.default=p.exports}});