diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index f2a04834..95ab91d4 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java index 0d1977b3..3ec3d921 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/CoEPALController.java @@ -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); + } + + } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java index b483ef84..9f636d36 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java @@ -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 methodAttributeModelMap = new HashMap<>(); + + // 校验形状 + List elements = ShapeUtil.getShapeJsonToJsonObject(define); + List 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 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 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数据的内部类 diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java index ba29655e..f4b19e45 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/web/CoeProcessLevelWeb.java @@ -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 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 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 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 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 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 getMoreAttrContent(String sid, String uuid, Map macroLibraries) { Map map = new HashMap(); - PALRepositoryModel m = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid); + PALRepositoryModel m = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(uuid); // 获取所有文件属性 List methodAttrModels = PALRepositoryAPIManager.getInstance().getValidAttributeModels(m.getWsId(), m.getMethodId()); Map attributeModelMap = new HashMap<>(); @@ -2639,7 +2639,7 @@ 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 = ""; } else if ("awsorg".equals(type)) {// 关联bpm组织架构 JSONObject refObj = JSONObject.parseObject(attributeModel.getRef()); @@ -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 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 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 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 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 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 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 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 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 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 = "[(" + processLevelModel.getName() + ")]"; } @@ -4100,7 +4096,7 @@ public class CoeProcessLevelWeb extends ActionWeb { UtilString idStr = new UtilString(ids); List 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 macroLibraries = new HashMap(); - 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 macroLibraries = new HashMap(); - PALRepositoryModel coeProcessLevelModel = (PALRepositoryModel) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id); + PALRepositoryModel coeProcessLevelModel = CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(id); List 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 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> 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 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("流程未找到
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) + "" + str.substring(index, len + index) + "" + str.substring(len + index, str.length()); + str = str.substring(0, index) + "" + str.substring(index, len + index) + "" + 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 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 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 methodAttrModels = PALRepositoryAPIManager.getInstance().getValidAttributeModels(m.getWsId(), m.getMethodId()); Map 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 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 list = DesignerShapeRelationCache.getListByAttrId(id, "", property.getPropertyId()); if (list != null && list.size() > 0) { List departmentModelList = new ArrayList<>(); diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml index 1c358d94..1d70de12 100755 --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/action.xml @@ -1730,4 +1730,8 @@ + + + + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js old mode 100755 new mode 100644 index 5db1f993..1ecb8ddc --- a/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js +++ b/com.actionsoft.apps.coe.pal/web/com.actionsoft.apps.coe.pal/js/coe.team.pal.designer.js @@ -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('
'), '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 = {};