add handbook
This commit is contained in:
		
							parent
							
								
									4df5885701
								
							
						
					
					
						commit
						2f01ece7a5
					
				| @ -99,7 +99,6 @@ function renderFormItem(h, elementList) { | |||||||
|   return elementList.map(scheme => { |   return elementList.map(scheme => { | ||||||
|     const config = scheme.__config__ |     const config = scheme.__config__ | ||||||
|     const layout = layouts[config.layout] |     const layout = layouts[config.layout] | ||||||
|     console.log(layout) |  | ||||||
|     if (layout) { |     if (layout) { | ||||||
|       return layout.call(this, h, scheme) |       return layout.call(this, h, scheme) | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										117
									
								
								ruoyi-ui/src/views/project/handbook.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								ruoyi-ui/src/views/project/handbook.vue
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,117 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="app-container"> | ||||||
|  |     <el-card class="box-card"> | ||||||
|  |       <div slot="header" class="clearfix"> | ||||||
|  |         <span>{{ processName }}</span> | ||||||
|  |       </div> | ||||||
|  | 
 | ||||||
|  |       <el-col :span="18" :offset="3"> | ||||||
|  |         <div class="form-conf" v-if="formOpen"> | ||||||
|  |           <parser :key="new Date().getTime()" :form-conf="formData" @submit="submit" ref="parser" @getData="getData"/> | ||||||
|  |         </div> | ||||||
|  |       </el-col> | ||||||
|  |     </el-card> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | import { listProcess} from "@/api/workflow/process"; | ||||||
|  | import { listAllCategory } from '@/api/workflow/category' | ||||||
|  | import { getProcessForm, startProcess } from '@/api/workflow/process' | ||||||
|  | import Parser from '@/utils/generator/parser' | ||||||
|  | 
 | ||||||
|  | export default { | ||||||
|  |   name: 'WorkStart', | ||||||
|  |   components: { | ||||||
|  |     Parser | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       definitionId: null, | ||||||
|  |       deployId: null, | ||||||
|  |       procInsId: null, | ||||||
|  |       formOpen: false, | ||||||
|  |       formData: {}, | ||||||
|  | 
 | ||||||
|  |       processName: '', | ||||||
|  |       categoryOptions: [], | ||||||
|  |       // 流程定义表格数据 | ||||||
|  |       processParams: null, | ||||||
|  |       // 查询参数 | ||||||
|  |       queryParams: { | ||||||
|  |         pageNum: 1, | ||||||
|  |         pageSize: 10, | ||||||
|  |         processKey: undefined, | ||||||
|  |         processName: "项目指南录入", | ||||||
|  |         category: "004" | ||||||
|  |       }, | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |     this.initData(); | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     initData() { | ||||||
|  |       /** 查询流程定义列表 */ | ||||||
|  |       listProcess(this.queryParams).then(response => { | ||||||
|  |         this.processParams = response.rows[0]; | ||||||
|  |         this.processName = this.processParams.processName; | ||||||
|  |         this.definitionId = this.processParams.definitionId; | ||||||
|  | 
 | ||||||
|  |         getProcessForm({ | ||||||
|  |           definitionId: this.processParams.definitionId, | ||||||
|  |           deployId: this.processParams.deploymentId, | ||||||
|  |           procInsId: undefined | ||||||
|  |         }).then(res => { | ||||||
|  |           if (res.data) { | ||||||
|  |             this.formData = res.data; | ||||||
|  |             this.formOpen = true | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  | 
 | ||||||
|  |     /** 接收子组件传的值 */ | ||||||
|  |     getData(data) { | ||||||
|  |       if (data) { | ||||||
|  |         const variables = []; | ||||||
|  |         data.fields.forEach(item => { | ||||||
|  |           let variableData = {}; | ||||||
|  |           variableData.label = item.__config__.label | ||||||
|  |           // 表单值为多个选项时 | ||||||
|  |           if (item.__config__.defaultValue instanceof Array) { | ||||||
|  |             const array = []; | ||||||
|  |             item.__config__.defaultValue.forEach(val => { | ||||||
|  |               array.push(val) | ||||||
|  |             }) | ||||||
|  |             variableData.val = array; | ||||||
|  |           } else { | ||||||
|  |             variableData.val = item.__config__.defaultValue | ||||||
|  |           } | ||||||
|  |           variables.push(variableData) | ||||||
|  |         }) | ||||||
|  |         this.variables = variables; | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     submit(data) { | ||||||
|  |       if (data && this.definitionId) { | ||||||
|  |         // 启动流程并将表单数据加入流程变量 | ||||||
|  |         startProcess(this.definitionId, JSON.stringify(data.valData)).then(res => { | ||||||
|  |           this.$modal.msgSuccess(res.msg); | ||||||
|  |           this.$tab.closeOpenPage({ | ||||||
|  |             path: '/work/own' | ||||||
|  |           }) | ||||||
|  |         }) | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .form-conf { | ||||||
|  |   margin: 15px auto; | ||||||
|  |   width: 80%; | ||||||
|  |   padding: 15px; | ||||||
|  | } | ||||||
|  | </style> | ||||||
							
								
								
									
										3153
									
								
								script/sql/mysql/ry-flowable-plus-240709.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3153
									
								
								script/sql/mysql/ry-flowable-plus-240709.sql
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user