Browse Source

自定义表单

master
周宇 5 months ago
parent
commit
7238c00b4b
  1. 8
      flysoft-admin/pom.xml
  2. 9
      flysoft-admin/src/main/resources/static/formCustom/avue/avue.min.js
  3. BIN
      flysoft-admin/src/main/resources/static/formCustom/avue/fonts/codicon.805fb6ad.ttf
  4. 1
      flysoft-admin/src/main/resources/static/formCustom/avue/index.css
  5. 17
      flysoft-admin/src/main/resources/static/formCustom/avue/index.umd.min.js
  6. 2
      flysoft-admin/src/main/resources/static/formCustom/axios.min.js
  7. 29
      flysoft-admin/src/main/resources/static/formCustom/common.js
  8. 1
      flysoft-admin/src/main/resources/static/formCustom/element-ui/index.js
  9. BIN
      flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/fonts/element-icons.ttf
  10. BIN
      flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/fonts/element-icons.woff
  11. 1
      flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/index.css
  12. BIN
      flysoft-admin/src/main/resources/static/formCustom/fonts/codicon.805fb6ad.ttf
  13. 13
      flysoft-admin/src/main/resources/static/formCustom/formCustom.css
  14. 140
      flysoft-admin/src/main/resources/static/formCustom/request.js
  15. 11
      flysoft-admin/src/main/resources/static/formCustom/vue.min.js
  16. 34
      flysoft-admin/src/main/resources/templates/include.html
  17. 56
      flysoft-customform/pom.xml
  18. 2732
      flysoft-customform/src/main/java/com/flysoft/customform/controller/PublicCustomFormController.java
  19. 236
      flysoft-customform/src/main/java/com/flysoft/customform/domain/PublicCustomForm.java
  20. 144
      flysoft-customform/src/main/java/com/flysoft/customform/domain/PublicCustomFormBase.java
  21. 17
      flysoft-customform/src/main/java/com/flysoft/customform/dto/PublicCustomFormDto.java
  22. 20
      flysoft-customform/src/main/java/com/flysoft/customform/mapper/PublicCustomFormMapper.java
  23. 21
      flysoft-customform/src/main/java/com/flysoft/customform/service/PublicCustomFormService.java
  24. 44
      flysoft-customform/src/main/java/com/flysoft/customform/service/impl/PublicCustomFormServiceImpl.java
  25. 10
      flysoft-customform/src/main/java/com/flysoft/customform/vo/PublicCustomFormVo.java
  26. 256
      flysoft-customform/src/main/resources/mapper/customform/PublicCustomFormMapper.xml
  27. 1293
      flysoft-customform/src/main/resources/templates/customform/publicCustomForm/toAdd.html
  28. 55
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/controller/FormsCustomController.java
  29. 27
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/domain/WorkFlowForms.java
  30. 8
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/mapper/WorkFlowFormsMapper.java
  31. 13
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/IFormsCustomService.java
  32. 8
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/IWorkFlowFormsService.java
  33. 90
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/impl/FormsCustomServiceImpl.java
  34. 19
      flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/impl/WorkFlowFormsServiceImpl.java
  35. 19
      flysoft-process-configuration/src/main/resources/mapper/processConfiguration/WorkFlowFormsMapper.xml
  36. 105
      flysoft-process-configuration/src/main/resources/templates/processConfiguration/forms/forms.html
  37. 242
      flysoft-process-configuration/src/main/resources/templates/processConfiguration/formsCustom/edit.html
  38. 7
      pom.xml

8
flysoft-admin/pom.xml

@ -223,10 +223,18 @@
<artifactId>flysoft-ganbu-service</artifactId>
</dependency>
<!-- 自定义表单模块 -->
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-customform</artifactId>
</dependency>
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-autherthird</artifactId>
</dependency>
</dependencies>
<build>

9
flysoft-admin/src/main/resources/static/formCustom/avue/avue.min.js vendored

File diff suppressed because one or more lines are too long

BIN
flysoft-admin/src/main/resources/static/formCustom/avue/fonts/codicon.805fb6ad.ttf

Binary file not shown.

1
flysoft-admin/src/main/resources/static/formCustom/avue/index.css

File diff suppressed because one or more lines are too long

17
flysoft-admin/src/main/resources/static/formCustom/avue/index.umd.min.js vendored

File diff suppressed because one or more lines are too long

2
flysoft-admin/src/main/resources/static/formCustom/axios.min.js vendored

File diff suppressed because one or more lines are too long

29
flysoft-admin/src/main/resources/static/formCustom/common.js

@ -0,0 +1,29 @@
// 返回当前激活的Tab页面关联的iframe的Windows对象
function activeWindow() {
var topWindow = $(window.parent.document);
var currentId = $('.page-tabs-content', topWindow).find('.active').attr('data-id');
if (!currentId) {
return window.parent;
}
return $('.RuoYi_iframe[data-id="' + currentId + '"]', topWindow)[0].contentWindow;
}
// 判断字符串是否为空
function isEmpty(value) {
if (value == null || this.trim(value) == "") {
return true;
}
return false;
}
// 判断一个字符串是否为非空串
function isNotEmpty(value) {
return !isEmpty(value);
}
// 空格截取
function trim(value) {
if (value == null) {
return "";
}
return value.toString().replace(/(^\s*)|(\s*$)|\r|\n/g, "");
}

1
flysoft-admin/src/main/resources/static/formCustom/element-ui/index.js

File diff suppressed because one or more lines are too long

BIN
flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/fonts/element-icons.ttf

Binary file not shown.

BIN
flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/fonts/element-icons.woff

Binary file not shown.

1
flysoft-admin/src/main/resources/static/formCustom/element-ui/theme-chalk/index.css

