先补充说一下自己定义流程整个的思路,自己定义流程的目的就是为了让一套代码解决多种业务流程。比方请假单、报销单、採购单、协作单等等。用户自己来设计流程图。




这里要涉及到这样几个基本问题,一是不同的业务需求,流程节点不一样。流程中的任务多少不一样,因此后台就必须解决这个逻辑处理上的问题。要能同一套代码实现动态任务数量的处理。


二是不同的业务各种字段叫法也不一样,各个节点相应的页面也应该不一样。比如请假单就须要请假申请人、请假天数、请假原因等字段,而报销单可能就是报销申请人、报销金额、报销原因、报销凭证等;申请页面要相应填写申请信息的页面,处理也面要相应处理任务的页面。不同业务之间自然也会有差别,因此就须要前台可以自己定义表单,用户自己来设计须要的页面。


三就是如何把后台自己定义和前台的自己定义关联起来正确的交互。




因此,遵循这一思路,我就分成这样三个步骤来着手,之前的学习中就着重攻克了后台逻辑适应不同数量任务的问题。

那么接下来就是第二步。实现前台的自己定义表单,我在工作中并不做前台。因此实现的过程也就是仅仅求功能实现,不求其它。


在自己定义表单中。使用到了ueditor表单设计器插件,
下载:http://formdesign.leipi.org/downloads.html#java
集成插件參考文档: http://formdesign.leipi.org/doc.html
实际上我就是把解压后的文件里的js、css和index.html拿到了我的文件里进行改动使用,我的项目基本结构例如以下图,当中webapp中红线框起来的是自己加的文件文件夹,没有框起来的就是从插件中拿来的:




项目基本环境配置例如以下:
1、 maven导包相关配置文件pom.xml:





2.web项目基本配置文件web.xml:


3.sping相关配置文件:spring.xml:

> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <context:annotation-config /> <mvc:annotation-driven /> <context:component-scan base-package="formControllers" /> <context:component-scan base-package="servicesImp" /> <!-- <bean > <property name="driverClass" value="com.mysql.jdbc.Driver"></property> <property name="url" value="jdbc:mysql://192.168.0.201:3306/formtest?

useUnicode=true&characterEncoding=utf8" ></property> <property name="username" value="root" ></property> <property name="password" value="123456" ></property> </bean> <bean > <property name="dataSource" ref="dataSource"></property> </bean> --> <!-- 避免IE运行AJAX时,返回JSON出现下载文件 --> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/html;charset=utf-8</value> </list> </property> </bean> <!-- 启动Spring MVC的注解功能,完毕请求和注解POJO的映射 --> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <ref bean="mappingJacksonHttpMessageConverter" /><!-- json转换器 --> </list> </property> </bean> </beans>



相关文章:

  • 2021-07-08
  • 2021-10-01
  • 2021-11-04
  • 2022-12-23
  • 2022-01-12
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-07-23
  • 2022-01-07
  • 2021-04-05
  • 2021-09-29
相关资源
相似解决方案