Commit fd460514 authored by 王万里's avatar 王万里

fix: 台账转换

parent 9b6d0b8c
......@@ -14,6 +14,17 @@
/*
* String controller
*/
let shareformKey = ""
let nodeIdParams = ""
let exeCount = true
let schemaListObj = {}
window.share && window.share.event.on("editCurrentNodeForm", (params)=> {
shareformKey = params
})
window.share && window.share.event.on("editCurrentNodeId", (paramsId)=>{
nodeIdParams = paramsId
})
angular.module('flowableModeler').controller('FlowableStringPropertyCtrl', [ '$scope', function ($scope) {
......@@ -101,7 +112,6 @@ angular.module('flowableModeler').controller('FlowableTextPropertyCtrl', [ '$sco
$scope.property.mode = 'read';
}, 0);
});
// Open the dialog
_internalCreateModal(opts, $modal, $scope);
}]);
......@@ -109,7 +119,6 @@ angular.module('flowableModeler').controller('FlowableTextPropertyCtrl', [ '$sco
angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', ['$scope', function($scope) {
$scope.save = function() {
console.log($scope.property)
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
......@@ -120,28 +129,133 @@ angular.module('flowableModeler').controller('FlowableTextPropertyPopupCtrl', ['
};
}]);
angular.module('flowableModeler').controller('HuiqianPopupCtrl', ['$scope','$http', function($scope, $http) {
$http.get(FLOWABLE.APP_URL.getStaffList())
.success(function(res){
console.log(res.data.getMe)
let arr = []
res.data.getMe.forEach((item,index)=>{
if (item.LevelCode.indexOf('1-24')) {
item.userList.forEach((childItem)=>{
arr.push({
loginName: childItem.loginName,
userName: childItem.userName,
userID: childItem.userID
angular.module('flowableModeler').controller('FieldReadConfigPopupCtrl', ['$rootScope','$scope', '$http', function($rootScope, $scope, $http) {
window.share && window.share.event.on("editCurrentNodeId", (params)=>{
nodeIdParams = params
})
if (nodeIdParams && shareformKey) {
$http.get(FLOWABLE.APP_URL.GetColumnConfig(nodeIdParams, shareformKey))
.success((res)=>{
console.log("进入。。。。。。。。。。///////////")
if (res.FieldConfigList && res.FieldConfigList.length > 0) {
res.FieldConfigList.forEach((item)=>{
$scope.property.properties.forEach((pItem)=>{
if (item.FieldCode === pItem.key) {
pItem.defaultUnit = item.Unit
pItem.defaultValue = item.Type
pItem.defaultChecked = item.IsShow === "1" ? true : false
}
})
})
// $rootScope.curField = $scope.property
// $scope.childFieldObj = $rootScope.curField
schemaListObj = $scope.property
console.log(schemaListObj, "schemaListObj......schemaListObj.......")
$scope.childFieldObj = schemaListObj
} else {
$scope.property.properties.forEach(el => {
el.defaultValue = ""
el.defaultChecked = true
el.defaultUnit = ""
});
}
})
$scope.userList = arr
})
}
// if ($rootScope.currentReadResourceId) {
// $http.get(FLOWABLE.APP_URL.GetColumnConfig($rootScope.currentReadResourceId, shareformKey))
// .success((res)=>{
// if (res.FieldConfigList && res.FieldConfigList.length > 0) {
// res.FieldConfigList.forEach((item)=>{
// $scope.property.properties.forEach((pItem)=>{
// if (item.FieldCode === pItem.key) {
// pItem.defaultUnit = item.Unit
// pItem.defaultValue = item.Type
// pItem.defaultChecked = item.IsShow === "1" ? true : false
// }
// })
// })
// $rootScope.curField = $scope.property
// $scope.childFieldObj = $rootScope.curField
// console.log($scope.childFieldObj, "$scope.childFieldObj......$scope.childFieldObj.......")
// } else {
// $scope.property.properties.forEach(el => {
// el.defaultValue = ""
// el.defaultChecked = true
// el.defaultUnit = ""
// });
// }
// })
// } else {
// $scope.property.properties.forEach(el => {
// el.defaultValue = ""
// el.defaultChecked = true
// el.defaultUnit = ""
// });
// }
// $scope.property.properties.forEach(el => {
// el.defaultValue = ""
// el.defaultChecked = true
// el.defaultUnit = ""
// });
// $rootScope.curField = $scope.property
// $scope.childFieldObj = $rootScope.curField
// $scope.childFieldObj = schemaListObj
// console.log($scope.childFieldObj, "$scope.childFieldObj$scope.childFieldObj")
$scope.isShow = true
$scope.toggleTable=function() {
$scope.isShow = !$scope.isShow
}
$scope.changeValue = function(params) {
const data = {
ActID: $rootScope.currentReadResourceId,
Config: "",
FieldCode: params.key,
FieldName: params.title,
FieldType: params.type,
FormKey: shareformKey,
IsShow: params.defaultChecked ? 1: 0,
Type: params.defaultValue,
Unit: params.defaultUnit
}
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveFieldConfig(), data: data})
.success(function(res) {
console.log(res)
})
}
}]);
angular.module('flowableModeler').controller('FieldWriteConfigPopupCtrl', ['$scope','$modal', '$timeout','$http', function($scope, $modal, $timeout, $http) {
$scope.toggleTable=function() {
$scope.isShow = !$scope.isShow
}
$scope.changeValue=function() {
}
}]);
angular.module('flowableModeler').controller('FieldTextPopup', ['$rootScope','$scope', function($rootScope,$scope) {
$scope.childFieldObj = $rootScope.curField
console.log($scope.childFieldObj)
$scope.save = function() {
console.log($scope.property)
$scope.updatePropertyInModel($scope.property);
$scope.close();
};
......@@ -150,4 +264,8 @@ angular.module('flowableModeler').controller('HuiqianPopupCtrl', ['$scope','$htt
$scope.property.mode = 'read';
$scope.$hide();
};
}]);
\ No newline at end of file
$scope.changeValue = function() {
console.log($scope)
}
}]);
......@@ -10,6 +10,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
let resourceIdList = []
angular.module('flowableModeler').controller('FlowableFormReferenceDisplayCtrl',
[ '$scope', '$modal', '$http', function($scope, $modal, $http) {
......@@ -42,6 +44,7 @@ angular.module('flowableModeler').controller('FlowableFormReferenceCtrl',
angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
[ '$rootScope', '$scope', '$http', '$location', 'editorManager', function($rootScope, $scope, $http, $location, editorManager) {
$scope.state = {'loadingForms' : true, 'formError' : false};
......@@ -93,6 +96,9 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
'name' : modelName,
'key' : modelKey
};
// resourceIdList.push($scope.property.value)
window.share && window.share.event.emit("currentNodeForm", $scope.property.value);
// $rootScope.currentFormData = $scope.property.value
$scope.updatePropertyInModel($scope.property);
$scope.close();
})
......@@ -295,16 +301,6 @@ angular.module('flowableModeler').controller('FlowableFormReferencePopupCtrl',
function(response) {
$scope.state.loadingForms = false;
$scope.state.formError = false;
// var arr = []
// response.getMe[0].data.forEach(item => {
// if (item.key.indexOf("&#") > -1) {
// item.key = $scope.decoder(item.key)
// }
// if (item.name.indexOf("&#") > -1) {
// item.name = $scope.decoder(item.name)
// }
// arr.push(item)
// });
$scope.forms = response.getMe[0].data;
})
.error(
......
......@@ -203,5 +203,9 @@ FLOWABLE.PROPERTY_CONFIG =
"huiqian" : {
"readModeTemplateUrl": "editor-app/configuration/properties/huiqian-read-template.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/huiqian-write-template.html"
},
"fieldconfig":{
"readModeTemplateUrl": "editor-app/configuration/properties/form-field-read-config.html",
"writeModeTemplateUrl": "editor-app/configuration/properties/form-field-write-config.html"
}
};
<!-- <div class="modal" ng-controller="FieldTextPopup">
<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>
<h3>{{property.title | translate}}</h3>
</div>
<div class="modal-body">
<div ng-repeat="child in childFieldObj.properties">
<input type="checkbox" ng-model="child.key" ng-change="changeValue()"/>
<span>{{child.title}}</span>
<select name="" id="">
<option value="">本人</option>
<option value="">本部门</option>
<option value="">部门主管</option>
<option value="">编码</option>
</select>
</div>
</div>
<div class="modal-footer">
<button ng-click="save()" class="btn btn-primary" translate >ACTION.SAVE</button>
</div>
</div>
</div>
</div> -->
\ No newline at end of file
<!-- <div ng-controller="FieldReadConfigPopupCtrl" style="line-height: 38px;">
<div ng-click="clickCurField()">
<input type="checkbox" ng-model="property.value" ng-change="changeValue()"/>
</div>
</div> -->
<div ng-controller="FieldReadConfigPopupCtrl">
<div style="height: 30px;line-height: 30px;margin: 2px 0;">
<span style="margin: 0 5px;font-size: 12px;">{{property.title}}</span>
<span class="caret" ng-click="toggleTable()"></span>
</div>
<table class="table" ng-if="isShow">
<tr>
<th></th>
<th>字段</th>
<th>默认值</th>
<th>单位</th>
</tr>
<tr ng-repeat="child in childFieldObj.properties">
<td style="width: 20px;">
<input type="checkbox" ng-model="child.defaultChecked" ng-change="changeValue(child)"/>
</td>
<td class="active">{{child.title}}</td>
<td class="active">
<select ng-model="child.defaultValue" ng-change="changeValue(child)">
<option value="无"></option>
<option value="本人">本人</option>
<option value="本部门">本部门</option>
<option value="部门主管">部门主管</option>
<option value="财务">财务</option>
</select>
</td>
<td class="active">
<select ng-model="child.defaultUnit" ng-change="changeValue(child)">
<option value="无"></option>
<option value="个"></option>
<option value="本"></option>
<option value="元"></option>
<option value="万元">万元</option>
</select>
</td>
</tr>
</table>
</div>
<div ng-controller="FieldWriteConfigPopupCtrl">
<table class="table" ng-if="isShow">
<tr ng-repeat="child in childFieldObj.properties">
<td><input type="checkbox" ng-model="child.key" ng-change="changeValue()"/></td>
<td class="active">active</td>
<td class="success">success</td>
<td class="warning">warning</td>
<td class="danger">danger</td>
</tr>
</table>
</div>
......@@ -146,13 +146,18 @@
<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}">
<span class="title" ng-if="!property.hidden" title="{{ property.description | translate}}">{{ property.title | translate }}&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>
</span>
<div ng-if="property.type === 'wangwanli'">
<ng-include src="getPropertyReadModeTemplateUrl($index)"></ng-include>
</div>
<!-- <div ng-if="property.type !== 'wangwanli'"> -->
<span class="title" ng-if="!property.hidden && property.type !== 'wangwanli'" title="{{ property.description | translate}}">{{ property.title | translate }}&nbsp;:</span>
<span class="title-removed" ng-if="property.hidden"><i>{{ property.title }}&nbsp;({{'PROPERTY.REMOVED' | translate}})&nbsp;:</i></span>
<span class="value" ng-if="property.type !== 'wangwanli'">
<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>
</div>
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
let nodeIdList = []
let formKey = ""
let nodeId = ""
angular.module('flowableModeler')
.controller('StencilController', ['$rootScope', '$scope', '$http', '$modal', '$timeout', '$window', 'editorManager',
function ($rootScope, $scope, $http, $modal, $timeout, $window, editorManager) {
// Property window toggle state
$scope.propertyWindowState = {'collapsed': false};
// Add reference to global header-config
$scope.headerConfig = FLOWABLE.HEADER_CONFIG;
$scope.propertyWindowState.toggle = function () {
$scope.propertyWindowState.collapsed = !$scope.propertyWindowState.collapsed;
$timeout(function () {
$window.dispatchEvent(new Event("resize"));
}, 100);
};
// Code that is dependent on an initialised Editor is wrapped in a promise for the editor
$scope.editorFactory.promise.then(function () {
/* Build stencil item list */
// Build simple json representation of stencil set
var stencilItemGroups = [];
// Helper method: find a group in an array
var findGroup = function (name, groupArray) {
for (var index = 0; index < groupArray.length; index++) {
if (groupArray[index].name === name) {
return groupArray[index];
}
}
return null;
};
// Helper method: add a new group to an array of groups
var addGroup = function (groupName, groupArray) {
var group = { name: groupName, items: [], paletteItems: [], groups: [], visible: true };
groupArray.push(group);
return group;
};
/*
StencilSet items
*/
var data = editorManager.getStencilData();
var quickMenuDefinition = undefined;
var ignoreForPaletteDefinition = undefined;
if (data.namespace == 'http://b3mn.org/stencilset/cmmn1.1#') {
quickMenuDefinition = ['HumanTask', 'Association'];
ignoreForPaletteDefinition = ['CasePlanModel'];
} else if (data.namespace == 'http://b3mn.org/stencilset/dmn1.2#') {
quickMenuDefinition = ['DecisionTableDecision', 'InformationRequirement', 'KnowledgeRequirement'];
ignoreForPaletteDefinition = [];
} else {
quickMenuDefinition = ['UserTask', 'EndNoneEvent', 'ExclusiveGateway',
'CatchTimerEvent', 'ThrowNoneEvent', 'TextAnnotation',
'SequenceFlow', 'Association'];
ignoreForPaletteDefinition = ['SequenceFlow', 'MessageFlow', 'Association', 'DataAssociation', 'DataStore', 'SendTask'];
}
var quickMenuItems = [];
var morphRoles = [];
for (var i = 0; i < data.rules.morphingRules.length; i++)
{
var role = data.rules.morphingRules[i].role;
var roleItem = {'role': role, 'morphOptions': []};
morphRoles.push(roleItem);
}
// Check all received items
for (var stencilIndex = 0; stencilIndex < data.stencils.length; stencilIndex++) {
// Check if the root group is the 'diagram' group. If so, this item should not be shown.
var currentGroupName = data.stencils[stencilIndex].groups[0];
if (currentGroupName === 'Diagram' || currentGroupName === 'BPMN.STENCILS.GROUPS.DIAGRAM' ||
currentGroupName === 'CMMN.STENCILS.GROUPS.DIAGRAM' ||
currentGroupName === 'DMN.STENCILS.GROUPS.DIAGRAM') {
continue; // go to next item
}
var removed = false;
if (data.stencils[stencilIndex].removed) {
removed = true;
}
var currentGroup = undefined;
if (!removed) {
// Check if this group already exists. If not, we create a new one
if (currentGroupName !== null && currentGroupName !== undefined && currentGroupName.length > 0) {
currentGroup = findGroup(currentGroupName, stencilItemGroups); // Find group in root groups array
if (currentGroup === null) {
currentGroup = addGroup(currentGroupName, stencilItemGroups);
}
// Add all child groups (if any)
for (var groupIndex = 1; groupIndex < data.stencils[stencilIndex].groups.length; groupIndex++) {
var childGroupName = data.stencils[stencilIndex].groups[groupIndex];
var childGroup = findGroup(childGroupName, currentGroup.groups);
if (childGroup === null) {
childGroup = addGroup(childGroupName, currentGroup.groups);
}
// The current group variable holds the parent of the next group (if any),
// and is basically the last element in the array of groups defined in the stencil item
currentGroup = childGroup;
}
}
}
// Construct the stencil item
var stencilItem = {'id': data.stencils[stencilIndex].id,
'name': data.stencils[stencilIndex].title,
'description': data.stencils[stencilIndex].description,
'icon': data.stencils[stencilIndex].icon,
'type': data.stencils[stencilIndex].type,
'roles': data.stencils[stencilIndex].roles,
'removed': removed,
'customIcon': false,
'canConnect': false,
'canConnectTo': false,
'canConnectAssociation': false};
if (data.stencils[stencilIndex].customIconId && data.stencils[stencilIndex].customIconId > 0) {
stencilItem.customIcon = true;
stencilItem.icon = data.stencils[stencilIndex].customIconId;
}
if (!removed) {
if (quickMenuDefinition.indexOf(stencilItem.id) >= 0) {
quickMenuItems[quickMenuDefinition.indexOf(stencilItem.id)] = stencilItem;
}
}
if (stencilItem.id === 'TextAnnotation' || stencilItem.id === 'BoundaryCompensationEvent') {
stencilItem.canConnectAssociation = true;
}
for (var i = 0; i < data.stencils[stencilIndex].roles.length; i++) {
var stencilRole = data.stencils[stencilIndex].roles[i];
if (data.namespace == 'http://b3mn.org/stencilset/cmmn1.1#') {
if (stencilRole === 'association_start') {
stencilItem.canConnect = true;
} else if (stencilRole === 'association_end') {
stencilItem.canConnectTo = true;
}
} else if (data.namespace == 'http://b3mn.org/stencilset/dmn1.2#') {
if (stencilRole === 'information_requirement_start') {
stencilItem.canConnect = true;
} else if (stencilRole === 'information_requirement_end') {
stencilItem.canConnectTo = true;
}
} else {
if (stencilRole === 'sequence_start') {
stencilItem.canConnect = true;
} else if (stencilRole === 'sequence_end') {
stencilItem.canConnectTo = true;
}
}
for (var j = 0; j < morphRoles.length; j++) {
if (stencilRole === morphRoles[j].role) {
if (!removed) {
morphRoles[j].morphOptions.push(stencilItem);
}
stencilItem.morphRole = morphRoles[j].role;
break;
}
}
}
if (currentGroup) {
// Add the stencil item to the correct group
currentGroup.items.push(stencilItem);
if (ignoreForPaletteDefinition.indexOf(stencilItem.id) < 0) {
currentGroup.paletteItems.push(stencilItem);
}
} else {
// It's a root stencil element
if (!removed) {
stencilItemGroups.push(stencilItem);
}
}
}
for (var i = 0; i < stencilItemGroups.length; i++) {
if (stencilItemGroups[i].paletteItems && stencilItemGroups[i].paletteItems.length == 0) {
stencilItemGroups[i].visible = false;
}
}
$scope.stencilItemGroups = stencilItemGroups;
var containmentRules = [];
for (var i = 0; i < data.rules.containmentRules.length; i++) {
var rule = data.rules.containmentRules[i];
containmentRules.push(rule);
}
$scope.containmentRules = containmentRules;
// remove quick menu items which are not available anymore due to custom pallette
var availableQuickMenuItems = [];
for (var i = 0; i < quickMenuItems.length; i++) {
if (quickMenuItems[i]) {
availableQuickMenuItems[availableQuickMenuItems.length] = quickMenuItems[i];
}
}
$scope.quickMenuItems = availableQuickMenuItems;
$scope.morphRoles = morphRoles;
/*
* Listen to selection change events: show properties
*/
editorManager.registerOnEvent(ORYX.CONFIG.EVENT_SELECTION_CHANGED, function (event) {
var shapes = event.elements;
var canvasSelected = false;
if (shapes && shapes.length == 0) {
shapes = [editorManager.getCanvas()];
canvasSelected = true;
}
if (shapes && shapes.length > 0) {
var selectedShape = shapes.first();
var stencil = selectedShape.getStencil();
if ($rootScope.selectedElementBeforeScrolling && stencil.id().indexOf('BPMNDiagram') !== -1 && stencil.id().indexOf('CMMNDiagram') !== -1 &&
stencil.id().indexOf('DMNDiagram') !== -1) {
// ignore canvas event because of empty selection when scrolling stops
return;
}
if ($rootScope.selectedElementBeforeScrolling && $rootScope.selectedElementBeforeScrolling.getId() === selectedShape.getId()) {
$rootScope.selectedElementBeforeScrolling = null;
return;
}
// Store previous selection
$scope.previousSelectedShape = $scope.selectedShape;
// Only do something if another element is selected (Oryx fires this event multiple times)
if ($scope.selectedShape !== undefined && $scope.selectedShape.getId() === selectedShape.getId()) {
if ($rootScope.forceSelectionRefresh) {
// Switch the flag again, this run will force refresh
$rootScope.forceSelectionRefresh = false;
} else {
// Selected the same element again, no need to update anything
return;
}
}
var selectedItem = {'title': '', 'properties': []};
if (canvasSelected) {
selectedItem.auditData = {
'author': $scope.modelData.createdByUser,
'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.get(key);
}
// First we check if there is a config for 'key-type' and then for 'type' alone
var propertyConfig = FLOWABLE.PROPERTY_CONFIG[key + '-' + property.type()];
if (propertyConfig === undefined || propertyConfig === null) {
propertyConfig = FLOWABLE.PROPERTY_CONFIG[property.type()];
}
if (propertyConfig === undefined || propertyConfig === null) {
console.log('WARNING: no property configuration defined for ' + key + ' of type ' + property.type());
} else {
if (selectedShape.properties.get(key) === 'true') {
selectedShape.properties.set(key, true);
if (selectedShape.resourceId.indexOf("sid-") < 0) {
$rootScope.resourceId = ""
} else {
$rootScope.resourceId = selectedShape.resourceId
}
console.log($rootScope.resourceId, "$rootScope.resourceId selectedShape.resourceId")
}
if (FLOWABLE.UI_CONFIG.showRemovedProperties == false && property.isHidden())
{
continue;
}
var currentProperty = {
'key': key,
'title': property.title(),
'description': property.description(),
'type': property.type(),
'mode': 'read',
'readonly': property.readonly(),
'hidden': property.isHidden(),
'value': selectedShape.properties.get(key)
};
if ((currentProperty.type === 'complex' || currentProperty.type === 'multiplecomplex') && currentProperty.value && currentProperty.value.length > 0) {
try {
currentProperty.value = JSON.parse(currentProperty.value);
} catch (err) {
// ignore
}
}
if (propertyConfig.readModeTemplateUrl !== undefined && propertyConfig.readModeTemplateUrl !== null) {
currentProperty.readModeTemplateUrl = propertyConfig.readModeTemplateUrl + '?version=' + $rootScope.staticIncludeVersion;
}
if (propertyConfig.writeModeTemplateUrl !== null && propertyConfig.writeModeTemplateUrl !== null) {
currentProperty.writeModeTemplateUrl = propertyConfig.writeModeTemplateUrl + '?version=' + $rootScope.staticIncludeVersion;
}
if ((currentProperty.readonly && propertyConfig.templateUrl !== undefined && propertyConfig.templateUrl !== null) ||
(currentProperty.readonly === undefined && propertyConfig.templateUrl !== undefined && propertyConfig.templateUrl !== null)) {
currentProperty.templateUrl = propertyConfig.templateUrl + '?version=' + $rootScope.staticIncludeVersion;
currentProperty.hasReadWriteMode = false;
}
else {
currentProperty.hasReadWriteMode = true;
}
if (currentProperty.value === undefined
|| currentProperty.value === null
|| currentProperty.value.length == 0) {
currentProperty.noValue = true;
}
selectedItem.properties.push(currentProperty);
}
}
window.share && window.share.event.on("createNode", (params)=> {
if (!params.resourceId) {
nodeId = params.resourceId
}
console.log(nodeId, "SaveColumnConfig nodeId createNode createNode")
})
window.share && window.share.event.on("currentNodeForm", (params)=> {
formKey = params.key
nodeIdList.push({
nodeId: nodeId,
formKey: formKey
})
if (nodeId && formKey) {
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(nodeId, formKey))
.success((res)=>{
let FormJson = JSON.parse(res.FormJson)
const formJsonProperties = FormJson.schema.properties
let formArr = []
for (key in formJsonProperties) {
for (let ckey in formJsonProperties[key].properties) {
let params = formJsonProperties[key].properties[ckey]
formArr.push({
ActID: nodeId,
Config: '',
FieldCode: ckey,
FieldName: params.title,
FieldType: params.type,
FormKey: formKey,
IsShow: 1,
Type:"",
Unit:""
})
}
}
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveColumnConfig(nodeId, decodeURI(formKey)), data: formArr})
.success(function(res) {
// console.log(res)
})
// let FormJson = {"schema":{"type":"object","ui:displayType":"row","ui:showDescIcon":true,"properties":{"object_-UvCWr":{"title":"工单信息","type":"object","properties":{"input_tzkvpC":{"title":"超时记录","type":"string","ui:options":{}},"input_Uo6WRF":{"title":"工单编号","type":"string","ui:options":{}}}},"object_Ic4XnA":{"title":"派单信息","type":"object","properties":{"date_O9YUWZ":{"title":"派单时间","type":"string","format":"date"},"input_aCUJ0c":{"title":"派单信息","type":"string","ui:options":{}},"select_fnxK9n":{"title":"处理时限","type":"string","enum":["8","24"],"enumNames":["8小时","24小时"]}}},"object_s3nPPO":{"title":"接单信息","type":"object","properties":{"date_Mu9mZD":{"title":"接单时间","type":"string","format":"date"},"input_4r9Nsv":{"title":"处理人员","type":"string","ui:options":{}},"input_UCumQ1":{"title":"承办科�??","type":"string","ui:options":{}},"input_p-C7Ag":{"title":"水表编号","type":"string","ui:options":{}},"input_09XpIU":{"title":"维修内�??","type":"string","ui:options":{}},"date_NT8w8m":{"title":"维修时间","type":"string","format":"date"},"image_BoKhol":{"title":"现场图标","type":"string","format":"image","ui:options":{}},"image_9WetPr":{"title":"完工图标","type":"string","format":"image","ui:options":{}},"textarea_ng7GLp":{"title":"备注","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_du_rtb":{"title":"部门审核","type":"object","properties":{"input_yYqJ0L":{"title":"审核�?","type":"string","ui:options":{}},"input_Q_wnkN":{"title":"审核部门","type":"string","ui:options":{}},"date_PkYqQS":{"title":"部门审核时间","type":"string","format":"date"},"textarea_Qmsa4s":{"title":"审核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_WNdEdt":{"title":"工程科�?�核","type":"object","properties":{"input_PQ3Khh":{"title":"工程科�?�核�?","type":"string","ui:options":{}},"date_gyH3V-":{"title":"工程科�?�核时间","type":"string","format":"date"},"textarea_F3ahcF":{"title":"工程科�?�核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_yVmzxn":{"title":"复核","type":"object","properties":{"input_OlbjAL":{"title":"复核�?","type":"string","ui:options":{}},"input_LYiawW":{"title":"复核部门","type":"string","ui:options":{}},"date_3fobcq":{"title":"复核时间","type":"string","format":"date"},"textarea_4ZWJaB":{"title":"复核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}}},"ui:column":3},"displayType":"row","showDescIcon":true,"column":3}
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
})
// console.log(selectedItem.properties, ":selectedItem.properties")
let clickedShape = ""
if (selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value){
clickedShape = selectedItem.properties[14].value.key
// console.log("进来了")
}
// console.log(nodeIdList, 'nodeIdList')
if (nodeIdList.length === 0 && $scope.selectedShape && clickedShape) {
console.log("编辑,进来了")
let editNodeId = $scope.selectedShape.resourceId
console.log(clickedShape, "clickedShape")
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(editNodeId, clickedShape))
.success((res)=>{
let FormJson = JSON.parse(res.FormJson)
// let FormJson = {"schema":{"type":"object","ui:displayType":"row","ui:showDescIcon":true,"properties":{"object_-UvCWr":{"title":"工单信息","type":"object","properties":{"input_tzkvpC":{"title":"超时记录","type":"string","ui:options":{}},"input_Uo6WRF":{"title":"工单编号","type":"string","ui:options":{}}}},"object_Ic4XnA":{"title":"派单信息","type":"object","properties":{"date_O9YUWZ":{"title":"派单时间","type":"string","format":"date"},"input_aCUJ0c":{"title":"派单信息","type":"string","ui:options":{}},"select_fnxK9n":{"title":"处理时限","type":"string","enum":["8","24"],"enumNames":["8小时","24小时"]}}},"object_s3nPPO":{"title":"接单信息","type":"object","properties":{"date_Mu9mZD":{"title":"接单时间","type":"string","format":"date"},"input_4r9Nsv":{"title":"处理人员","type":"string","ui:options":{}},"input_UCumQ1":{"title":"承办科�??","type":"string","ui:options":{}},"input_p-C7Ag":{"title":"水表编号","type":"string","ui:options":{}},"input_09XpIU":{"title":"维修内�??","type":"string","ui:options":{}},"date_NT8w8m":{"title":"维修时间","type":"string","format":"date"},"image_BoKhol":{"title":"现场图标","type":"string","format":"image","ui:options":{}},"image_9WetPr":{"title":"完工图标","type":"string","format":"image","ui:options":{}},"textarea_ng7GLp":{"title":"备注","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_du_rtb":{"title":"部门审核","type":"object","properties":{"input_yYqJ0L":{"title":"审核�?","type":"string","ui:options":{}},"input_Q_wnkN":{"title":"审核部门","type":"string","ui:options":{}},"date_PkYqQS":{"title":"部门审核时间","type":"string","format":"date"},"textarea_Qmsa4s":{"title":"审核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_WNdEdt":{"title":"工程科�?�核","type":"object","properties":{"input_PQ3Khh":{"title":"工程科�?�核�?","type":"string","ui:options":{}},"date_gyH3V-":{"title":"工程科�?�核时间","type":"string","format":"date"},"textarea_F3ahcF":{"title":"工程科�?�核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_yVmzxn":{"title":"复核","type":"object","properties":{"input_OlbjAL":{"title":"复核�?","type":"string","ui:options":{}},"input_LYiawW":{"title":"复核部门","type":"string","ui:options":{}},"date_3fobcq":{"title":"复核时间","type":"string","format":"date"},"textarea_4ZWJaB":{"title":"复核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}}},"ui:column":3},"displayType":"row","showDescIcon":true,"column":3}
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
if (clickedShape && formKey && nodeId) {
let obj = {}
let reduceNodeList = nodeIdList.reduce((cur,next) => {
obj[next.nodeId] ? "" : obj[next.nodeId] = true && cur.push(next);
return cur;
},[])
reduceNodeList.forEach((item)=>{
if (item.formKey === clickedShape) {
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(item.nodeId, item.formKey))
.success((res)=>{
let FormJson = JSON.parse(res.FormJson)
// let FormJson = {"schema":{"type":"object","ui:displayType":"row","ui:showDescIcon":true,"properties":{"object_-UvCWr":{"title":"工单信息","type":"object","properties":{"input_tzkvpC":{"title":"超时记录","type":"string","ui:options":{}},"input_Uo6WRF":{"title":"工单编号","type":"string","ui:options":{}}}},"object_Ic4XnA":{"title":"派单信息","type":"object","properties":{"date_O9YUWZ":{"title":"派单时间","type":"string","format":"date"},"input_aCUJ0c":{"title":"派单信息","type":"string","ui:options":{}},"select_fnxK9n":{"title":"处理时限","type":"string","enum":["8","24"],"enumNames":["8小时","24小时"]}}},"object_s3nPPO":{"title":"接单信息","type":"object","properties":{"date_Mu9mZD":{"title":"接单时间","type":"string","format":"date"},"input_4r9Nsv":{"title":"处理人员","type":"string","ui:options":{}},"input_UCumQ1":{"title":"承办科�??","type":"string","ui:options":{}},"input_p-C7Ag":{"title":"水表编号","type":"string","ui:options":{}},"input_09XpIU":{"title":"维修内�??","type":"string","ui:options":{}},"date_NT8w8m":{"title":"维修时间","type":"string","format":"date"},"image_BoKhol":{"title":"现场图标","type":"string","format":"image","ui:options":{}},"image_9WetPr":{"title":"完工图标","type":"string","format":"image","ui:options":{}},"textarea_ng7GLp":{"title":"备注","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_du_rtb":{"title":"部门审核","type":"object","properties":{"input_yYqJ0L":{"title":"审核�?","type":"string","ui:options":{}},"input_Q_wnkN":{"title":"审核部门","type":"string","ui:options":{}},"date_PkYqQS":{"title":"部门审核时间","type":"string","format":"date"},"textarea_Qmsa4s":{"title":"审核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_WNdEdt":{"title":"工程科�?�核","type":"object","properties":{"input_PQ3Khh":{"title":"工程科�?�核�?","type":"string","ui:options":{}},"date_gyH3V-":{"title":"工程科�?�核时间","type":"string","format":"date"},"textarea_F3ahcF":{"title":"工程科�?�核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_yVmzxn":{"title":"复核","type":"object","properties":{"input_OlbjAL":{"title":"复核�?","type":"string","ui:options":{}},"input_LYiawW":{"title":"复核部门","type":"string","ui:options":{}},"date_3fobcq":{"title":"复核时间","type":"string","format":"date"},"textarea_4ZWJaB":{"title":"复核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}}},"ui:column":3},"displayType":"row","showDescIcon":true,"column":3}
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
})
}
// Need to wrap this in an $apply block, see http://jimhoskins.com/2012/12/17/angularjs-and-apply.html
$scope.safeApply(function () {
$scope.selectedItem = selectedItem;
$scope.selectedShape = selectedShape;
});
} else {
$scope.safeApply(function () {
$scope.selectedItem = {};
$scope.selectedShape = null;
});
}
});
editorManager.registerOnEvent(ORYX.CONFIG.EVENT_SELECTION_CHANGED, function (event) {
FLOWABLE.eventBus.dispatch(FLOWABLE.eventBus.EVENT_TYPE_HIDE_SHAPE_BUTTONS);
var shapes = event.elements;
if (shapes && shapes.length == 1) {
var selectedShape = shapes.first();
var a = editorManager.getCanvas().node.getScreenCTM();
var absoluteXY = selectedShape.absoluteXY();
absoluteXY.x *= a.a;
absoluteXY.y *= a.d;
var additionalIEZoom = 1;
if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
var ua = navigator.userAgent;
if (ua.indexOf('MSIE') >= 0) {
//IE 10 and below
var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100);
if (zoom !== 100) {
additionalIEZoom = zoom / 100
}
}
}
if (additionalIEZoom === 1) {
absoluteXY.y = absoluteXY.y - jQuery("#canvasSection").offset().top + 5;
absoluteXY.x = absoluteXY.x - jQuery("#canvasSection").offset().left;
} else {
var canvasOffsetLeft = jQuery("#canvasSection").offset().left;
var canvasScrollLeft = jQuery("#canvasSection").scrollLeft();
var canvasScrollTop = jQuery("#canvasSection").scrollTop();
var offset = a.e - (canvasOffsetLeft * additionalIEZoom);
var additionaloffset = 0;
if (offset > 10) {
additionaloffset = (offset / additionalIEZoom) - offset;
}
absoluteXY.y = absoluteXY.y - (jQuery("#canvasSection").offset().top * additionalIEZoom) + 5 + ((canvasScrollTop * additionalIEZoom) - canvasScrollTop);
absoluteXY.x = absoluteXY.x - (canvasOffsetLeft * additionalIEZoom) + additionaloffset + ((canvasScrollLeft * additionalIEZoom) - canvasScrollLeft);
}
var bounds = new ORYX.Core.Bounds(a.e + absoluteXY.x, a.f + absoluteXY.y, a.e + absoluteXY.x + a.a*selectedShape.bounds.width(), a.f + absoluteXY.y + a.d*selectedShape.bounds.height());
var shapeXY = bounds.upperLeft();
var stencilItem = $scope.getStencilItemById(selectedShape.getStencil().idWithoutNs());
var morphShapes = [];
if (stencilItem && stencilItem.morphRole) {
for (var i = 0; i < $scope.morphRoles.length; i++) {
if ($scope.morphRoles[i].role === stencilItem.morphRole) {
morphShapes = $scope.morphRoles[i].morphOptions;
}
}
}
var x = shapeXY.x;
if (bounds.width() < 48) {
x -= 24;
}
if (morphShapes && morphShapes.length > 0) {
// In case the element is not wide enough, start the 2 bottom-buttons more to the left
// to prevent overflow in the right-menu
var morphButton = document.getElementById('morph-button');
morphButton.style.display = "block";
morphButton.style.left = x + 24 +'px';
morphButton.style.top = (shapeXY.y+bounds.height() + 2) + 'px';
}
var deleteButton = document.getElementById('delete-button');
deleteButton.style.display = "block";
deleteButton.style.left = x + 'px';
deleteButton.style.top = (shapeXY.y+bounds.height() + 2) + 'px';
var editable = selectedShape._stencil._jsonStencil.id.endsWith('CollapsedSubProcess') ;
var editButton = document.getElementById('edit-button');
if (editable) {
editButton.style.display = "block";
if (morphShapes && morphShapes.length > 0) {
editButton.style.left = x + 24 + 24 + 'px';
} else {
editButton.style.left = x + 24 +'px';
}
editButton.style.top = (shapeXY.y+bounds.height() + 2) + 'px';
} else {
editButton.style.display = "none";
}
if (stencilItem && (stencilItem.canConnect || stencilItem.canConnectAssociation)) {
var quickButtonCounter = 0;
var quickButtonX = shapeXY.x+bounds.width() + 5;
var quickButtonY = shapeXY.y;
jQuery('.Oryx_button').each(function(i, obj) {
if (obj.id !== 'morph-button' && obj.id != 'delete-button' && obj.id !== 'edit-button') {
quickButtonCounter++;
if (quickButtonCounter > 3) {
quickButtonX = shapeXY.x+bounds.width() + 5;
quickButtonY += 24;
quickButtonCounter = 1;
} else if (quickButtonCounter > 1) {
quickButtonX += 24;
}
obj.style.display = "block";
obj.style.left = quickButtonX + 'px';
obj.style.top = quickButtonY + 'px';
}
});
}
}
});
if (!$rootScope.stencilInitialized) {
FLOWABLE.eventBus.addListener(FLOWABLE.eventBus.EVENT_TYPE_HIDE_SHAPE_BUTTONS, function (event) {
jQuery('.Oryx_button').each(function(i, obj) {
obj.style.display = "none";
});
});
/*
* Listen to property updates and act upon them
*/
FLOWABLE.eventBus.addListener(FLOWABLE.eventBus.EVENT_TYPE_PROPERTY_VALUE_CHANGED, function (event) {
if (event.property && event.property.key) {
// If the name property is been updated, we also need to change the title of the currently selected item
if (event.property.key === 'oryx-name' && $scope.selectedItem !== undefined && $scope.selectedItem !== null) {
$scope.selectedItem.title = event.newValue;
}
// Update "no value" flag
event.property.noValue = (event.property.value === undefined
|| event.property.value === null
|| event.property.value.length == 0);
}
});
FLOWABLE.eventBus.addListener(FLOWABLE.eventBus.EVENT_TYPE_SHOW_VALIDATION_POPUP, function (event) {
// Method to open validation dialog
var showValidationDialog = function() {
$rootScope.currentValidationId = event.validationId;
$rootScope.isOnProcessLevel = event.onProcessLevel;
_internalCreateModal({template: 'editor-app/popups/validation-errors.html?version=' + Date.now()}, $modal, $rootScope);
};
showValidationDialog();
});
FLOWABLE.eventBus.addListener(FLOWABLE.eventBus.EVENT_TYPE_NAVIGATE_TO_PROCESS, function (event) {
var modelMetaData = editorManager.getBaseModelData();
$rootScope.editorHistory.push({
id: modelMetaData.modelId,
name: modelMetaData.name,
type: 'bpmnmodel'
});
$window.location.href = "../editor/#/editor/" + event.processId;
});
$rootScope.stencilInitialized = true;
}
$scope.morphShape = function() {
$scope.safeApply(function () {
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
$rootScope.currentSelectedShape = shapes.first();
var stencilItem = $scope.getStencilItemById($rootScope.currentSelectedShape.getStencil().idWithoutNs());
var morphShapes = [];
for (var i = 0; i < $scope.morphRoles.length; i++) {
if ($scope.morphRoles[i].role === stencilItem.morphRole) {
morphShapes = $scope.morphRoles[i].morphOptions.slice();
}
}
// Method to open shape select dialog (used later on)
var showSelectShapeDialog = function()
{
$rootScope.morphShapes = morphShapes;
_internalCreateModal({
backdrop: false,
keyboard: true,
template: 'editor-app/popups/select-shape.html?version=' + Date.now()
}, $modal, $rootScope);
};
showSelectShapeDialog();
}
});
};
$scope.deleteShape = function() {
FLOWABLE.TOOLBAR.ACTIONS.deleteItem({'$scope': $scope, 'editorManager': editorManager});
};
$scope.quickAddItem = function(newItemId) {
$scope.safeApply(function () {
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
$rootScope.currentSelectedShape = shapes.first();
var containedStencil = undefined;
var stencilSets = editorManager.getStencilSets().values();
for (var i = 0; i < stencilSets.length; i++) {
var stencilSet = stencilSets[i];
var nodes = stencilSet.nodes();
for (var j = 0; j < nodes.length; j++) {
if (nodes[j].idWithoutNs() === newItemId) {
containedStencil = nodes[j];
break;
}
}
}
if (!containedStencil) return;
var option = {type: $scope.currentSelectedShape.getStencil().namespace() + newItemId, namespace: $scope.currentSelectedShape.getStencil().namespace()};
option['connectedShape'] = $rootScope.currentSelectedShape;
option['parent'] = $rootScope.currentSelectedShape.parent;
option['containedStencil'] = containedStencil;
var args = { sourceShape: $rootScope.currentSelectedShape, targetStencil: containedStencil };
var targetStencil = editorManager.getRules().connectMorph(args);
// Check if there can be a target shape
if (!targetStencil) {
return;
}
option['connectingType'] = targetStencil.id();
var command = new FLOWABLE.CreateCommand(option, undefined, undefined, editorManager.getEditor());
editorManager.executeCommands([command]);
}
});
};
$scope.editShape = function(){
editorManager.edit($scope.selectedShape.resourceId);
};
}); // end of $scope.editorFactory.promise block
/* Click handler for clicking a property */
$scope.propertyClicked = function (index) {
if (!$scope.selectedItem.properties[index].hidden) {
$scope.selectedItem.properties[index].mode = "write";
}
};
/* Helper method to retrieve the template url for a property */
$scope.getPropertyTemplateUrl = function (index) {
return $scope.selectedItem.properties[index].templateUrl;
};
$scope.getPropertyReadModeTemplateUrl = function (index) {
// 处理不可�?改数�? disabled
const disableArr = ["oryx-process_id"]
disableArr.forEach((item)=>{
if ($scope.selectedItem.properties[index].key === item) {
let sArr = $scope.selectedItem.properties[index].writeModeTemplateUrl.split('?')
sArr[0] = "editor-app/configuration/properties/disabled-template.html"
let writeModeTemplateUrl = sArr[0] + '?' + sArr[1]
$scope.selectedItem.properties[index].writeModeTemplateUrl = writeModeTemplateUrl
}
})
// console.log($scope.selectedItem.properties)
// 处理下拉框数�?
const showRealWriteArr = ["flowable-multiinstance", "flowable-http-request-method", "flowable-processhistorylevel"]
showRealWriteArr.forEach((item)=>{
if($scope.selectedItem.properties[index].type === item) {
$scope.selectedItem.properties[index].readModeTemplateUrl = $scope.selectedItem.properties[index].writeModeTemplateUrl
}
})
return $scope.selectedItem.properties[index].readModeTemplateUrl;
};
$scope.getPropertyWriteModeTemplateUrl = function (index) {
return $scope.selectedItem.properties[index].writeModeTemplateUrl;
};
/* 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)
if (shapeId) {
if (shape.id != shapeId && $scope.previousSelectedShape && $scope.previousSelectedShape.id == shapeId) {
shape = $scope.previousSelectedShape;
console.log(shape)
} else {
shape = null;
}
}
if (!shape) {
// When no shape is selected, or no shape is found for the alternative
// shape ID, do nothing
return;
}
var key = property.key;
var newValue = property.value;
var oldValue = shape.properties.get(key);
if (newValue != oldValue) {
var commandClass = ORYX.Core.Command.extend({
construct: function () {
this.key = key;
this.oldValue = oldValue;
this.newValue = newValue;
this.shape = shape;
this.facade = editorManager.getEditor();
},
execute: function () {
this.shape.setProperty(this.key, this.newValue);
this.facade.getCanvas().update();
this.facade.updateSelection();
},
rollback: function () {
this.shape.setProperty(this.key, this.oldValue);
this.facade.getCanvas().update();
this.facade.updateSelection();
}
});
// Instantiate the class
var command = new commandClass();
// Execute the command
editorManager.executeCommands([command]);
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_PROPWINDOW_PROP_CHANGED,
elements: [shape],
key: key
});
// Switch the property back to read mode, now the update is done
property.mode = 'read';
// Fire event to all who is interested
// Fire event to all who want to know about this
var event = {
type: FLOWABLE.eventBus.EVENT_TYPE_PROPERTY_VALUE_CHANGED,
property: property,
oldValue: oldValue,
newValue: newValue
};
FLOWABLE.eventBus.dispatch(event.type, event);
} else {
// Switch the property back to read mode, no update was needed
property.mode = 'read';
}
};
/**
* Helper method that searches a group for an item with the given id.
* If not found, will return undefined.
*/
$scope.findStencilItemInGroup = function (stencilItemId, group) {
var item;
// Check all items directly in this group
for (var j = 0; j < group.items.length; j++) {
item = group.items[j];
if (item.id === stencilItemId) {
return item;
}
}
// Check the child groups
if (group.groups && group.groups.length > 0) {
for (var k = 0; k < group.groups.length; k++) {
item = $scope.findStencilItemInGroup(stencilItemId, group.groups[k]);
if (item) {
return item;
}
}
}
return undefined;
};
/**
* Helper method to find a stencil item.
*/
$scope.getStencilItemById = function (stencilItemId) {
for (var i = 0; i < $scope.stencilItemGroups.length; i++) {
var element = $scope.stencilItemGroups[i];
// Real group
if (element.items !== null && element.items !== undefined) {
var item = $scope.findStencilItemInGroup(stencilItemId, element);
if (item) {
return item;
}
} else { // Root stencil item
if (element.id === stencilItemId) {
return element;
}
}
}
return undefined;
};
/*
* DRAG AND DROP FUNCTIONALITY
*/
$scope.dropCallback = function (event, ui) {
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.attached"
});
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.added"
});
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeMenu"
});
FLOWABLE.eventBus.dispatch(FLOWABLE.eventBus.EVENT_TYPE_HIDE_SHAPE_BUTTONS);
if ($scope.dragCanContain) {
var item = $scope.getStencilItemById(ui.draggable[0].id);
var pos = {x: event.pageX, y: event.pageY};
var additionalIEZoom = 1;
if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
var ua = navigator.userAgent;
if (ua.indexOf('MSIE') >= 0) {
//IE 10 and below
var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100);
if (zoom !== 100) {
additionalIEZoom = zoom / 100;
}
}
}
var screenCTM = editorManager.getCanvas().node.getScreenCTM();
// Correcting the UpperLeft-Offset
pos.x -= (screenCTM.e / additionalIEZoom);
pos.y -= (screenCTM.f / additionalIEZoom);
// Correcting the Zoom-Factor
pos.x /= screenCTM.a;
pos.y /= screenCTM.d;
// Correcting the ScrollOffset
pos.x -= document.documentElement.scrollLeft;
pos.y -= document.documentElement.scrollTop;
var parentAbs = $scope.dragCurrentParent.absoluteXY();
pos.x -= parentAbs.x;
pos.y -= parentAbs.y;
var containedStencil = undefined;
var stencilSets = editorManager.getStencilSets().values();
for (var i = 0; i < stencilSets.length; i++) {
var stencilSet = stencilSets[i];
var nodes = stencilSet.nodes();
for (var j = 0; j < nodes.length; j++) {
if (nodes[j].idWithoutNs() === ui.draggable[0].id) {
containedStencil = nodes[j];
break;
}
}
if (!containedStencil) {
var edges = stencilSet.edges();
for (var j = 0; j < edges.length; j++) {
if (edges[j].idWithoutNs() === ui.draggable[0].id) {
containedStencil = edges[j];
break;
}
}
}
}
if (!containedStencil) return;
if ($scope.quickMenu) {
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
var currentSelectedShape = shapes.first();
var option = {};
option.type = currentSelectedShape.getStencil().namespace() + ui.draggable[0].id;
option.namespace = currentSelectedShape.getStencil().namespace();
option.connectedShape = currentSelectedShape;
option.parent = $scope.dragCurrentParent;
option.containedStencil = containedStencil;
// If the ctrl key is not pressed,
// snapp the new shape to the center
// if it is near to the center of the other shape
if (!event.ctrlKey) {
// Get the center of the shape
var cShape = currentSelectedShape.bounds.center();
// Snapp +-20 Pixel horizontal to the center
if (20 > Math.abs(cShape.x - pos.x)) {
pos.x = cShape.x;
}
// Snapp +-20 Pixel vertical to the center
if (20 > Math.abs(cShape.y - pos.y)) {
pos.y = cShape.y;
}
}
option.position = pos;
if (containedStencil.idWithoutNs() !== 'SequenceFlow' && containedStencil.idWithoutNs() !== 'Association' &&
containedStencil.idWithoutNs() !== 'MessageFlow' && containedStencil.idWithoutNs() !== 'DataAssociation' &&
containedStencil.idWithoutNs() !== 'InformationRequirement' && containedStencil.idWithoutNs() !== 'KnowledgeRequirement') {
var args = { sourceShape: currentSelectedShape, targetStencil: containedStencil };
var targetStencil = editorManager.getRules().connectMorph(args);
if (!targetStencil) { // Check if there can be a target shape
return;
}
option.connectingType = targetStencil.id();
}
var command = new FLOWABLE.CreateCommand(option, $scope.dropTargetElement, pos, editorManager.getEditor());
editorManager.executeCommands([command]);
}
} else {
var canAttach = false;
if (containedStencil.idWithoutNs() === 'BoundaryErrorEvent' || containedStencil.idWithoutNs() === 'BoundaryTimerEvent' ||
containedStencil.idWithoutNs() === 'BoundarySignalEvent' || containedStencil.idWithoutNs() === 'BoundaryMessageEvent' ||
containedStencil.idWithoutNs() === 'BoundaryCancelEvent' || containedStencil.idWithoutNs() === 'BoundaryCompensationEvent') {
// Modify position, otherwise boundary event will get position related to left corner of the canvas instead of the container
pos = editorManager.eventCoordinates( event );
canAttach = true;
}
var option = {};
option['type'] = $scope.modelData.model.stencilset.namespace + item.id;
option['namespace'] = $scope.modelData.model.stencilset.namespace;
option['position'] = pos;
option['parent'] = $scope.dragCurrentParent;
var commandClass = ORYX.Core.Command.extend({
construct: function(option, dockedShape, canAttach, position, facade){
this.option = option;
this.docker = null;
this.dockedShape = dockedShape;
this.dockedShapeParent = dockedShape.parent || facade.getCanvas();
this.position = position;
this.facade = facade;
this.selection = this.facade.getSelection();
this.shape = null;
this.parent = null;
this.canAttach = canAttach;
},
execute: function(){
if (!this.shape) {
this.shape = this.facade.createShape(option);
this.parent = this.shape.parent;
} else if (this.parent) {
this.parent.add(this.shape);
}
if (this.canAttach && this.shape.dockers && this.shape.dockers.length) {
this.docker = this.shape.dockers[0];
this.dockedShapeParent.add(this.docker.parent);
// Set the Docker to the new Shape
this.docker.setDockedShape(undefined);
this.docker.bounds.centerMoveTo(this.position);
if (this.dockedShape !== this.facade.getCanvas()) {
this.docker.setDockedShape(this.dockedShape);
}
this.facade.setSelection( [this.docker.parent] );
}
this.facade.getCanvas().update();
this.facade.updateSelection();
},
rollback: function(){
if (this.shape) {
this.facade.setSelection(this.selection.without(this.shape));
this.facade.deleteShape(this.shape);
}
if (this.canAttach && this.docker) {
this.docker.setDockedShape(undefined);
}
this.facade.getCanvas().update();
this.facade.updateSelection();
}
});
// Update canvas
var command = new commandClass(option, $scope.dragCurrentParent, canAttach, pos, editorManager.getEditor());
editorManager.executeCommands([command]);
// Fire event to all who want to know about this
var dropEvent = {
type: FLOWABLE.eventBus.EVENT_TYPE_ITEM_DROPPED,
droppedItem: item,
position: pos
};
FLOWABLE.eventBus.dispatch(dropEvent.type, dropEvent);
}
}
$scope.dragCurrentParent = undefined;
$scope.dragCurrentParentId = undefined;
$scope.dragCurrentParentStencil = undefined;
$scope.dragCanContain = undefined;
$scope.quickMenu = undefined;
$scope.dropTargetElement = undefined;
};
$scope.overCallback = function (event, ui) {
$scope.dragModeOver = true;
};
$scope.outCallback = function (event, ui) {
$scope.dragModeOver = false;
};
$scope.startDragCallback = function (event, ui) {
$scope.dragModeOver = false;
$scope.quickMenu = false;
if (!ui.helper.hasClass('stencil-item-dragged')) {
ui.helper.addClass('stencil-item-dragged');
}
};
$scope.startDragCallbackQuickMenu = function (event, ui) {
$scope.dragModeOver = false;
$scope.quickMenu = true;
};
$scope.dragCallback = function (event, ui) {
if ($scope.dragModeOver != false) {
var coord = editorManager.eventCoordinatesXY(event.pageX, event.pageY);
var additionalIEZoom = 1;
if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
var ua = navigator.userAgent;
if (ua.indexOf('MSIE') >= 0) {
//IE 10 and below
var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100);
if (zoom !== 100) {
additionalIEZoom = zoom / 100
}
}
}
if (additionalIEZoom !== 1) {
coord.x = coord.x / additionalIEZoom;
coord.y = coord.y / additionalIEZoom;
}
var aShapes = editorManager.getCanvas().getAbstractShapesAtPosition(coord);
if (aShapes.length <= 0) {
if (event.helper) {
$scope.dragCanContain = false;
return false;
}
}
if (aShapes[0] instanceof ORYX.Core.Canvas) {
editorManager.getCanvas().setHightlightStateBasedOnX(coord.x);
}
if (aShapes.length == 1 && aShapes[0] instanceof ORYX.Core.Canvas) {
var item = $scope.getStencilItemById(event.target.id);
var parentCandidate = aShapes[0];
if (item.id === 'Lane' || item.id === 'BoundaryErrorEvent' || item.id === 'BoundaryMessageEvent' ||
item.id === 'BoundarySignalEvent' || item.id === 'BoundaryTimerEvent' ||
item.id === 'BoundaryCancelEvent' || item.id === 'BoundaryCompensationEvent' ||
item.id === 'EntryCriterion') {
$scope.dragCanContain = false;
// Show Highlight
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_SHOW,
highlightId: 'shapeRepo.added',
elements: [parentCandidate],
style: ORYX.CONFIG.SELECTION_HIGHLIGHT_STYLE_RECTANGLE,
color: ORYX.CONFIG.SELECTION_INVALID_COLOR
});
} else {
$scope.dragCanContain = true;
$scope.dragCurrentParent = parentCandidate;
$scope.dragCurrentParentId = parentCandidate.id;
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.added"
});
}
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.attached"
});
return false;
} else {
var item = $scope.getStencilItemById(event.target.id);
var parentCandidate = aShapes.reverse().find(function (candidate) {
return (candidate instanceof ORYX.Core.Canvas
|| candidate instanceof ORYX.Core.Node
|| candidate instanceof ORYX.Core.Edge);
});
if (!parentCandidate) {
$scope.dragCanContain = false;
return false;
}
if (item.type === "node") {
// check if the draggable is a boundary event and the parent an Activity
var _canContain = false;
var parentStencilId = parentCandidate.getStencil().id();
if ($scope.dragCurrentParentId && $scope.dragCurrentParentId === parentCandidate.id) {
return false;
}
var parentItem = $scope.getStencilItemById(parentCandidate.getStencil().idWithoutNs());
if (parentCandidate.getStencil().id().endsWith("DecisionServiceSection")) {
if (item.id === 'Decision') {
_canContain = true;
}
} else if (parentItem.roles.indexOf('Activity') > -1) {
if (item.roles.indexOf('IntermediateEventOnActivityBoundary') > -1
|| item.roles.indexOf('EntryCriterionOnItemBoundary') > -1
|| item.roles.indexOf('ExitCriterionOnItemBoundary') > -1) {
_canContain = true;
}
} else if(parentItem.roles.indexOf('StageActivity') > -1) {
if (item.roles.indexOf('EntryCriterionOnItemBoundary') > -1
|| item.roles.indexOf('ExitCriterionOnItemBoundary') > -1) {
_canContain = true;
}
} else if(parentItem.roles.indexOf('StageModelActivity') > -1) {
if (item.roles.indexOf('ExitCriterionOnItemBoundary') > -1) {
_canContain = true;
}
} else if (parentCandidate.getStencil().idWithoutNs() === 'Pool') {
if (item.id === 'Lane') {
_canContain = true;
}
}
if (_canContain) {
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_SHOW,
highlightId: "shapeRepo.attached",
elements: [parentCandidate],
style: ORYX.CONFIG.SELECTION_HIGHLIGHT_STYLE_RECTANGLE,
color: ORYX.CONFIG.SELECTION_VALID_COLOR
});
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.added"
});
} else {
for (var i = 0; i < $scope.containmentRules.length; i++) {
var rule = $scope.containmentRules[i];
if (rule.role === parentItem.id) {
for (var j = 0; j < rule.contains.length; j++) {
if (item.roles.indexOf(rule.contains[j]) > -1) {
_canContain = true;
break;
}
}
if (_canContain) {
break;
}
}
}
// Show Highlight
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_SHOW,
highlightId: 'shapeRepo.added',
elements: [parentCandidate],
color: _canContain ? ORYX.CONFIG.SELECTION_VALID_COLOR : ORYX.CONFIG.SELECTION_INVALID_COLOR
});
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.attached"
});
}
$scope.dragCurrentParent = parentCandidate;
$scope.dragCurrentParentId = parentCandidate.id;
$scope.dragCurrentParentStencil = parentStencilId;
$scope.dragCanContain = _canContain;
} else {
var canvasCandidate = editorManager.getCanvas();
var canConnect = false;
var targetStencil = $scope.getStencilItemById(parentCandidate.getStencil().idWithoutNs());
if (targetStencil) {
var associationConnect = false;
if (stencil.idWithoutNs() === 'Association' && (curCan.getStencil().idWithoutNs() === 'TextAnnotation' || curCan.getStencil().idWithoutNs() === 'BoundaryCompensationEvent')) {
associationConnect = true;
} else if (stencil.idWithoutNs() === 'DataAssociation' && curCan.getStencil().idWithoutNs() === 'DataStore') {
associationConnect = true;
}
if (targetStencil.canConnectTo || associationConnect) {
canConnect = true;
}
}
//Edge
$scope.dragCurrentParent = canvasCandidate;
$scope.dragCurrentParentId = canvasCandidate.id;
$scope.dragCurrentParentStencil = canvasCandidate.getStencil().id();
$scope.dragCanContain = canConnect;
// Show Highlight
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_SHOW,
highlightId: 'shapeRepo.added',
elements: [canvasCandidate],
color: ORYX.CONFIG.SELECTION_VALID_COLOR
});
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_HIDE,
highlightId: "shapeRepo.attached"
});
}
}
}
};
$scope.dragCallbackQuickMenu = function (event, ui) {
if ($scope.dragModeOver != false) {
var coord = editorManager.eventCoordinatesXY(event.pageX, event.pageY);
var additionalIEZoom = 1;
if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) {
var ua = navigator.userAgent;
if (ua.indexOf('MSIE') >= 0) {
//IE 10 and below
var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100);
if (zoom !== 100) {
additionalIEZoom = zoom / 100
}
}
}
if (additionalIEZoom !== 1) {
coord.x = coord.x / additionalIEZoom;
coord.y = coord.y / additionalIEZoom;
}
var aShapes = editorManager.getCanvas().getAbstractShapesAtPosition(coord);
if (aShapes.length <= 0) {
if (event.helper) {
$scope.dragCanContain = false;
return false;
}
}
if (aShapes[0] instanceof ORYX.Core.Canvas) {
editorManager.getCanvas().setHightlightStateBasedOnX(coord.x);
}
var stencil = undefined;
var stencilSets = editorManager.getStencilSets().values();
for (var i = 0; i < stencilSets.length; i++) {
var stencilSet = stencilSets[i];
var nodes = stencilSet.nodes();
for (var j = 0; j < nodes.length; j++) {
if (nodes[j].idWithoutNs() === event.target.id) {
stencil = nodes[j];
break;
}
}
if (!stencil) {
var edges = stencilSet.edges();
for (var j = 0; j < edges.length; j++) {
if (edges[j].idWithoutNs() === event.target.id) {
stencil = edges[j];
break;
}
}
}
}
var candidate = aShapes.last();
var isValid = false;
if (stencil.type() === "node") {
//check containment rules
var canContain = editorManager.getRules().canContain({containingShape:candidate, containedStencil:stencil});
var parentCandidate = aShapes.reverse().find(function (candidate) {
return (candidate instanceof ORYX.Core.Canvas
|| candidate instanceof ORYX.Core.Node
|| candidate instanceof ORYX.Core.Edge);
});
if (!parentCandidate) {
$scope.dragCanContain = false;
return false;
}
$scope.dragCurrentParent = parentCandidate;
$scope.dragCurrentParentId = parentCandidate.id;
$scope.dragCurrentParentStencil = parentCandidate.getStencil().id();
$scope.dragCanContain = canContain;
$scope.dropTargetElement = parentCandidate;
isValid = canContain;
} else { //Edge
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
var currentSelectedShape = shapes.first();
var curCan = candidate;
var canConnect = false;
var targetStencil = $scope.getStencilItemById(curCan.getStencil().idWithoutNs());
if (targetStencil) {
var associationConnect = false;
if (stencil.idWithoutNs() === 'Association' && (curCan.getStencil().idWithoutNs() === 'TextAnnotation' || curCan.getStencil().idWithoutNs() === 'BoundaryCompensationEvent')) {
associationConnect = true;
} else if (stencil.idWithoutNs() === 'DataAssociation' && curCan.getStencil().idWithoutNs() === 'DataStore') {
associationConnect = true;
}
if (targetStencil.canConnectTo || associationConnect) {
while (!canConnect && curCan && !(curCan instanceof ORYX.Core.Canvas)) {
candidate = curCan;
//check connection rules
canConnect = editorManager.getRules().canConnect({
sourceShape: currentSelectedShape,
edgeStencil: stencil,
targetShape: curCan
});
curCan = curCan.parent;
}
}
}
var parentCandidate = editorManager.getCanvas();
isValid = canConnect;
$scope.dragCurrentParent = parentCandidate;
$scope.dragCurrentParentId = parentCandidate.id;
$scope.dragCurrentParentStencil = parentCandidate.getStencil().id();
$scope.dragCanContain = canConnect;
$scope.dropTargetElement = candidate;
}
}
editorManager.handleEvents({
type: ORYX.CONFIG.EVENT_HIGHLIGHT_SHOW,
highlightId:'shapeMenu',
elements: [candidate],
color: isValid ? ORYX.CONFIG.SELECTION_VALID_COLOR : ORYX.CONFIG.SELECTION_INVALID_COLOR
});
}
};
$scope.pullRight = function() {
document.getElementById("propertySection").style.display = "none"
document.getElementById("pull-left-btn").style.display = "block"
}
$scope.pullLeft = function() {
document.getElementById("propertySection").style.display = "block"
document.getElementById("pull-left-btn").style.display = "none"
}
}]);
var FLOWABLE = FLOWABLE || {};
//create command for undo/redo
FLOWABLE.CreateCommand = ORYX.Core.Command.extend({
construct: function(option, currentReference, position, facade){
this.option = option;
this.currentReference = currentReference;
this.position = position;
this.facade = facade;
this.shape;
this.edge;
this.targetRefPos;
this.sourceRefPos;
/*
* clone options parameters
*/
this.connectedShape = option.connectedShape;
this.connectingType = option.connectingType;
this.namespace = option.namespace;
this.type = option.type;
this.containedStencil = option.containedStencil;
this.parent = option.parent;
this.currentReference = currentReference;
this.shapeOptions = option.shapeOptions;
},
execute: function(){
if (this.shape) {
if (this.shape instanceof ORYX.Core.Node) {
this.parent.add(this.shape);
if (this.edge) {
this.facade.getCanvas().add(this.edge);
this.edge.dockers.first().setDockedShape(this.connectedShape);
this.edge.dockers.first().setReferencePoint(this.sourceRefPos);
this.edge.dockers.last().setDockedShape(this.shape);
this.edge.dockers.last().setReferencePoint(this.targetRefPos);
}
this.facade.setSelection([this.shape]);
} else if (this.shape instanceof ORYX.Core.Edge) {
this.facade.getCanvas().add(this.shape);
this.shape.dockers.first().setDockedShape(this.connectedShape);
this.shape.dockers.first().setReferencePoint(this.sourceRefPos);
}
}
else {
this.shape = this.facade.createShape(this.option);
this.edge = (!(this.shape instanceof ORYX.Core.Edge)) ? this.shape.getIncomingShapes().first() : undefined;
}
if (this.currentReference && this.position) {
if (this.shape instanceof ORYX.Core.Edge) {
if (!(this.currentReference instanceof ORYX.Core.Canvas)) {
this.shape.dockers.last().setDockedShape(this.currentReference);
if (this.currentReference.getStencil().idWithoutNs() === 'TextAnnotation')
{
var midpoint = {};
midpoint.x = 0;
midpoint.y = this.currentReference.bounds.height() / 2;
this.shape.dockers.last().setReferencePoint(midpoint);
}
else
{
this.shape.dockers.last().setReferencePoint(this.currentReference.bounds.midPoint());
}
}
else {
this.shape.dockers.last().bounds.centerMoveTo(this.position);
}
this.sourceRefPos = this.shape.dockers.first().referencePoint;
this.targetRefPos = this.shape.dockers.last().referencePoint;
} else if (this.edge){
this.sourceRefPos = this.edge.dockers.first().referencePoint;
this.targetRefPos = this.edge.dockers.last().referencePoint;
}
} else {
var containedStencil = this.containedStencil;
var connectedShape = this.connectedShape;
var bc = connectedShape.bounds;
var bs = this.shape.bounds;
var pos = bc.center();
if(containedStencil.defaultAlign()==="north") {
pos.y -= (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET + (bs.height()/2);
} else if(containedStencil.defaultAlign()==="northeast") {
pos.x += (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.width()/2);
pos.y -= (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.height()/2);
} else if(containedStencil.defaultAlign()==="southeast") {
pos.x += (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.width()/2);
pos.y += (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.height()/2);
} else if(containedStencil.defaultAlign()==="south") {
pos.y += (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET + (bs.height()/2);
} else if(containedStencil.defaultAlign()==="southwest") {
pos.x -= (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.width()/2);
pos.y += (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.height()/2);
} else if(containedStencil.defaultAlign()==="west") {
pos.x -= (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET + (bs.width()/2);
} else if(containedStencil.defaultAlign()==="northwest") {
pos.x -= (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.width()/2);
pos.y -= (bc.height() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET_CORNER + (bs.height()/2);
} else {
pos.x += (bc.width() / 2) + ORYX.CONFIG.SHAPEMENU_CREATE_OFFSET + (bs.width()/2);
}
// Move shape to the new position
this.shape.bounds.centerMoveTo(pos);
// Move all dockers of a node to the position
if (this.shape instanceof ORYX.Core.Node){
(this.shape.dockers||[]).each(function(docker){
docker.bounds.centerMoveTo(pos);
});
}
//this.shape.update();
this.position = pos;
if (this.edge){
this.sourceRefPos = this.edge.dockers.first().referencePoint;
this.targetRefPos = this.edge.dockers.last().referencePoint;
}
}
this.facade.getCanvas().update();
this.facade.updateSelection();
},
rollback: function(){
this.facade.deleteShape(this.shape);
if(this.edge) {
this.facade.deleteShape(this.edge);
}
//this.currentParent.update();
this.facade.setSelection(this.facade.getSelection().without(this.shape, this.edge));
}
});
......@@ -13,6 +13,11 @@
'use strict';
let nodeIdList = []
let formKey = ""
let nodeId = ""
let selectCurrentNodeId = ""
angular.module('flowableModeler')
.controller('StencilController', ['$rootScope', '$scope', '$http', '$modal', '$timeout', '$window', 'editorManager',
function ($rootScope, $scope, $http, $modal, $timeout, $window, editorManager) {
......@@ -286,7 +291,6 @@ angular.module('flowableModeler')
// Gather properties of selected item
var properties = stencil.properties();
console.log(properties)
for (var i = 0; i < properties.length; i++) {
var property = properties[i];
if (property.popular() == false) continue;
......@@ -308,7 +312,14 @@ angular.module('flowableModeler')
if (selectedShape.properties.get(key) === 'true') {
selectedShape.properties.set(key, true);
console.log(selectedShape)
if (selectedShape.resourceId.indexOf("sid-") < 0) {
$rootScope.resourceId = ""
} else {
$rootScope.resourceId = selectedShape.resourceId
}
console.log($rootScope.resourceId, "$rootScope.resourceId selectedShape.resourceId")
}
if (FLOWABLE.UI_CONFIG.showRemovedProperties == false && property.isHidden())
......@@ -358,13 +369,331 @@ angular.module('flowableModeler')
}
selectedItem.properties.push(currentProperty);
}
}
// 新增节点逻辑
console.log("新增节点逻辑")
console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList')
window.share && window.share.event.on("currentNodeForm", (params)=> {
formKey = params.key
console.log(formKey, "currentNodeForm...currentNodeForm")
nodeIdList.push({
nodeId: $rootScope.currentReadResourceId,
formKey: formKey
})
if ($rootScope.currentReadResourceId && formKey) {
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig($rootScope.resourceId, formKey))
.success((res)=>{
console.log("新增节点逻辑,新增success、")
let FormJson = JSON.parse(res.FormJson)
const formJsonProperties = FormJson.schema.properties
let formArr = []
for (key in formJsonProperties) {
for (let ckey in formJsonProperties[key].properties) {
let params = formJsonProperties[key].properties[ckey]
formArr.push({
ActID: $rootScope.currentReadResourceId,
Config: '',
FieldCode: ckey,
FieldName: params.title,
FieldType: params.type,
FormKey: formKey,
IsShow: 1,
Type:"",
Unit:""
})
}
}
$http({method: 'POST', url: FLOWABLE.APP_URL.SaveColumnConfig($rootScope.currentReadResourceId, decodeURI(formKey)), data: formArr})
.success(function(res) {
// console.log(res)
})
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
})
// / 以下处理新增编辑逻辑
console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem")
if (nodeIdList.length > 0 && selectCurrentNodeId && selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value){
let clickedShape = selectedItem.properties[14].value.key
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(selectCurrentNodeId, clickedShape))
.success((res)=>{
console.log("以下处理新增编辑逻辑,新增success、")
let FormJson = JSON.parse(res.FormJson)
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
// 以下处理保存之后得读取数值
console.log("以下处理保存之后得读取数值")
console.log(selectedItem, ":selectedItem.selectedItemselectedItemselectedItem")
console.log(nodeIdList, 'nodeIdList nodeIdList nodeIdList nodeIdList')
console.log(selectCurrentNodeId, "selectCurrentNodeIdselectCurrentNodeIdselectCurrentNodeIdselectCurrentNodeId")
if (nodeIdList.length === 0) {
window.share && window.share.event.on("readEditNodeId", (params)=> {
console.log(params ,"editNodeeditNodeeditNode")
if (selectedItem && selectedItem.properties.length > 14 && selectedItem.properties[14].value) {
// console.log("编辑,读取字段配置,进来了")
let clickedShape = selectedItem.properties[14].value.key
window.share && window.share.event.emit("editCurrentNodeForm", clickedShape);
window.share && window.share.event.emit("editCurrentNodeId", params);
let currentObjArr = []
$http.get(FLOWABLE.APP_URL.GetColumnConfig(params, clickedShape))
.success((res)=>{
let FormJson = JSON.parse(res.FormJson)
let fatherObj = FormJson.schema.properties
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
arr.push({...objCollections[key],key})
}
return arr
}
let fieldTitle = {
description: '',
hasReadWriteMode: false,
hidden: false,
mode: "read",
readModeTemplateUrl: "",
readonly: false,
title: '表单字段',
type: "string",
value: true,
writeModeTemplateUrl: "",
}
for(let key in fatherObj) {
const currentObj = {
description: '',
hasReadWriteMode: false,
hidden: false,
key: key,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: fatherObj[key].title,
type: "wangwanli",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
currentObjArr.push(currentObj)
}
currentObjArr.unshift(fieldTitle)
$rootScope.formKeyList = selectedItem.properties
let preArr = []
let nextArr = []
if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
preArr = $rootScope.formKeyList.slice(0,15)
nextArr = $rootScope.formKeyList.slice(15)
}
selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
})
}
})
}
/// 再次进入编辑
// if (clickedShape && formKey && nodeId) {
// let obj = {}
// let reduceNodeList = nodeIdList.reduce((cur,next) => {
// obj[next.nodeId] ? "" : obj[next.nodeId] = true && cur.push(next);
// return cur;
// },[])
// reduceNodeList.forEach((item)=>{
// if (item.formKey === clickedShape) {
// let currentObjArr = []
// $http.get(FLOWABLE.APP_URL.GetColumnConfig(item.nodeId, item.formKey))
// .success((res)=>{
// let FormJson = JSON.parse(res.FormJson)
// // let FormJson = {"schema":{"type":"object","ui:displayType":"row","ui:showDescIcon":true,"properties":{"object_-UvCWr":{"title":"工单信息","type":"object","properties":{"input_tzkvpC":{"title":"超时记录","type":"string","ui:options":{}},"input_Uo6WRF":{"title":"工单编号","type":"string","ui:options":{}}}},"object_Ic4XnA":{"title":"派单信息","type":"object","properties":{"date_O9YUWZ":{"title":"派单时间","type":"string","format":"date"},"input_aCUJ0c":{"title":"派单信息","type":"string","ui:options":{}},"select_fnxK9n":{"title":"处理时限","type":"string","enum":["8","24"],"enumNames":["8小时","24小时"]}}},"object_s3nPPO":{"title":"接单信息","type":"object","properties":{"date_Mu9mZD":{"title":"接单时间","type":"string","format":"date"},"input_4r9Nsv":{"title":"处理人员","type":"string","ui:options":{}},"input_UCumQ1":{"title":"承办科�??","type":"string","ui:options":{}},"input_p-C7Ag":{"title":"水表编号","type":"string","ui:options":{}},"input_09XpIU":{"title":"维修内�??","type":"string","ui:options":{}},"date_NT8w8m":{"title":"维修时间","type":"string","format":"date"},"image_BoKhol":{"title":"现场图标","type":"string","format":"image","ui:options":{}},"image_9WetPr":{"title":"完工图标","type":"string","format":"image","ui:options":{}},"textarea_ng7GLp":{"title":"备注","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_du_rtb":{"title":"部门审核","type":"object","properties":{"input_yYqJ0L":{"title":"审核�?","type":"string","ui:options":{}},"input_Q_wnkN":{"title":"审核部门","type":"string","ui:options":{}},"date_PkYqQS":{"title":"部门审核时间","type":"string","format":"date"},"textarea_Qmsa4s":{"title":"审核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_WNdEdt":{"title":"工程科�?�核","type":"object","properties":{"input_PQ3Khh":{"title":"工程科�?�核�?","type":"string","ui:options":{}},"date_gyH3V-":{"title":"工程科�?�核时间","type":"string","format":"date"},"textarea_F3ahcF":{"title":"工程科�?�核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_yVmzxn":{"title":"复核","type":"object","properties":{"input_OlbjAL":{"title":"复核�?","type":"string","ui:options":{}},"input_LYiawW":{"title":"复核部门","type":"string","ui:options":{}},"date_3fobcq":{"title":"复核时间","type":"string","format":"date"},"textarea_4ZWJaB":{"title":"复核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}}},"ui:column":3},"displayType":"row","showDescIcon":true,"column":3}
// let fatherObj = FormJson.schema.properties
// function generatorArr(objCollections) {
// let arr = []
// for(let key in objCollections) {
// arr.push({...objCollections[key],key})
// }
// return arr
// }
// let fieldTitle = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// mode: "read",
// readModeTemplateUrl: "",
// readonly: false,
// title: '表单字段',
// type: "string",
// value: true,
// writeModeTemplateUrl: "",
// }
// for(let key in fatherObj) {
// const currentObj = {
// description: '',
// hasReadWriteMode: false,
// hidden: false,
// key: key,
// mode: "read",
// readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
// readonly: false,
// title: fatherObj[key].title,
// type: "wangwanli",
// value: true,
// properties: generatorArr(fatherObj[key].properties),
// writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
// }
// currentObjArr.push(currentObj)
// }
// currentObjArr.unshift(fieldTitle)
// $rootScope.formKeyList = selectedItem.properties
// let preArr = []
// let nextArr = []
// if ($rootScope.formKeyList.length > 14 && $rootScope.formKeyList[14].key === "oryx-formreference") {
// preArr = $rootScope.formKeyList.slice(0,15)
// nextArr = $rootScope.formKeyList.slice(15)
// }
// selectedItem.properties = preArr.concat(currentObjArr).concat(nextArr)
// })
// }
// })
// }
// Need to wrap this in an $apply block, see http://jimhoskins.com/2012/12/17/angularjs-and-apply.html
$scope.safeApply(function () {
$scope.selectedItem = selectedItem;
$scope.selectedShape = selectedShape;
console.log(selectedShape, "selectedShapeselectedShapeselectedShapeselectedShapeselectedShape")
if (selectedShape.resourceId.indexOf("sid-") > -1) {
selectCurrentNodeId = selectedShape.resourceId
window.share && window.share.event.emit("readEditNodeId", selectCurrentNodeId);
$rootScope.currentReadResourceId = selectCurrentNodeId
} else {
selectCurrentNodeId = ""
}
});
} else {
......@@ -545,33 +874,33 @@ angular.module('flowableModeler')
}
$scope.morphShape = function() {
$scope.safeApply(function () {
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
$rootScope.currentSelectedShape = shapes.first();
var stencilItem = $scope.getStencilItemById($rootScope.currentSelectedShape.getStencil().idWithoutNs());
var morphShapes = [];
for (var i = 0; i < $scope.morphRoles.length; i++) {
if ($scope.morphRoles[i].role === stencilItem.morphRole) {
morphShapes = $scope.morphRoles[i].morphOptions.slice();
$scope.safeApply(function () {
var shapes = editorManager.getSelection();
if (shapes && shapes.length == 1) {
$rootScope.currentSelectedShape = shapes.first();
var stencilItem = $scope.getStencilItemById($rootScope.currentSelectedShape.getStencil().idWithoutNs());
var morphShapes = [];
for (var i = 0; i < $scope.morphRoles.length; i++) {
if ($scope.morphRoles[i].role === stencilItem.morphRole) {
morphShapes = $scope.morphRoles[i].morphOptions.slice();
}
}
}
// Method to open shape select dialog (used later on)
var showSelectShapeDialog = function()
{
$rootScope.morphShapes = morphShapes;
_internalCreateModal({
backdrop: false,
keyboard: true,
template: 'editor-app/popups/select-shape.html?version=' + Date.now()
}, $modal, $rootScope);
};
// Method to open shape select dialog (used later on)
var showSelectShapeDialog = function()
{
$rootScope.morphShapes = morphShapes;
_internalCreateModal({
backdrop: false,
keyboard: true,
template: 'editor-app/popups/select-shape.html?version=' + Date.now()
}, $modal, $rootScope);
};
showSelectShapeDialog();
}
});
showSelectShapeDialog();
}
});
};
$scope.deleteShape = function() {
......@@ -634,7 +963,6 @@ angular.module('flowableModeler')
if (!$scope.selectedItem.properties[index].hidden) {
$scope.selectedItem.properties[index].mode = "write";
}
console.log($scope.selectedItem.properties)
};
/* Helper method to retrieve the template url for a property */
......@@ -642,7 +970,7 @@ angular.module('flowableModeler')
return $scope.selectedItem.properties[index].templateUrl;
};
$scope.getPropertyReadModeTemplateUrl = function (index) {
// 处理不可修改数据 disabled
// 处理不可�?改数�? disabled
const disableArr = ["oryx-process_id"]
disableArr.forEach((item)=>{
if ($scope.selectedItem.properties[index].key === item) {
......@@ -653,7 +981,7 @@ angular.module('flowableModeler')
}
})
// console.log($scope.selectedItem.properties)
// 处理下拉框数
// 处理下拉框数�?
const showRealWriteArr = ["flowable-multiinstance", "flowable-http-request-method", "flowable-processhistorylevel"]
showRealWriteArr.forEach((item)=>{
if($scope.selectedItem.properties[index].type === item) {
......@@ -675,6 +1003,7 @@ angular.module('flowableModeler')
if (shapeId) {
if (shape.id != shapeId && $scope.previousSelectedShape && $scope.previousSelectedShape.id == shapeId) {
shape = $scope.previousSelectedShape;
console.log(shape)
} else {
shape = null;
}
......
......@@ -869,6 +869,12 @@
"DESCRIPTION" : "关联到一个表单"
}
},
"FORMFIELDCONFIG" : {
"FIELDCONFIG" : {
"TITLE" : "表单字段配置",
"DESCRIPTION" : "配置节点表单字段显示"
}
},
"TERMINATEALLPACKAGE" : {
"TERMINATEALL" : {
"TITLE" : "终止所有",
......
......@@ -8,7 +8,8 @@
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Flowable Modeler</title>
<link rel="icon" type="image/ico" href="favicon.ico">
......@@ -41,6 +42,15 @@
<link rel="stylesheet" href="styles/style-editor.css">
<link rel="stylesheet" href="fonts/form-btns/iconfont.css">
<script src="scripts/event.js"></script>
<script>
window.share = {
event: new EventEmitter(),
};
window.share.event.setMaxListeners(1000);
</script>
<!-- endbuild -->
<script>
window.addEventListener('message',(event) =>{
......@@ -51,6 +61,8 @@
document.cookie = event.data + ";expires=" + exp.toGMTString();
}, false);
</script>
</head>
<body ng-app="flowableModeler" ng-cloak>
......@@ -133,6 +145,7 @@
<script src="libs/json3_3.2.6/lib/json3.min.js"></script>
<![endif]-->
<script src="libs/jquery_1.11.0/jquery.min.js"></script>
<script src="libs/jquery-ui-1.10.3.custom.min.js"></script>
......@@ -148,6 +161,7 @@
<script src="libs/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
<script src="libs/angular-strap_2.1.6/angular-strap.min.js"></script>
<script src="libs/angular-strap_2.1.6/angular-strap.tpl.min.js"></script>
<script src="libs/momentjs_2.18.1/momentjs.min.js"></script>
<script src="libs/bootstrap-tour_0.9.1/bootstrap-tour.min.js"></script>
<script src="libs/ng-file-upload/ng-file-upload-shim.min.js"></script>
......
#user nobody;
worker_processes 2;
worker_processes auto;
#error_log logs/error.log;
#error_log logs/error.log notice;
......@@ -16,7 +16,7 @@ events {
http {
include mime.types;
default_type application/octet-stream;
# default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
......@@ -24,25 +24,25 @@ http {
#access_log logs/access.log main;
sendfile on;
# sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
# keepalive_timeout 65;
# gzip on;
server {
listen 8890;
server_name localhost;
charset utf-8;
charset koi8-r;
root flowable-engine-fontend;
index index.html index.htm;
# access_log logs/host.access.log main;
location / {
root flowable-engine-fontend;
index index.html index.htm;
}
location /idmweb/ {
......@@ -82,6 +82,7 @@ http {
location / {
root form-render;
try_files $uri /index.html;
index index.html index.htm;
}
......
......@@ -16,7 +16,6 @@ var FORM_TOOLBAR = {
ACTIONS: {
saveModel: function (services) {
_internalCreateModal({
backdrop: true,
keyboard: true,
......
......@@ -206,6 +206,21 @@ FLOWABLE.APP_URL = {
return '/CityInterface/rest/services/PandaWorkflow.svc/GetModelDetail?ModelID=' + id + '&Model_key=' + key +'&Cookie=' + cookie
},
// 获取字段配置信息
GetColumnConfig:function(ACTID, FORMKEY) {
return `/CityInterface/rest/services/PandaWorkflow.svc/GetColumnConfig?ActID=${ACTID}&FormKey=${FORMKEY}`
},
// 保存单个字段配置信息
SaveFieldConfig:function() {
return `/CityInterface/rest/services/PandaWorkflow.svc/SaveFieldConfig`
},
// 保存整个表单字段配置信息
SaveColumnConfig:function(ACTID, FORMKEY) {
return `/CityInterface/rest/services/PandaWorkflow.svc/SaveColumnConfig?ActID=${ACTID}&FormKey=${FORMKEY}`
},
getStaffList: function() {
return '/Cityinterface/rest/services/CountyProduct.svc/AccountManage/getUserListForRole?_version=9999'
},
......
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
菴�腱肢�恰�頵����篏睡��
**/
//var isArray = Array.isArray;
var isArray = Array.isArray || function (obj) {
return Object.prototype.toString.call(obj) === '[object Array]' ? true : false;
};
function EventEmitter() {}
// By default EventEmitters will print a warning if more than
// 10 listeners are added to it. This is a useful default which
// helps finding memory leaks.
//
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
var defaultMaxListeners = 20;
EventEmitter.prototype.setMaxListeners = function (n) {
if (!this._events) this._events = {};
this._maxListeners = n;
};
EventEmitter.prototype.emit = function () {
var type = arguments[0];
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events || !this._events.error ||
(isArray(this._events.error) && !this._events.error.length)) {
if (arguments[1] instanceof Error) {
throw arguments[1]; // Unhandled 'error' event
} else {
throw new Error("Uncaught, unspecified 'error' event.");
}
return false;
}
}
if (!this._events) return false;
var handler = this._events[type];
if (!handler) return false;
if (typeof handler == 'function') {
switch (arguments.length) {
// fast cases
case 1:
handler.call(this);
break;
case 2:
handler.call(this, arguments[1]);
break;
case 3:
handler.call(this, arguments[1], arguments[2]);
break;
// slower
default:
var l = arguments.length;
var args = new Array(l - 1);
for (var i = 1; i < l; i++) args[i - 1] = arguments[i];
handler.apply(this, args);
}
return true;
} else if (isArray(handler)) {
var l = arguments.length;
var args = new Array(l - 1);
for (var i = 1; i < l; i++) args[i - 1] = arguments[i];
var listeners = handler.slice();
for (var i = 0, l = listeners.length; i < l; i++) {
listeners[i].apply(this, args);
}
return true;
} else {
return false;
}
};
EventEmitter.prototype.addListener = function (type, listener) {
if ('function' !== typeof listener) {
throw new Error('addListener only takes instances of Function');
}
if (!this._events) this._events = {};
// To avoid recursion in the case that type == "newListeners"! Before
// adding it to the listeners, first emit "newListeners".
this.emit('newListener', type, listener);
if (!this._events[type]) {
// Optimize the case of one listener. Don't need the extra array object.
this._events[type] = listener;
} else if (isArray(this._events[type])) {
// If we've already got an array, just append.
this._events[type].push(listener);
} else {
// Adding the second element, need to change to array.
this._events[type] = [this._events[type], listener];
}
// Check for listener leak
if (isArray(this._events[type]) && !this._events[type].warned) {
var m;
if (this._maxListeners !== undefined) {
m = this._maxListeners;
} else {
m = defaultMaxListeners;
}
if (m && m > 0 && this._events[type].length > m) {
this._events[type].warned = true;
console.error('Possible mem-leak detected. event[' + type + '] %d listeners added. ' +
'Use emitter.setMaxListeners() to increase limit.',
this._events[type].length);
console.trace();
}
}
return this;
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.once = function (type, listener) {
if ('function' !== typeof listener) {
throw new Error('.once only takes instances of Function');
}
var self = this;
function g() {
self.removeListener(type, g);
listener.apply(this, arguments);
};
g.listener = listener;
self.on(type, g);
return this;
};
EventEmitter.prototype.removeListener = function (type, listener) {
if ('function' !== typeof listener) {
throw new Error('removeListener only takes instances of Function');
}
// does not use listeners(), so no side effect of creating _events[type]
if (!this._events || !this._events[type]) return this;
var list = this._events[type];
if (isArray(list)) {
var position = -1;
for (var i = 0, length = list.length; i < length; i++) {
if (list[i] === listener ||
(list[i].listener && list[i].listener === listener)) {
position = i;
break;
}
}
if (position < 0) return this;
list.splice(position, 1);
if (list.length == 0)
delete this._events[type];
} else if (list === listener ||
(list.listener && list.listener === listener)) {
delete this._events[type];
}
return this;
};
EventEmitter.prototype.removeAllListeners = function (type) {
if (arguments.length === 0) {
this._events = {};
return this;
}
// does not use listeners(), so no side effect of creating _events[type]
if (type && this._events && this._events[type]) this._events[type] = null;
return this;
};
EventEmitter.prototype.listeners = function (type) {
if (!this._events) this._events = {};
if (!this._events[type]) this._events[type] = [];
if (!isArray(this._events[type])) {
this._events[type] = [this._events[type]];
}
return this._events[type];
};
\ No newline at end of file
......@@ -357,7 +357,7 @@ a.dropdown-toggle {
/** Subtle dropdown (eg. sort) */
.dropdown-subtle {
margin-right: 5px;
margin-right: 200px;
color: #606b7d;
}
......@@ -986,7 +986,7 @@ a.dropdown-toggle {
}
.wrapper {
padding: 55px 15px 15px 15px;
/* padding: 55px 15px 15px 15px; */
max-width: 1400px;
min-width: 1024px;
margin: 0 auto;
......
......@@ -11,9 +11,13 @@
*/
.container-fluid {
max-width: 1400px;
/* max-width: 1400px; */
min-width: 1000px;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.subtle-select .glyphicon {
......@@ -26,7 +30,7 @@ a.subtle-select:hover .glyphicon {
}
.full {
padding: 0 15px;
/* padding: 0 15px; */
width: 100%;
}
......@@ -83,6 +87,22 @@ h1 {
text-overflow: ellipsis;
}
.subheader{
background: #fff !important;
border-bottom: 1px solid #e8edf1 !important;
}
.subheader .fixed-container-header{
display: flex;
justify-content: space-between;
align-items: center;
height: 40px;
}
.subheader .fixed-container-header .btnsgroup{
margin-right: 10px;
}
.subheader .details .counter {
top: -1px;
line-height: 1;
......@@ -119,9 +139,17 @@ h1 {
/* List Filter */
.filter-wrapper {
min-height: 400px;
margin-top: 10px;
/* min-height: 400px; */
margin-top: 15px;
margin-left: -15px;
display: flex;
justify-content: flex-end;
width: 100%;
border-bottom: 1px solid #e8edf1;
}
.filter-wrapper .input-group{
margin-bottom: 10px;
}
ul.filter-list {
......@@ -164,7 +192,7 @@ ul.filter-list li.current a:hover, ul.filter-list li.current a:focus {
.item-wrapper {
padding-left: 0;
margin-top: 5px;
margin-top: -42px;
}
.item-wrapper .message {
......
......@@ -44,6 +44,45 @@
return str;
}
console.log(decoder("&#29066;&#29483;&#20840;&#22269;&#19994;&#32489;&#20449;&#24687;&#21488;&#36134;"))
var arrslice = [1,2,3,4,5,6]
console.log(arrslice.slice(0,3))
console.log(arrslice.slice(3))
let FormJson = {"schema":{"type":"object","ui:displayType":"row","ui:showDescIcon":true,"properties":{"object_-UvCWr":{"title":"工单信息","type":"object","properties":{"input_tzkvpC":{"title":"超时记录","type":"string","ui:options":{}},"input_Uo6WRF":{"title":"工单编号","type":"string","ui:options":{}}}},"object_Ic4XnA":{"title":"派单信息","type":"object","properties":{"date_O9YUWZ":{"title":"派单时间","type":"string","format":"date"},"input_aCUJ0c":{"title":"派单信息","type":"string","ui:options":{}},"select_fnxK9n":{"title":"处理时限","type":"string","enum":["8","24"],"enumNames":["8小时","24小时"]}}},"object_s3nPPO":{"title":"接单信息","type":"object","properties":{"date_Mu9mZD":{"title":"接单时间","type":"string","format":"date"},"input_4r9Nsv":{"title":"处理人员","type":"string","ui:options":{}},"input_UCumQ1":{"title":"承办科�??","type":"string","ui:options":{}},"input_p-C7Ag":{"title":"水表编号","type":"string","ui:options":{}},"input_09XpIU":{"title":"维修内�??","type":"string","ui:options":{}},"date_NT8w8m":{"title":"维修时间","type":"string","format":"date"},"image_BoKhol":{"title":"现场图标","type":"string","format":"image","ui:options":{}},"image_9WetPr":{"title":"完工图标","type":"string","format":"image","ui:options":{}},"textarea_ng7GLp":{"title":"备注","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_du_rtb":{"title":"部门审核","type":"object","properties":{"input_yYqJ0L":{"title":"审核�?","type":"string","ui:options":{}},"input_Q_wnkN":{"title":"审核部门","type":"string","ui:options":{}},"date_PkYqQS":{"title":"部门审核时间","type":"string","format":"date"},"textarea_Qmsa4s":{"title":"审核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_WNdEdt":{"title":"工程科�?�核","type":"object","properties":{"input_PQ3Khh":{"title":"工程科�?�核�?","type":"string","ui:options":{}},"date_gyH3V-":{"title":"工程科�?�核时间","type":"string","format":"date"},"textarea_F3ahcF":{"title":"工程科�?�核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}},"object_yVmzxn":{"title":"复核","type":"object","properties":{"input_OlbjAL":{"title":"复核�?","type":"string","ui:options":{}},"input_LYiawW":{"title":"复核部门","type":"string","ui:options":{}},"date_3fobcq":{"title":"复核时间","type":"string","format":"date"},"textarea_4ZWJaB":{"title":"复核意�??","type":"string","format":"textarea","ui:options":{},"ui:width":"300%"}}}},"ui:column":3},"displayType":"row","showDescIcon":true,"column":3}
let fatherObj = FormJson.schema.properties
let strrrraRR = []
function generatorArr(objCollections) {
let arr = []
for(let key in objCollections) {
console.log(key)
arr.push({...objCollections[key],key})
}
return arr
}
for(let key in fatherObj) {
const currentObj = {
$$hashKey: `${key}`,
description: '',
hasReadWriteMode: true,
hidden: false,
key: `${key}`,
mode: "read",
readModeTemplateUrl: "editor-app/configuration/properties/form-field-read-config.html?version=" + (new Date()).getTime(),
readonly: false,
title: `${fatherObj[key].title}`,
type: "boolean",
value: true,
properties: generatorArr(fatherObj[key].properties),
writeModeTemplateUrl: "editor-app/configuration/properties/form-field-write-config.html?version=" + (new Date()).getTime(),
}
strrrraRR.push(currentObj)
}
console.log(strrrraRR)
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var arr= [
{
noedId: '123',
formKey: 'gjasgdfkj'
},
{
noedId: '123',
formKey: 'gjasgdfkj'
},
{
noedId: '133',
formKey: 'gjasgdfkj'
},
{
noedId: '123',
formKey: 'gjasgdfkj'
}
]
let obj = {};
let peon = arr.reduce((cur,next) => {
obj[next.noedId] ? "" : obj[next.noedId] = true && cur.push(next);
return cur;
},[])
console.log(peon);
</script>
</body>
</html>
\ No newline at end of file
<div class="subheader">
<div class="fixed-container">
<div class="btn-group pull-right">
<button type="button" class="btn btn-default" ng-click="createProcess()" translate>PROCESS-LIST.ACTION.CREATE</button>
<button type="button" class="btn btn-default" ng-click="importProcess()" translate>PROCESS-LIST.ACTION.IMPORT</button>
</div>
<div class="fixed-container-header">
<h2>{{'PROCESS-LIST.TITLE' | translate}}</h2>
<div class="btnsgroup">
<button type="button" class="btn btn-xs btn-default" ng-click="createProcess()" translate>PROCESS-LIST.ACTION.CREATE</button>
<button type="button" style="margin-left: 10px;" class="btn btn-xs btn-default" ng-click="importProcess()" translate>PROCESS-LIST.ACTION.IMPORT</button>
</div>
</div>
</div>
<div class="container-fluid content" auto-height offset="40">
<div class="col-xs-2 filter-wrapper">
<div class="filter-wrapper">
<div class="input-group">
<span class="input-group-addon"> <i
class="glyphicon glyphicon-search"></i>
</span> <input type="text" ng-model="model.pendingFilterText" class="form-control" ng-change="filterDelayed()"
placeholder="{{'PROCESS-LIST.SEARCH-PLACEHOLDER' | translate}}">
</div>
<ul class="filter-list">
<!-- <ul class="filter-list">
<li ng-repeat="filter in model.filters" ng-class="{'current' : filter.id == model.activeFilter.id}">
<a ng-click="activateFilter(filter)">{{'PROCESS-LIST.FILTER.' + filter.labelKey | translate}}</a>
</li>
</ul>
</ul> -->
</div>
<div class="col-xs-10 item-wrapper" id="list-items">
<div class="col-xs-12 item-wrapper" id="list-items">
<div class="dropdown-subtle pull-right">
<div class="btn-group btn-group-sm" activiti-fix-dropdown-bug>
<button type="button" class="btn btn-default dropdown-toggle"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment