webpackJsonp([33],{QVlR:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("Dd8w"),s=i.n(a),n=i("NYxO"),r=i("uBmv"),o=i("mtWM"),l=i.n(o),c={created:function(){this.getData()},data:function(){return{totalNumber:0,totalPage:0,currentPage:1,pageSize:20,tableData:[],multipleMode:!1,loading:!1,processDefinitions:[],selectedProcessDefinitionId:"",dialogVisible:!1,startForm:[],startFormModel:{}}},computed:s()({},Object(n.b)(["tableHeight","userInfo"]),{selection:function(){return this.$refs.table.selection.map(function(t){return t.id})}}),methods:{pageSizeChange:function(t){this.pageSize=t,this.getData()},currentPageChange:function(t){this.currentPage=t,this.getData()},getData:function(){var t=this;this.$http.get({url:"/rest/repository/process-definitions",data:{suspended:!1}}).then(function(e){t.processDefinitions=e.data}),this.$http.get({url:"/activiti/process/history",data:{}}).then(function(e){t.tableData=e.data})},startProcess:function(){var t=this;this.loading=!0,this.$http.get({url:"/rest/form/form-data",data:{processDefinitionId:this.selectedProcessDefinitionId}}).then(function(e){t.loading=!1,t.startForm=e.formProperties,t.startFormModel={},t.dialogVisible=!0,setTimeout(function(){t.$refs.startForm.clearValidate()},50)})},confirmStartProcess:function(){var t=this;this.$refs.startForm.validate(function(e){e&&(t.loading=!0,l.a.post("/rest/form/form-data",{processDefinitionId:t.selectedProcessDefinitionId,businessKey:null,properties:t.$refs.startForm.getData()}).then(function(e){t.loading=!1,t.dialogVisible=!1,t.$message.success("成功"),t.getData()}).catch(function(e){t.loading=!1,t.$message.error("失败")}))})},view:function(t){window.open(this.$baseUrl+"/diagram-viewer/index.html?processDefinitionId="+t.processDefinitionId+"&processInstanceId="+t.processInstanceId)}},components:{DynamicForm:r.a}},d={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"filters-container"},[i("el-select",{staticClass:"filter-item",attrs:{size:"small"},model:{value:t.selectedProcessDefinitionId,callback:function(e){t.selectedProcessDefinitionId=e},expression:"selectedProcessDefinitionId"}},t._l(t.processDefinitions,function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),t._v(" "),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",size:"small"},on:{click:t.startProcess}},[t._v("发起\n        ")])],1),t._v(" "),i("el-table",{ref:"table",attrs:{data:t.tableData,height:t.tableHeight,"row-key":"id"}},[t.multipleMode?i("el-table-column",{attrs:{align:"center",type:"selection","min-width":"50"}}):t._e(),t._v(" "),i("el-table-column",{attrs:{prop:"id",label:"id",width:"150"}}),t._v(" "),i("el-table-column",{attrs:{prop:"processDefinitionName",label:"名称"}}),t._v(" "),i("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.endTime?i("el-tag",{attrs:{size:"mini",type:"info"}},[t._v("已完成")]):i("el-tag",{attrs:{size:"mini",type:"success"}},[t._v("运行中")])]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"startTime",label:"创建时间",formatter:t.datetimeFormatter}}),t._v(" "),i("el-table-column",{attrs:{prop:"endTime",label:"结束时间",formatter:t.datetimeFormatter}}),t._v(" "),i("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:function(e){t.view(a)}}},[t._v("查看")])]}}])})],1),t._v(" "),i("div",{staticClass:"pagination-wrapper"},[i("el-pagination",{attrs:{background:"","current-page":t.currentPage,"page-sizes":[10,20,30,40,50],"page-size":t.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.totalNumber},on:{"size-change":t.pageSizeChange,"current-change":t.currentPageChange}})],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"发起流程"},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("dynamic-form",{ref:"startForm",attrs:{formProps:t.startForm},model:{value:t.startFormModel,callback:function(e){t.startFormModel=e},expression:"startFormModel"}}),t._v(" "),i("div",{attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary",loading:t.loading,size:"small"},on:{click:t.confirmStartProcess}},[t._v("确定")])],1)],1)],1)},staticRenderFns:[]};var u=i("VU/8")(c,d,!1,function(t){i("R2Qx")},"data-v-43da44f6",null);e.default=u.exports},R2Qx:function(t,e){}});
//# sourceMappingURL=33.b1878b57e50a67c41619.js.map