流程引擎节点属性调整,增加开始节点绑定表单功能

This commit is contained in:
WenG 2022-03-20 22:34:14 +08:00
parent 210bb3e7e1
commit 2d80c0f6ce
24 changed files with 3223 additions and 140 deletions

View File

@ -1,12 +1,19 @@
package ink.wgink.module.activiti.controller.api.oa;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.module.activiti.pojo.dtos.oa.NodeFieldDTO;
import ink.wgink.module.activiti.pojo.vos.oa.UpdateEditableVO;
import ink.wgink.module.activiti.pojo.vos.oa.UpdateVisibleVO;
import ink.wgink.module.activiti.service.oa.INodeFieldService;
import io.swagger.annotations.Api;
import ink.wgink.pojo.result.ErrorResult;
import ink.wgink.pojo.result.SuccessResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description: 表单字段与流程节点
@ -22,4 +29,47 @@ public class NodeFieldController extends DefaultBaseController {
@Autowired
private INodeFieldService nodeFieldService;
@ApiOperation(value = "更新显示状态", notes = "更新显示状态接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "nodeFieldId", value = "节点字段ID", paramType = "path")
})
@PutMapping("update-visible/{nodeFieldId}")
@CheckRequestBodyAnnotation
public SuccessResult updateVisible(@PathVariable("nodeFieldId") String nodeFieldId, @RequestBody UpdateVisibleVO updateVisibleVO) {
nodeFieldService.updateVisible(nodeFieldId, updateVisibleVO.getIsVisible());
return new SuccessResult();
}
@ApiOperation(value = "更新编辑状态", notes = "更新编辑状态接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "nodeFieldId", value = "节点字段ID", paramType = "path")
})
@PutMapping("update-editable/{nodeFieldId}")
@CheckRequestBodyAnnotation
public SuccessResult updateEditable(@PathVariable("nodeFieldId") String nodeFieldId, @RequestBody UpdateEditableVO updateEditableVO) {
nodeFieldService.updateEditable(nodeFieldId, updateEditableVO.getIsEditable());
return new SuccessResult();
}
@ApiOperation(value = "节点列表", notes = "节点列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "deploymentId", value = "部署ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-node/deployment-id/{deploymentId}")
public List<NodeFieldDTO> listNodeByDeploymentId(@PathVariable("deploymentId") String deploymentId) {
return nodeFieldService.listNodeByDeploymentId(deploymentId);
}
@ApiOperation(value = "节点字段列表", notes = "节点字段列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "deploymentId", value = "部署ID", paramType = "path"),
@ApiImplicitParam(name = "flowNodeId", value = "节点ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list/deployment-id/{deploymentId}/flow-node-id/{flowNodeId}")
public List<NodeFieldDTO> listByDeploymentIdAndFlowNodeId(@PathVariable("deploymentId") String deploymentId, @PathVariable("flowNodeId") String flowNodeId) {
return nodeFieldService.listByDeploymentIdAndFlowNodeId(deploymentId, flowNodeId);
}
}

View File

@ -0,0 +1,33 @@
package ink.wgink.module.activiti.controller.route.oa;
import ink.wgink.interfaces.consts.ISystemConstant;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* @Description: 节点字段
* @Author: WenG
* @Date: 2022/3/19 10:19
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "节点字段路由")
@Controller
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/oa/node-field")
public class NodeFieldRouteController {
@GetMapping("list-node")
public ModelAndView listNode() {
ModelAndView mv = new ModelAndView("oa/list-node");
return mv;
}
@GetMapping("list-node-field")
public ModelAndView listNodeField() {
ModelAndView mv = new ModelAndView("oa/list-node-field");
return mv;
}
}

View File