File diff suppressed because one or more lines are too long

BIN
flysoft-admin/src/main/resources/static/formCustom/fonts/codicon.805fb6ad.ttf

Binary file not shown.

13
flysoft-admin/src/main/resources/static/formCustom/formCustom.css

@ -0,0 +1,13 @@
.el-collapse {
border-top: 0px solid #EBEEF5;
border-bottom: 0px solid #EBEEF5;
}
.el-collapse-item__wrap {
border-bottom: 0px solid #EBEEF5;
}
.el-collapse-item__header.is-active {
display: none;
}

140
flysoft-admin/src/main/resources/static/formCustom/request.js

@ -0,0 +1,140 @@
function request(url,data){
const params = new URLSearchParams();
if(data!=null){
for(let key in data){
params.append(key, data[key]);
}
}
return service({
url: url,
method: 'post',
data: params,
})
}
axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'
// 创建axios实例
const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分
baseURL: ctx,
// 超时 毫秒
timeout: 10000,
})
let loading;
// request拦截器
service.interceptors.request.use(config => {
if(loading==null){
loading = app.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
}
//config.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
//config.headers.Accept = 'application/x-www-form-urlencoded;charset=utf-8';
// get请求映射params参数
if (config.method === 'get' && config.params) {
let url = config.url + '?';
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
var part = encodeURIComponent(propName) + "=";
if (value !== null && typeof(value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
var subPart = encodeURIComponent(params) + "=";
url += subPart + encodeURIComponent(value[key]) + "&";
}
} else {
url += part + encodeURIComponent(value) + "&";
}
}
}
url = url.slice(0, -1);
config.params = {};
config.url = url;
}
return config
}, error => {
if(loading!=null){
loading.close();
loading=null;
}
app.$message.error(error)
console.log(error)
Promise.reject(error)
})
// 响应拦截器
service.interceptors.response.use(res => {
if(loading!=null){
loading.close();
loading=null;
}
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 获取错误信息
const msg = res.data.msg;
//登录超时
if (code === 1) {
app.$message.error(msg)
return Promise.reject(new Error(msg))
//Toast.fail('登录状态已过期,请重新登录');
/* store.dispatch('LogOut').then(() => {
router.push({path:"/login"}).catch(()=>{});
})*/
/*MessageBox.confirm('', '', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
store.dispatch('LogOut').then(() => {
location.href = '/index';
})
}).catch(() => {});*/
}
//警告
else if (code === 301) {
app.$message.error(msg)
return Promise.reject(new Error(msg))
}
//错误
else if (code === 500) {
app.$message.error(msg)
return Promise.reject(new Error(msg))
}
//其他错误
else if (code !== 200) {
app.$message.error(msg)
return Promise.reject('error')
} else {
return res.data
}
},
error => {
if(loading!=null){
loading.close();
loading=null;
}
console.log('err' + error)
let { message } = error;
if (message == "Network Error") {
message = "后端接口连接异常";
}
else if (message.includes("timeout")) {
message = "系统接口请求超时";
}
else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
app.$message.error(message)
return Promise.reject(error)
})

11
flysoft-admin/src/main/resources/static/formCustom/vue.min.js vendored

File diff suppressed because one or more lines are too long

34
flysoft-admin/src/main/resources/templates/include.html

@ -223,3 +223,37 @@
<div th:fragment="flysoft-common-js">
<script th:src="@{/flysoft/flysoft-common.js}"></script>
</div>
<!-- vue通用CSS -->
<head th:fragment=vue-header(title)>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="">
<meta name="description" content="">
<title th:text="${title}"></title>
<link th:href="@{/formCustom/avue/index.css}" rel="stylesheet"/>
<link th:href="@{/formCustom/element-ui/theme-chalk/index.css}" rel="stylesheet"/>
<link th:href="@{/formCustom/formCustom.css}" rel="stylesheet"/>
</head>
<!-- vue通用JS -->
<div th:fragment="vue-footer">
<script th:inline="javascript">
var ctx = [[@{/}]]; var lockscreen = [[${session.lockscreen}]]; if(lockscreen){window.top.location=ctx+"lockscreen";}
var profileDownload = [[${profileDownload}]];
/** 远程访问文件下载通用方法 */
function remoteDownload(fileUrl,fileName) {
window.location.href=profileDownload+'&filePath='+fileUrl+'&fileName='+encodeURI(encodeURI(fileName));
}
</script>
<script th:src="@{/formCustom/vue.min.js}"></script>
<script th:src="@{/formCustom/element-ui/index.js}"></script>
<script th:src="@{/formCustom/avue/avue.min.js}"></script>
<script th:src="@{/formCustom/avue/index.umd.min.js}"></script>
<script th:src="@{/formCustom/axios.min.js}"></script>
<script th:src="@{/formCustom/request.js}" ></script>
<script th:src="@{/formCustom/common.js}" ></script>
</div>

56
flysoft-customform/pom.xml

@ -0,0 +1,56 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>flysoft</artifactId>
<groupId>com.flysoft</groupId>
<version>4.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>flysoft-customform</artifactId>
<description>
自定义表单模块
</description>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- 通用工具-->
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-common</artifactId>
</dependency>
<!-- 核心模块-->
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-framework</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.1.7.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-process-configuration</artifactId>
</dependency>
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-document</artifactId>
</dependency>
</dependencies>
</project>

2732
flysoft-customform/src/main/java/com/flysoft/customform/controller/PublicCustomFormController.java

File diff suppressed because it is too large Load Diff

236
flysoft-customform/src/main/java/com/flysoft/customform/domain/PublicCustomForm.java

@ -0,0 +1,236 @@
package com.flysoft.customform.domain;
import lombok.Data;
import java.util.Date;
@Data
public class PublicCustomForm extends PublicCustomFormBase{
/**
* 主键id
*/
private String id;
/**
* 自定义表单表单设计json
*/
private String customJson;
/**
* 自定义表单表单数据
*/
private String customData;
/**
* 文档状态 1拟稿 2流转中 3归档
*/
private String wjstate;
/**
* 流程id
*/
private String flowid;
/**
* 流程名称
*/
private String subflowFlowname;
/**
* 创建人单位id
*/
private String createUserdwid;
/**
* 创建人岗位id
*/
private String createUsergwid;
/**
* 创建人id
*/
private String createUserid;
/**
* 归档时间
*/
private Date archdate;
/**
* 文档经办人
*/
private String doneman;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 表单类型(显示业务表基础表名)
*/
private String businessType;
/**
* 内部公开 0不公开 1公开 2 按角色人员公开
*/
private String isPublic;
/**
* 角色id
*/
private String roleid;
/**
* 内部公开单位id
*/
private String unitId;
/**
* 业务控制层路径
*/
private String formDetailUrl;
/**
* 是否需要归档 0不归档1归档
*/
private String isGuid;
/** 历史意见1 */
private String fqyjx1;
/** 意见1 */
private String flow_yj1;
/** 历史意见2 */
private String fqyjx2;
/** 意见2 */
private String flow_yj2;
/** 历史意见3 */
private String fqyjx3;
/** 意见3 */
private String flow_yj3;
/** 历史意见4 */
private String fqyjx4;
/** 意见4 */
private String flow_yj4;
/** 历史意见5 */
private String fqyjx5;
/** 意见5 */
private String flow_yj5;
/** 历史意见6 */
private String fqyjx6;
/** 意见6 */
private String flow_yj6;
/** 历史意见7 */
private String fqyjx7;
/** 意见7 */
private String flow_yj7;
/** 历史意见8 */
private String fqyjx8;
/** 意见8 */
private String flow_yj8;
/** 历史意见9 */
private String fqyjx9;
/** 意见9 */
private String flow_yj9;
/** 历史意见10 */
private String fqyjx10;
/** 意见10 */
private String flow_yj10;
/** 历史意见11 */
private String fqyjx11;
/** 意见11 */
private String flow_yj11;
/** 历史意见12 */
private String fqyjx12;
/** 意见12 */
private String flow_yj12;
/** 历史意见13 */
private String fqyjx13;
/** 意见13 */
private String flow_yj13;
/** 历史意见14 */
private String fqyjx14;
/** 意见14 */
private String flow_yj14;
/** 历史意见15 */
private String fqyjx15;
/** 意见15 */
private String flow_yj15;
/** 历史意见16 */
private String fqyjx16;
/** 意见16 */
private String flow_yj16;
/** 历史意见17 */
private String fqyjx17;
/** 意见17 */
private String flow_yj17;
/** 历史意见18 */
private String fqyjx18;
/** 意见18 */
private String flow_yj18;
/** 历史意见19 */
private String fqyjx19;
/** 意见19 */
private String flow_yj19;
/** 历史意见20 */
private String fqyjx20;
/** 意见20 */
private String flow_yj20;
}

144
flysoft-customform/src/main/java/com/flysoft/customform/domain/PublicCustomFormBase.java

@ -0,0 +1,144 @@
package com.flysoft.customform.domain;
import com.flysoft.common.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 其他页面使用字段不在表单中存取
*/
@Data
public class PublicCustomFormBase {
/** 历史意见1 */
@Excel(name = "历史意见1")
private String fqyjx1;
/** 意见1 */
@Excel(name = "意见1")
private String flow_yj1;
/** 历史意见2 */
@Excel(name = "历史意见2")
private String fqyjx2;
/** 意见2 */
@Excel(name = "意见2")
private String flow_yj2;
/** 历史意见3 */
@Excel(name = "历史意见3")
private String fqyjx3;
/** 意见3 */
@Excel(name = "意见3")
private String flow_yj3;
/** 历史意见4 */
@Excel(name = "历史意见4")
private String fqyjx4;
/** 意见4 */
@Excel(name = "意见4")
private String flow_yj4;
/** 历史意见5 */
@Excel(name = "历史意见5")
private String fqyjx5;
/** 意见5 */
@Excel(name = "意见5")
private String flow_yj5;
/** 历史意见6 */
private String fqyjx6;
/** 意见6 */
private String flow_yj6;
/** 历史意见7 */
private String fqyjx7;
/** 意见7 */
private String flow_yj7;
/** 历史意见8 */
private String fqyjx8;
/** 意见8 */
private String flow_yj8;
/** 历史意见9 */
private String fqyjx9;
/** 意见9 */
private String flow_yj9;
/** 历史意见10 */
private String fqyjx10;
/** 意见10 */
private String flow_yj10;
/** 历史意见11 */
private String fqyjx11;
/** 意见11 */
private String flow_yj11;
/** 历史意见12 */
private String fqyjx12;
/** 意见12 */
private String flow_yj12;
/** 历史意见13 */
private String fqyjx13;
/** 意见13 */
private String flow_yj13;
/** 历史意见14 */
private String fqyjx14;
/** 意见14 */
private String flow_yj14;
/** 历史意见15 */
private String fqyjx15;
/** 意见15 */
private String flow_yj15;
/** 历史意见16 */
private String fqyjx16;
/** 意见16 */
private String flow_yj16;
/** 历史意见17 */
private String fqyjx17;
/** 意见17 */
private String flow_yj17;
/** 历史意见18 */
private String fqyjx18;
/** 意见18 */
private String flow_yj18;
/** 历史意见19 */
private String fqyjx19;
/** 意见19 */
private String flow_yj19;
/** 历史意见20 */
private String fqyjx20;
/** 意见20 */
private String flow_yj20;
}

17
flysoft-customform/src/main/java/com/flysoft/customform/dto/PublicCustomFormDto.java

@ -0,0 +1,17 @@
package com.flysoft.customform.dto;
import com.flysoft.framework.dto.BasePageDto;
import lombok.Data;
@Data
public class PublicCustomFormDto extends BasePageDto {
private String id;//主键id
private String wjstate;//文档状态 1拟稿 2流转中 3归档
}

20
flysoft-customform/src/main/java/com/flysoft/customform/mapper/PublicCustomFormMapper.java

@ -0,0 +1,20 @@
package com.flysoft.customform.mapper;
import com.flysoft.customform.domain.PublicCustomForm;
import com.flysoft.customform.dto.PublicCustomFormDto;
import com.flysoft.customform.vo.PublicCustomFormVo;
import java.util.List;
public interface PublicCustomFormMapper {
int deleteByPrimaryKey(String id);
int insertSelective(PublicCustomForm record);
PublicCustomFormVo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(PublicCustomForm record);
List<PublicCustomForm> selectList(PublicCustomFormDto record);
}

21
flysoft-customform/src/main/java/com/flysoft/customform/service/PublicCustomFormService.java

@ -0,0 +1,21 @@
package com.flysoft.customform.service;
import com.flysoft.customform.domain.PublicCustomForm;
import com.flysoft.customform.dto.PublicCustomFormDto;
import com.flysoft.customform.vo.PublicCustomFormVo;
import java.util.List;
public interface PublicCustomFormService {
int deleteByPrimaryKey(String id);
int insertSelective(PublicCustomForm record);
PublicCustomFormVo selectByPrimaryKey(String id);
int updateByPrimaryKeySelective(PublicCustomForm record);
List<PublicCustomForm> selectList(PublicCustomFormDto record);
}

44
flysoft-customform/src/main/java/com/flysoft/customform/service/impl/PublicCustomFormServiceImpl.java

@ -0,0 +1,44 @@
package com.flysoft.customform.service.impl;
import com.flysoft.customform.domain.PublicCustomForm;
import com.flysoft.customform.dto.PublicCustomFormDto;
import com.flysoft.customform.mapper.PublicCustomFormMapper;
import com.flysoft.customform.service.PublicCustomFormService;
import com.flysoft.customform.vo.PublicCustomFormVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
@Service
public class PublicCustomFormServiceImpl implements PublicCustomFormService {
@Resource
private PublicCustomFormMapper mapper;
@Override
public int deleteByPrimaryKey(String id) {
return mapper.deleteByPrimaryKey(id);
}
@Override
public int insertSelective(PublicCustomForm record) {
return mapper.insertSelective(record);
}
@Override
public PublicCustomFormVo selectByPrimaryKey(String id) {
return mapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(PublicCustomForm record) {
return mapper.updateByPrimaryKeySelective(record);
}
@Override
public List<PublicCustomForm> selectList(PublicCustomFormDto record) {
return mapper.selectList(record);
}
}

10
flysoft-customform/src/main/java/com/flysoft/customform/vo/PublicCustomFormVo.java

@ -0,0 +1,10 @@
package com.flysoft.customform.vo;
import com.flysoft.customform.domain.PublicCustomForm;
import lombok.Data;
@Data
public class PublicCustomFormVo extends PublicCustomForm {
}

256
flysoft-customform/src/main/resources/mapper/customform/PublicCustomFormMapper.xml

@ -0,0 +1,256 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flysoft.customform.mapper.PublicCustomFormMapper">
<resultMap id="BaseResultMap" type="com.flysoft.customform.vo.PublicCustomFormVo">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="custom_json" jdbcType="VARCHAR" property="customJson" />
<result column="custom_data" jdbcType="VARCHAR" property="customData" />
<result column="wjstate" jdbcType="VARCHAR" property="wjstate" />
<result column="flowid" jdbcType="VARCHAR" property="flowid" />
<result column="subflow_flowname" jdbcType="VARCHAR" property="subflowFlowname" />
<result column="create_userdwid" jdbcType="VARCHAR" property="createUserdwid" />
<result column="create_usergwid" jdbcType="VARCHAR" property="createUsergwid" />
<result column="create_userid" jdbcType="VARCHAR" property="createUserid" />
<result column="archdate" jdbcType="TIMESTAMP" property="archdate" />
<result column="doneman" jdbcType="VARCHAR" property="doneman" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="business_type" jdbcType="VARCHAR" property="businessType" />
<result column="is_public" jdbcType="VARCHAR" property="isPublic" />
<result column="roleid" jdbcType="VARCHAR" property="roleid" />
<result column="unit_id" jdbcType="VARCHAR" property="unitId" />
<result column="form_detail_url" jdbcType="VARCHAR" property="formDetailUrl" />
<result column="is_guid" jdbcType="VARCHAR" property="isGuid" />
</resultMap>
<sql id="Base_Column_List">
id, custom_json, custom_data, wjstate, flowid, subflow_flowname, create_userdwid,
create_usergwid, create_userid, archdate, doneman, create_by, create_time, update_by,
update_time, business_type, is_public, roleid, unit_id, form_detail_url, is_guid
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from public_custom_form
where id = #{id,jdbcType=VARCHAR}
</select>
<select id="selectList" parameterType="com.flysoft.customform.dto.PublicCustomFormDto" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from public_custom_form
<where>
<if test="wjstate!=null and wjstate!=''">
and wjstate=#{wjstate}
</if>
</where>
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from public_custom_form
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insertSelective" parameterType="com.flysoft.customform.domain.PublicCustomForm">
insert into public_custom_form
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="customJson != null">
custom_json,
</if>
<if test="customData != null">
custom_data,
</if>
<if test="wjstate != null">
wjstate,
</if>
<if test="flowid != null">
flowid,
</if>
<if test="subflowFlowname != null">
subflow_flowname,
</if>
<if test="createUserdwid != null">
create_userdwid,
</if>
<if test="createUsergwid != null">
create_usergwid,
</if>
<if test="createUserid != null">
create_userid,
</if>
<if test="archdate != null">
archdate,
</if>
<if test="doneman != null">
doneman,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="businessType != null">
business_type,
</if>
<if test="isPublic != null">
is_public,
</if>
<if test="roleid != null">
roleid,
</if>
<if test="unitId != null">
unit_id,
</if>
<if test="formDetailUrl != null">
form_detail_url,
</if>
<if test="isGuid != null">
is_guid,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="customJson != null">
#{customJson,jdbcType=VARCHAR},
</if>
<if test="customData != null">
#{customData,jdbcType=VARCHAR},
</if>
<if test="wjstate != null">
#{wjstate,jdbcType=VARCHAR},
</if>
<if test="flowid != null">
#{flowid,jdbcType=VARCHAR},
</if>
<if test="subflowFlowname != null">
#{subflowFlowname,jdbcType=VARCHAR},
</if>
<if test="createUserdwid != null">
#{createUserdwid,jdbcType=VARCHAR},
</if>
<if test="createUsergwid != null">
#{createUsergwid,jdbcType=VARCHAR},
</if>
<if test="createUserid != null">
#{createUserid,jdbcType=VARCHAR},
</if>
<if test="archdate != null">
#{archdate,jdbcType=TIMESTAMP},
</if>
<if test="doneman != null">
#{doneman,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="businessType != null">
#{businessType,jdbcType=VARCHAR},
</if>
<if test="isPublic != null">
#{isPublic,jdbcType=VARCHAR},
</if>
<if test="roleid != null">
#{roleid,jdbcType=VARCHAR},
</if>
<if test="unitId != null">
#{unitId,jdbcType=VARCHAR},
</if>
<if test="formDetailUrl != null">
#{formDetailUrl,jdbcType=VARCHAR},
</if>
<if test="isGuid != null">
#{isGuid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.flysoft.customform.domain.PublicCustomForm">
update public_custom_form
<set>
<if test="customJson != null">
custom_json = #{customJson,jdbcType=VARCHAR},
</if>
<if test="customData != null">
custom_data = #{customData,jdbcType=VARCHAR},
</if>
<if test="wjstate != null">
wjstate = #{wjstate,jdbcType=VARCHAR},
</if>
<if test="flowid != null">
flowid = #{flowid,jdbcType=VARCHAR},
</if>
<if test="subflowFlowname != null">
subflow_flowname = #{subflowFlowname,jdbcType=VARCHAR},
</if>
<if test="createUserdwid != null">
create_userdwid = #{createUserdwid,jdbcType=VARCHAR},
</if>
<if test="createUsergwid != null">
create_usergwid = #{createUsergwid,jdbcType=VARCHAR},
</if>
<if test="createUserid != null">
create_userid = #{createUserid,jdbcType=VARCHAR},
</if>
<if test="archdate != null">
archdate = #{archdate,jdbcType=TIMESTAMP},
</if>
<if test="doneman != null">
doneman = #{doneman,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="businessType != null">
business_type = #{businessType,jdbcType=VARCHAR},
</if>
<if test="isPublic != null">
is_public = #{isPublic,jdbcType=VARCHAR},
</if>
<if test="roleid != null">
roleid = #{roleid,jdbcType=VARCHAR},
</if>
<if test="unitId != null">
unit_id = #{unitId,jdbcType=VARCHAR},
</if>
<if test="formDetailUrl != null">
form_detail_url = #{formDetailUrl,jdbcType=VARCHAR},
</if>
<if test="isGuid != null">
is_guid = #{isGuid,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

1293
flysoft-customform/src/main/resources/templates/customform/publicCustomForm/toAdd.html

File diff suppressed because it is too large Load Diff

55
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/controller/FormsCustomController.java

@ -0,0 +1,55 @@
package com.flysoft.processConfiguration.controller;
import com.flysoft.common.core.controller.BaseController;
import com.flysoft.common.core.domain.AjaxResult;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import com.flysoft.processConfiguration.service.IFormsCustomService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.Map;
/**
* 自定义工作流单Controller
*/
@Controller
@RequestMapping("/processConfiguration/formsCustom")
public class FormsCustomController extends BaseController {
private String prefix = "processConfiguration/formsCustom";
@Resource
private IFormsCustomService sev;
/**
* 跳转新增 或者编辑
*/
@GetMapping("/edit")
public String edit(String id, ModelMap mmap) {
mmap.put("id", id);
return prefix + "/edit";
}
/**
* 获取表单信息
*/
@PostMapping("/details")
@ResponseBody
public AjaxResult details(String id) {
Map<String, Object> res = sev.details(id);
return AjaxResult.success(res);
}
/**
* 拷贝表单信息
*/
@PostMapping("/copyForm")
@ResponseBody
public AjaxResult copyForm(String id) {
WorkFlowForms workFlowForms = sev.copyForm(id);
return AjaxResult.success(workFlowForms);
}
}

27
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/domain/WorkFlowForms.java

@ -56,11 +56,38 @@ public class WorkFlowForms extends BaseEntity
@Excel(name = "表单类型(显示业务表基础表名)")
private String formsType;
/**
* 是否表单自定义 1 常规表单 2 自定义表单
*/
private Integer iscustom;
/**
* 自定义表单表单设计json
*/
private String customJson;
//公共表单查询显示
private String createPublicDw;
//创建单位名称
private String createDwName;
public Integer getIscustom() {
return iscustom;
}
public void setIscustom(Integer iscustom) {
this.iscustom = iscustom;
}
public String getCustomJson() {
return customJson;
}
public void setCustomJson(String customJson) {
this.customJson = customJson;
}
public String getCreatePublicDw() {
return createPublicDw;
}

8
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/mapper/WorkFlowFormsMapper.java

@ -1,8 +1,9 @@
package com.flysoft.processConfiguration.mapper;
import java.util.List;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import java.util.List;
/**
* 工作流单Mapper接口
*
@ -65,4 +66,9 @@ public interface WorkFlowFormsMapper
* @return 结果
*/
public int deleteWorkFlowFormsByIds(String[] ids);
/**
* 获取最大序号
*/
public Long selectMaxSort(WorkFlowForms workFlowForms);
}

