Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
eebb95441c
Binary file not shown.
Binary file not shown.
@ -16,6 +16,7 @@ import java.util.concurrent.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.model.CoeCooperationTeamModel;
|
||||
import com.actionsoft.apps.coe.pal.pal.manage.publish.PublishAPIManager;
|
||||
@ -1921,7 +1922,8 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
List<PALRepositoryModel> list = dao.getPublishedRepositoryList(wsId);
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
if (list != null) {
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
@ -1953,7 +1955,8 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
List<PALRepositoryModel> list = dao.getPublishedRepositoryList(wsId);
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, _uc.getUID());
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, _uc.getUID(), false);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
if (list != null) {
|
||||
List<PALRepositoryModel> removeList = new ArrayList<PALRepositoryModel>();
|
||||
|
||||
Binary file not shown.
@ -3309,4 +3309,18 @@ public class CoEPALController {
|
||||
return web.getRepositoryModelVersionDiff(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验形状属性
|
||||
* @param me
|
||||
* @param uuid
|
||||
* @param define 若为空字符串,则获取系统当前保存的define进行校验
|
||||
* @return
|
||||
*/
|
||||
@Mapping("com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid")
|
||||
public String validRepositoryShapeAttr(UserContext me, String uuid, String define) {
|
||||
CoeDesignerWeb web = new CoeDesignerWeb(me);
|
||||
return web.validRepositoryShapeAttr(uuid, define);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -505,8 +505,8 @@ public class CoeCooperationAPIManager {
|
||||
// 获取用户权限,判断是否已存在
|
||||
List<String> rolePermList = new CoeCooperationRolePermDao().getRolePermListByRole(teamId, hideRole.getId());
|
||||
if (!rolePermList.contains(palVersionId)) {
|
||||
// 添加角色权限
|
||||
CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, hideRole.getId(), palVersionId);
|
||||
// 添加角色权限, 当前用户新建默认给全部的操作权限
|
||||
CoeCooperationRolePermModel rolePerm = new CoeCooperationRolePermModel(UUIDGener.getUUID(), teamId, hideRole.getId(), palVersionId,"w,d,v");
|
||||
new CoeCooperationRolePermDao().insert(rolePerm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.*;
|
||||
import com.actionsoft.apps.AppsConst;
|
||||
import com.actionsoft.apps.coe.pal.constant.CoEConstant;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
|
||||
import com.actionsoft.apps.lifecycle.api.AppsAPIManager;
|
||||
@ -140,7 +141,8 @@ public class PALMethodCache {
|
||||
List<String> methodList = PALMethodCache.getPALMethodList(sort);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
List<String> permMethodList = new ArrayList<>();
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
|
||||
for (String verId : versionIds) {
|
||||
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
|
||||
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {
|
||||
@ -169,7 +171,8 @@ public class PALMethodCache {
|
||||
List<String> methodList = PALMethodCache.getPALMethodList(sort);
|
||||
if (UtilString.isNotEmpty(teamId)) {
|
||||
List<String> permMethodList = new ArrayList<>();
|
||||
List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
// List<String> versionIds = CoeCooperationAPIManager.getInstance().queryCooperationRoleDataPermByTeamUser(teamId, userId);
|
||||
Set<String> versionIds = CooperationCache.getUserDataVisitablePermission(teamId, userId, false);
|
||||
for (String verId : versionIds) {
|
||||
List<PALRepositoryModel> verModels = PALRepositoryCache.getByVersionId(verId);
|
||||
if (verModels != null && verModels.size() > 0 && !permMethodList.contains(verModels.get(0).getMethodCategory())) {
|
||||
|
||||
@ -3401,6 +3401,80 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
return ro.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验形状属性
|
||||
* @param uuid
|
||||
* @param define 若为空字符串,则获取系统当前保存的define进行校验
|
||||
* @return
|
||||
*/
|
||||
public String validRepositoryShapeAttr(String uuid, String define) {
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
|
||||
if (model == null) {
|
||||
return ResponseObject.newErrResponse("模型不存在").toString();
|
||||
}
|
||||
if (UtilString.isEmpty(define) || "null".equals(define) || "undefined".equals(define)) {
|
||||
define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, uuid);
|
||||
}
|
||||
Map<String, PALMethodAttributeModel> methodAttributeModelMap = new HashMap<>();
|
||||
|
||||
// 校验形状
|
||||
List<JSONObject> elements = ShapeUtil.getShapeJsonToJsonObject(define);
|
||||
List<JSONObject> resultList = new ArrayList<>();
|
||||
for (JSONObject o : elements) {
|
||||
String shapeId = o.getString("id");
|
||||
String shapeName = o.getString("name");
|
||||
String text = UtilString.isEmpty(o.getString("text")) ? o.getString("title") : o.getString("text");
|
||||
String shapeCategory = o.getString("category");
|
||||
JSONObject dataAttributes = o.getJSONObject("dataAttributes");
|
||||
JSONArray attributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray");
|
||||
for (int i = 0; i < attributesJsonArray.size(); i++) {
|
||||
JSONObject attr = attributesJsonArray.getJSONObject(i);
|
||||
String attrId = attr.getString("id");
|
||||
String value = attr.getString("value");
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attrId)) {
|
||||
List<PALMethodAttributeModel> methodAttributeModels = CoeDesignerShapeAPIManager.getInstance().getValidAndUseAttributeModels(model.getWsId(), shapeCategory.replace("_", "."), shapeName, model.getMethodId());
|
||||
for (PALMethodAttributeModel attributeModel : methodAttributeModels) {
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attributeModel.getKey())) {
|
||||
methodAttributeModelMap.put(shapeName + "-" + attributeModel.getKey(), attributeModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attrId)) {
|
||||
continue;// 没有配置到形状的属性,不处理
|
||||
}
|
||||
PALMethodAttributeModel attrModel = methodAttributeModelMap.get(shapeName + "-" + attrId);
|
||||
if (attrModel.getIsRequired()) {// 筛选必填
|
||||
String attrType = attrModel.getType();
|
||||
boolean flag = true;
|
||||
if ("relation".equals(attrType) || "awsorg".equals(attrType)) {
|
||||
List<DesignerShapeRelationModel> list = DesignerShapeRelationCache.getListByAttrId(model.getId(), shapeId, attrId);
|
||||
if (list == null || list.isEmpty()) {
|
||||
flag = false;
|
||||
}
|
||||
} else {
|
||||
flag = UtilString.isNotEmpty(value);
|
||||
}
|
||||
if (!flag) {
|
||||
JSONObject tmp = new JSONObject();
|
||||
tmp.put("shapeId", shapeId);
|
||||
tmp.put("shapeName", text);
|
||||
tmp.put("attrName", attrModel.getNewTitle());
|
||||
tmp.put("attrId", attrId);
|
||||
resultList.add(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
if (!resultList.isEmpty()) {
|
||||
ro.setData(resultList);
|
||||
ro.err("校验未通过");
|
||||
return ro.toString();
|
||||
}
|
||||
return ResponseObject.newOkResponse().toString();
|
||||
|
||||
}
|
||||
|
||||
/******************************************新版门户流程详情end********************************************************/
|
||||
|
||||
//获取excel数据的内部类
|
||||
|
||||
@ -6,7 +6,6 @@ import com.actionsoft.apps.coe.pal.cooperation.CoeCooperationAPIManager;
|
||||
import com.actionsoft.apps.coe.pal.cooperation.cache.CooperationCache;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
|
||||
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
|
||||
import com.actionsoft.apps.coe.pal.output.pr.util.ReportRepositoryCompare;
|
||||
import com.actionsoft.apps.coe.pal.pal.output.util.OutputWordUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.DiagramsUtil;
|
||||
import com.actionsoft.apps.coe.pal.pal.repository.util.ShapeUtils;
|
||||
@ -116,6 +115,7 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.docx4j.wml.R;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
@ -173,14 +173,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString utilString = new UtilString(plSecurityW);
|
||||
List<String> v = utilString.split(",");
|
||||
for (int i = 0, size = v.size(); i < size; i++) {
|
||||
String w = (String) v.get(i);
|
||||
String w = v.get(i);
|
||||
plSecurityR = plSecurityR.replace(",", " ");
|
||||
if (plSecurityR.indexOf(w) > -1) {
|
||||
plSecurityR = plSecurityR.replace(w, "");
|
||||
}
|
||||
}
|
||||
plSecurityR = plSecurityR.trim();
|
||||
UtilString r = new UtilString(plSecurityR.toString());
|
||||
UtilString r = new UtilString(plSecurityR);
|
||||
List<String> newplRs = r.split(" ");
|
||||
int c = 0;
|
||||
Iterator it = newplRs.iterator();
|
||||
@ -204,14 +204,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString utilString = new UtilString(newStr);
|
||||
List<String> v = utilString.split(",");
|
||||
for (int i = 0, size = v.size(); i < size; i++) {
|
||||
String w = (String) v.get(i);
|
||||
String w = v.get(i);
|
||||
oldStr = oldStr.replace(",", " ");
|
||||
if (oldStr.indexOf(w) > -1) {
|
||||
oldStr = oldStr.replace(w, "");
|
||||
}
|
||||
}
|
||||
oldStr = oldStr.trim();
|
||||
UtilString r = new UtilString(oldStr.toString());
|
||||
UtilString r = new UtilString(oldStr);
|
||||
List<String> newplRs = r.split(" ");
|
||||
int c = 0;
|
||||
Iterator it = newplRs.iterator();
|
||||
@ -247,7 +247,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
macroLibraries.put("option", getCoeWorspaceHtml());
|
||||
macroLibraries.put("wsuuid", wsuuid);
|
||||
macroLibraries.put("userId", _uc.getUserModel().getUID());
|
||||
CoeWorkSpaceModel model = (CoeWorkSpaceModel) CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
||||
CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
||||
macroLibraries.put("wsName", model == null ? "" : I18nRes.findValue(CoEConstant.APP_ID, model.getWsName()));
|
||||
macroLibraries.put("treeData", PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeRootData(_uc, wsuuid, "", "isUsed"));
|
||||
macroLibraries.put("appId", CoEConstant.APP_ID);
|
||||
@ -892,7 +892,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
FileOutputStream out = null;
|
||||
try {
|
||||
out = new FileOutputStream(dc.getPath() + File.separator + "plMessage.txt");
|
||||
out.write(messageObject.toString().getBytes("UTF-8"));
|
||||
out.write(messageObject.toString().getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
@ -1558,7 +1558,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
FileOutputStream logOut = null;
|
||||
try {
|
||||
logOut = new FileOutputStream(expandDir.getPath() + "/importLog.txt");
|
||||
logOut.write(sbLog.toString().getBytes("UTF-8"));
|
||||
logOut.write(sbLog.toString().getBytes(StandardCharsets.UTF_8));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
@ -2040,7 +2040,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
//写入导入日志
|
||||
try {
|
||||
FileOutputStream logOut = new FileOutputStream(path + "/importLog.txt");
|
||||
logOut.write(sbLog.toString().getBytes("UTF-8"));
|
||||
logOut.write(sbLog.toString().getBytes(StandardCharsets.UTF_8));
|
||||
logOut.flush();
|
||||
logOut.close();
|
||||
} catch (IOException e) {
|
||||
@ -2298,7 +2298,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
map.put("sid", super.getContext().getSessionId());
|
||||
map.put("option", getCoeWorspaceHtml());
|
||||
map.put("wsuuid", wsuuid);
|
||||
CoeWorkSpaceModel model = (CoeWorkSpaceModel) CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
||||
CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsuuid);
|
||||
map.put("wsName", model == null ? "" : I18nRes.findValue(CoEConstant.APP_ID, model.getWsName()));
|
||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.manage.html", map);
|
||||
}
|
||||
@ -2310,7 +2310,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
macroLibraries.put("sid", super.getContext().getSessionId());
|
||||
macroLibraries.put("option", getCoeWorspaceHtml());
|
||||
macroLibraries.put("wsId", wsId);
|
||||
CoeWorkSpaceModel model = (CoeWorkSpaceModel) CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsId);
|
||||
CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsId);
|
||||
macroLibraries.put("wsName", model == null ? "" : model.getWsName());
|
||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.level.portal.tree.htm", macroLibraries);
|
||||
}
|
||||
@ -2326,7 +2326,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
*/
|
||||
public String createOrUpdateCoeProcessLevel(String wsid, String pid, String id, String type, String editable) {
|
||||
// 获得父级模型
|
||||
PALRepositoryModel parentPlModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
PALRepositoryModel parentPlModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
// 获得有哪些建模方法
|
||||
List<PALMethodModel> methodModels = null;
|
||||
if (parentPlModel == null) {
|
||||
@ -2354,7 +2354,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
if (!id.equals("") && !id.equals("0")) {
|
||||
macroLibraries.put("showStyle", "");
|
||||
PALRepositoryModel plModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
if ("default".equals(plModel.getMethodId())) {
|
||||
macroLibraries.put("showStyleCss", "Y");
|
||||
}
|
||||
@ -2447,7 +2447,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
// }
|
||||
|
||||
protected com.alibaba.fastjson.JSONArray getMoreSpecialAttr(String sid, String uuid) {
|
||||
PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
if (m == null) {
|
||||
return new com.alibaba.fastjson.JSONArray();
|
||||
}
|
||||
@ -2477,7 +2477,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
private Map<String, Object> getMoreAttrContent(String sid, String uuid, Map<String, Object> macroLibraries) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
// 获取所有文件属性
|
||||
List<PALMethodAttributeModel> methodAttrModels = PALRepositoryAPIManager.getInstance().getValidAttributeModels(m.getWsId(), m.getMethodId());
|
||||
Map<String, PALMethodAttributeModel> attributeModelMap = new HashMap<>();
|
||||
@ -2639,14 +2639,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
} else if ("relation".equals(type)) {// 关联pal模型文件、形状
|
||||
JSONObject refObj = JSONObject.parseObject(attributeModel.getRef());
|
||||
event = "readonly='readonly' relationFileId=\"" + fileId + "\" relationShapeId=\"" + shapeId + "\" groupPath=\"" + attributeModel.getGroupPath() + "\" ref="+ refObj +" onclick=\"openRelationDialog($(this), \'saveContent\')\"";
|
||||
event = "readonly='readonly' relationFileId=\"" + fileId + "\" relationShapeId=\"" + shapeId + "\" groupPath=\"" + attributeModel.getGroupPath() + "\" ref="+ refObj + " onclick=\"openRelationDialog($(this), 'saveContent')\"";
|
||||
input = "<input type='text' class='awsui-textbox' name=\"" + id + "\" id=\"" + id + "\" value=\"" + inputValue + "\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" isRequired='" + isRequired + "' data-originvalue='" + inputValue + "' " + event + "/>";
|
||||
} else if ("awsorg".equals(type)) {// 关联bpm组织架构
|
||||
JSONObject refObj = JSONObject.parseObject(attributeModel.getRef());
|
||||
event = "readonly='readonly' data-value="+ dataArr +" groupPath=\"" + attributeModel.getGroupPath() + "\" ref="+ refObj +" onclick=\"openRelationAwsorgDialog($(this))\"";
|
||||
input = "<input type='text' class='awsui-textbox' name=\"" + id + "\" id=\"" + id + "\" value=\"" + inputValue + "\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" isRequired='" + isRequired + "' data-originvalue='" + inputValue + "' " + event + "/>";
|
||||
} else if("DateTimePicker".equals(type)) {
|
||||
input = "<input class=\"awsui-textbox\" id=\"" + id + "\" name=\"dateTimePicker\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" data-originvalue='" + inputValue + "' value='" + inputValue + "' isRequired='" + isRequired + "' onblur='saveContent($(this));'>" + "</input>";
|
||||
input = "<input class=\"awsui-textbox\" autocomplete='off' id=\"" + id + "\" name=\"dateTimePicker\" sid=\"" + sid + "\" uuid=\"" + uuid + "\" data-originvalue='" + inputValue + "' value='" + inputValue + "' isRequired='" + isRequired + "' onblur='saveContent($(this));'>" + "</input>";
|
||||
}else if ("table".equals(type)){
|
||||
|
||||
JSONObject table = JSON.parseObject(jsonValue);
|
||||
@ -2966,11 +2966,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
public boolean getIsDorpStatus(String plName) {
|
||||
if ((plName.equals(CoeProcessLevelConstant.SUPPORTTHEMANAGEMENTPROCESS)) || (plName.equals(CoeProcessLevelConstant.COREBUSINESSPROCESSES)) || (plName.equals(CoeProcessLevelConstant.SUPPORTPROCESS)) || (plName.equals(CoeProcessLevelConstant.COREMANAGEMENTPROCESS)) || (plName.equals(CoeProcessLevelConstant.STRATEGICPROCESS))) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return (!plName.equals(CoeProcessLevelConstant.SUPPORTTHEMANAGEMENTPROCESS)) && (!plName.equals(CoeProcessLevelConstant.COREBUSINESSPROCESSES)) && (!plName.equals(CoeProcessLevelConstant.SUPPORTPROCESS)) && (!plName.equals(CoeProcessLevelConstant.COREMANAGEMENTPROCESS)) && (!plName.equals(CoeProcessLevelConstant.STRATEGICPROCESS));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3020,7 +3016,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
// 获取属性的关联类型(relationType)
|
||||
Map<String, PALMethodAttributeModel> attrModelMap = new HashMap<>();
|
||||
if(uuid != null && attrId != null && !"".equals(attrId)) {
|
||||
PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALMethodModel palMethodModel = PALMethodCache.getPALMethodModelById(m.getMethodId());
|
||||
if (palMethodModel != null) {
|
||||
List<PALMethodAttributeModel> attributes = palMethodModel.getAttributes();
|
||||
@ -3332,7 +3328,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
return;
|
||||
}
|
||||
//记录日志
|
||||
PALRepositoryModel repository = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel repository = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
BPMNModel defineModel = null;
|
||||
if (repository.getMethodId().equals("process.bpmn2")) {
|
||||
defineModel = CoeDesignerAPIManager.getInstance().getDefinitionOfBpmn(uuid, 0);
|
||||
@ -3372,7 +3368,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
String filePath = logVerPath;// 文件路径
|
||||
UtilFile defaultFile = new UtilFile(filePath);// 文件
|
||||
//写入内容
|
||||
defaultFile.write(jsonContent.getBytes("UTF8"));
|
||||
defaultFile.write(jsonContent.getBytes(StandardCharsets.UTF_8));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -3432,7 +3428,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString sourceStr = new UtilString(source);
|
||||
List<String> vstr = sourceStr.split(",");
|
||||
for (int i = 0, size = vstr.size(); i < size; i++) {
|
||||
String id = (String) vstr.get(i);
|
||||
String id = vstr.get(i);
|
||||
if (target.indexOf(id) == -1) { // 查找少了的id号
|
||||
st.add(id);
|
||||
}
|
||||
@ -3441,7 +3437,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString sourceStr = new UtilString(source);
|
||||
List<String> vstr = sourceStr.split(",");
|
||||
for (int i = 0, size = vstr.size(); i < size; i++) {
|
||||
String id = (String) vstr.get(i);
|
||||
String id = vstr.get(i);
|
||||
// 查找少了的id号
|
||||
st.add(id);
|
||||
}
|
||||
@ -3551,11 +3547,11 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString ut = new UtilString(orderIndexs);
|
||||
List<String> v = ut.split(",");
|
||||
for (int i = 0, size = v.size(); i < size; i++) {
|
||||
String st = (String) v.get(i);
|
||||
String st = v.get(i);
|
||||
UtilString u = new UtilString(st);
|
||||
List<String> vv = u.split("|");
|
||||
String id = (String) vv.get(0);
|
||||
int orderIndex = Integer.parseInt((String) vv.get(1));
|
||||
String id = vv.get(0);
|
||||
int orderIndex = Integer.parseInt(vv.get(1));
|
||||
PALRepositoryModelImpl model = (PALRepositoryModelImpl) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
model.setOrderIndex(orderIndex);
|
||||
wsId = model.getWsId();
|
||||
@ -3585,14 +3581,14 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
if (!pids.equals("")) {
|
||||
UtilString ut = new UtilString(pids);
|
||||
List<String> v = ut.split(",");
|
||||
String ids = (String) v.get(0);
|
||||
String pid = (String) v.get(1);
|
||||
String ids = v.get(0);
|
||||
String pid = v.get(1);
|
||||
UtilString u = new UtilString(ids);
|
||||
List<String> vv = u.split("|");
|
||||
for (int i = 0, size = vv.size(); i < size; i++) {
|
||||
String id = (String) vv.get(i);
|
||||
String id = vv.get(i);
|
||||
PALRepositoryModelImpl model = (PALRepositoryModelImpl) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
PALRepositoryModel pidModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
PALRepositoryModel pidModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
model.setParentId(pid);
|
||||
model.setLevel(pidModel.getLevel() + 1);
|
||||
wsId = model.getWsId();
|
||||
@ -4041,7 +4037,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
String awsId = coeProcessLevelModel.getAWSProcessId();
|
||||
if (!awsId.equals("")) {
|
||||
List<ProcessDefinition> table = ProcessDefCache.getInstance().getListOfProcessVersion(CoEConstant.APP_ID, awsId);
|
||||
ProcessDefinition model = (ProcessDefinition) table.get(new Integer(table.size()));
|
||||
ProcessDefinition model = table.get(new Integer(table.size()));
|
||||
if (model != null) {
|
||||
list.add(model);
|
||||
coeList.add(coeProcessLevelModel);
|
||||
@ -4056,7 +4052,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
// 获得工作空间下流程树的根?
|
||||
private String getAwsProcessRootTreeJson(String wsId) {
|
||||
CoeWorkSpaceModel model = (CoeWorkSpaceModel) CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsId);
|
||||
CoeWorkSpaceModel model = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstance(wsId);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
JSONObject rootJson = new JSONObject();
|
||||
rootJson.put("id", "node_0");
|
||||
@ -4079,7 +4075,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
rootJson.put("pid", "node_0");
|
||||
rootJson.put("wsid", wsId);
|
||||
String processLevelName = "";
|
||||
PALRepositoryModel processLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(coeProcessLevelModel.getId());
|
||||
PALRepositoryModel processLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(coeProcessLevelModel.getId());
|
||||
if (processLevelModel != null) {
|
||||
processLevelName = "[<I18N#流程分级>(" + processLevelModel.getName() + ")]";
|
||||
}
|
||||
@ -4100,7 +4096,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilString idStr = new UtilString(ids);
|
||||
List<String> v = idStr.split(",");
|
||||
for (int i = 0, size = v.size(); i < size; i++) {
|
||||
String id = (String) v.get(i);
|
||||
String id = v.get(i);
|
||||
if (id.equals(workFlowModel.getVersionId())) {
|
||||
json.put("checked", "true");
|
||||
break;
|
||||
@ -4158,7 +4154,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
*/
|
||||
public String getPortalHtml(String ruuid, String wsid, String type) {
|
||||
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
|
||||
macroLibraries.put("createButton", "");
|
||||
macroLibraries.put("importPalButton", "");
|
||||
@ -4245,11 +4241,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilFile utilFile = new UtilFile(p + "/" + cplm.getId() + ".small.png");
|
||||
if (utilFile.exists()) {
|
||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||
try {
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||
userImg = "1";
|
||||
}
|
||||
}
|
||||
@ -4276,7 +4268,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
|
||||
String subProcessCount = "";
|
||||
StringBuilder subProcessList = new StringBuilder("");
|
||||
StringBuilder subProcessList = new StringBuilder();
|
||||
// String icon = "../apps/" + CoEConstant.APP_ID + "/img/method/" + cplm.getMethodId() + "/16.leaf.png";
|
||||
String icon = "";
|
||||
if (!"default".equals(cplm.getMethodId())) {
|
||||
@ -4517,7 +4509,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
// 获取标题路径
|
||||
private String getProcessLevelTitle(String ruuid, String wsid, String type) {
|
||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
if (type.equals("0")) {
|
||||
return I18nRes.findValue(CoEConstant.APP_ID, ruuid);
|
||||
} else {
|
||||
@ -4526,7 +4518,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
ruuid = coeProcessLevelModel.getParentId();
|
||||
PALRepositoryModel model;
|
||||
while (true) {
|
||||
model = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
model = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
if (model != null) {
|
||||
list.add(model);
|
||||
ruuid = model.getParentId();
|
||||
@ -4590,7 +4582,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
*/
|
||||
public String createProcessLevel(String wsid, String id) {
|
||||
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
List<PALMethodModel> list;
|
||||
StringBuffer liString = new StringBuffer();
|
||||
if (coeProcessLevelModel == null) {
|
||||
@ -4748,7 +4740,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
object.put("icon", icon);
|
||||
if (!folderMap.containsKey(model.getMethodId())) {
|
||||
PALMethodModel methodModel = PALMethodManager.getInstance().getPALMethodModelById(model.getMethodId());
|
||||
folderMap.put(model.getMethodId(), methodModel == null ? true : methodModel.isFolder());
|
||||
folderMap.put(model.getMethodId(), methodModel == null || methodModel.isFolder());
|
||||
}
|
||||
object.put("folder", folderMap.get(model.getMethodId()));
|
||||
result.add(object);
|
||||
@ -4970,7 +4962,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
resultObj.put("updateDate", UtilDate.datetimeFormat(model.getModifyDate(), "yyyy年MM月dd日"));
|
||||
if (!folderMap.containsKey(model.getMethodId())) {
|
||||
PALMethodModel methodModel = PALMethodManager.getInstance().getPALMethodModelById(model.getMethodId());
|
||||
folderMap.put(model.getMethodId(), methodModel == null ? true : methodModel.isFolder());
|
||||
folderMap.put(model.getMethodId(), methodModel == null || methodModel.isFolder());
|
||||
}
|
||||
resultObj.put("folder", folderMap.get(model.getMethodId()));
|
||||
result.add(resultObj);
|
||||
@ -5298,7 +5290,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
private void updateDefineShape(PALRepositoryModelImpl newModel, Map<String, String> mapNewUUID, String define) {
|
||||
String messageJson = null;
|
||||
PALRepositoryModel levelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(newModel.getId());
|
||||
PALRepositoryModel levelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(newModel.getId());
|
||||
String filePath = levelModel.getFilePath();
|
||||
filePath = filePath + File.separator + levelModel.getId();
|
||||
UtilFile utilFile = new UtilFile(filePath);
|
||||
@ -5313,11 +5305,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
messageJson = messageJson.replace(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
try {
|
||||
utilFile.write(messageJson.getBytes("utf-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
utilFile.write(messageJson.getBytes(StandardCharsets.UTF_8));
|
||||
DesignerRelationShapeCacheManager cache = DesignerRelationShapeCacheManager.getInstance();
|
||||
Map<String, Set<JSONObject>> shapeMap = cache.getEventMap();
|
||||
ShapeUtil.shapeJsonToObject(messageJson, shapeMap, newModel.getId());
|
||||
@ -5376,7 +5364,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
public String coePALProcessLevelCreateAjax(String wsid, String pid, String id, String type) {
|
||||
|
||||
// 获得父级模型
|
||||
PALRepositoryModel parentPlModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
PALRepositoryModel parentPlModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(pid);
|
||||
// 获得有哪些建模方法?
|
||||
List<PALMethodModel> palMethodModels = null;
|
||||
if (parentPlModel == null) {
|
||||
@ -5420,7 +5408,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
if (!id.equals("") && !id.equals("0")) {
|
||||
macroLibraries.put("showStyle", "");
|
||||
PALRepositoryModel plModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id);
|
||||
plNo = plModel.getNo();
|
||||
plName = plModel.getName();
|
||||
plLevel = plModel.getLevel();
|
||||
@ -5434,7 +5422,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
if ("".equals(departmentId)) {
|
||||
continue;
|
||||
}
|
||||
DepartmentModel dModel = (DepartmentModel) DepartmentCache.getModel(departmentId);
|
||||
DepartmentModel dModel = DepartmentCache.getModel(departmentId);
|
||||
if (dModel == null) {
|
||||
continue;
|
||||
}
|
||||
@ -5544,7 +5532,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
* @return
|
||||
*/
|
||||
public String mark(String uuid) {
|
||||
PALRepositoryModel model = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel model = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
if (model == null) {
|
||||
throw new AWSException("流程未找到<br>uuid:" + uuid);
|
||||
}
|
||||
@ -5852,11 +5840,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilFile utilFile = new UtilFile(p + "/" + model.getId() + ".small.png");
|
||||
if (utilFile.exists()) {
|
||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||
try {
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6760,7 +6744,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
if(!corr1.contains(processDef.getId()) && !corr2.contains(processDef.getId())) return true;
|
||||
}
|
||||
if ("correlated".equals(type)) {
|
||||
if(corr1.contains(processDef.getId()) || corr2.contains(processDef.getId())) return true;
|
||||
return corr1.contains(processDef.getId()) || corr2.contains(processDef.getId());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -7103,7 +7087,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
int index = str.toUpperCase().indexOf(query);
|
||||
int len = query.length();
|
||||
if (index > -1) {
|
||||
str = str.substring(0, index) + "<span style='background: #55e094'>" + str.substring(index, len + index) + "</span>" + str.substring(len + index, str.length());
|
||||
str = str.substring(0, index) + "<span style='background: #55e094'>" + str.substring(index, len + index) + "</span>" + str.substring(len + index);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
@ -7139,10 +7123,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModel parentModel;
|
||||
if ("ws".equals(parentType)) { // 父节点是资产库
|
||||
parentModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
parentModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
} else {
|
||||
plParentId = idMap.get(jsObject.getString("pid"));
|
||||
parentModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
parentModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
}
|
||||
String uid = super.getContext().getUID();
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
@ -7195,7 +7179,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
model.setOrderIndex(orderIndex + 1);
|
||||
model.setHistoryMaxVersion("0");
|
||||
// 权限和父级同步
|
||||
PALRepositoryModel cplm = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
PALRepositoryModel cplm = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
|
||||
if (cplm != null) {
|
||||
model.setLevel(cplm.getLevel() + 1);// 比父级多一级层级
|
||||
@ -7226,10 +7210,10 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
String parentType = jsObject.getString("parentType");
|
||||
PALRepositoryModel parentModel;
|
||||
if ("ws".equals(parentType)) { // 父节点是资产库
|
||||
parentModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
parentModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
} else {
|
||||
plParentId = idMap.get(jsObject.getString("pid"));
|
||||
parentModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
parentModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(plParentId);
|
||||
}
|
||||
plParentId = plParentId.length() == 36 ? parentModel.getVersionId() : plParentId;
|
||||
// 该流程是否已有兄弟流程(同一个流程,不同的版本)进行了当前节点的父节点下关联,关联过,取出数据,没有关联过,新建数据
|
||||
@ -7273,7 +7257,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModelImpl model = new PALRepositoryModelImpl();
|
||||
model.setWsId(wsId);
|
||||
model.setLevel((Integer) (parentModel == null ? 1 : (parentModel.getLevel() + 1)));
|
||||
model.setLevel(parentModel == null ? 1 : (parentModel.getLevel() + 1));
|
||||
String plNo = "";
|
||||
if (plParentId.length() == 36) {
|
||||
if (parentModel != null) {
|
||||
@ -7316,7 +7300,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
// 创建
|
||||
try {
|
||||
coeProcessLevel.insert(model);
|
||||
PALRepositoryModel plModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(model.getId());
|
||||
PALRepositoryModel plModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(model.getId());
|
||||
// 设置文件路径,无物理文件
|
||||
String path = PLRFilePath.getInstance().create(AppsAPIManager.getInstance().getAppContext(CoEConstant.APP_ID), model.getId());
|
||||
path = path.replace(model.getVersionId(), model.getId());
|
||||
@ -7658,7 +7642,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
*/
|
||||
public String getPortalParam(String ruuid, String wsid) {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(ruuid);
|
||||
if (coeProcessLevelModel == null) {
|
||||
throw new AWSException("没有查找到文件");
|
||||
}
|
||||
@ -7713,7 +7697,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
//记录日志
|
||||
//流程
|
||||
PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
if (coeProcessLevelModel == null) {
|
||||
return ro.toString();
|
||||
}
|
||||
@ -7948,7 +7932,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
try {
|
||||
coeProcessLevel.insert(model);
|
||||
// 流程发布用户组权限和父级同步
|
||||
PALRepositoryModel parentModel = (PALRepositoryModel) coeProcessLevel.getInstance(parentId);
|
||||
PALRepositoryModel parentModel = coeProcessLevel.getInstance(parentId);
|
||||
if (parentModel != null) {
|
||||
PublishUserGroupPerm dao = new PublishUserGroupPerm();
|
||||
List<PublishUserGroupPermModel> list = dao.getAllPermsByResourceId(parentModel.getVersionId());
|
||||
@ -8049,7 +8033,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
try {
|
||||
coeProcessLevel.insert(model);
|
||||
// 流程发布用户组权限和父级同步
|
||||
PALRepositoryModel parentModel = (PALRepositoryModel) coeProcessLevel.getInstance(parentId);
|
||||
PALRepositoryModel parentModel = coeProcessLevel.getInstance(parentId);
|
||||
if (parentModel != null) {
|
||||
PublishUserGroupPerm dao = new PublishUserGroupPerm();
|
||||
List<PublishUserGroupPermModel> list = dao.getAllPermsByResourceId(parentModel.getVersionId());
|
||||
@ -8378,7 +8362,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
|
||||
/************************************文件属性校验************************************/
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid);
|
||||
// 获取所有文件属性
|
||||
List<PALMethodAttributeModel> methodAttrModels = PALRepositoryAPIManager.getInstance().getValidAttributeModels(m.getWsId(), m.getMethodId());
|
||||
Map<String, PALMethodAttributeModel> attributeModelMap = new HashMap<>();
|
||||
@ -8856,7 +8840,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
ResponseObject ro = ResponseObject.newOkResponse();
|
||||
// 获取当前文件信息
|
||||
PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel();
|
||||
PALRepositoryModel model = (PALRepositoryModel)coeProcessLevel .getInstance(id);
|
||||
PALRepositoryModel model = coeProcessLevel .getInstance(id);
|
||||
|
||||
if (id.length() >= 36 && model == null) {
|
||||
return ResponseObject.newErrResponse("模型文件查询失败").toString();
|
||||
@ -9237,11 +9221,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
UtilFile utilFile = new UtilFile(p + "/" + model.getId() + ".small.png");
|
||||
if (utilFile.exists()) {
|
||||
byte[] base64Bytes = Base64.encode(utilFile.readBytes());
|
||||
try {
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
photo = "data:image/png;base64," + new String(base64Bytes, StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
if (UtilString.isEmpty(photo)) {// 默认
|
||||
@ -9465,7 +9445,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
JSONArray defaultAttrConfig = CoeProcessLevelUtil.getAllDefaultAttrData();
|
||||
for (int i = 0; i < defaultAttrConfig.size(); i++) {
|
||||
JSONObject attr = defaultAttrConfig.getJSONObject(i);
|
||||
attr.put("readonly", fileReadonly ? true : attr.getBooleanValue("readonly") ? true : false);
|
||||
attr.put("readonly", fileReadonly || attr.getBooleanValue("readonly"));
|
||||
if (PALRepositoryModelImpl.FIELD_PL_NAME.equals(attr.getString("id"))) {// 名称
|
||||
attr.put("value", model.getName());
|
||||
}
|
||||
@ -9515,7 +9495,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
obj.put("label", title);
|
||||
obj.put("ref", ref);
|
||||
obj.put("type", type);
|
||||
obj.put("readonly", fileReadonly ? true : xmlReadonly ? true : false);
|
||||
obj.put("readonly", fileReadonly || xmlReadonly);
|
||||
obj.put("desc",attributeModel.getDesc()==null?"":attributeModel.getDesc());
|
||||
obj.put("isRequired",attributeModel.getIsRequired());
|
||||
if ("string".equals(type)) {
|
||||
@ -9569,7 +9549,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
} else if ("relation".equals(type)) {
|
||||
JSONObject refObj = JSONObject.parseObject(attributeModel.getRef());
|
||||
obj.put("ref", refObj);
|
||||
obj.put("readonly", fileReadonly ? true : false);
|
||||
obj.put("readonly", fileReadonly);
|
||||
List<DesignerShapeRelationModel> list = DesignerShapeRelationCache.getListByAttrId(id, "", property.getPropertyId());
|
||||
if (list != null && list.size() > 0) {
|
||||
// 判断是否有重复数据,进行重复过滤
|
||||
@ -9614,7 +9594,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
} else if ("awsorg".equals(type)) {
|
||||
JSONObject refObj = JSONObject.parseObject(attributeModel.getRef());
|
||||
obj.put("ref", refObj);
|
||||
obj.put("readonly", fileReadonly ? true : false);
|
||||
obj.put("readonly", fileReadonly);
|
||||
List<DesignerShapeRelationModel> list = DesignerShapeRelationCache.getListByAttrId(id, "", property.getPropertyId());
|
||||
if (list != null && list.size() > 0) {
|
||||
List<DepartmentModel> departmentModelList = new ArrayList<>();
|
||||
|
||||
@ -912,12 +912,12 @@
|
||||
<li ac="selectall">全选
|
||||
<div class="extend">Ctrl+A</div>
|
||||
</li>
|
||||
<li ac="selectVertical">调整垂直间距
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
<li ac="selectHorizontal">调整水平间距
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
<!-- <li ac="selectVertical">调整垂直间距-->
|
||||
<!-- <div class="extend"></div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li ac="selectHorizontal">调整水平间距-->
|
||||
<!-- <div class="extend"></div>-->
|
||||
<!-- </li>-->
|
||||
<li class="devider devi_selectall"></li>
|
||||
<li ac="drawline">
|
||||
<div class="ico linkertype_normal"></div>创建连线
|
||||
@ -928,7 +928,8 @@
|
||||
<div class="extend"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="designer_subline" style="position:absolute;"></div>
|
||||
<!-- <div id="designer_subline1" style="position:absolute;"></div>-->
|
||||
<!-- <div id="designer_subline2" style="position:absolute;"></div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div id="shape_img_container"></div>
|
||||
@ -1155,7 +1156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dock_view dock_view_attribute" style="width: 350px">
|
||||
<div class="dock_view dock_view_attribute" style="width: 350px;overflow: auto">
|
||||
<div class="dock_view_header">
|
||||
<font id='dock_view_header_title'>文件属性</font>
|
||||
<div class="ico ico_dock_collapse"></div>
|
||||
|
||||
@ -1730,4 +1730,8 @@
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal_repository_model_version_diff_query">
|
||||
<param name="id"/>
|
||||
</cmd-bean>
|
||||
<cmd-bean name="com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid">
|
||||
<param name="uuid"/>
|
||||
<param name="define"/>
|
||||
</cmd-bean>
|
||||
</aws-actions>
|
||||
152
com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js
Executable file → Normal file
152
com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js
Executable file → Normal file
@ -22,8 +22,8 @@ $(function() {
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert(errorThrown, 'err');
|
||||
console.log(jqXHR)
|
||||
console.log(textStatus)
|
||||
console.log(jqXHR);
|
||||
console.log(textStatus);
|
||||
console.log(errorThrown)
|
||||
}
|
||||
});
|
||||
@ -90,75 +90,89 @@ $(function() {
|
||||
tempMessageArr[messageId] = messageArrayForSave[messageId];
|
||||
}
|
||||
var messageArray = JSON.stringify(tempMessageArr);
|
||||
var elements = obj.elements
|
||||
for(let i in elements) {
|
||||
for(let a = 0; a < elements[i].dataAttributes.length; a ++ ) {
|
||||
if(elements[i].dataAttributes[a].attributesJsonArray !== undefined) {
|
||||
for(let b = 0; b < elements[i].dataAttributes[a].attributesJsonArray.length; b ++) {
|
||||
if(elements[i].dataAttributes[a].attributesJsonArray[b].isRequired && elements[i].dataAttributes[a].attributesJsonArray[b].value == '') {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert("必填项不能为空", 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
sid: CLB.sid,
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_process_define_save",
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_define_shape_attr_valid",
|
||||
uuid: ruuid,
|
||||
define: awsui.encode(obj),
|
||||
teamId: $("#teamId").val(),
|
||||
BPMInstanceName: BPMInstanceName,
|
||||
messages: messageArray
|
||||
},
|
||||
success: function (msg, textStatus, jqXHR) {
|
||||
debugger;
|
||||
if(msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
messageArrayForSave = {};
|
||||
$("#saving_tip").css("color", "rgb(26, 164, 125)");
|
||||
$("#saving_tip").text("保存成功");
|
||||
recordShapeText();// 记录最新的节点及其文本text
|
||||
//更多属性的处理,当节点处理完成后再处理更多属性
|
||||
if (saveAttributesJson.length > 0 || removeAttributeJson.length > 0){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd",
|
||||
data : {
|
||||
sid : encodeURI(CLB.sid),
|
||||
cmd : "com.actionsoft.apps.coe.pal_pl_repository_more_attribute_save",
|
||||
wsId : $("#wsId").val(),
|
||||
uuid : ruuid,
|
||||
attributesJson : JSON.stringify(saveAttributesJson),
|
||||
removeAttributeJson : JSON.stringify(removeAttributeJson)
|
||||
},
|
||||
success:function(r) {
|
||||
saveAttributesJson = [];
|
||||
removeAttributeJson = [];
|
||||
},
|
||||
error:function(r) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "./jd",
|
||||
data: {
|
||||
sid: CLB.sid,
|
||||
cmd: "com.actionsoft.apps.coe.pal_repository_process_define_save",
|
||||
uuid: ruuid,
|
||||
define: awsui.encode(obj),
|
||||
teamId: $("#teamId").val(),
|
||||
BPMInstanceName: BPMInstanceName,
|
||||
messages: messageArray
|
||||
},
|
||||
success: function (msg, textStatus, jqXHR) {
|
||||
if(msg.result == "ok") {
|
||||
$.simpleAlert("close");
|
||||
messageArrayForSave = {};
|
||||
$("#saving_tip").css("color", "rgb(26, 164, 125)");
|
||||
$("#saving_tip").text("保存成功");
|
||||
recordShapeText();// 记录最新的节点及其文本text
|
||||
//更多属性的处理,当节点处理完成后再处理更多属性
|
||||
if (saveAttributesJson.length > 0 || removeAttributeJson.length > 0){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "./jd",
|
||||
data : {
|
||||
sid : encodeURI(CLB.sid),
|
||||
cmd : "com.actionsoft.apps.coe.pal_pl_repository_more_attribute_save",
|
||||
wsId : $("#wsId").val(),
|
||||
uuid : ruuid,
|
||||
attributesJson : JSON.stringify(saveAttributesJson),
|
||||
removeAttributeJson : JSON.stringify(removeAttributeJson)
|
||||
},
|
||||
success:function(r) {
|
||||
saveAttributesJson = [];
|
||||
removeAttributeJson = [];
|
||||
},
|
||||
error:function(r) {
|
||||
}
|
||||
});
|
||||
}
|
||||
$.simpleAlert("保存成功", "ok");
|
||||
//保存结束时间戳
|
||||
//var saveEndTime = new Date().getTime();
|
||||
//console.log("流程保存时间:", (saveEndTime - saveStartTime) + "毫秒");
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg.data.desc, 'error', 2000);
|
||||
}
|
||||
});
|
||||
}
|
||||
$.simpleAlert("保存成功", "ok");
|
||||
//保存结束时间戳
|
||||
//var saveEndTime = new Date().getTime();
|
||||
//console.log("流程保存时间:", (saveEndTime - saveStartTime) + "毫秒");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert('保存失败', 'error', 1500);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert(msg.data.desc, 'error', 2000);
|
||||
var result = msg.data;
|
||||
var resultMsg = [];
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
var o = result[i];
|
||||
resultMsg.push('[' + o.shapeName + ']的[' + o.attrName + ']不能为空' );
|
||||
}
|
||||
$.simpleAlert(resultMsg.join('<br>'), 'error');
|
||||
// $.simpleAlert(ro.msg, 'error');
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
$.simpleAlert("close");
|
||||
$.simpleAlert('保存失败', 'error', 1500);
|
||||
$.simpleAlert('校验失败', 'error', 1500);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -181,7 +195,7 @@ $(function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//在弹出“是否离开”的提示框后,选择离开,则触发onunload事件
|
||||
window.onunload = function(){
|
||||
@ -197,7 +211,7 @@ $(function() {
|
||||
uuid: ruuid
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
// saveTimer();
|
||||
intervalRefresh();
|
||||
}
|
||||
@ -238,7 +252,7 @@ $(function() {
|
||||
$('#bar_sort').off("click").on("click",function (){
|
||||
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存") {
|
||||
$.simpleAlert('页面未保存,请先保存', 'error', 1500);
|
||||
return;
|
||||
|
||||
} else {
|
||||
// $.simpleAlert("正在编号", "loading");
|
||||
// $.ajax({
|
||||
@ -268,11 +282,11 @@ $(function() {
|
||||
{ shapeId: 'obj_c9e1cdab200000014a2eade016e8170d',order: 5},
|
||||
{ shapeId: 'obj_c9e1cdb266f0000159a7c8afa7701a68',order: 6},
|
||||
]
|
||||
}
|
||||
let obj = Model.define
|
||||
console.log(obj)
|
||||
let elements = obj.elements
|
||||
let orderList = numObj.orderList
|
||||
};
|
||||
let obj = Model.define;
|
||||
console.log(obj);
|
||||
let elements = obj.elements;
|
||||
let orderList = numObj.orderList;
|
||||
for (let j = 0; j < orderList.length; j++) {
|
||||
for(let i in elements) {
|
||||
if (orderList[j].shapeId == i) {
|
||||
@ -303,7 +317,7 @@ $(function() {
|
||||
$("#saving_tip").text("文件已修改,未保存");
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
/**定时保存**/
|
||||
@ -321,7 +335,7 @@ function saveTimer() {
|
||||
alertmsg(count, msg);
|
||||
}
|
||||
}})
|
||||
}
|
||||
};
|
||||
alertmsg(count, msg);
|
||||
// $.simpleAlert("5秒之后自动进行保存", "info", 5000, {callback:function(){$("#bar_save").click();}});
|
||||
}, 300000);
|
||||
@ -343,7 +357,7 @@ function intervalRefresh() {
|
||||
alert : false,
|
||||
ok: function(msg){
|
||||
if (msg.data.isLocked) {
|
||||
var m = '当前流程被 ' + msg.data.currentUserName + ' 强行获取编辑权或锁定'
|
||||
var m = '当前流程被 ' + msg.data.currentUserName + ' 强行获取编辑权或锁定';
|
||||
$.simpleAlert(m,"info",4000,{mode:true,callback:function() {
|
||||
if ($("#saving_tip").text() != "已保存成功" && $("#saving_tip").text() != "保存成功" && $("#saving_tip").text() != "您的文件已经成功保存" && $("#saving_tip").text() != "") {
|
||||
$("#saving_tip").text('');// 防止reload时出现浏览器自带提示
|
||||
@ -389,7 +403,7 @@ var CommonLock = {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 记录所有节点及节点名称,保存时对比
|
||||
var shapeTextRecord = {};
|
||||
|
||||
@ -6,6 +6,8 @@ Designer.contextMenu.show = function(x, y) {
|
||||
var currentFocus = Utils.getShapeByPosition(x, y, false);
|
||||
menu.children().hide();
|
||||
menu.children("li[ac=selectall]").show();
|
||||
menu.children("li[ac=selectVertical]").show();
|
||||
menu.children("li[ac=selectHorizontal]").show();
|
||||
menu.children(".devi_selectall").show();
|
||||
menu.children("li[ac=drawline]").show();
|
||||
menu.children("li[ac=processAttribute]").show();
|
||||
@ -163,6 +165,10 @@ Designer.contextMenu.execAction = function(item) {
|
||||
showPropertiesDialog(true);
|
||||
} else if (action == "customdefine") {
|
||||
openCustomDefineDialog();
|
||||
} else if(action == 'selectVertical') {
|
||||
Designer.selectVertical(this.menuPos);
|
||||
} else if (action == 'selectHorizontal') {
|
||||
Designer.selectHorizontal(this.menuPos);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1117,7 +1117,6 @@ function getLinkFileValue(treeNode) {
|
||||
// 数属性tab页面效果js
|
||||
|
||||
function selectAttrTabTag(showContent, selfObj) {
|
||||
debugger;
|
||||
// 操作标签
|
||||
var tag = $("#tabUlContainer li");
|
||||
var taglength = tag.length;
|
||||
@ -1303,7 +1302,7 @@ function noPermissionMsg(){
|
||||
// 属性的动态切换
|
||||
|
||||
function attributeShowTabContent(currentShape) {
|
||||
debugger;
|
||||
|
||||
// 属性弹出层显示的内容
|
||||
var shape = Utils.getSelected()[0];
|
||||
if (!shape) {
|
||||
@ -1443,7 +1442,6 @@ function getPrivateAttributeHtml(attributesJsonArray, tbodyId, shape) {
|
||||
+ ' <div class="attribute_td_div_css">' + obj.value + '</div>'
|
||||
+ ' </td></tr>';
|
||||
if ((!objReadonly && objType == "string") || (!objReadonly && objType == "list") || (!objReadonly && objType == "link")) {
|
||||
debugger;
|
||||
// 目前支持到文本的输入 ,需求定下了再改
|
||||
constr = '<tr ' + mouseout + mouseover + ' objid="' + obj.id + '" class="tagContentTableTr">'
|
||||
+ ' <td>' + objName + requiredSpan + '</td>'
|
||||
@ -1941,7 +1939,6 @@ function showEditButton(obj) {
|
||||
|
||||
var inputUpdate = false;
|
||||
function saveInputContent(obj,value) {
|
||||
debugger;
|
||||
// 按钮
|
||||
// $(obj).siblings("span::contains('...')").hide();
|
||||
inputUpdate = true;
|
||||
@ -2777,10 +2774,16 @@ function setDivHeight() {/*
|
||||
}
|
||||
|
||||
function changeArributeByShape() {
|
||||
debugger;
|
||||
if (Utils.getSelected()[0] == null) {
|
||||
$("#dock_content_attribute").hide();
|
||||
$("#attr_no_more_attribute_id").show();
|
||||
var iframeDocument=$("#file_attribute")[0].contentWindow.document;
|
||||
var body = $(iframeDocument).find('body')
|
||||
var pickerNum = $(body).find('input[name="dateTimePicker"]').length
|
||||
if (pickerNum > 0) {
|
||||
var height = $(body).find('#frmMain').height() + 300
|
||||
$("#file_attribute").height(height)
|
||||
}
|
||||
} else {
|
||||
// 属性弹出层显示的内容
|
||||
var shape = Utils.getSelected()[0];
|
||||
@ -3426,7 +3429,7 @@ function getRelevanceAwsOrgNameByShapeId(objIds, shapeId) {
|
||||
|
||||
// 形状关联弹窗
|
||||
function openRelationDig(obj,value) {
|
||||
debugger;
|
||||
|
||||
var shapeRelationValue = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").val();
|
||||
var ref = $("input[objid_shapeId='" + $(obj).attr("objid") + "']").attr("ref"); // shape file shapeAndFile
|
||||
var relationShapeIds = '';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* 设计器对外提供的方法
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -17,55 +17,216 @@ Designer.addFunction("open", function(definition){
|
||||
$(".shape_box").remove();
|
||||
Model.define.elements = {};
|
||||
Model.persistence.elements = {};
|
||||
Model.define.page = definition.page;
|
||||
|
||||
Model.define.page = definition.page;
|
||||
|
||||
//*******此处添加AWS流程设计器特有的属性*******//
|
||||
Model.define.processProperties=definition.processProperties;//此处添加aws全局属性
|
||||
Model.define.processDocument=definition.processDocument;//此处添加aws全局属性
|
||||
Model.define.uuid=definition.uuid;//此处添加流程uuid
|
||||
//Model.define.title=definition.title;//此处添加流程title
|
||||
//向页面processDefId processDefTitle 赋值
|
||||
//process.processDefId=definition.uuid;
|
||||
process.title=definition.title;
|
||||
Model.define.processProperties=definition.processProperties;//此处添加aws全局属性
|
||||
Model.define.processDocument=definition.processDocument;//此处添加aws全局属性
|
||||
Model.define.uuid=definition.uuid;//此处添加流程uuid
|
||||
//Model.define.title=definition.title;//此处添加流程title
|
||||
//向页面processDefId processDefTitle 赋值
|
||||
//process.processDefId=definition.uuid;
|
||||
process.title=definition.title;
|
||||
//*******添加结束*******//
|
||||
|
||||
Model.persistence.page = Utils.copy(definition.page);
|
||||
Designer.initialize.initCanvas();
|
||||
var shapes = definition.elements;
|
||||
//先构造形状,再构造连接线,因为连接线的绘制过程有可能依赖所连接的图形
|
||||
var shapeCount = 0;
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name != "linker"){
|
||||
Schema.initShapeFunctions(shape);
|
||||
Designer.painter.renderShape(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
shapeCount++;
|
||||
}
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name == "linker"){
|
||||
Designer.painter.renderLinker(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
}
|
||||
if(shapeCount == 0){
|
||||
Model.build();
|
||||
}
|
||||
Navigator.draw();
|
||||
|
||||
Model.persistence.page = Utils.copy(definition.page);
|
||||
Designer.initialize.initCanvas();
|
||||
var shapes = definition.elements;
|
||||
//先构造形状,再构造连接线,因为连接线的绘制过程有可能依赖所连接的图形
|
||||
var shapeCount = 0;
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name != "linker"){
|
||||
Schema.initShapeFunctions(shape);
|
||||
Designer.painter.renderShape(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
shapeCount++;
|
||||
}
|
||||
for(var shapeId in shapes){
|
||||
var shape = shapes[shapeId];
|
||||
if(shape.name == "linker"){
|
||||
Designer.painter.renderLinker(shape);
|
||||
Model.add(shape, false);
|
||||
}
|
||||
}
|
||||
if(shapeCount == 0){
|
||||
Model.build();
|
||||
}
|
||||
Navigator.draw();
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:全选
|
||||
*/
|
||||
Designer.addFunction("selectAll", function(){
|
||||
var shapes = Model.define.elements;
|
||||
var shapeIds = [];
|
||||
for(var shapeId in shapes){
|
||||
shapeIds.push(shapeId);
|
||||
}
|
||||
Utils.selectShape(shapeIds);
|
||||
var shapes = Model.define.elements;
|
||||
var shapeIds = [];
|
||||
for(var shapeId in shapes){
|
||||
shapeIds.push(shapeId);
|
||||
}
|
||||
Utils.selectShape(shapeIds);
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:调节垂直间距
|
||||
*/
|
||||
Designer.addFunction("selectVertical", function(menuPos){
|
||||
var selectedIds = [];
|
||||
var lineArr = []
|
||||
var shapeArr = []
|
||||
var menuY = menuPos.y
|
||||
var shapes = Model.define.elements;
|
||||
console.log(shapes)
|
||||
|
||||
var subline1 = $('#designer_subline1')
|
||||
var subline2 = $('#designer_subline2')
|
||||
subline1.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 4,
|
||||
width: Model.define.page.width,
|
||||
height: 0,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: 0,
|
||||
top : menuY
|
||||
});
|
||||
subline2.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 5,
|
||||
width: Model.define.page.width,
|
||||
height: 0,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: 0,
|
||||
top : menuY,
|
||||
cursor: 'move'
|
||||
});
|
||||
|
||||
var container = $("#canvas_container");
|
||||
var canvas = $("#designer_canvas");
|
||||
subline2.bind('mousedown.drag',function (b) {
|
||||
container.bind('mousemove.drag',function (e) {
|
||||
var newPos = Utils.getRelativePos(e.pageX, e.pageY, canvas);
|
||||
if (newPos.y >= menuY) {
|
||||
subline1.css({
|
||||
backgroundColor: 'rgba(114,253,107,0.5)',
|
||||
height: newPos.y - menuY
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
} else {
|
||||
subline1.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'rgba(246,163,163,0.5)',
|
||||
height: menuY - newPos.y
|
||||
})
|
||||
}
|
||||
subline2.css({
|
||||
top : newPos.y,
|
||||
});
|
||||
$(document).unbind("mouseup.drop").bind("mouseup.drop",
|
||||
function() {
|
||||
subline1.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline2.css({
|
||||
backgroundColor: 'translate',
|
||||
height: 0
|
||||
})
|
||||
subline1.hide()
|
||||
subline2.hide()
|
||||
$(document).unbind("mouseup.drop")
|
||||
})
|
||||
})
|
||||
$(document).bind('mouseup.drag',function () {
|
||||
container.unbind("mousemove.drag");
|
||||
// subline2.unbind("mousedown.drag");
|
||||
$(document).unbind("mouseup.drag");
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
for(var shapeId in shapes){
|
||||
if (shapes[shapeId].points == undefined) {
|
||||
shapeArr.push(shapes[shapeId])
|
||||
} else {
|
||||
lineArr.push(shapes[shapeId])
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < shapeArr.length; i++) {
|
||||
if (shapeArr[i].props.y + shapeArr[i].props.h >= menuY) {
|
||||
selectedIds.push(shapeArr[i].id)
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < lineArr.length; i++) {
|
||||
if (lineArr[i].from.y >= menuY || lineArr[i].to.y >= menuY) {
|
||||
selectedIds.push(lineArr[i].id)
|
||||
}
|
||||
}
|
||||
// Utils.selectShape(selectedIds);
|
||||
|
||||
|
||||
// for (var i = 0; i < selectedIds.length; i++) {
|
||||
// N(selectedIds[i])
|
||||
// $(".shape_contour[forshape=" + selectedIds[i].id + "]").css({
|
||||
// left: selectedIds[i].props.x.toScale(),
|
||||
// top: selectedIds[i].props.y.toScale()
|
||||
// })
|
||||
// }
|
||||
// var K = Utils.getSelectedLinkerIds();
|
||||
// if (selectedIds.length == 1 && K.length == 1) {
|
||||
// return
|
||||
// }
|
||||
// if (K.length > 0) {
|
||||
// var I = Utils.getSelectedIds();
|
||||
// Designer.painter.drawControls(I)
|
||||
// } else {
|
||||
// var E = $("#shape_controls");
|
||||
// E.css({
|
||||
// left: parseFloat(E.css("left")),
|
||||
// top: parseFloat(E.css("top")) + 100
|
||||
// })
|
||||
// }
|
||||
// var F = $("#shape_controls").position();
|
||||
// if (F && Utils.getSelected().length > 0) {
|
||||
// Designer.op.showTip("X: " + Math.round(F.left.restoreScale()) + " Y: " + Math.round(F.top.restoreScale()));
|
||||
// }
|
||||
// function N(a) {
|
||||
// a.props.x += 0;
|
||||
// a.props.y += 100;
|
||||
// var b = $("#" + a.id);
|
||||
// b.css({
|
||||
// left: parseFloat(b.css("left")),
|
||||
// top: parseFloat(b.css("top")) + 100
|
||||
// })
|
||||
// }
|
||||
});
|
||||
|
||||
/**
|
||||
* 设计器方法:调节水平间距
|
||||
*/
|
||||
Designer.addFunction("selectHorizontal", function(menuPos){
|
||||
var menuX = menuPos.x
|
||||
let subline = $('#designer_subline')
|
||||
console.log(subline)
|
||||
subline.css({
|
||||
display : "block",
|
||||
"z-index" : Model.orderList.length + 4,
|
||||
width: 0,
|
||||
height: Model.define.page.height,
|
||||
borderStyle:'dotted',
|
||||
borderWidth: '1px',
|
||||
left: menuX,
|
||||
top :0,
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user