webpackJsonp([12],{HdAN:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("Xxa5"),a=n.n(r),l=n("exGp"),c=n.n(l),i=n("Dd8w"),s=n.n(i),o={0:"无效",1:"正常"},u=n("oZit"),d=n("NYxO"),p={name:"roles",mixins:[n("3HZp").a],data:function(){return{enableCreate:!1,value:"",columns:function(){var e=this;return[{prop:"name",label:"项目名",width:180},{prop:"status",label:"状态",width:180,render:function(e,t){return o[t.row.status]}},{prop:"environment_name",label:"环境",width:180},{label:"空间",width:180,prop:"space_name"},{label:"操作",minWidth:200,render:function(t,n,r){return t("div",[e.renderMemberTool(n.row),e.renderEditTool(n.row),e.renderDeleteTool(n.row)])}}]}.call(this),form:{search:""},breadcrumbData:[{to:"",name:"项目"}]}},watch:{value:function(){this.search()}},computed:s()({},Object(d.c)(["user","space","spaceName"])),methods:{callServe:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$refs.table;return c()(a.a.mark(function n(){var r,l,c,i,s;return a.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(u.d)({size:t.page.size,page:t.page.currentPage,kw:e.value});case 2:r=n.sent,l=r.data,c=l.list,i=l.count,s=l.enable_create,e.enableCreate=s,t.page.total=i,t.list=c;case 10:case"end":return n.stop()}},n,e)}))()},search:function(){this.callServe()},addProject:function(){this.$router.push("/"+this.spaceName+"/project/create")},edit:function(e){this.$router.push("/"+this.spaceName+"/project/edit/"+e.id)},editmembers:function(e){this.$router.push("/"+this.spaceName+"/project/members/"+e.id)},renderEditTool:function(e){var t=this,n=this.$createElement;return e.enable_update?n("el-button",{attrs:{type:"text",icon:"el-icon-edit",size:"small"},on:{click:function(){return t.edit(s()({},e))}}},["编辑"]):null},renderDeleteTool:function(e){var t=this,n=this.$createElement;return e.enable_delete?n("el-button",{attrs:{type:"text",icon:"el-icon-delete",size:"small"},class:"user-delete",on:{click:function(){return t.delete(s()({},e))}}},["删除"]):null},renderMemberTool:function(e){var t=this,n=this.$createElement;return e.enable_update?n("el-button",{attrs:{type:"text",icon:"el-icon-edit",size:"small"},on:{click:function(){return t.editmembers(s()({},e))}}},["成员管理"]):null},deleteRole:function(e){var t=this;return c()(a.a.mark(function n(){return a.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(u.b)(e.id);case 2:t.callServe(),t.$message({type:"success",message:"删除成功!"});case 4:case"end":return n.stop()}},n,t)}))()},delete:function(e){var t=this;this.$confirm("确定删除该项目吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.deleteRole(e)}).catch(function(){t.$message({type:"info",message:"已取消删除"})})}}},m={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"wl-project"},[n("wl-breadcrumb",{attrs:{data:e.breadcrumbData,isBackButton:!1}}),e._v(" "),n("el-form",{attrs:{inline:!0},nativeOn:{submit:function(e){e.preventDefault()}}},[n("el-form-item",[n("el-input",{attrs:{placeholder:"请输入项目名称",size:"small"},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.search},slot:"append"})],1)],1),e._v(" "),e.enableCreate?n("el-form-item",[n("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.addProject}},[e._v("新建项目")])],1):e._e()],1),e._v(" "),n("wl-table",{ref:"table",attrs:{columns:e.columns},on:{callServe:e.callServe}})],1)},staticRenderFns:[]};var f=n("VU/8")(p,m,!1,function(e){n("qyMa")},null,null);t.default=f.exports},qyMa:function(e,t){}});