13
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/IFormsCustomService.java

@ -0,0 +1,13 @@
package com.flysoft.processConfiguration.service;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import java.util.Map;
public interface IFormsCustomService {
Map<String,Object> details(String id);
WorkFlowForms copyForm(String id);
}

8
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/IWorkFlowFormsService.java

@ -1,8 +1,9 @@
package com.flysoft.processConfiguration.service;
import java.util.List;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import java.util.List;
/**
* 工作流单Service接口
*
@ -65,4 +66,9 @@ public interface IWorkFlowFormsService
* @return 结果
*/
public int deleteWorkFlowFormsById(String id);
/**
* 获取最大序号
*/
public Long selectMaxSort(WorkFlowForms workFlowForms);
}

90
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/impl/FormsCustomServiceImpl.java

@ -0,0 +1,90 @@
package com.flysoft.processConfiguration.service.impl;
import com.flysoft.common.utils.StringUtils;
import com.flysoft.framework.util.ShiroUtils;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import com.flysoft.processConfiguration.service.IFormsCustomService;
import com.flysoft.processConfiguration.service.IWorkFlowFormsService;
import com.flysoft.system.domain.SysDept;
import com.flysoft.system.domain.SysUser;
import com.flysoft.system.service.ISysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class FormsCustomServiceImpl implements IFormsCustomService {
@Autowired
private ISysDeptService deptService;
@Autowired
private IWorkFlowFormsService workFlowFormsService;
@Override
public Map<String, Object> details(String id) {
Map<String,Object> res = new HashMap<>();
SysUser user = ShiroUtils.getSysUser();
WorkFlowForms forms = null;
List<SysDept> deptList = null;
//编辑
if(StringUtils.isNotEmpty(id)){
forms = workFlowFormsService.selectWorkFlowFormsById(id);
}else{
Long sort = workFlowFormsService.selectMaxSort(new WorkFlowForms());
if(sort==null){
sort=0l;
}
sort+=1;
forms = new WorkFlowForms();
forms.setSort(Float.valueOf(sort));
forms.setFormsName("自定义表单"+sort);
forms.setFormsUrl("customform/publicCustomForm/toAdd.html");
forms.setFormsDetailUrl("customform/publicCustomForm");
forms.setFormsType("public_custom_form");
if("admin".equals(user.getLoginName())){
forms.setCreateDwId("0");//所有单位
}else{
forms.setCreateDwId(user.getDwIdStr());
}
forms.setStatus(1);
forms.setRemark("");
forms.setUpdateUserId("");
}
if (!"admin".equals(ShiroUtils.getLoginName())) {
deptList = new ArrayList<>();
SysDept dept = deptService.selectDeptByVId(user.getDwIdStr());
deptList.add(dept);
} else {
deptList = deptService.selectDeptUnitList();
if(deptList!=null && !deptList.isEmpty()){
SysDept all = new SysDept();
all.setVdeptid("0");
all.setDeptName("所有单位");
deptList.add(0,all);
}
}
res.put("forms", forms);
res.put("user", user);
res.put("deptList", deptList);
return res;
}
@Override
public WorkFlowForms copyForm(String id) {
WorkFlowForms workFlowForms = workFlowFormsService.selectWorkFlowFormsById(id);
String newProccessId = UUID.randomUUID().toString().replaceAll("-", "");
workFlowForms.setId(newProccessId);
workFlowFormsService.insertWorkFlowForms(workFlowForms);
return workFlowForms;
}
}

19
flysoft-process-configuration/src/main/java/com/flysoft/processConfiguration/service/impl/WorkFlowFormsServiceImpl.java

@ -1,13 +1,14 @@
package com.flysoft.processConfiguration.service.impl;
import java.util.List;
import com.flysoft.common.core.text.Convert;
import com.flysoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.flysoft.processConfiguration.mapper.WorkFlowFormsMapper;
import com.flysoft.processConfiguration.domain.WorkFlowForms;
import com.flysoft.processConfiguration.mapper.WorkFlowFormsMapper;
import com.flysoft.processConfiguration.service.IWorkFlowFormsService;
import com.flysoft.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 工作流单Service业务层处理
@ -105,4 +106,12 @@ public class WorkFlowFormsServiceImpl implements IWorkFlowFormsService
{
return workFlowFormsMapper.deleteWorkFlowFormsById(id);
}
/**
* 获取最大序号
*/
@Override
public Long selectMaxSort(WorkFlowForms workFlowForms) {
return workFlowFormsMapper.selectMaxSort(workFlowForms);
}
}

19
flysoft-process-configuration/src/main/resources/mapper/processConfiguration/WorkFlowFormsMapper.xml

