提交 32ab4f0b authored 作者: 1239068511@qq.com's avatar 1239068511@qq.com

Initial commit

上级
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
# 工作流项目核心
## 项目简介
### 环境要求
- Maven3+
- Jdk1.8+
- springboot 2.4.1 以下 2.1.4 以上 (包含所提到的版本)
### 代码结构
```
├─src
│ ├─main
│ │ ├─java
│ │ │ └─com
│ │ │ └─tykj
│ │ │ └─workflowcore
│ │ │ ├─api
│ │ │ ├─base --系统基础模块
│ │ │ │ ├─annotations --注解类
│ │ │ │ ├─aop
│ │ │ │ ├─config
│ │ │ │ ├─entity
│ │ │ │ ├─page
│ │ │ │ ├─result
│ │ │ │ └─util
│ │ │ ├─model_layer --数据模型
│ │ │ │ ├─annotations
│ │ │ │ ├─controller
│ │ │ │ ├─dao
│ │ │ │ ├─entity
│ │ │ │ │ └─vo
│ │ │ │ ├─service
│ │ │ │ │ └─impl
│ │ │ │ ├─util
│ │ │ ├─workflow_editor --工作流编辑器
│ │ │ │ ├─config
│ │ │ │ ├─controller
│ │ │ │ ├─dao
│ │ │ │ ├─entity
│ │ │ │ │ └─vo
│ │ │ │ ├─enums
│ │ │ │ ├─listener
│ │ │ │ ├─service
│ │ │ │ │ └─impl
│ │ │ │ ├─util
│ │ │ └─WorkflowCoreApplication --SpringBoot启动类
│ │ └─resources --核心配置所在位置
│ │ ├─mapper
│ │ ├─template
│ │ └─ui
│ │ └─images
│ └─test
│ └─java
│ └─org
│ └─yaukie
│ └─frame --核心逻辑所在位置
```
## 使用方式
### 后端安装
#### maven
```
<dependency>
<groupId>com.tykj</groupId>
<artifactId>workflow-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
#### 本地引入
1. 获取 workflow-core-0.0.1-SNAPSHOT.jar
2. 在你自己项目的根目录下创建lib文件夹 并将 jar 包放入
3. pom 添加 如下
```
<dependency>
<groupId>com.tykj</groupId>
<artifactId>workflow-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/lib/workflow-core-0.0.1-SNAPSHOT.jar</systemPath>
</dependency>
```
### 前端安装
```
npm install workflow-form
```
### 配置
1. 在springboot 启动类上添加注解 @EnableWorkFlowCore
```
@EnableWorkFlowCore
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowCoreApplication.class, args);
}
}
```
### 使用
1. 工作流部分
1. 建立数据模型
![image-20210315130344008](images/image-20210315130344008.png)
2. 建立流程
![image-20210315131641756](images/image-20210315131641756.png)
3. 为节点配置页面
![image-20210315131723560](images/image-20210315131723560.png)
![image-20210315132632917](images/image-20210315132632917.png)
4. 配置节点的执行人
![image-20210315132126849](images/image-20210315132126849.png)
如需要使用工作流的执行人功能请实现 UserService
例如:
```
@Service
@Primary
public class FlowUserServiceImpl implements UserService {
@Override
public WorkFlowUser getCurrentUser() {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setId(1L);
workFlowUser.setUserName("张三");
return workFlowUser;
}
@Override
public List<WorkFlowUser> getAllUser() {
List<WorkFlowUser> workFlowUsers = new ArrayList<>();
for (int i = 0; i < 10; i++) {
WorkFlowUser workFlowUser = new WorkFlowUser();
workFlowUser.setUserName("张1");
workFlowUser.setId((long) i);
workFlowUsers.add(workFlowUser);
}
return workFlowUsers;
}
@Override
public List<WorkFlowRole> getAllRole(String roleType) {
List<WorkFlowRole> workFlowUsers = new ArrayList<>();
if (roleType.equals("department")){
workFlowUsers.add(new WorkFlowRole("开发部","department","1"));
workFlowUsers.add(new WorkFlowRole("运营部","department","2"));
workFlowUsers.add(new WorkFlowRole("测试部","department","3"));
}else {
workFlowUsers.add(new WorkFlowRole("管理员","role","1"));
workFlowUsers.add(new WorkFlowRole("普通用户","role","2"));
workFlowUsers.add(new WorkFlowRole("运维人员","role","3"));
}
return workFlowUsers;
}
@Override
public List<WorkFlowRoleType> getRoleType() {
List<WorkFlowRoleType> workFlowRoleTypes = new ArrayList<>();
workFlowRoleTypes.add(new WorkFlowRoleType("部门","department"));
workFlowRoleTypes.add(new WorkFlowRoleType("角色","role"));
return workFlowRoleTypes;
}
}
```
2. 宿主系统部分
1. 查询可发起流程
```
接口返回值示例
{
"message": "查询成功",
"data": {
"content": [
{
"id": 2,
"createdTime": "2021-03-15T03:00:48.028+00:00",
"updatedTime": "2021-03-15T03:10:33.009+00:00",
"deleted": 0,
"userId": null,
"userName": null,
"flowName": "测试1",
"resourceName": "processId_2850e08d-0e3d-4925-93f6-adce8a9e2246bpmn20.xml",
"flowKey": "processId_2850e08d-0e3d-4925-93f6-adce8a9e2246",
//前端组件需要使用该数据
"state": 0,
"filePath": "\\xml\\processId_2850e08d-0e3d-4925-93f6-adce8a9e2246bpmn20.xml",
"flowDescribe": "测试2",
"startId": null,
"startPageId": 1, //前端组件需要使用该数据
"processInstanceId": null,
"deployId": "a4c408b0-853a-11eb-81c9-d2c637ad090d"
},
{
"id": 3,
"createdTime": "2021-03-15T03:17:30.914+00:00",
"updatedTime": "2021-03-15T03:17:31.850+00:00",
"deleted": 0,
"userId": null,
"userName": null,
"flowName": "测试流程1",
"resourceName": "processId_560c6b5c-8be5-40b8-852f-8e174346e9c8bpmn20.xml",
"flowKey": "processId_560c6b5c-8be5-40b8-852f-8e174346e9c8",
"state": 0,
"filePath": "\\xml\\processId_560c6b5c-8be5-40b8-852f-8e174346e9c8bpmn20.xml",
"flowDescribe": "测试流程描述1",
"startId": null,
"startPageId": null,
"processInstanceId": null,
"deployId": "fa83de4c-853c-11eb-81c9-d2c637ad090d"
}
],
"pageable": {
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"offset": 0,
"pageSize": 15,
"pageNumber": 0,
"paged": true,
"unpaged": false
},
"totalElements": 2,
"last": true,
"totalPages": 1,
"number": 0,
"size": 15,
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"numberOfElements": 2,
"first": true,
"empty": false
}
}
```
2. 渲染页面
```
fromUtil.creatFrom(pageId,flowKey)
```
(渲染出来的表单页面中的逻辑由工作流控制,用户完成表单所有操作后页面会自动关闭)
3. 模拟效果
![image-20210315132852126](images/image-20210315132852126.png)
![image-20210315132859363](images/image-20210315132859363.png)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tykj</groupId>
<artifactId>workflow-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>workflow-core</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 下面是我引入的东西 zsp-->
<dependency>
<groupId>com.github.caspar-chen</groupId>
<artifactId>swagger-ui-layer</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!--flowable整合springboot-->
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable-spring-boot-starter</artifactId>
<version>6.6.0</version>
</dependency>
<!--fastjson-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.54</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.wenhao</groupId>
<artifactId>jpa-spec</artifactId>
<version>3.1.1</version>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- dom4j -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- caffeine缓存 -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
</dependencies>
<build>
<resources>
<!-- <resource>-->
<!-- <directory>src/main/java</directory>-->
<!-- <includes>-->
<!-- <include>**/*</include>-->
<!-- </includes>-->
<!-- <excludes>-->
<!-- <exclude>**/.svn/*</exclude>-->
<!-- </excludes>-->
<!-- <filtering>false</filtering>-->
<!-- </resource>-->
<!-- <resource>-->
<!-- <directory>${project.basedir}/src/main/resources</directory>-->
<!-- <targetPath>META-INF/resources/</targetPath>-->
<!-- </resource>-->
</resources>
<plugins>
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- </plugin>-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source> <!--指明源码用的Jdk版本-->
<target>1.8</target> <!--指明打包后的Jdk版本-->
</configuration>
</plugin>
</plugins>
</build>
</project>
package com.tykj.workflowcore;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* 测试时的启动类
* @author admin
*/
@SpringBootApplication
@EnableTransactionManagement
public class WorkflowCoreApplication {
public static void main(String[] args) {
SpringApplication.run(WorkflowCoreApplication.class, args);
System.out.println(
"█▀▀▀▀▀▀▀█▀▀▀█▀▀▀█▀▀▀█▀█▀▀▀▀▀▀▀█\n" +
"█ █▀▀▀█ █ ▄ ▀█▄▀█▀▀▀▄▀█ █▀▀▀█ █\n" +
"█ █ █ █▄▄█▄█▀ ▄ ▄ ▀▄█ █ █ █\n" +
"█ ▀▀▀▀▀ █ █▀▄ █▀█▀█▀▄ █ ▀▀▀▀▀ █\n" +
"█▀▀██▀▀▀██▄█▀▄▀█▀▄▄██▀██▀█▀▀▀▀█\n" +
"█▀▄▄▄ ▄▀ ▄▄▀ ▄ ██ ▀▄ ▄▀ █\n" +
"█ ▀ ██▀▀██ ▄▀▀███ ▄▄ ▄█ ▀█▄▄█\n" +
"█▀▄█▀ █▀▀ ███ █ ▄███▀▄ ▄▄▀▀▄ █\n" +
"█▀█▀▄▄ ▀▀▄ ▀▀▄▀▄ ▄ █▀▀ █▄▀▀█▄ █\n" +
"█▄▄▀▀ ▀▀ █▀▀▀ ▄█ ▀██▀▀ ▄▀▀▄ █\n" +
"█▀▀▀▀█▀▀██▄▀▄▀▀██▀ █ ▀ ▀ █▀██\n" +
"█▀▀▀▀▀▀▀█▄█▀██▄▀ ▀ █▀ █▀█ █ ▄ █\n" +
"█ █▀▀▀█ █ █▀▀▄▀▀▀█ █▀ ▀▀▀ ██▄▀█\n" +
"█ █ █ ███▀▀ ▀ ▀ ▄▄█▄▄▀ █▄ ▀ █\n" +
"█ ▀▀▀▀▀ █ █▄▀ ██▀ ██▀█▄ █ ▄█\n" +
"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀");
}
}
package com.tykj.workflowcore.base.annotations;
import com.tykj.workflowcore.base.config.WorkflowCoreRunner;
import org.springframework.context.annotation.Import;
import java.lang.annotation.*;
/**
* @author HASEE
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@Import({WorkflowCoreRunner.class})
public @interface EnableWorkFlowCore {
}
package com.tykj.workflowcore.base.aop;
import com.tykj.workflowcore.base.entity.BaseEntity;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver;
import java.util.Date;
import static java.util.Objects.isNull;
/**
* @author C
*/
@Aspect
@Component
public class EntityHandle {
@Before("execution(* org.springframework.data.repository.CrudRepository.save(..)) && args(com.tykj.workflowcore.base.entity.BaseEntity))")
public void checkTimes(JoinPoint point) {
Object[] args = point.getArgs();
for (Object arg : args) {
if (arg instanceof BaseEntity){
BaseEntity entity = (BaseEntity) arg;
if (isNull(entity.getCreatedTime())){
entity.setCreatedTime(new Date());
}
entity.setUpdatedTime(new Date());
}
}
}
}
package com.tykj.workflowcore.base.config;
import com.tykj.workflowcore.workflow_editer.listener.ProcessEndListener;
import org.flowable.engine.RuntimeService;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
/**
* @author HuangXiahao
* @version V1.0
* @class FlowableGlobListenerConfig
* @packageName com.tykj.workflowcore.base.config
**/
@Configuration
public class FlowableGlobListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
@Autowired
private SpringProcessEngineConfiguration configuration;
@Autowired
private ProcessEndListener processEndListener;
@Autowired
private RuntimeService runtimeService;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
//任务完成全局监听
//dispatcher.addEventListener(activityCompleteListener, FlowableEngineEventType.TASK_CREATED);
runtimeService.addEventListener(processEndListener);
}
}
package com.tykj.workflowcore.base.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.io.File;
/**
* @author zsp
* @version V1.0
* @class WebMvcConfig
* @packageName com.example.personnelmanager.common.config
* @data 2020/6/11
**/
@Configuration
@EnableSwagger2
public class WebMvcConfig implements WebMvcConfigurer {
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns("*")
.allowCredentials(true)
.allowedMethods("GET", "POST", "DELETE", "PUT", "PATCH")
.maxAge(3600);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/workflow/xml/**")
.addResourceLocations("file:" + System.getProperty("user.dir") + File.separator+"xml"+File.separator);
// .addResourceLocations("file:" + System.getProperty("user.dir") +"\\xml\\");
registry.addResourceHandler("/xml/**")
.addResourceLocations("file:" + System.getProperty("user.dir") + File.separator+"xml"+File.separator);
// .addResourceLocations("file:" + System.getProperty("user.dir") + "\\xml\\");
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/workflow/");
registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
};
}
}
package com.tykj.workflowcore.base.config;
import com.tykj.workflowcore.model_layer.service.ModelService;
import com.tykj.workflowcore.workflow_editer.listener.ProcessEndListener;
import org.flowable.engine.RuntimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import static com.tykj.workflowcore.base.util.ClassUtil.loadClassByLoader;
/**
* @author HuangXiahao
* @version V1.0
* @class Comm
* @packageName com.tykj.workflwcore
**/
@Configuration
@ComponentScan(
basePackages = {"com.tykj.workflowcore"}
)
@EnableJpaRepositories(basePackages = {
"com.tykj.workflowcore.model_layer.dao",
"com.tykj.workflowcore.workflow_editer.dao"
})
public class WorkflowCoreRunner implements CommandLineRunner {
@Autowired
ModelService modelService;
@Autowired
RuntimeService runtimeService;
@Bean
ClassLoader initClassLoader(){
return getClass().getClassLoader();
}
@Override
public void run(String... args) {
System.out.println("核心成功启动");
//创建xml文件夹 如果不存在的话
createXmlMkdir();
modelService.swaggerScan(loadClassByLoader(this.getClass().getClassLoader()));
}
public void createXmlMkdir(){
File file = new File(System.getProperty("user.dir")+"\\xml");
if (!file.exists()){
file.mkdir();
}
}
// //通过loader加载所有类
// private List<Class<?>> loadClassByLoader(ClassLoader load) {
// List<Class<?>> classes = new ArrayList<>();
// try {
// Enumeration<URL> urls = load.getResources("");
// //放所有类型
// while (urls.hasMoreElements()) {
// URL url = urls.nextElement();
// //文件类型(其实是文件夹)
// if (url.getProtocol().equals("file")) {
// loadClassByPath(null, url.getPath(), classes, load);
// }
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// return classes;
// }
//
// //通过文件路径加载所有类 root 主要用来替换path中前缀(除包路径以外的路径)
// private void loadClassByPath(String root, String path, List<Class<?>> list, ClassLoader load) {
// File f = new File(path);
// if (root == null) root = f.getPath();
// //判断是否是class文件
// if (f.isFile() && f.getName().matches("^.*\\.class$")) {
// try {
// String classPath = f.getPath();
// //截取出className 将路径分割符替换为.(windows是\ linux、mac是/)
// String className = classPath.substring(root.length() + 1, classPath.length() - 6).replace('/', '.').replace('\\', '.');
// list.add(load.loadClass(className));
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// } else {
// File[] fs = f.listFiles();
// if (fs == null) return;
// for (File file : fs) {
// loadClassByPath(root, file.getPath(), list, load);
// }
// }
// }
}
package com.tykj.workflowcore.base.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
/**
* @author HuangXiahao
* @version V1.0
* @class BaseEntity
* @packageName com.example.demo.entity
**/
@Data
@MappedSuperclass
public abstract class BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("主键")
protected Integer id;
@ApiModelProperty("创建时间")
@Temporal(TemporalType.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd hh:mm")
protected Date createdTime;
@ApiModelProperty("修改时间")
@Temporal(TemporalType.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd hh:mm")
protected Date updatedTime;
@ApiModelProperty("逻辑删除 0为 false 1为 true")
protected Integer deleted = 0;
}
package com.tykj.workflowcore.base.page;
import lombok.Data;
import org.springframework.data.domain.Sort;
/**
* 描述:Jpa排序类
*
* @author HuangXiahao
* @version V1.0
* @data 2020/5/13
**/
@Data
public class JpaCustomOrder {
private String coulmn;
private Sort.Direction direction;
}
package com.tykj.workflowcore.base.page;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.util.Assert;
import java.util.ArrayList;
import java.util.List;
/**
* JPA分页类
* @author HuangXiahao
* @class CustomOrder
* @data 2020/5/13
**/
public class JpaCustomPage {
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Integer page = 0;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Integer size = 15;
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private List<JpaCustomOrder> orders = new ArrayList<>();
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
Assert.isTrue(page >= 0, "分页信息错误!");
this.size = size;
}
public List<JpaCustomOrder> getOrders() {
return orders;
}
public void setOrders(List<JpaCustomOrder> orders) {
this.orders = orders;
}
@JsonIgnore
public long getOffset() {
return page * size;
}
@JsonIgnore
public Integer getLimit() {
return size;
}
@JsonIgnore
public PageRequest getPageable() {
if (orders.size() != 0) {
List<Sort.Order> orders = new ArrayList<>();
this.orders.stream().forEach(item ->
orders.add(new Sort.Order(item.getDirection(), item.getCoulmn())));
return PageRequest.of(getPage(), getLimit(), Sort.by(orders));
}
return PageRequest.of(getPage(), getLimit());
}
}
package com.tykj.workflowcore.base.result;
import org.springframework.http.ResponseEntity;
/**
* 全局错误处理类,用于处理一些不容易定义的错误
*
* @author HuangXiahao
**/
public class ApiException extends RuntimeException {
private ResponseEntity responseEntity;
public ApiException(ResponseEntity responseEntity) {
this.responseEntity = responseEntity;
}
public ApiException(String message) {
this.responseEntity = ResponseEntity.status(500).body(new ResultObj("",message));
}
public ApiException( Object data,String message) {
this.responseEntity = ResponseEntity.status(500).body(new ResultObj(data, message));
}
public ResponseEntity getResponseEntity() {
return responseEntity;
}
public void setResponseEntity(ResponseEntity responseEntity) {
this.responseEntity = responseEntity;
}
}
package com.tykj.workflowcore.base.result;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.BindException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver;
import java.sql.SQLSyntaxErrorException;
/**
* 错误处理类
* 所有的报错信息都会通过本层的方法向外界返回
*
* @author HuangXiahao
**/
@Order(Ordered.HIGHEST_PRECEDENCE)
@ControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
/**
* 业务错误
*
* @param e 报错信息
*/
@ResponseBody
@ExceptionHandler(ApiException.class)
public ResponseEntity errorMessage(ApiException e) {
log.warn("[自定义异常] {}", e.toString());
if (e.getResponseEntity() != null) {
return e.getResponseEntity();
}
return ResultUtil.failed(e.getMessage());
}
/**
* 处理字段长度异常
* @param invalidFormatException
* @return
*/
@ExceptionHandler(InvalidFormatException.class)
public ResponseEntity handle(InvalidFormatException invalidFormatException){
log.warn(invalidFormatException.toString());
return ResultUtil.failed("字段长度错误,请修改为合适的长度!");
}
@ExceptionHandler(SQLSyntaxErrorException.class)
public ResponseEntity handleSQl(InvalidFormatException invalidFormatException){
log.warn(invalidFormatException.toString());
return ResultUtil.failed("列名不合法,请修改列名!");
}
}
package com.tykj.workflowcore.base.result;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author dengdiyi
* @description 接口返回统一标准类
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonPropertyOrder(value = {"message", "data"})
public class ResultObj<T> {
private T data;
private String message;
public ResultObj(T o) {
this.data = o;
this.message = "no message";
}
}
package com.tykj.workflowcore.base.result;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
/**
* @author HuangXiahao
* @version V1.0
* @class ResultMessage
* @packageName com.example.hello.demo.resultObject
**/
public class ResultUtil<T> {
/**
* 成功返回结果
*
* @param data 获取的数据
*/
public static <T> ResponseEntity<ResultObj<T>> success(T data,String message) {
return ResponseEntity.ok(new ResultObj<>(data,message));
}
/**
* 成功返回结果
*/
public static <T> ResponseEntity<ResultObj<T>> success(String message) {
return ResponseEntity.ok(new ResultObj<>(null,message));
}
/**
* 成功返回结果
*
* @param data 获取的数据
*/
public static <T> ResponseEntity success(T data, HttpHeaders headers) {
return new ResponseEntity(new ResultObj(data), headers, HttpStatus.OK);
}
/**
* 失败返回结果
*/
public static <T> ResponseEntity failed() {
return ResponseEntity.status(500).body(new ResultObj("服务器内部发生错误"));
}
/**
* 失败返回结果
*/
public static <T> ResponseEntity failed(T content) {
return new ResponseEntity(new ResultObj(content), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 失败返回结果
*/
public static <T> ResponseEntity failed(HttpStatus httpStatus) {
return new ResponseEntity(httpStatus);
}
/**
* 失败返回结果
*/
public static <T> ResponseEntity failed(HttpStatus httpStatus, T content) {
return new ResponseEntity(new ResultObj(content), httpStatus);
}
/**
* 参数验证失败返回结果
*/
public static <T> ResponseEntity validateFailed(T content) {
return failed(HttpStatus.INTERNAL_SERVER_ERROR, content);
}
/**
* 未登录返回结果
*/
public static <T> ResponseEntity unauthorized() {
return failed(HttpStatus.UNAUTHORIZED);
}
/**
* 未授权返回结果
*/
public static <T> ResponseEntity forbidden() {
return failed(HttpStatus.FORBIDDEN);
}
}
package com.tykj.workflowcore.base.util;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
public class ClassUtil {
/**
* 读取项目中所有Class 并以Class对象的集合返回
* @param load ClassLoader
* @return Class对象集合
*/
public static List<Class<?>> loadClassByLoader(ClassLoader load) {
List<Class<?>> classes = new ArrayList<>();
try {
Enumeration<URL> urls = load.getResources("");
//放所有类型
while (urls.hasMoreElements()) {
URL url = urls.nextElement();
//文件类型(其实是文件夹)
if (url.getProtocol().equals("file")) {
loadClassByPath(null, url.getPath(), classes, load);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return classes;
}
/**
* 通过文件路径加载所有类 root 主要用来替换path中前缀(除包路径以外的路径)
*/
private static void loadClassByPath(String root, String path, List<Class<?>> list, ClassLoader load) {
File f = new File(path);
if (root == null) {
root = f.getPath();
}
//判断是否是class文件
if (f.isFile() && f.getName().matches("^.*\\.class$")) {
try {
String classPath = f.getPath();
//截取出className 将路径分割符替换为.(windows是\ linux、mac是/)
String className = classPath.substring(root.length() + 1, classPath.length() - 6).replace('/', '.').replace('\\', '.');
list.add(load.loadClass(className));
} catch (Exception ex) {
ex.printStackTrace();
}
} else {
File[] fs = f.listFiles();
if (fs == null) {
return;
}
for (File file : fs) {
loadClassByPath(root, file.getPath(), list, load);
}
}
}
}
package com.tykj.workflowcore.base.util;
import java.io.*;
/**
* @author HuangXiahao
* @version V1.0
* @class FileUtil
* @packageName com.tykj.workflowcore.base.util
**/
public class FileUtil {
public static File createFileByString(String filePath,String fileString){
File f = null;
try {
f = new File(filePath);
// 判断文件是否存在
if(!f.exists()){
f.createNewFile();
}
} catch (Exception e) {
e.printStackTrace();
}
BufferedReader bufferedReader = null;
BufferedWriter bufferedWriter = null;
try {
bufferedReader = new BufferedReader(new StringReader(fileString));
bufferedWriter = new BufferedWriter(new FileWriter(f));
//字符缓冲区
char buf[] = new char[1024];
int len;
while ((len = bufferedReader.read(buf)) != -1) {
bufferedWriter.write(buf, 0, len);
}
bufferedWriter.flush();
bufferedReader.close();
bufferedWriter.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (bufferedReader != null) {
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return f;
}
}
spring:
datasource:
username: root
password: root
url: jdbc:mysql://127.0.0.1:3306/workflow?useSSL=false&serverTimezone=GMT%2b8&characterEncoding=utf-8&nullCatalogMeansCurrent=true
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
show-sql: true
hibernate:
ddl-auto: update
server:
port: 8800
.processManage[data-v-78f92573] .el-form-item__label{font-size:18px}.topDiv[data-v-78f92573]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;cursor:pointer}.title[data-v-78f92573]{font-size:22px;color:#35435e;font-weight:700;margin-bottom:20px}.addProcess[data-v-78f92573]{font-size:18px;color:#2a3db3;border:1px solid #2a3db3;width:136px;height:36px;border-radius:18px;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;background-color:#fff}.main[data-v-78f92573]{height:calc(100% - 134px);background-color:#fff}.searchBar[data-v-78f92573] .el-form-item{margin-bottom:0}.searchBar[data-v-78f92573] .el-form-item__content{line-height:0}.searchBar[data-v-78f92573] .el-input__inner,.searchBar[data-v-78f92573] .el-select .el-input__inner{background:#f9fafd;border:1px solid #ebedf1;font-size:18px;color:#a1a8ba}.processManage[data-v-78f92573] .el-input__inner:focus,.processManage[data-v-78f92573] .el-textarea__inner:focus{background-color:#fdfdfd;border:1px solid #a8b0e2;font-size:18px;color:#35435e}.searchBar[data-v-78f92573]{background-color:#fff;width:100%;height:84px;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);border-radius:4px;margin-bottom:20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box}.searchBtn[data-v-78f92573]{width:120px;height:40px;font-size:20px;color:#fff;background-color:#2a3db3;border:none;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:4px}.searchBtn[data-v-78f92573]:nth-child(2){background-color:#f9fafd;color:#394b6b;border:1px solid #e8eaf0;cursor:pointer;margin-left:20px}.searchBtn[data-v-78f92573]:nth-child(2):hover{background-color:#eef1f9}.addBtn[data-v-78f92573]{width:120px;height:40px;font-size:20px;color:#fff;background-color:#2a3db3;border:none;cursor:pointer;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-left:20px;border-radius:4px}.addBtn[data-v-78f92573]:first-child{background-color:#f9fafd;color:#394b6b;border:1px solid #e8eaf0;cursor:pointer}.addBtn[data-v-78f92573]:hover{background-color:rgba(42,61,179,.8)}.addBtn[data-v-78f92573]:first-child:hover{background-color:rgba(238,241,249,.8)}.addProcessDialog[data-v-78f92573] .el-input__inner,.addProcessDialog[data-v-78f92573] .el-textarea__inner{font-size:18px;background-color:#f9fafd}.operation span[data-v-78f92573]{font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;width:50px;display:inline-block}.operation span[data-v-78f92573]:first-child{color:#2a3db3}.operation span[data-v-78f92573]:nth-child(3){color:#f25742}.disableSpan[data-v-78f92573]{color:#fe7001}.processManage[data-v-78f92573] .el-dialog__body{padding:30px 40px 10px 40px}.processManage[data-v-78f92573] .el-dialog__footer{padding:10px 40px 30px}
\ No newline at end of file
.main[data-v-33cb2b2c]{background-color:#fff;height:100%}
\ No newline at end of file
#process[data-v-cd5066ac]{height:100%}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
.searchBar[data-v-4f65c0ad]{background-color:#fff;width:100%;height:84px;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.addOutsideTableDialog[data-v-4f65c0ad] .el-dialog__header,.searchBar[data-v-4f65c0ad]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.addOutsideTableDialog[data-v-4f65c0ad] .el-dialog__header{background:#e0e8ff;height:36px;padding:10px}.addOutsideTableDialog[data-v-4f65c0ad] .el-dialog__header>.el-dialog__title{font-size:22px;color:#35435e;font-weight:700;margin-left:30px}.addOutsideTableDialog[data-v-4f65c0ad] .el-dialog__header>.el-dialog__headerbtn>i{border-radius:50%;background:#2a3db3;color:#fff;font-size:22px}.addProcessDialog[data-v-4f65c0ad] .el-input__inner,.addProcessDialog[data-v-4f65c0ad] .el-textarea__inner{font-size:20px;background-color:#f9fafd}.ty_padding_left_right[data-v-4f65c0ad]{padding:0 36px}.checkModel[data-v-4f65c0ad]{width:100%;height:60px;display:-webkit-box;display:-ms-flexbox;display:flex}.ty_lable[data-v-4f65c0ad]{font-size:20px;color:#606266;line-height:60px;white-space:nowrap}.checkModel_select[data-v-4f65c0ad]{-webkit-box-flex:1;-ms-flex:1;flex:1;height:36px;margin-top:10px;padding-left:16px;padding-right:6px}.checkModel_select[data-v-4f65c0ad] .el-select{width:100%;height:40px;background:#f9fafd;border:1px solid #ebedf1;font-size:20px;color:#a1a8ba;border-radius:3px}.checkModel_select[data-v-4f65c0ad] .el-select .el-input__inner{border:0;font-size:20px}.check_byte[data-v-4f65c0ad]{display:-webkit-box;display:-ms-flexbox;display:flex}.table_wrap[data-v-4f65c0ad]{width:calc(100% - 40px);-webkit-box-flex:1;-ms-flex:1;flex:1;margin-top:0;padding-left:16px}.addDataModel[data-v-5f9842d4]{height:100%}.addDataModel[data-v-5f9842d4] .el-form-item__label{font-size:20px}.searchBar[data-v-5f9842d4] .el-col{margin:10px 0}.searchBar[data-v-5f9842d4] .el-form-item{margin-bottom:0}.searchBar[data-v-5f9842d4] .el-form-item__content{line-height:0}.searchBar[data-v-5f9842d4] .el-input__inner,.searchBar[data-v-5f9842d4] .el-select .el-input__inner{background:#f9fafd;border:1px solid #ebedf1;font-size:20px;color:#a1a8ba}.searchBar[data-v-5f9842d4] .el-input__inner:focus{background-color:#fdfdfd;border:1px solid #a8b0e2;font-size:20px;color:#35435e}.searchBar[data-v-5f9842d4]{background-color:#fff;width:100%;height:160px;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);border-radius:4px;margin-bottom:20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box}.basicObject[data-v-5f9842d4]{font-size:20px;color:#606266;line-height:40px;display:-webkit-box;display:-ms-flexbox;display:flex}.basicObject_input[data-v-5f9842d4]{position:relative;width:60%;margin-left:10px}.basicObject_input input[data-v-5f9842d4]{width:98%;background:#f9fafd;border:1px solid #ebedf1;font-size:20px;color:#a1a8ba;height:37px;line-height:37px;border-radius:3px;margin:0;padding-left:16px}.basicObject_input input.active.focus[data-v-5f9842d4],.basicObject_input input.active[data-v-5f9842d4]:focus,.basicObject_input input.focus[data-v-5f9842d4],.basicObject_input input:active.focus[data-v-5f9842d4],.basicObject_input input[data-v-5f9842d4]:active:focus,.basicObject_input input[data-v-5f9842d4]:focus{outline:none;border-color:#ebedf1;-webkit-box-shadow:none;box-shadow:none}.icon_more[data-v-5f9842d4]{background:#fff;right:-13px}.icon-circle-close[data-v-5f9842d4],.icon_more[data-v-5f9842d4]{font-size:20px;width:37px;height:36px;border:0;color:#606266;position:absolute;cursor:pointer;top:3px;border-radius:3px}.icon-circle-close[data-v-5f9842d4]{background:transparent;right:36px}.icon_more.active.focus[data-v-5f9842d4],.icon_more.active[data-v-5f9842d4]:focus,.icon_more.focus[data-v-5f9842d4],.icon_more:active.focus[data-v-5f9842d4],.icon_more[data-v-5f9842d4]:active:focus,.icon_more[data-v-5f9842d4]:focus{outline-color:#2a3db3;outline-width:1px;-webkit-box-shadow:none;box-shadow:none}.ty_span_name[data-v-5f9842d4]{font-size:20px;line-height:40px;color:#a1a8ba}
\ No newline at end of file
#dataModel[data-v-37e3475c]{height:100%}
\ No newline at end of file
.dataModelManage[data-v-617021e3] .el-form-item__label{font-size:18px}.main[data-v-617021e3]{height:calc(100% - 134px);background-color:#fff}.searchBar[data-v-617021e3] .el-form-item{margin-bottom:0}.searchBar[data-v-617021e3] .el-form-item__content{line-height:0}.searchBar[data-v-617021e3] .el-input__inner,.searchBar[data-v-617021e3] .el-select .el-input__inner{background:#f9fafd;border:1px solid #ebedf1;font-size:18px;color:#a1a8ba}.searchBar[data-v-617021e3] .el-input__inner:focus{background-color:#fdfdfd;border:1px solid #a8b0e2;font-size:18px;color:#35435e}.searchBar[data-v-617021e3]{background-color:#fff;width:100%;height:84px;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);border-radius:4px;margin-bottom:20px;-webkit-box-sizing:border-box;box-sizing:border-box}.border-wrap[data-v-617021e3],.searchBar[data-v-617021e3]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.border-wrap[data-v-617021e3]{margin-top:20px}.addProcessDialog[data-v-617021e3] .el-input__inner,.addProcessDialog[data-v-617021e3] .el-textarea__inner{font-size:20px;background-color:#f9fafd}.operation span[data-v-617021e3]{font-size:20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;width:50px;display:inline-block}.operation span[data-v-617021e3]:first-child{color:#2a3db3}.operation span[data-v-617021e3]:nth-child(2){margin:0 20px}.operation span[data-v-617021e3]:nth-child(3){color:#f25742}.disableSpan[data-v-617021e3]{color:#fe7001}
\ No newline at end of file
.homePage>.el-container[data-v-b002c8dc],.homePage[data-v-b002c8dc],.homePage[data-v-b002c8dc] .el-aside{height:100%}.homePage[data-v-b002c8dc] .menu{height:100%;width:100%;background-color:#2a3db3}.homePage .title[data-v-b002c8dc]{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:34px}.homePage .title span[data-v-b002c8dc]{font-size:35px;font-weight:700;color:#fff;text-align:center;margin:44px 0}.homePage .menuItem[data-v-b002c8dc]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.homePage .menuItem[data-v-b002c8dc],.ItemDiv[data-v-b002c8dc]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ItemDiv[data-v-b002c8dc]{width:228px;height:56px;border-radius:8px;margin:0;margin-bottom:20px;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.itemDivAct[data-v-b002c8dc]{background-color:#fff}.itemDivAct .ItemSpanAct[data-v-b002c8dc]{color:#35435e}.ItemImg[data-v-b002c8dc]{margin-left:20px;margin-right:10px}.ItemSpan[data-v-b002c8dc]{font-size:20px;color:#d7dbe3}.header[data-v-b002c8dc]{width:100%;height:72px!important;padding:0!important;background-color:#f3f2f7}.header>div[data-v-b002c8dc]{width:100%;height:56px;background-color:#fff;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.ty_return[data-v-b002c8dc]{display:inline-block;margin-right:40px;color:#2a3db3!important;cursor:pointer}.main[data-v-b002c8dc] .stripe{background-color:#fcfcfd}.main[data-v-b002c8dc]{background-color:#f3f2f7;padding:12px 32px 32px;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;height:94%;-webkit-box-shadow:0 2px 4px rgba(42,61,179,.1);box-shadow:0 2px 4px rgba(42,61,179,.1);border-radius:4px}.main[data-v-b002c8dc] .el-table .cell{font-size:18px;color:#35435e;line-height:36px;text-align:center}.main[data-v-b002c8dc] .el-table th{background-color:#dde1f3}.main[data-v-b002c8dc] .el-table th>.cell{text-align:center;font-size:16px;background-color:#dde1f3;color:#65728a}.main[data-v-b002c8dc] .el-dialog__header{background:#e0e8ff;height:36px;padding:10px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.main[data-v-b002c8dc] .el-dialog__header>.el-dialog__title{font-size:20px;color:#35435e;font-weight:700;margin-left:30px}.main[data-v-b002c8dc] .el-dialog__header>.el-dialog__headerbtn>i{border-radius:50%;background:#2a3db3;color:#fff;font-size:22px}.main[data-v-b002c8dc] .el-dialog{border-radius:6px;-webkit-box-shadow:4px 4px 8px rgba(42,61,179,.2);box-shadow:4px 4px 8px rgba(42,61,179,.2)}.homePage[data-v-b002c8dc] .el-dialog__header{border-radius:6px}.main[data-v-b002c8dc] .el-dialog__header>.el-dialog__headerbtn:hover{opacity:.6}.main[data-v-b002c8dc] .el-table td{border-bottom:1px solid #e7ebfc}.main[data-v-b002c8dc] .el-table td,.main[data-v-b002c8dc] .el-table th{padding:8px 0!important}.main[data-v-b002c8dc] .el-table tr:hover>td{background-color:#98a9e1!important}.main[data-v-b002c8dc] .el-table__body tr:hover :not(input,i){color:#fff!important}.time[data-v-b002c8dc]{height:80px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.time span[data-v-b002c8dc]{font-size:18px;color:#65728a;margin-left:34px}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!doctype html><html lang="zh"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=0,maximum-scale=0,user-scalable=yes,shrink-to-fit=no"><link rel="icon" href="favicon.ico"><title>workFlow</title><style>.pre-loader{position:absolute;top:calc(50% - 32px);left:calc(50% - 32px);width:64px;height:64px;border-radius:50%;perspective:800px}.pre-loader .inner{position:absolute;box-sizing:border-box;width:100%;height:100%;border-radius:50%}.pre-loader .inner.one{left:0;top:0;-webkit-animation:rotate-one 1s linear infinite;animation:rotate-one 1s linear infinite;border-bottom:3px solid #bc9048}.pre-loader .inner.two{right:0;top:0;-webkit-animation:rotate-two 1s linear infinite;animation:rotate-two 1s linear infinite;border-right:3px solid #74aeff}.pre-loader .inner.three{right:0;bottom:0;-webkit-animation:rotate-three 1s linear infinite;animation:rotate-three 1s linear infinite;border-top:3px solid #caef74}@keyframes rotate-one{0%{-webkit-transform:rotateX(35deg) rotateY(-45deg) rotateZ(0);transform:rotateX(35deg) rotateY(-45deg) rotateZ(0)}100%{-webkit-transform:rotateX(35deg) rotateY(-45deg) rotateZ(360deg);transform:rotateX(35deg) rotateY(-45deg) rotateZ(360deg)}}@keyframes rotate-two{0%{-webkit-transform:rotateX(50deg) rotateY(10deg) rotateZ(0);transform:rotateX(50deg) rotateY(10deg) rotateZ(0)}100%{-webkit-transform:rotateX(50deg) rotateY(10deg) rotateZ(360deg);transform:rotateX(50deg) rotateY(10deg) rotateZ(360deg)}}@keyframes rotate-three{0%{-webkit-transform:rotateX(35deg) rotateY(55deg) rotateZ(0);transform:rotateX(35deg) rotateY(55deg) rotateZ(0)}100%{-webkit-transform:rotateX(35deg) rotateY(55deg) rotateZ(360deg);transform:rotateX(35deg) rotateY(55deg) rotateZ(360deg)}}</style><link href="https://lib.baomitu.com/element-ui/2.13.2/theme-chalk/index.css" rel="stylesheet"><link href="https://lib.baomitu.com/monaco-editor/0.19.3/min/vs/editor/editor.main.css" rel="stylesheet"><script src="https://lib.baomitu.com/vue/2.6.11/vue.min.js"></script><script src="https://lib.baomitu.com/vue-router/3.1.3/vue-router.min.js"></script><script src="https://lib.baomitu.com/element-ui/2.13.2/index.js"></script><link href="css/chunk-3490531b.f21179c2.css" rel="prefetch"><link href="css/chunk-79a2a6d4.f7ea5f40.css" rel="prefetch"><link href="css/chunk-7c52297c.61b80532.css" rel="prefetch"><link href="css/chunk-96416bc8.6faf6191.css" rel="prefetch"><link href="css/chunk-afb8fb42.15b2225c.css" rel="prefetch"><link href="css/chunk-b5da06ba.7a6ae39b.css" rel="prefetch"><link href="css/chunk-d7adda04.ef613c84.css" rel="prefetch"><link href="css/parser-home.137a6b9f.css" rel="prefetch"><link href="css/tinymce-example.0e433876.css" rel="prefetch"><link href="js/chunk-3490531b.dccf3627.js" rel="prefetch"><link href="js/chunk-79a2a6d4.b1d5b12d.js" rel="prefetch"><link href="js/chunk-7c52297c.c0a80b51.js" rel="prefetch"><link href="js/chunk-96416bc8.de387df8.js" rel="prefetch"><link href="js/chunk-afb8fb42.5673b2e6.js" rel="prefetch"><link href="js/chunk-b5da06ba.6d3fd328.js" rel="prefetch"><link href="js/chunk-d7adda04.cddad5a4.js" rel="prefetch"><link href="js/chunk-fec0be80.0583a8a1.js" rel="prefetch"><link href="js/parser-home.8d475fe7.js" rel="prefetch"><link href="js/tinymce-example.0cafa1e6.js" rel="prefetch"><link href="css/index.72f7c174.css" rel="preload" as="style"><link href="js/chunk-vendors.b6d9e7af.js" rel="preload" as="script"><link href="js/index.80b1be28.js" rel="preload" as="script"><link href="css/index.72f7c174.css" rel="stylesheet"></head><body><noscript><strong>抱歉,javascript被禁用,请开启后重试。</strong></noscript><div id="app"></div><div class="pre-loader" id="pre-loader"><div class="inner one"></div><div class="inner two"></div><div class="inner three"></div></div><script src="js/chunk-vendors.b6d9e7af.js"></script><script src="js/index.80b1be28.js"></script></body></html>
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3490531b"],{"3b5b":function(e,t,a){"use strict";a("ea1e")},b3a2:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"processManage",staticStyle:{height:"100%"}},[a("div",{staticClass:"topDiv"},[a("span",{staticClass:"title"},[e._v("流程管理")]),a("button",{staticClass:"addProcess",on:{click:e.openAddProcessDialog}},[e._v("新建流程")])]),a("div",{staticClass:"searchBar"},[a("el-form",{ref:"form",staticStyle:{width:"100%"},attrs:{model:e.searchForm,"label-width":"130px"}},[a("el-row",[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"流程名:"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入"},model:{value:e.searchForm.name,callback:function(t){e.$set(e.searchForm,"name",t)},expression:"searchForm.name"}})],1)],1),a("el-col",{staticStyle:{"margin-left":"20px"},attrs:{span:6}},[a("el-form-item",{attrs:{label:"是否启用:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:e.searchForm.disable,callback:function(t){e.$set(e.searchForm,"disable",t)},expression:"searchForm.disable"}},[a("el-option",{attrs:{label:"是",value:0}}),a("el-option",{attrs:{label:"否",value:1}})],1)],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",[a("button",{staticClass:"searchBtn",on:{click:e.searchData}},[e._v("查询")]),a("button",{staticClass:"searchBtn",on:{click:e.reset}},[e._v("重置")])])],1)],1)],1)],1),a("div",{staticClass:"main"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,"row-class-name":function(e){e.row;var t=e.rowIndex;return t%2==0?"":"stripe"}}},[a("el-table-column",{attrs:{type:"index",label:"序号",width:"100"}}),a("el-table-column",{attrs:{prop:"flowName",label:"流程名"}}),a("el-table-column",{attrs:{prop:"flowDescribe",label:"流程描述"}}),a("el-table-column",{attrs:{prop:"createdTime",label:"创建时间"}}),a("el-table-column",{attrs:{label:"是否启用"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(1==t.row.state?"暂停":"启用"))])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"350"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"operation"},[a("span",{on:{click:function(a){return e.editProcess(t.row)}}},[e._v("编辑")]),a("span",{on:{click:function(a){return e.deleteProcess(t.row)}}},[e._v("删除")])])]}}])})],1),a("el-pagination",{staticStyle:{"text-align":"right","margin-right":"20px","margin-top":"30px"},attrs:{background:"",layout:"prev, pager, next",total:e.totalPages,"prev-text":"上一页","next-text":"下一页"},on:{"current-change":e.pageChange}}),a("el-dialog",{staticClass:"addProcessDialog",attrs:{title:"新增流程",visible:e.addProcessDialog,width:"30%","before-close":e.handleClose,top:"20vh"},on:{"update:visible":function(t){e.addProcessDialog=t}}},[a("el-form",{ref:"addForm",staticStyle:{width:"100%"},attrs:{rules:e.addFormRules,model:e.addForm,"label-width":"120px"}},[a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"流程名:",prop:"flowName"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入"},model:{value:e.addForm.flowName,callback:function(t){e.$set(e.addForm,"flowName",t)},expression:"addForm.flowName"}})],1)],1)],1),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"流程描述:",prop:"flowDescribe"}},[a("el-input",{staticStyle:{width:"100%"},attrs:{type:"textarea",autosize:{minRows:4,maxRows:4},placeholder:"请输入"},model:{value:e.addForm.flowDescribe,callback:function(t){e.$set(e.addForm,"flowDescribe",t)},expression:"addForm.flowDescribe"}})],1)],1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("button",{staticClass:"addBtn",on:{click:e.handleClose}},[e._v("取消")]),a("button",{staticClass:"addBtn",on:{click:e.submitProcess}},[e._v("提交")])])],1)],1)])},o=[],l=(a("b0c0"),a("d3b7"),a("ac1f"),a("25f0"),a("5319"),{name:"processManage",data:function(){return{searchForm:{},addProcessDialog:!1,totalPages:0,nowPage:0,addForm:{},addFormRules:{flowName:[{required:!0,message:"请输入流程名称",trigger:"blur"}],flowDescribe:[{required:!0,message:"请输入流程描述",trigger:"blur"}]},tableData:[]}},created:function(){this.getAllProcessData()},methods:{getDate:function(e){var t=new Date(e),a=t.getFullYear()+"-",s=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",o=t.getDate()<10?"0"+t.getDate():t.getDate(),l=(t.getHours()<10?"0"+t.getHours():t.getHours())+":",r=(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":",n=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return a+s+o+" "+l+r+n},submitProcess:function(){var e=this;this.$refs.addForm.validate((function(t){if(!t)return console.log("error submit!!"),!1;var a=e.guid();e.addForm.flowKey="process_".concat(a),console.log(e.addForm),e.$axios.addProcess(e.addForm).then((function(t){e.$message.success("流程创建成功"),e.$router.push({path:"./processEdit",query:{processId:t.data.data}}),e.addProcessDialog=!1})).catch((function(e){console.log(e)}))}))},getAllProcessData:function(e){var t=this;this.$axios.getAllProcessData({size:9,page:e,flowName:this.searchForm.name,state:this.searchForm.disable}).then((function(e){var a=e.data.content;t.totalPages=10*e.data.totalPages,t.tableData=a})).catch((function(e){console.log(e)}))},handleClose:function(){this.$refs.addForm.resetFields(),this.addProcessDialog=!1},openAddProcessDialog:function(){this.addProcessDialog=!0},searchData:function(){this.getAllProcessData()},reset:function(){this.searchForm={}},pageChange:function(e){this.nowPage=e-1,this.getAllProcessData(e-1)},editProcess:function(e){this.$router.push({path:"./processEdit",query:{processId:e.id}})},deleteProcess:function(e){var t=this;this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){0==e.state?t.$message({showClose:!0,message:"该流程正在启用,请先暂停后再删除",type:"error"}):t.$axios.deleteProcess({id:e.id}).then((function(e){t.$message.success("删除成功"),t.getAllProcessData(t.nowPage)})).catch((function(e){console.log(e)}))})).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0,a="x"==e?t:3&t|8;return a.toString(16)}))}}}),r=l,n=(a("3b5b"),a("2877")),c=Object(n["a"])(r,s,o,!1,null,"78f92573",null);t["default"]=c.exports},ea1e:function(e,t,a){}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79a2a6d4"],{"0f1d":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticStyle:{height:"100%"}},[a("div",{staticClass:"main"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData,"row-class-name":function(t){t.row;var e=t.rowIndex;return e%2==0?"":"stripe"}}},[a("el-table-column",{attrs:{type:"index",label:"序号",width:"100"}}),a("el-table-column",{attrs:{prop:"flowName",label:"流程名"}}),a("el-table-column",{attrs:{prop:"flowDescribe",label:"流程描述"}}),a("el-table-column",{attrs:{prop:"createdTime",label:"创建时间"}}),a("el-table-column",{attrs:{label:"是否启用"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(1==e.row.state?"暂停":"启用"))])]}}])}),a("el-table-column",{attrs:{label:"操作",width:"350"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"operation"},[a("span",{on:{click:function(a){return t.editProcess(e.row)}}},[t._v("编辑")]),a("span",{class:1!=e.row.state?"disableSpan":"",on:{click:function(a){return t.disableProcess(e.row.id)}}},[t._v(t._s(1==e.row.state?"启用":"暂停"))]),a("span",{on:{click:function(a){return t.deleteProcess(e.row)}}},[t._v("删除")])])]}}])})],1),a("el-pagination",{staticStyle:{"text-align":"right","margin-right":"20px","margin-top":"30px"},attrs:{background:"",layout:"prev, pager, next",total:t.totalPages,"prev-text":"上一页","next-text":"下一页"},on:{"current-change":t.pageChange}})],1)])},s=[],o=(a("b0c0"),{name:"searchFlowInfo",data:function(){return{totalPages:0,tableData:[],searchForm:{},nowPage:0}},created:function(){this.getProcessData()},methods:{getProcessData:function(t){var e=this;this.$axios.getProcessData({size:9,page:t,flowName:this.searchForm.name,state:this.searchForm.disable}).then((function(t){var a=t.data.content;e.totalPages=10*t.data.totalPages,e.tableData=a})).catch((function(t){console.log(t)}))},pageChange:function(t){this.nowPage=t-1,this.getProcessData(t-1)}}}),r=o,l=(a("c858"),a("2877")),c=Object(l["a"])(r,n,s,!1,null,"33cb2b2c",null);e["default"]=c.exports},"7c02":function(t,e,a){},c858:function(t,e,a){"use strict";a("7c02")}}]);
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7c52297c"],{"4d46":function(e,t,c){},"64f1":function(e,t,c){"use strict";c.r(t);var n=function(){var e=this,t=e.$createElement,c=e._self._c||t;return c("div",{attrs:{id:"process"}},[c("keep-alive",{attrs:{include:"processEdit"}},[c("router-view")],1)],1)},s=[],r={name:"process"},i=r,a=(c("760a"),c("2877")),u=Object(a["a"])(i,n,s,!1,null,"cd5066ac",null);t["default"]=u.exports},"760a":function(e,t,c){"use strict";c("4d46")}}]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论