webpackJsonp([27],{MPZN:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("Dd8w"),i=n.n(a),s=n("NYxO"),r=n("mtWM"),o=n.n(r),l={created:function(){this.getData()},data:function(){return{totalNumber:0,totalPage:0,currentPage:1,pageSize:20,tableData:[],name:"",multipleMode:!1,loading:!1}},computed:i()({},Object(s.b)(["tableHeight"]),{selection:function(){return this.$refs.table.selection.map(function(e){return e.id})}}),methods:{pageSizeChange:function(e){this.pageSize=e,this.getData()},currentPageChange:function(e){this.currentPage=e,this.getData()},getData:function(){var e=this,t={};this.name&&(t.name=this.name),this.$http.get({url:"/rest/repository/process-definitions",data:t}).then(function(t){e.totalNumber=t.data.length;var n=e.currentPage-1;e.tableData=t.data.splice((n<0?0:n)*e.pageSize,e.pageSize)})},toggleMultipleMode:function(e){this.multipleMode=e,e||this.$refs.table.clearSelection()},editRow:function(e){window.open(this.$baseUrl+"/modeler.html?modelId="+e.id)},operation1:function(){this.$notify({title:"提示",message:this.selection})},operation2:function(){this.$message("操作2")},changeState:function(e,t){var n=this;this.$alert("确认"+(t?"激活":"挂起")+"？","警告",{type:"warning"}).then(function(){return o.a.put("/rest/repository/process-definitions/"+e.id,{action:t?"activate":"suspend",includeProcessInstances:!1})}).then(function(){n.$message.success("操作成功"),n.getData()}).catch(function(e){"cancel"===e||n.$message.error("操作失败")})},deleteDeployment:function(e){var t=this;this.$alert("确认删除？","警告",{type:"error"}).then(function(){return t.$http.post({url:"/activiti/process/deleteDeployment",data:{deploymentId:e.deploymentId}})}).then(function(e){e.success?(t.$message.success("删除成功"),t.getData()):t.$message.error("删除失败")}).catch(function(){t.$message.error("删除失败")})}}},c={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"filters-container"}),e._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.$store.state.fetchingData,expression:"$store.state.fetchingData"}],ref:"table",attrs:{data:e.tableData,height:e.tableHeight,"row-key":"id"}},[e.multipleMode?n("el-table-column",{attrs:{align:"center",type:"selection","min-width":"50"}}):e._e(),e._v(" "),n("el-table-column",{attrs:{prop:"id",label:"id",width:"150"}}),e._v(" "),n("el-table-column",{attrs:{prop:"name",label:"名称"}}),e._v(" "),n("el-table-column",{attrs:{prop:"description",label:"描述"}}),e._v(" "),n("el-table-column",{attrs:{prop:"version",label:"版本",align:"center"}}),e._v(" "),n("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.suspended?n("el-tag",{attrs:{size:"mini",type:"info"}},[e._v("已挂起")]):n("el-tag",{attrs:{size:"mini",type:"success"}},[e._v("已激活")])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.suspended?n("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:function(t){e.changeState(a,!0)}}},[e._v("激活\n                ")]):n("el-button",{attrs:{type:"warning",size:"mini",plain:""},on:{click:function(t){e.changeState(a,!1)}}},[e._v("挂起")]),e._v(" "),n("el-button",{attrs:{type:"danger",size:"mini",plain:""},on:{click:function(t){e.deleteDeployment(a)}}},[e._v("删除")])]}}])})],1),e._v(" "),n("div",{staticClass:"pagination-wrapper"},[n("el-pagination",{attrs:{background:"","current-page":e.currentPage,"page-sizes":[10,20,30,40,50],"page-size":e.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.totalNumber},on:{"size-change":e.pageSizeChange,"current-change":e.currentPageChange}})],1)],1)},staticRenderFns:[]};var u=n("VU/8")(l,c,!1,function(e){n("v5tO")},"data-v-5d2615bc",null);t.default=u.exports},v5tO:function(e,t){}});
//# sourceMappingURL=27.9bb705b8785fd9b969ec.js.map