@ -18,10 +18,14 @@
<result property="updateUserId" column="update_user_id" />
<result property="createDwId" column="create_dw_id" />
<result property="formsType" column="forms_type" />
<result column="iscustom" property="iscustom" />
<result column="custom_json" property="customJson" />
</resultMap>
<sql id="selectWorkFlowFormsVo">
select id, sort, forms_name, forms_url,forms_detail_url, status, remark, create_time, update_time, create_user_id, update_user_id, create_dw_id , forms_type from work_flow_forms
select id, sort, forms_name, forms_url,forms_detail_url, status, remark, create_time,
update_time, create_user_id, update_user_id, create_dw_id , forms_type ,custom_json,iscustom
from work_flow_forms
</sql>
<select id="selectWorkFlowFormsList" parameterType="WorkFlowForms" resultMap="WorkFlowFormsResult">
@ -74,6 +78,8 @@
<if test="updateUserId != null">update_user_id,</if>
<if test="createDwId != null">create_dw_id,</if>
<if test="formsType != null">forms_type,</if>
<if test="iscustom != null">iscustom,</if>
<if test="customJson != null">custom_json,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -89,6 +95,8 @@
<if test="updateUserId != null">#{updateUserId},</if>
<if test="createDwId != null">#{createDwId},</if>
<if test="formsType != null">#{formsType},</if>
<if test="iscustom != null">#{iscustom},</if>
<if test="customJson != null">#{customJson},</if>
</trim>
</insert>
@ -107,6 +115,8 @@
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
<if test="createDwId != null">create_dw_id = #{createDwId},</if>
<if test="formsType != null">forms_type = #{formsType},</if>
<if test="iscustom != null">iscustom = #{iscustom},</if>
<if test="customJson != null">custom_json = #{customJson},</if>
</trim>
where id = #{id}
</update>
@ -122,4 +132,11 @@
</foreach>
</delete>
<select id="selectMaxSort" resultType="long" parameterType="WorkFlowForms">
select max(sort) from work_flow_forms
<where>
<if test="createDwId != null and createDwId != ''">and create_dw_id = #{createDwId}</if>
</where>
</select>
</mapper>

105
flysoft-process-configuration/src/main/resources/templates/processConfiguration/forms/forms.html

@ -6,10 +6,30 @@
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="notEmploy-form">
<div class="select-list">
<ul>
<li>
表单名称:<input type="text" name="formsName"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" >
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-success" onclick="openFormsCustom()">
<i class="fa fa-plus"></i> 新增自定义表单
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" >
<i class="fa fa-edit"></i> 修改
</a>
@ -56,10 +76,25 @@
},
{
field: 'sort',
title: '自定义序号',
title: '序号',
sortable:true
},
{
field: 'iscustom',
title: '表单类型',
formatter: function (value, row, index) {
let html = "普通表单";
if(value==2){
html="自定义表单"
}
return html;
}
},
{
field: 'formsDetailUrl',
title: '地址',
},
{
field: 'formsName',
title: '表单名称',
formatter : function(value, row, index) {
@ -69,11 +104,11 @@
},
{
title: '操作',
align: 'center',
align: 'left',
cellStyle: function (value, row, index) {
return {
css: {
"min-width": "180px",
"width": "300px",
}
}
},
@ -81,6 +116,10 @@
var actions = [];
actions.push('<a class="btn btn-primary single btn-xs " href="#" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
//自定义表单
if(row.iscustom==2){
actions.push('<a class="btn btn-success btn-xs " href="#" onclick="openFormsCustom(\'' + row.id + '\')"><i class="fa fa-location-arrow"></i>设计</a> ');
}
actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
@ -88,6 +127,66 @@
};
$.table.init(options);
});
/**
* 跳转自定义表单
*/
function openFormsCustom(id){
let title = "自定义表单";
if($.common.isNotEmpty(id)){
title = "编辑"+title;
}else{
title = "添加"+title;
id="";
}
openFullPart(title, ctx+"processConfiguration/formsCustom/edit?id="+id);
}
/**
* 弹出全屏
*/
function openFullPart(title, url, width, height){
// 如果是移动端,就使用自适应大小弹窗
if ($.common.isMobile()) {
width = 'auto';
height = 'auto';
}
if ($.common.isEmpty(title)) {
title = false;
}
if ($.common.isEmpty(url)) {
url = "/404.html";
}
if ($.common.isEmpty(width)) {
width = 800;
}
if ($.common.isEmpty(height)) {
height = ($(window).height() - 50);
}
var index = top.layer.open({
type: 2,
area: [width + 'px', height + 'px'],
fix: false,
//不固定
maxmin: true,
shade: 0.3,
title: title,
content: url,
btn: ['确定', '关闭'],
// 弹层外区域关闭
shadeClose: true,
yes: function (index, layero) {
var iframeWin = layero.find('iframe')[0];
iframeWin.contentWindow.submitHandler(index, layero);
},
cancel: function (index) {
return true;
}
});
top.layer.full(index);
}
</script>
</body>
</html>

242
flysoft-process-configuration/src/main/resources/templates/processConfiguration/formsCustom/edit.html

@ -0,0 +1,242 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: vue-header('自定义表单')"/>
</head>
<body>
<div id="app">
<!-- 表单配置 -->
<el-dialog title="表单配置" :visible.sync="dialogConfigForm" width="800px" top="8vh">
<el-form :model="form" ref="ruleForm">
<el-form-item label="序号" label-width="120px" prop="sort" :rules="[{ required: true, message: '序号不能为空!'}]">
<el-input v-model="form.sort" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="表单名称" label-width="120px" prop="formsName" :rules="[{ required: true, message: '表单名称不能为空!'}]">
<el-input v-model="form.formsName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="页面路径" label-width="120px" prop="formsDetailUrl" :rules="[{ required: true, message: '表单路径不能为空!'}]">
<el-input v-model="form.formsUrl" autocomplete="off" placeholder="例:document/fwlz/toAdd.html" ></el-input>
</el-form-item>
<el-form-item label="表单路径" label-width="120px" prop="formsDetailUrl" :rules="[{ required: true, message: '表单路径不能为空!'}]">
<el-input v-model="form.formsDetailUrl" autocomplete="off" placeholder="例:document/fwlz,(后缀方法可以为/add、/edit、/look)" ></el-input>
</el-form-item>
<el-form-item label="表名" label-width="120px" prop="formsType" :rules="[{ required: true, message: '表名不能为空!'}]">
<el-input v-model="form.formsType" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="所属单位" label-width="120px" prop="createDwId" :rules="[{ required: true, message: '请选择所属单位!'}]">
<el-select v-model="form.createDwId" clearable filterable placeholder="请选择" >
<el-option
v-for="item in deptList"
:key="item.vdeptid"
:label="item.deptName"
:value="item.vdeptid">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" label-width="120px">
<el-input type="textarea" v-model="form.remark"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogConfigForm = false">取 消</el-button>
<el-button type="primary" @click="configClick">确 定</el-button>
</div>
</el-dialog>
<!-- 表单设计器 -->
<avue-form-design style="height: 100vh;"
@submit="handleSubmit"
ref="formDesign"
:options="design.options"
:include-fields="design.includeFields"
:toolbar="design.toolbar"
:custom-fields="design.customFields"
>
<template slot="toolbar-left">
<el-button type="text"
icon="el-icon-setting"
@click="handleConfig">配置</el-button>
</template>
</avue-form-design>
</div>
<th:block th:include="include :: vue-footer"/>
<script th:inline="javascript">
Vue.use(window.AvueFormDesign)
var app = new Vue({
el: '#app',
data() {
return {
id:[[${id}]],
form:{},
deptList:[],
//配置表单
dialogConfigForm:false,
//设计器
design:{
toolbar: ['generate', 'preview', 'clear'],
options: {},
includeFields:[
//布局字段
'group', /*'dynamic', */'title',
//输入字段
'input', 'password', 'textarea', 'number', /*'url', 'array', 'img', 'map',*/
//选择字段
'radio', 'checkbox', 'select', 'cascader', 'tree',
//上传字段
/*'upload',*/
//日期时间字段
'year', 'month', 'week', 'date', 'time', 'datetime', 'daterange', 'timerange', 'datetimerange',
//插件字段(需单独引入依赖)
/*'ueditor',*/
//其他字段
/*'icon', 'switch', 'rate', 'slider', 'color'*/
],
customFields: [
{
title: '标题',
component: 'el-input',
icon: 'el-icon-edit',
label:'标题',
prop: 'gwsubject',
span: 24,
},
{
title: '意见(flow_yj1)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj1)',
prop: 'flow_yj1',
span: 24,
},
{
title: '意见(flow_yj2)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj2)',
prop: 'flow_yj2',
span: 24,
},
{
title: '意见(flow_yj3)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj3)',
prop: 'flow_yj3',
span: 24,
},
{
title: '意见(flow_yj4)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj4)',
prop: 'flow_yj4',
span: 24,
},
{
title: '意见(flow_yj5)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj5)',
prop: 'flow_yj5',
span: 24,
},
{
title: '意见(flow_yj6)',
component: 'el-input',
icon: 'el-icon-edit',
label:'意见(flow_yj6)',
prop: 'flow_yj1',
span: 24,
},
]
},
}
},
methods: {
//生成
handleSubmit(data) {
this.$message.success("查看控制台")
},
//配置其他信息
handleConfig(){
//打开编辑框
this.dialogConfigForm =true;
},
//提交保存数据
handleSave(){
if(isEmpty(this.form.formsName)){
this.$message.error('请配置表单信息!');
return;
}
//获取配置数据
this.$refs.formDesign.getData('string').then(data => {
// if(data.indexOf("prop:'title'")<=0){
// this.$message.error('表单缺少标题!');
// return;
// }
//提交保存
this.form.iscustom=2;//是否表单自定义 1 常规表单 2 自定义表单
this.form.customJson=data;
delete this.form.params;//删除多余属性,否则保存失败
//新增或者修改
let url = "processConfiguration/forms/add";
if(isNotEmpty(this.id)){
url = "processConfiguration/forms/edit";
}
request(url,this.form).then(res => {
this.$message({
message: res.msg,
type: 'success'
});
parent.layer.closeAll();
});
})
},
//配置表单提交
configClick(){
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
this.dialogConfigForm = false;
} else {
console.log('error submit!!');
return false;
}
});
},
init(){
//初始化详细信息
request('processConfiguration/formsCustom/details', {"id":this.id}).then(res => {
this.form=res.data.forms==null?{}:res.data.forms;
this.deptList=res.data.deptList==null?[]:deptList=res.data.deptList;
this.design.options=this.form.customJson;
console.log(res.data)
});
},
},
created(){
//初始化
this.init();
window['handleSave']=() =>{this.handleSave()}
//初始化时为window绑定一个方法
/*receiveParamsFromHtml(res){console.log(res)}
window['vueDefinedMyProp']=(receiveParams) =>{this.receiveParamsFromHtml(receiveParams)}
*/
},
});
function submitHandler() {
window['handleSave']();
}
</script>
</body>
</html>

7
pom.xml

@ -324,6 +324,12 @@
<artifactId>flysoft-autherthird</artifactId>
<version>${flysoft.version}</version>
</dependency>
<!-- 自定义表单模块 -->
<dependency>
<groupId>com.flysoft</groupId>
<artifactId>flysoft-customform</artifactId>
<version>${flysoft.version}</version>
</dependency>
</dependencies>
@ -351,6 +357,7 @@
<module>flysoft-sendwork</module>
<module>flysoft-ganbu-service</module>
<module>flysoft-autherthird</module>
<module>flysoft-customform</module>
</modules>
<packaging>pom</packaging>

Loading…
Cancel
Save