@ -2,9 +2,13 @@ package ink.wgink.module.activiti.dao.oa;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.module.activiti.pojo.dtos.oa.NodeFieldDTO;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/**
@ -31,4 +35,31 @@ public interface INodeFieldDao extends IInitBaseTable {
* @throws RemoveException
*/
void delete(Map<String, Object> params) throws RemoveException;
/**
* 更新
*
* @param params
* @throws UpdateException
*/
void update(Map<String, Object> params) throws UpdateException;
/**
* 节点列表
*
* @param params
* @return
* @throws SearchException
*/
List<NodeFieldDTO> listNode(Map<String, Object> params) throws SearchException;
/**
* 列表
*
* @param params
* @return
* @throws SearchException
*/
List<NodeFieldDTO> list(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,85 @@
package ink.wgink.module.activiti.pojo.dtos.oa;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 节点字段
* @Author: WenG
* @Date: 2022/3/19 11:05
* @Version: 1.0
**/
@ApiModel
public class NodeFieldDTO {
@ApiModelProperty(name = "nodeFieldId", value = "主键")
private String nodeFieldId;
@ApiModelProperty(name = "formId", value = "表单ID")
private String formId;
@ApiModelProperty(name = "deploymentId", value = "部署ID")
private String deploymentId;
@ApiModelProperty(name = "flowNodeId", value = "节点")
private String flowNodeId;
@ApiModelProperty(name = "fieldName", value = "字段名")
private String fieldName;
@ApiModelProperty(name = "isVisible", value = "是否可见")
private Integer isVisible;
@ApiModelProperty(name = "isEditable", value = "是否可编辑")
private Integer isEditable;
public String getNodeFieldId() {
return nodeFieldId;
}
public void setNodeFieldId(String nodeFieldId) {
this.nodeFieldId = nodeFieldId;
}
public String getFormId() {
return formId;
}
public void setFormId(String formId) {
this.formId = formId;
}
public String getDeploymentId() {
return deploymentId;
}
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
public String getFlowNodeId() {
return flowNodeId;
}
public void setFlowNodeId(String flowNodeId) {
this.flowNodeId = flowNodeId;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public Integer getIsVisible() {
return isVisible;
}
public void setIsVisible(Integer isVisible) {
this.isVisible = isVisible;
}
public Integer getIsEditable() {
return isEditable;
}
public void setIsEditable(Integer isEditable) {
this.isEditable = isEditable;
}
}

View File

@ -0,0 +1,27 @@
package ink.wgink.module.activiti.pojo.vos.oa;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 显示状态
* @Author: WenG
* @Date: 2022/3/19 15:49
* @Version: 1.0
**/
@ApiModel
public class UpdateEditableVO {
@ApiModelProperty(name = "isEditable", value = "是否可编辑")
@CheckNumberAnnotation(name = "是否可编辑", types = {"0", "1"})
private Integer isEditable;
public Integer getIsEditable() {
return isEditable == null ? 0 : isEditable;
}
public void setIsEditable(Integer isEditable) {
this.isEditable = isEditable;
}
}

View File

@ -0,0 +1,27 @@
package ink.wgink.module.activiti.pojo.vos.oa;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 显示状态
* @Author: WenG
* @Date: 2022/3/19 15:49
* @Version: 1.0
**/
@ApiModel
public class UpdateVisibleVO {
@ApiModelProperty(name = "isVisible", value = "是否可见")
@CheckNumberAnnotation(name = "是否可见", types = {"0", "1"})
private Integer isVisible;
public Integer getIsVisible() {
return isVisible == null ? 0 : isVisible;
}
public void setIsVisible(Integer isVisible) {
this.isVisible = isVisible;
}
}

View File

@ -1,7 +1,10 @@
package ink.wgink.module.activiti.service.oa;
import ink.wgink.module.activiti.pojo.dtos.oa.NodeFieldDTO;
import ink.wgink.module.activiti.pojo.vos.oa.NodeFieldUpdateVO;
import java.util.List;
/**
* @Description: 表单字段与流程节点
* @Author: WenG
@ -17,4 +20,37 @@ public interface INodeFieldService {
*/
void save(NodeFieldUpdateVO nodeFieldUpdateVO);
/**
* 更新显示状态
*
* @param nodeFieldId
* @param isVisible
*/
void updateVisible(String nodeFieldId, Integer isVisible);
/**
* 更新编辑状态
*
* @param nodeFieldId
* @param isEditable
*/
void updateEditable(String nodeFieldId, Integer isEditable);
/**
* 节点列表
*
* @param deploymentId
* @return
*/
List<NodeFieldDTO> listNodeByDeploymentId(String deploymentId);
/**
* 节点字段列表
*
* @param deploymentId
* @param flowNodeId
* @return
*/
List<NodeFieldDTO> listByDeploymentIdAndFlowNodeId(String deploymentId, String flowNodeId);
}

View File

@ -2,6 +2,7 @@ package ink.wgink.module.activiti.service.oa.impl;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.module.activiti.dao.oa.INodeFieldDao;
import ink.wgink.module.activiti.pojo.dtos.oa.NodeFieldDTO;
import ink.wgink.module.activiti.pojo.vos.oa.NodeFieldUpdateVO;
import ink.wgink.module.activiti.pojo.vos.oa.NodeFieldVO;
import ink.wgink.module.activiti.service.oa.INodeFieldService;
@ -33,6 +34,37 @@ public class NodeFieldFieldServiceImpl extends DefaultBaseService implements INo
save(nodeFieldUpdateVO.getDeploymentId(), nodeFieldUpdateVO.getFormId(), nodeFieldUpdateVO.getFlowNodeId(), nodeFieldUpdateVO.getFormFields());
}
@Override
public void updateVisible(String nodeFieldId, Integer isVisible) {
Map<String, Object> params = getHashMap(4);
params.put("nodeFieldId", nodeFieldId);
params.put("isVisible", isVisible);
nodeFieldDao.update(params);
}
@Override
public void updateEditable(String nodeFieldId, Integer isEditable) {
Map<String, Object> params = getHashMap(4);
params.put("nodeFieldId", nodeFieldId);
params.put("isEditable", isEditable);
nodeFieldDao.update(params);
}
@Override
public List<NodeFieldDTO> listNodeByDeploymentId(String deploymentId) {
Map<String, Object> params = getHashMap(2);
params.put("deploymentId", deploymentId);
return nodeFieldDao.listNode(params);
}
@Override
public List<NodeFieldDTO> listByDeploymentIdAndFlowNodeId(String deploymentId, String flowNodeId) {
Map<String, Object> params = getHashMap(2);
params.put("deploymentId", deploymentId);
params.put("flowNodeId", flowNodeId);
return nodeFieldDao.list(params);
}
/**
* 保存
*

View File

@ -2,6 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ink.wgink.module.activiti.dao.oa.INodeFieldDao">
<resultMap id="nodeFieldDTO" type="ink.wgink.module.activiti.pojo.dtos.oa.NodeFieldDTO">
<id column="node_field_id" property="nodeFieldId"/>
<result column="deployment_id" property="deploymentId"/>
<result column="form_id" property="formId"/>
<result column="flow_node_id" property="flowNodeId"/>
<result column="field_name" property="fieldName"/>
<result column="is_visible" property="isVisible"/>
<result column="is_editable" property="isEditable"/>
</resultMap>
<update id="createTable">
CREATE TABLE IF NOT EXISTS `oa_node_field` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
@ -53,4 +63,76 @@
</if>
</delete>
<!-- 更新 -->
<update id="update" parameterType="map">
UPDATE
oa_node_field
SET
<if test="isVisible != null">
is_visible = #{isVisible},
</if>
<if test="isEditable != null">
is_editable = #{isEditable},
</if>
node_field_id = #{nodeFieldId}
WHERE
node_field_id = #{nodeFieldId}
</update>
<!-- 节点列表 -->
<select id="listNode" parameterType="map" resultMap="nodeFieldDTO">
SELECT
deployment_id,
form_id,
flow_node_id
FROM
oa_node_field
<where>
<if test="deploymentId != null and deploymentId != ''">
AND
deployment_id = #{deploymentId}
</if>
<if test="formId != null and formId != ''">
AND
form_id = #{formId}
</if>
</where>
GROUP BY
deployment_id,
form_id,
flow_node_id
ORDER BY
id
</select>
<!-- 列表 -->
<select id="list" parameterType="map" resultMap="nodeFieldDTO">
SELECT
node_field_id,
deployment_id,
form_id,
flow_node_id,
field_name,
is_visible,
is_editable
FROM
oa_node_field
<where>
<if test="deploymentId != null and deploymentId != ''">
AND
deployment_id = #{deploymentId}
</if>
<if test="formId != null and formId != ''">
AND
form_id = #{formId}
</if>
<if test="flowNodeId != null and flowNodeId != ''">
AND
flow_node_id = #{flowNodeId}
</if>
</where>
ORDER BY
id
</select>
</mapper>

View File

@ -20,11 +20,11 @@
/*
* Assignment
*/
var KisBpmAssignmentCtrl = [ '$scope', '$modal', function($scope, $modal) {
var KisBpmAssignmentCtrl = ['$scope', '$modal', function ($scope, $modal) {
// Config for the modal window
var opts = {
template: 'editor-app/configuration/properties/assignment-popup.html?version=' + Date.now(),
template: 'editor-app/configuration/properties/assignment-popup.html?version=' + Date.now(),
scope: $scope
};
@ -32,119 +32,102 @@ var KisBpmAssignmentCtrl = [ '$scope', '$modal', function($scope, $modal) {
$modal(opts);
}];
var KisBpmAssignmentPopupCtrl = [ '$scope', function($scope) {
var KisBpmAssignmentPopupCtrl = ['$scope', function ($scope) {
// Put json representing assignment on scope
if ($scope.property.value !== undefined && $scope.property.value !== null
&& $scope.property.value.assignment !== undefined
&& $scope.property.value.assignment !== null)
{
&& $scope.property.value.assignment !== null) {
$scope.assignment = $scope.property.value.assignment;
} else {
$scope.assignment = {};
}
if ($scope.assignment.candidateUsers == undefined || $scope.assignment.candidateUsers.length == 0)
{
$scope.assignment.candidateUsers = [{value: ''}];
if ($scope.assignment.candidateUsers == undefined || $scope.assignment.candidateUsers.length == 0) {
$scope.assignment.candidateUsers = [{value: ''}];
}
// Click handler for + button after enum value
var userValueIndex = 1;
$scope.addCandidateUserValue = function(index) {
$scope.addCandidateUserValue = function (index) {
$scope.assignment.candidateUsers.splice(index + 1, 0, {value: 'value ' + userValueIndex++});
};
// Click handler for - button after enum value
$scope.removeCandidateUserValue = function(index) {
$scope.removeCandidateUserValue = function (index) {
$scope.assignment.candidateUsers.splice(index, 1);
};
if ($scope.assignment.candidateGroups == undefined || $scope.assignment.candidateGroups.length == 0)
{
$scope.assignment.candidateGroups = [{value: ''}];
if ($scope.assignment.candidateGroups == undefined || $scope.assignment.candidateGroups.length == 0) {
$scope.assignment.candidateGroups = [{value: ''}];
}
var groupValueIndex = 1;
$scope.addCandidateGroupValue = function(index) {
$scope.addCandidateGroupValue = function (index) {
$scope.assignment.candidateGroups.splice(index + 1, 0, {value: 'value ' + groupValueIndex++});
};
// Click handler for - button after enum value
$scope.removeCandidateGroupValue = function(index) {
$scope.removeCandidateGroupValue = function (index) {
$scope.assignment.candidateGroups.splice(index, 1);
};
$scope.save = function() {
$scope.save = function () {
$scope.property.value = {};
handleAssignmentInput($scope);
$scope.property.value.assignment = $scope.assignment;
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
// Close button handler
$scope.close = function() {
handleAssignmentInput($scope);
$scope.property.mode = 'read';
$scope.$hide();
$scope.close = function () {
handleAssignmentInput($scope);
$scope.property.mode = 'read';
$scope.$hide();
};
var handleAssignmentInput = function($scope) {
if ($scope.assignment.candidateUsers)
{
var emptyUsers = true;
var toRemoveIndexes = [];
for (var i = 0; i < $scope.assignment.candidateUsers.length; i++)
{
if ($scope.assignment.candidateUsers[i].value != '')
{
emptyUsers = false;
}
else
{
toRemoveIndexes[toRemoveIndexes.length] = i;
}
}
for (var i = 0; i < toRemoveIndexes.length; i++)
{
$scope.assignment.candidateUsers.splice(toRemoveIndexes[i], 1);
}
if (emptyUsers)
{
$scope.assignment.candidateUsers = undefined;
}
}
if ($scope.assignment.candidateGroups)
{
var emptyGroups = true;
var toRemoveIndexes = [];
for (var i = 0; i < $scope.assignment.candidateGroups.length; i++)
{
if ($scope.assignment.candidateGroups[i].value != '')
{
emptyGroups = false;
}
else
{
toRemoveIndexes[toRemoveIndexes.length] = i;
}
}
for (var i = 0; i < toRemoveIndexes.length; i++)
{
$scope.assignment.candidateGroups.splice(toRemoveIndexes[i], 1);
}
if (emptyGroups)
{
$scope.assignment.candidateGroups = undefined;
}
}
var handleAssignmentInput = function ($scope) {
if ($scope.assignment.candidateUsers) {
var emptyUsers = true;
var toRemoveIndexes = [];
for (var i = 0; i < $scope.assignment.candidateUsers.length; i++) {
if ($scope.assignment.candidateUsers[i].value != '') {
emptyUsers = false;
} else {
toRemoveIndexes[toRemoveIndexes.length] = i;
}
}
for (var i = 0; i < toRemoveIndexes.length; i++) {
$scope.assignment.candidateUsers.splice(toRemoveIndexes[i], 1);
}
if (emptyUsers) {
$scope.assignment.candidateUsers = undefined;
}
}
if ($scope.assignment.candidateGroups) {
var emptyGroups = true;
var toRemoveIndexes = [];
for (var i = 0; i < $scope.assignment.candidateGroups.length; i++) {
if ($scope.assignment.candidateGroups[i].value != '') {
emptyGroups = false;
} else {
toRemoveIndexes[toRemoveIndexes.length] = i;
}
}
for (var i = 0; i < toRemoveIndexes.length; i++) {
$scope.assignment.candidateGroups.splice(toRemoveIndexes[i], 1);
}
if (emptyGroups) {
$scope.assignment.candidateGroups = undefined;
}
}
};
}];

View File

@ -0,0 +1,76 @@
/*
* Activiti Modeler component part of the Activiti project
* Copyright 2005-2014 Alfresco Software, Ltd. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* form-select
*/
var FormSelectWriteController = ['$scope', '$modal', function($scope, $modal) {
$modal({
template: 'editor-app/configuration/properties/form-select-template.html?version=' + Date.now(),
scope: $scope
});
}];
var FormSelectController = ['$scope', function($scope) {
$scope.form = {};
if($scope.property.value) {
$scope.form.formId = $scope.property.value;
}
$scope.selectFormId = function() {
top.dialog.dialogData.oldSelectedFormList = [{formId: $scope.form.formId}];
top.dialog.open({
url: 'route/form/list-select',
title: '选择表单',
width: '1000px',
height: '500px',
onClose: function() {
var newSelectedFormList = top.dialog.dialogData.newSelectedFormList;
if(newSelectedFormList.length != 0) {
$scope.form.formId = newSelectedFormList[0].formId;
} else {
$scope.form.formId = '';
}
document.getElementById('formId').value = $scope.form.formId;
top.dialog.dialogData.oldSelectedFormList = [];
}
});
}
$scope.save = function() {
$scope.property.value = '';
$scope.property.value = $scope.form.formId;
$scope.updatePropertyInModel($scope.property);
$scope.$hide();
$scope.close();
};
$scope.cancel = function() {
$scope.$hide();
$scope.property.mode = 'read';
};
// Close button handler
$scope.close = function() {
$scope.$hide();
$scope.property.mode = 'read';
};
}];

View File

@ -95,5 +95,9 @@ KISBPM.PROPERTY_CONFIG =
"oryx-messageref-string" : {
"readModeTemplateUrl": "editor-app/configuration/properties/default-value-display-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/message-property-write-template.html"
},
"formkeydefinition": {
"readModeTemplateUrl": "editor-app/configuration/properties/form-select-display-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/form-select-write-template.html"
}
};

View File

@ -0,0 +1,2 @@
<span ng-if="property.value">{{property.value}}</span>
<span ng-if="!property.value">No form selected</span>

View File

@ -0,0 +1,22 @@
<div class="modal" ng-controller="FormSelectController">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;</button>
<h2 translate>绑定自定义表单</h2>
</div>
<div class="modal-body">
<div class="row row-no-gutter">
<div class="form-group">
<label for="formId">点击选择表单</label>
<input type="text" id="formId" class="form-control" ng-model="form.formId" placeholder="点击选择表单" ng-click="selectFormId()" readonly/>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button>
<button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1 @@
<div ng-controller="FormSelectWriteController"></div>

View File

@ -113,17 +113,16 @@
</div>
<div class="selected-item-body">
<div>
<div class="property-row" ng-repeat="property in selectedItem.properties"
ng-click="propertyClicked($index)" ng-class="{'clear' : $index%2 == 0}">
<div class="property-row"
ng-repeat="property in selectedItem.properties"
ng-click="propertyClicked($index)"
ng-class="{'clear' : $index%2 == 0}">
<span class="title" ng-if="!property.hidden">{{ property.title }}&nbsp;:</span>
<span class="title-removed" ng-if="property.hidden"><i>{{ property.title }}&nbsp;({{'PROPERTY.REMOVED' | translate}})&nbsp;:</i></span>
<span class="value">
<ng-include
src="getPropertyTemplateUrl($index)" ng-if="!property.hasReadWriteMode"></ng-include>
<ng-include src="getPropertyReadModeTemplateUrl($index)"
ng-if="property.hasReadWriteMode && property.mode == 'read'"></ng-include>
<ng-include src="getPropertyWriteModeTemplateUrl($index)"
ng-if="property.hasReadWriteMode && property.mode == 'write'"></ng-include>
<ng-include src="getPropertyTemplateUrl($index)" ng-if="!property.hasReadWriteMode"></ng-include>
<ng-include src="getPropertyReadModeTemplateUrl($index)" ng-if="property.hasReadWriteMode && property.mode == 'read'"></ng-include>
<ng-include src="getPropertyWriteModeTemplateUrl($index)" ng-if="property.hasReadWriteMode && property.mode == 'write'"></ng-include>
</span>
</div>
</div>

View File

@ -257,14 +257,12 @@ angular.module('activitiModeler')
'createDate': $scope.modelData.createDate
};
}
// Gather properties of selected item
var properties = stencil.properties();
for (var i = 0; i < properties.length; i++) {
var property = properties[i];
if (property.popular() == false) continue;
var key = property.prefix() + "-" + property.id();
if (key === 'oryx-name') {
selectedItem.title = selectedShape.properties[key];
}
@ -570,7 +568,6 @@ angular.module('activitiModeler')
/* Method available to all sub controllers (for property controllers) to update the internal Oryx model */
$scope.updatePropertyInModel = function (property, shapeId) {
var shape = $scope.selectedShape;
// Some updates may happen when selected shape is already changed, so when an additional
// shapeId is supplied, we need to make sure the correct shape is updated (current or previous)
@ -590,7 +587,6 @@ angular.module('activitiModeler')
var key = property.key;
var newValue = property.value;
var oldValue = shape.properties[key];
if (newValue != oldValue) {
var commandClass = ORYX.Core.Command.extend({
construct: function () {

View File

@ -89,7 +89,7 @@
"id": "process_namespace",
"type": "String",
"title": "目标命名空间",
"value": "http://www.activiti.org/processdef",
"value": "www.wgink.ink",
"description": "工作流目标命名空间",
"popular": true
}
@ -166,7 +166,7 @@
{
"id": "usertaskassignment",
"type": "Complex",
"title": "代理",
"title": "用户代理",
"value": "",
"description": "Assignment definition for the user task",
"popular": true
@ -191,7 +191,7 @@
"properties": [
{
"id": "formkeydefinition",
"type": "String",
"type": "formkeydefinition",
"title": "自定义表单",
"value": "",
"description": "用户任务表单编号",
@ -955,8 +955,7 @@
"documentationpackage",
"executionlistenerspackage",
"initiatorpackage",
"formkeydefinitionpackage",
"formpropertiespackage"
"formkeydefinitionpackage"
],
"hiddenPropertyPackages": [],
"roles": [
@ -1092,10 +1091,8 @@
"multiinstance_conditionpackage",
"isforcompensationpackage",
"usertaskassignmentpackage",
"formkeydefinitionpackage",
"duedatedefinitionpackage",
"prioritydefinitionpackage",
"formpropertiespackage",
"tasklistenerspackage"
],
"hiddenPropertyPackages": [],

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,7 @@
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
@ -122,7 +123,11 @@
if(!row.deploymentId) {
return '-';
}
return '<button class="layui-btn layui-btn-xs" lay-event="flowChatEvent">查看</button>';
var flowChatImg = '<img id="flowChat'+ row.id +'" src="route/activiti/get-process-image/'+ row.deploymentId +'" style="width: 30px; height: 30px;"/>'
setTimeout(function() {
new Viewer(document.getElementById('flowChat'+ row.id));
}, 50);
return flowChatImg;
}
},
{field: 'option2', width: 80, title: '操作', align:'center', fixed: 'right',
@ -248,18 +253,6 @@
top.dialog.close(loadLayerIndex);
});
});
} else if(layEvent === 'flowChatEvent') {
if(!data.deploymentId) {
top.dialog.msg('流程未部署,无法查看流程图');
return;
}
top.dialog.open({
url: top.restAjax.path('route/activiti/get-process-image/{deploymentId}', [data.deploymentId]),
title: '流程图',
width: '800px',
height: '400px',
onClose: function() {}
});
}
});
});

View File

@ -9,6 +9,7 @@
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
@ -110,15 +111,6 @@
return rowData;
}
},
{field:'category', width:150, title: '目录名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field:'resourceName', width:200, title: '流程资源名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -128,19 +120,22 @@
return rowData;
}
},
{field: 'diagramResourceName', width: 80, title: '流程图', align:'center', fixed: 'right',
{field: 'diagramResourceName', width: 80, title: '流程图', align:'center',
templet: function(row) {
if(!row.deploymentId) {
return '-';
}
return '<button class="layui-btn layui-btn-xs" lay-event="flowChatEvent">查看</button>';
var flowChatImg = '<img id="flowChat'+ row.id +'" src="route/activiti/get-process-image/'+ row.deploymentId +'" style="width: 30px; height: 30px;"/>'
setTimeout(function() {
new Viewer(document.getElementById('flowChat'+ row.id));
}, 50);
return flowChatImg;
}
},
{field: 'form', width: 180, title: '操作', align:'center', fixed: 'right',
{field: 'form', width: 100, title: '操作', align:'center', fixed: 'right',
templet: function(row) {
return '<div class="layui-btn-group">' +
'<button class="layui-btn layui-btn-xs" lay-event="bindFormEvent">绑定表单</button>'+
'<button class="layui-btn layui-btn-primary layui-btn-xs" lay-event="bindFormEvent">节点管理</button>'+
'<button class="layui-btn layui-btn-xs" lay-event="nodeEvent">节点管理</button>'+
'</div>';
}
}
@ -185,20 +180,14 @@
table.on('tool(dataTable)', function(obj) {
var data = obj.data;
var layEvent = obj.event;
if(layEvent === 'flowChatEvent') {
if(!data.deploymentId) {
top.dialog.msg('流程未部署,无法查看流程图');
return;
}
if(layEvent === 'nodeEvent') {
top.dialog.open({
url: top.restAjax.path('route/activiti/get-process-image/{deploymentId}', [data.deploymentId]),
title: '流程图',
width: '800px',
height: '400px',
url: top.restAjax.path('route/oa/node-field/list-node?deploymentId={deploymentId}', [data.deploymentId]),
title: '节点字段管理',
width: '400px',
height: '500px',
onClose: function() {}
});
} else if(layEvent === 'bindFormEvent') {
}
});
});

View File

@ -116,6 +116,7 @@
<script src="editor-app/configuration/properties-signal-scope-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-message-definitions-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-message-scope-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/properties-form-select-controller.js" type="text/javascript"></script>
<script src="editor-app/configuration/toolbar.js" type="text/javascript"></script>
<script src="editor-app/configuration/toolbar-custom-actions.js" type="text/javascript"></script>

View File

@ -0,0 +1,115 @@
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'} ">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<form class="layui-form">
<table class="layui-table">
<col width="60">
<col>
<col width="80">
<col width="80">
</colgroup>
<thead>
<tr>
<th>序号</th>
<th>字段名</th>
<th>可见</th>
<th>可操作</th>
</tr>
</thead>
<tbody id="tBody"></tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var laydate = layui.laydate;
var common = layui.common;
var form = layui.form;
var queryParams = top.restAjax.params(window.location.href);
var deploymentId = queryParams.deploymentId;
var flowNodeId = queryParams.flowNodeId;
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/node-field/list/deployment-id/{deploymentId}/flow-node-id/{flowNodeId}', [deploymentId, flowNodeId]), {}, null, function(code, data) {
var trs = ''
for(var i = 0, item; item = data[i++];) {
var tr = '<tr>' +
'<td>'+ i +'</td>' +
'<td>'+ item.fieldName +'</td>' +
'<td><input type="checkbox" lay-skin="switch" lay-text="是|否" '+ (item.isVisible ? 'checked' : '') +' lay-filter="isVisibleFilter" data-node-field-id="'+ item.nodeFieldId +'"></td>' +
'<td><input type="checkbox" lay-skin="switch" lay-text="是|否" '+ (item.isEditable ? 'checked' : '') +' lay-filter="isEditableFilter" data-node-field-id="'+ item.nodeFieldId +'"></td>' +
'</tr>';
trs += tr;
}
$('#tBody').append(trs);
form.render();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
form.on('switch(isVisibleFilter)', function(obj) {
var nodeFieldId = obj.elem.dataset.nodeFieldId;
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/node-field/update-visible/{nodeFieldId}', [nodeFieldId]), {
isVisible: obj.elem.checked ? 1 : 0
}, null, function(code, data) {
top.dialog.msg('操作成功');
}, function(code, data) {
top.dialog.msg(data.msg);
obj.elem.checked = !checked;
form.render('checkbox')
});
});
form.on('switch(isEditableFilter)', function(obj) {
var nodeFieldId = obj.elem.dataset.nodeFieldId;
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/node-field/update-editable/{nodeFieldId}', [nodeFieldId]), {
isVisible: obj.elem.checked ? 1 : 0
}, null, function(code, data) {
top.dialog.msg('操作成功');
}, function(code, data) {
top.dialog.msg(data.msg);
obj.elem.checked = !checked;
form.render('checkbox')
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,90 @@
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<base th:href="${#request.getContextPath() + '/'} ">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<table class="layui-table">
<col width="60">
<col>
<col width="80">
</colgroup>
<thead>
<tr>
<th>序号</th>
<th>节点ID</th>
<th>表单管理</th>
</tr>
</thead>
<tbody id="tBody"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var laydate = layui.laydate;
var common = layui.common;
var deploymentId = top.restAjax.params(window.location.href).deploymentId;
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/node-field/list-node/deployment-id/{deploymentId}', [deploymentId]), {}, null, function(code, data) {
var trs = ''
for(var i = 0, item; item = data[i++];) {
var tr = '<tr>' +
'<td>'+ i +'</td>' +
'<td>'+ item.flowNodeId +'</td>' +
'<td><button type="button" class="layui-btn layui-btn-xs form-config" data-flow-node-id="'+ item.flowNodeId +'" data-form-id="'+ item.formId +'">表单配置</button></td>' +
'</tr>';
trs += tr;
}
$('#tBody').append(trs);
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
$(document).on('click', '.form-config', function() {
var flowNodeId = this.dataset.flowNodeId;
var formId = this.dataset.formId;
top.dialog.open({
url: top.restAjax.path('route/oa/node-field/list-node-field?deploymentId={deploymentId}&flowNodeId={flowNodeId}', [deploymentId, flowNodeId]),
title: '【'+ flowNodeId +'】节点表单字段',
width: '600px',
height: '500px',
onClose: function() {}
});
})
});
</script>
</body>
</html>