流程阅览移动端初版提交
This commit is contained in:
parent
c83e12d889
commit
33aaa548c1
Binary file not shown.
@ -99,6 +99,8 @@ import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.i18n.I18nRes;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
import com.actionsoft.sdk.local.api.BOAPI;
|
||||
import com.actionsoft.sdk.local.api.BOQueryAPI;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -3631,6 +3633,17 @@ public class PALRepositoryQueryAPIManager {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面(移动端)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPublishMobilePortalHtml(UserContext uc, String uuid, String taskId, boolean checkPublish) {
|
||||
return getPublishMobilePortalHtml(uc, uuid, taskId, checkPublish, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面
|
||||
*
|
||||
@ -3695,6 +3708,82 @@ public class PALRepositoryQueryAPIManager {
|
||||
return web.getPortalDesignerHtml(uuid, upVisit, taskId);// 返回页面
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 流程发布门户详情页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPublishMobilePortalHtml(UserContext uc, String uuid, String taskId, boolean checkPublish, boolean upVisit) {
|
||||
|
||||
//权限校验
|
||||
// if (!CoeCooperationAPIManager.getInstance().hasRepositoryPermision(uuid)) {
|
||||
// return AlertWindow.getWarningMessagePage("打开失败", "无该文件查看权限");
|
||||
// }
|
||||
|
||||
//三员管理,文件密级权限校验
|
||||
if (HighSecurityUtil.isON() && HighSecurityUtil.fileSecuritySwitch()){
|
||||
CoeProcessLevelWeb web = new CoeProcessLevelWeb(uc);
|
||||
ResponseObject responseObject = web.checkFilePemission(uuid);
|
||||
if (responseObject.isErr()){
|
||||
return AlertWindow.getWarningMessagePage("打开失败", responseObject.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid);
|
||||
if (model == null) {
|
||||
throw new AWSException("该流程未找到,打开失败");
|
||||
}
|
||||
if ("default".equals(model.getMethodId())) {
|
||||
throw new AWSException("文件夹类型不支持打开");
|
||||
}
|
||||
if (checkPublish) {
|
||||
if (!model.isPublish()) {
|
||||
throw new AWSException("该流程当前状态为未发布状态,不允许打开");
|
||||
}
|
||||
}
|
||||
|
||||
// 新的权限校验,若是该模型已发布,按照权限范围表中的权限控制是否可访问,若是该模型尚未发布(例如在发布过程中、已停用等),则不进行权限控制,都可访问
|
||||
if (model.isPublish()) {
|
||||
if (!hasAccessPortalDesignerPerm(uc, model)) {
|
||||
return AlertWindow.getWarningMessagePage("打开失败", "无该文件查看权限");
|
||||
}
|
||||
}
|
||||
|
||||
if (UtilString.isEmpty(taskId)) {// 停用或已发布状态查询流程手册
|
||||
taskId = getProcessReportTaskId(model);
|
||||
}
|
||||
CoeDesignerWeb web = new CoeDesignerWeb(uc);
|
||||
// 操作行为日志记录
|
||||
if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) {
|
||||
CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_REPOSITORY, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_REPOSITORY_ACCESS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOAPI boAPI = SDK.getBOAPI();
|
||||
BOQueryAPI BoQuAPI = boAPI.query("BO_ACT_EXPENSE", true);
|
||||
BoQuAPI.addQuery("APPLYUSER in ('admin','test')", null);
|
||||
BoQuAPI.addQuery("user = ","3");
|
||||
List<BO> lists = BoQuAPI.list();
|
||||
for (BO bo:lists){
|
||||
String bindid=bo.getString("bindid");//获取流程实例ID
|
||||
String msg= bo.getString("MSG");//MSG是大文本类型,且UI组件是HTML排版
|
||||
System.out.println("输出MSG的值为:"+msg);
|
||||
String amount= bo.getString("AMOUNT");//AMOUNT是数值类型,且UI组件是货币
|
||||
System.out.println("输出AMOUNT的值为:"+amount);
|
||||
}
|
||||
|
||||
return web.getMobilePortalDesignerHtml(uuid, upVisit, taskId);// 返回页面
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean hasAccessPortalDesignerPerm(UserContext uc, PALRepositoryModel model) {
|
||||
String newBoName = "BO_ACT_PUBLISH_PERM_SCOPE";
|
||||
BO bo = SDK.getBOAPI().query(newBoName).addQuery("PALVERSIONID=", model.getVersionId()).detail();
|
||||
|
||||
@ -3310,6 +3310,458 @@ public class CoeDesignerWeb extends ActionWeb {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 门户流程详情详情 (移动端)
|
||||
* @param rUUID 流程ID
|
||||
* @param upVisit 记录访问量+1,true:记录 ;false:不记录
|
||||
* @param taskId 流程手册id
|
||||
* @return
|
||||
*/
|
||||
public String getMobilePortalDesignerHtml(String rUUID, boolean upVisit, String taskId) {
|
||||
String processDefId = "";
|
||||
Map<String, Object> macroLibraries = new HashMap<String, Object>();
|
||||
macroLibraries.put("selectedElementId", "");
|
||||
macroLibraries.put("js", "");
|
||||
PALRepositoryModelImpl plModel = (PALRepositoryModelImpl) CoeProcessLevelDaoFacotory.createCoeProcessLevel().getInstance(rUUID);
|
||||
|
||||
if (plModel == null) {
|
||||
return AlertWindow.getNotFoundMessagePage("未找到文件", "该文件已被删除");
|
||||
}
|
||||
|
||||
macroLibraries.put("taskId", taskId);
|
||||
// 增加三员管理模式taskid为new,change判断
|
||||
if ("process".equals(plModel.getMethodCategory()) && !UtilString.isEmpty(taskId) && !"submit_create".equals(taskId) && !"new".equals(taskId) && !"change".equals(taskId)) {
|
||||
macroLibraries.put("outputFileName", plModel.getName() + ".doc");
|
||||
macroLibraries.put("taskId", taskId);
|
||||
// 压缩包名称 和 手册模板
|
||||
OutputTaskModel taskModel = new OutputTask().getTaskReportById(taskId);
|
||||
if(taskModel!=null){
|
||||
// 压缩包名称
|
||||
macroLibraries.put("taskName", taskModel.getTaskName() + ".zip");
|
||||
OutputAppProfile appFile = OutputAppManager.getProfile(taskModel.getProfileId());
|
||||
// 手册模板(com.actionsoft.apps.coe.pal.output.pr)
|
||||
macroLibraries.put("taskProfile", appFile.getAppContext().getId());
|
||||
}
|
||||
}
|
||||
|
||||
String type = CoeDesignerConstant.DESIGNER_DIFINITION_DEFAULT;
|
||||
if (plModel.getMethodId() != null && plModel.getMethodId().indexOf(CoeDesignerConstant.DESIGNER_DIFINITION_BPMN) != -1) {
|
||||
type = CoeDesignerConstant.DESIGNER_DIFINITION_BPMN;
|
||||
} else {
|
||||
type = CoeDesignerConstant.DESIGNER_DIFINITION_DEFAULT;
|
||||
}
|
||||
|
||||
boolean isCorrelateBpms = PALRepositoryQueryAPIManager.getInstance().isCorrelateBpms(plModel.getId(), true);
|
||||
macroLibraries.put("isMarked", false);
|
||||
//默认排序
|
||||
List<String> defaultAttrSort;
|
||||
if (CoeDesignerConstant.DESIGNER_DIFINITION_BPMN.equals(type)) {
|
||||
// 删除与BPMS关联的无效关联关系
|
||||
CoeProcessLevelUtil.deleteInvalidCorrelate(plModel.getId());
|
||||
if (isCorrelateBpms) {
|
||||
processDefId = PALRepositoryQueryAPIManager.getInstance().queryBpmsProcessDefIdByPalId(plModel.getId(), true);
|
||||
} else {
|
||||
processDefId = "";
|
||||
}
|
||||
getBpmnDesginerUI(plModel, macroLibraries, true, true);
|
||||
defaultAttrSort = getBpmnParams(plModel, processDefId, macroLibraries);
|
||||
macroLibraries.put("isMarked", CoeProcessLevelUtil.hasMarked(plModel.getId()));
|
||||
} else {
|
||||
getCoeDesginerUI(plModel, macroLibraries, true, true);
|
||||
defaultAttrSort = getCoeParams(plModel, macroLibraries);
|
||||
}
|
||||
int state = 0;// 版本状态:设计、运行、停用
|
||||
if (isCorrelateBpms) {
|
||||
ProcessDefinition definition = ProcessDefCache.getInstance().get(processDefId);
|
||||
if (definition != null) {
|
||||
state = definition.getVersionStatus();
|
||||
}
|
||||
}
|
||||
macroLibraries.put("BPMNSupport", AWSServerEngineConfiguration.getEngineBPMNSupport());
|
||||
macroLibraries.put("BPMNLevel0", AWSServerEngineConfiguration.getEngineBPMNLevel0());
|
||||
macroLibraries.put("BPMNLevel1", AWSServerEngineConfiguration.getEngineBPMNLevel1());
|
||||
macroLibraries.put("BPMNLevel2", AWSServerEngineConfiguration.getEngineBPMNLevel2());
|
||||
String userUrl = SDK.getPortalAPI().getUserPhoto(_uc, _uc.getUID());
|
||||
getMoreSharpe(plModel.getMethodId(), plModel.getId(), macroLibraries);// 获取更多图形
|
||||
macroLibraries.put("ver", 0);
|
||||
macroLibraries.put("methodId", plModel.getMethodId());
|
||||
macroLibraries.put("sid", _uc.getSessionId());
|
||||
macroLibraries.put("wsId", plModel.getWsId());
|
||||
macroLibraries.put("uuid", rUUID);// definition的UUID
|
||||
macroLibraries.put("parentChartId", plModel.getParentId());
|
||||
macroLibraries.put("uid", _uc.getUID());
|
||||
macroLibraries.put("userUrl", userUrl);
|
||||
macroLibraries.put("userName", _uc.getUserModel().getUserName());
|
||||
macroLibraries.put("schema", getSchema(plModel.getId(), plModel.getMethodId(), PALMethodUtil.getCustom(plModel.getMethodId(), plModel.getId())));
|
||||
macroLibraries.put("sessionId", _uc.getSessionId());
|
||||
macroLibraries.put("fileName", ShapeUtil.replaceBlank(plModel.getName()));
|
||||
macroLibraries.put("typeName", I18nRes.findValue(CoEConstant.APP_ID, plModel.getMethodCategory()) + "图");
|
||||
macroLibraries.put("openType", 0);
|
||||
macroLibraries.put("teamId", "");
|
||||
macroLibraries.put("perms", "");// 该流程权限(w,d,v)
|
||||
macroLibraries.put("filePerms", "");// 所有具有权限的流程Id
|
||||
macroLibraries.put("isPublish", plModel.isPublish());
|
||||
CoeUserModel userModel = (CoeUserModel) CoeUserDaoFactory.createUser().getInstanceByUserId(_uc.getUID());
|
||||
boolean isAdmin = (userModel != null && (userModel.getIsAdmin() == 1));
|
||||
macroLibraries.put("isAdmin", isAdmin);
|
||||
// 更多特性权限
|
||||
String moreAttrRight = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "MOREATTR_RIGHT");// 1普通用户有设置更多特性权限,
|
||||
if ("2".equals(moreAttrRight)) {// 只有admin显示
|
||||
if ("admin".equals(_uc.getUID())) {
|
||||
macroLibraries.put("moreAttrRight", true);
|
||||
} else {
|
||||
macroLibraries.put("moreAttrRight", false);
|
||||
}
|
||||
} else if ("0".equals(moreAttrRight)) {// 0只有管理员用户有权限
|
||||
if (isAdmin) {// 管理员用户
|
||||
macroLibraries.put("moreAttrRight", true);
|
||||
} else{// 普通用户
|
||||
macroLibraries.put("moreAttrRight", false);
|
||||
}
|
||||
} else {
|
||||
macroLibraries.put("moreAttrRight", true);
|
||||
}
|
||||
// 自动保存
|
||||
String isSysAutoSave = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, "SYS_AUTOSAVE");
|
||||
macroLibraries.put("isAutoSave", isSysAutoSave);
|
||||
macroLibraries.put("checkoutTip", "");
|
||||
macroLibraries.put("isView", true);// 是否只读打开
|
||||
|
||||
// 是否允许用户自定义模板,0:不允许;1:允许。
|
||||
AppAPI appApi = SDK.getAppAPI();
|
||||
String isCustomDefine = appApi.getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_CUSTOM_DEFINE_SCHEMA);
|
||||
macroLibraries.put("isCustomDefine", isCustomDefine);
|
||||
macroLibraries.put("openAppType", "0");
|
||||
|
||||
macroLibraries.put("editable", "0");
|
||||
|
||||
if (plModel.isPublish()) {
|
||||
long viewCount = plModel.getViewCount();
|
||||
plModel.setViewCount(viewCount + 1);
|
||||
PALRepository dao = new PALRepository();
|
||||
dao.update(plModel);
|
||||
}
|
||||
|
||||
getDesginerDefaultParams(macroLibraries);// 获取默认参数配置
|
||||
|
||||
macroLibraries.put("usersPhoto", "");
|
||||
macroLibraries.put("userNum", "");
|
||||
DesignerRelationShapeCacheManager relationShapeCache = DesignerRelationShapeCacheManager.getInstance();
|
||||
Map<String, Map<String, Object>> shapeMap = relationShapeCache.getShapemap();
|
||||
boolean isExistCopy = shapeMap.get(_uc.getUID()) != null;
|
||||
boolean isAppearCopy = shapeMap.get(_uc.getUID()) == null || shapeMap.get(_uc.getUID()).get("shapeCopyContent") == null;
|
||||
// 默认为定义复制
|
||||
macroLibraries.put("isExistCopy", isExistCopy);
|
||||
macroLibraries.put("isAppearCopy", isAppearCopy);
|
||||
|
||||
macroLibraries.put("diagram", "");
|
||||
macroLibraries.put("state", state);
|
||||
// DockBtnBar中的各功能是否显示
|
||||
macroLibraries.put("attributeView", "");
|
||||
macroLibraries.put("messageView", "");
|
||||
macroLibraries.put("printView", "");
|
||||
macroLibraries.put("publishView", "");
|
||||
|
||||
String riskStyle = "display:none;";
|
||||
// risk应用已下架
|
||||
// if (SDK.getAppAPI().isInstalled("com.actionsoft.apps.coe.pal.risk") && SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.risk")) {
|
||||
// riskStyle = "";
|
||||
// }
|
||||
// if (plModel.getMethodId().equals("process.epc") || plModel.getMethodId().equals("process.bpmn2") || plModel.getMethodId().equals("process.flowchart")) {
|
||||
// riskStyle = UtilString.isEmpty(riskStyle) ? "" : "display:none;";
|
||||
// } else {
|
||||
// riskStyle = "display:none;";
|
||||
// }
|
||||
macroLibraries.put("riskStyle", riskStyle);
|
||||
String processOnIsInstall = "false";
|
||||
if (SDK.getAppAPI().isInstalled("com.actionsoft.apps.coe.pal.processon")) {
|
||||
processOnIsInstall = "true";
|
||||
}
|
||||
String processOnIsActive = "false";
|
||||
if (SDK.getAppAPI().isActive("com.actionsoft.apps.coe.pal.processon")) {
|
||||
processOnIsActive = "true";
|
||||
}
|
||||
macroLibraries.put("processOnIsInstall", processOnIsInstall);
|
||||
macroLibraries.put("processOnIsActive", processOnIsActive);
|
||||
|
||||
|
||||
JSONObject relationShapeIds = new JSONObject();
|
||||
JSONObject relationShapeModels = new JSONObject();
|
||||
|
||||
|
||||
|
||||
String define = PALRepositoryQueryAPIManager.getInstance().getProcessDefinition(_uc, plModel.getId());
|
||||
JSONObject definition = JSONObject.parseObject(define);
|
||||
JSONObject elements = definition.getJSONObject("elements");
|
||||
for (String id: elements.keySet()) {
|
||||
JSONObject shapeObj = elements.getJSONObject(id);
|
||||
String name = shapeObj.getString("name");
|
||||
if ("linker".equals(name)) {
|
||||
continue;
|
||||
}
|
||||
Iterator<DesignerShapeRelationModel> modelIterator = DesignerShapeRelationCache.getByShapeId(plModel.getId(), id);
|
||||
if (modelIterator != null) {
|
||||
while (modelIterator.hasNext()) {
|
||||
DesignerShapeRelationModel shapeRelationModel = modelIterator.next();
|
||||
PALRepositoryModel relationPalModel = PALRepositoryCache.getCache().get(shapeRelationModel.getRelationFileId());
|
||||
if (relationPalModel != null) {
|
||||
relationShapeIds.put(shapeRelationModel.getRelationShapeId(), shapeRelationModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, JSONObject> map = PALRepositoryQueryAPIManager.getInstance().queryRepositoryShapeAttributeById(plModel.getId(), id, shapeObj, "|");
|
||||
for (Entry<String, JSONObject> entry : map.entrySet()) {
|
||||
JSONObject object = entry.getValue();
|
||||
if (object == null || object.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
relationShapeModels.put(id + "_" + entry.getKey(), Arrays.asList(object.getString("text").split("\\|")));
|
||||
}
|
||||
}
|
||||
|
||||
macroLibraries.put("relationShapes", relationShapeIds);
|
||||
macroLibraries.put("relationShapeModels", relationShapeModels);
|
||||
|
||||
if (defaultAttrSort != null && defaultAttrSort.size() > 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < defaultAttrSort.size(); i++) {
|
||||
if (i == defaultAttrSort.size() - 1) {
|
||||
sb.append(defaultAttrSort.get(i));
|
||||
} else {
|
||||
sb.append(defaultAttrSort.get(i) + "|");
|
||||
}
|
||||
}
|
||||
macroLibraries.put("defaultAttrSort", sb.toString());
|
||||
} else {
|
||||
macroLibraries.put("defaultAttrSort", "");
|
||||
}
|
||||
macroLibraries.put("importShapeStyle", "display:none");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Set<String> ids = new HashSet<>();
|
||||
sb.append(plModel.getName());
|
||||
ids.add(plModel.getId());
|
||||
getFilePath(sb, ids, plModel);
|
||||
macroLibraries.put("toolbarName", sb.toString());
|
||||
|
||||
List<String> shapeIds = new ArrayList<>();// 当前流程所有节点
|
||||
List<Map<String, Object>> shapeList = CoeDesignerUtil.getShapeMessageJson2(rUUID);//获取所有节点
|
||||
if (shapeList != null && shapeList.size() > 0) {
|
||||
for (Map<String, Object> map : shapeList) {
|
||||
shapeIds.add((String)map.get("id"));
|
||||
}
|
||||
}
|
||||
|
||||
getPalProcessLinkTag(plModel, macroLibraries);
|
||||
/********************附件************************/
|
||||
// 文件或节点自身附件
|
||||
com.alibaba.fastjson.JSONObject upFileObject = new com.alibaba.fastjson.JSONObject();
|
||||
upFileObject.put("file", new JSONArray());
|
||||
for (String shape : shapeIds) {
|
||||
upFileObject.put(shape, new JSONArray());
|
||||
}
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(rUUID).append("'");
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
|
||||
//三员管理下,过滤当前用户与文件密级显示
|
||||
if(HighSecurityUtil.isON()){
|
||||
macroLibraries.put("isHighSecurity", true);
|
||||
PALRepositoryQueryAPIManager.getInstance().upFileSecurityFilter(this._uc,fileList);
|
||||
}
|
||||
if (fileList != null && fileList.size() > 0) {
|
||||
for (UpfileModel upfileModel : fileList) {
|
||||
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
||||
object.put("id", upfileModel.getUuid());
|
||||
object.put("name", upfileModel.getFileName());
|
||||
object.put("type", "self");
|
||||
if ("f".equals(upfileModel.getType())) {
|
||||
upFileObject.getJSONArray("file").add(object);
|
||||
}
|
||||
if ("s".equals(upfileModel.getType())) {
|
||||
if (upFileObject.getJSONArray(upfileModel.getShape_uuid()) == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
String filename=upfileModel.getFileName().substring(upfileModel.getFileName().lastIndexOf("."));
|
||||
|
||||
if(!filename.equals(".xml")){
|
||||
upFileObject.getJSONArray(upfileModel.getShape_uuid()).add(object);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 文件或节点的关联节点的附件
|
||||
//查询流程和节点附件
|
||||
List<DesignerShapeRelationModel> relationList = null;
|
||||
// 查询关联的节点
|
||||
DesignerShapeRelationDao relationDao = new DesignerShapeRelationDao();
|
||||
relationList = relationDao.getModelListByFileId(rUUID);
|
||||
|
||||
//关联文件list
|
||||
List<UpfileModel> relationUpfFileList = new ArrayList<>();
|
||||
/*if (relationList != null && relationList.size() > 0) {
|
||||
for (int i = 0; i < relationList.size(); i++) {
|
||||
DesignerShapeRelationModel model = relationList.get(i);
|
||||
if (UtilString.isEmpty(model.getRelationShapeId())) {// 关联的模型文件
|
||||
List<UpfileModel> files = upFileDao.search(model.getRelationFileId(), null, "file");
|
||||
relationUpfFileList.addAll(files);
|
||||
}else {
|
||||
//关联的图形文件
|
||||
List<UpfileModel> files = upFileDao.search(model.getRelationFileId(), model.getRelationShapeId(), null);
|
||||
relationUpfFileList.addAll(files);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (relationUpfFileList != null && relationUpfFileList.size() > 0) {
|
||||
//三员管理,过滤关联文件密级显示
|
||||
if(HighSecurityUtil.isON()){
|
||||
PALRepositoryQueryAPIManager.getInstance().upFileSecurityFilter(this._uc,relationUpfFileList);
|
||||
}
|
||||
for (UpfileModel relationUpFile : relationUpfFileList) {
|
||||
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
||||
object.put("id", relationUpFile.getUuid());
|
||||
object.put("name", relationUpFile.getFileName());
|
||||
object.put("type", "relation");
|
||||
upFileObject.getJSONArray("file").add(object);// 文件
|
||||
}
|
||||
}
|
||||
macroLibraries.put("upfileData", upFileObject);
|
||||
/********************附件************************/
|
||||
/********************步骤说明************************/
|
||||
// 获取所有关联属性
|
||||
JSONObject relationShapes = new JSONObject();
|
||||
if (shapeList != null && shapeList.size() > 0) {
|
||||
for (Map<String, Object> map : shapeList) {
|
||||
String shapeId1 = (String)map.get("id");
|
||||
relationShapes.put(shapeId1, new JSONObject());
|
||||
String shapeName = (String) map.get("type");
|
||||
String shapeCategory = (String) map.get("category");
|
||||
String shapeMethod = shapeCategory.replace("_", ".");
|
||||
List<PALMethodAttributeModel> attributeModelList = CoeDesignerShapeAPIManager.getInstance().getValidAttributeModels(plModel.getWsId(), shapeMethod, shapeName, plModel.getMethodId());
|
||||
Map<String, JSONObject> refMap = new HashMap();
|
||||
Map<String, String> attrTypeMap = new HashMap<>();
|
||||
for (PALMethodAttributeModel model : attributeModelList) {
|
||||
if (!model.getUse()) {
|
||||
continue;
|
||||
}
|
||||
if ("relation".equals(model.getType()) || "awsorg".equals(model.getType())) {
|
||||
refMap.put(model.getKey(), JSON.parseObject(model.getRef()));
|
||||
}
|
||||
attrTypeMap.put(model.getKey(), model.getType());
|
||||
}
|
||||
List<DesignerShapeRelationModel> list = new DesignerShapeRelationDao().getModelListByShapeIdAndRelationShapeId(plModel.getId(), shapeId1, null, null);
|
||||
List<DesignerShapeRelationModel> modelList = new ArrayList<>();
|
||||
for (DesignerShapeRelationModel model : list) {
|
||||
String attrId = model.getAttrId();
|
||||
if (attrTypeMap.containsKey(attrId)) {
|
||||
if ("relation".equals(attrTypeMap.get(attrId))) {
|
||||
if (refMap.containsKey(attrId)) {
|
||||
String relationType = refMap.get(attrId).getString("type");
|
||||
if ("file".equals(relationType)) {// 关联的文件
|
||||
List<PALRepositoryModel> list2 = PALRepositoryCache.getByVersionId(plModel.getWsId(), model.getRelationFileId());
|
||||
for (PALRepositoryModel model2 : list2) {
|
||||
if (model2.isUse()) {
|
||||
model.setRelationShapeText(model2.getName());
|
||||
model.setRelationFileId(model2.getId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
modelList.add(model);
|
||||
} else {
|
||||
modelList.add(model);
|
||||
}
|
||||
}
|
||||
} else if ("awsorg".equals(attrTypeMap.get(attrId))) {
|
||||
JSONObject object = JSONObject.parseObject(model.getRelationShapeText());
|
||||
String id = object.getString("id");
|
||||
HashSet<String> keys = new HashSet<>();
|
||||
if (!keys.contains(id)) {
|
||||
// 查询最新名称
|
||||
if ("department".equals(object.getString("type"))) {
|
||||
DepartmentModel dept = SDK.getORGAPI().getDepartmentById(object.getString("id"));
|
||||
if (dept == null) continue;
|
||||
object.put("name", dept.getName());
|
||||
}
|
||||
if ("position".equals(object.getString("type"))) {
|
||||
RoleModel roleModel = SDK.getORGAPI().getRoleById(object.getString("id"));
|
||||
if (roleModel == null) continue;
|
||||
object.put("name", roleModel.getName());
|
||||
}
|
||||
if ("user".equals(object.getString("type"))) {
|
||||
UserModel user = SDK.getORGAPI().getUser(object.getString("id"));
|
||||
if (user == null) continue;
|
||||
object.put("name", user.getUserName());
|
||||
}
|
||||
if ("role".equals(object.getString("type"))) {
|
||||
RoleModel roleModel = SDK.getORGAPI().getRoleById(object.getString("id"));
|
||||
if (roleModel == null) continue;
|
||||
object.put("name", roleModel.getName());
|
||||
}
|
||||
modelList.add(model);
|
||||
keys.add(id);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
// 去重
|
||||
List<DesignerShapeRelationModel> tempList = new ArrayList<DesignerShapeRelationModel>();
|
||||
Set<String> keys = new HashSet<>();
|
||||
for (DesignerShapeRelationModel model : modelList) {
|
||||
String key = model.getFileId() + model.getShapeId() + model.getAttrId() + model.getRelationFileId() + model.getRelationShapeId() + model.getRelationShapeText();
|
||||
if (!keys.contains(key)) {
|
||||
tempList.add(model);
|
||||
keys.add(key);
|
||||
}
|
||||
}
|
||||
modelList = tempList;
|
||||
modelList.sort((m1, m2) -> {return m1.getId().compareTo(m2.getId());});
|
||||
for (DesignerShapeRelationModel model : modelList) {
|
||||
if (attrTypeMap.containsKey(model.getAttrId())) {
|
||||
if ("relation".equals(attrTypeMap.get(model.getAttrId()))) {
|
||||
if (relationShapes.getJSONObject(shapeId1).containsKey(model.getAttrId())) {
|
||||
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), relationShapes.getJSONObject(shapeId1).getString(model.getAttrId()) + "," + model.getRelationShapeText());
|
||||
} else {
|
||||
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), model.getRelationShapeText());
|
||||
}
|
||||
} else if ("awsorg".equals(attrTypeMap.get(model.getAttrId()))) {
|
||||
if (relationShapes.getJSONObject(shapeId1).containsKey(model.getAttrId())) {
|
||||
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), relationShapes.getJSONObject(shapeId1).getString(model.getAttrId()) + "," + JSONObject.parseObject(model.getRelationShapeText()).getString("name"));
|
||||
} else {
|
||||
relationShapes.getJSONObject(shapeId1).put(model.getAttrId(), JSONObject.parseObject(model.getRelationShapeText()).getString("name"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
macroLibraries.put("relationShapesData", relationShapes);
|
||||
/********************步骤说明************************/
|
||||
/********************描述************************/
|
||||
// 自定义属性
|
||||
JSONObject object = CoeProcessLevelUtil.getProcessLevelPropertyVal(plModel.getId());
|
||||
macroLibraries.put("processDesc", object);
|
||||
if (upVisit) {
|
||||
PALRepositoryQueryAPIManager.getInstance().UpDatePublishCount(plModel);
|
||||
}
|
||||
/********************描述************************/
|
||||
return HtmlPageTemplate.merge(CoEConstant.APP_ID, "pal.pl.repository.designer.view.portal.mobile.html", macroLibraries);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据method获取当前文件所定义的自定义属性
|
||||
* @param model
|
||||
|
||||
@ -2285,7 +2285,7 @@ public class CoeProcessLevelUtil {
|
||||
JSONArray jsonValue = jsonObjectMap.get(attributeModel.getKey()).getJSONArray("value");
|
||||
if(jsonValue.size()>0){
|
||||
|
||||
String sessionId = new SSOUtil().registerClientSessionNoPassword(plModel.getCreateUser(), LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
|
||||
String sessionId = new SSOUtil().registerClientSessionNoPassword("admin", LoginConst.DEFAULT_LANG, "localhost", LoginConst.DEVICE_PC);
|
||||
|
||||
for(int i=0;i<jsonValue.size();i++){
|
||||
relationFileId = jsonValue.getJSONObject(i).get("fileId").toString();
|
||||
@ -2383,8 +2383,8 @@ public class CoeProcessLevelUtil {
|
||||
* @return
|
||||
*/
|
||||
public static String getLastPublishTaskIdByModelId(String repositoryId) {
|
||||
//String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC";
|
||||
String sql="SELECT TASKID FROM (SELECT TASKID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID=? ORDER BY CREATEDATE DESC) WHERE ROWNUM=1";
|
||||
String sql = "SELECT pl.TASKID FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl WHERE pl.pid = p.id AND pl.palrepositoryid = ? ORDER BY publishdate DESC";
|
||||
//String sql="SELECT TASKID FROM (SELECT TASKID FROM BO_ACT_COE_PUBLISH_N WHERE PUBLISHFILEID=? ORDER BY CREATEDATE DESC) WHERE ROWNUM=1";
|
||||
String taskId = DBSql.getObject(sql, new RowMapper<String>() {
|
||||
@Override
|
||||
public String mapRow(ResultSet rs, int arg1) throws SQLException {
|
||||
|
||||
@ -9062,6 +9062,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!methodAttributeModelMap.containsKey(shapeName + "-" + attrId)) {
|
||||
continue;// 没有配置到形状的属性,不处理
|
||||
}
|
||||
@ -9077,6 +9078,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
|
||||
flag2 = UtilString.isNotEmpty(value);
|
||||
}*/
|
||||
if (!flag2) {
|
||||
|
||||
sb2.append("【"+o.get("text")+"】"+"''"+attrModel.getNewTitle()+"''").append(",");
|
||||
|
||||
}
|
||||
|
||||
@ -907,7 +907,6 @@
|
||||
color: #999999!important;
|
||||
background-color: #ffffff!important;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,489 @@
|
||||
$(function() {
|
||||
// 版本管理
|
||||
// if ((isView == 1 || isView == true) && perms.indexOf("w") == -1 && process.processDefId == "") {
|
||||
// $("#toolbar_designer_version_no").off("click.coe.openVersion").css({"cursor": "default"});
|
||||
// $("#toolbar_wfversion_info_status").off("click.coe.openVersion").css({"cursor": "default"});
|
||||
// } else {
|
||||
// $("#toolbar_designer_version_no").on("click.coe.openVersion",function() {openDesignerVersionManager();});
|
||||
// $("#toolbar_wfversion_info_status").on("click.coe.openVersion",function() {openDesignerVersionManager();});
|
||||
// }
|
||||
|
||||
$("div.selected").removeClass("selected");
|
||||
|
||||
//形状属性
|
||||
$("#toolbar-shape-attr").unbind("click").bind("click", function() {
|
||||
if($("#toolbar-shape-attr").hasClass("disabled")) {
|
||||
//
|
||||
} else {
|
||||
BPMNBiz.showPropertiesDialog(); //打开形状属性
|
||||
}
|
||||
|
||||
});
|
||||
//流程属性
|
||||
$("#toolbar-global-prop").unbind("click").bind("click", function() {
|
||||
BPMNBiz.showPropertiesDialog(true); //打开流程属性
|
||||
});
|
||||
});
|
||||
var aaa=true
|
||||
/**
|
||||
* 打开一个历史版本
|
||||
*/
|
||||
Dock.openHistory = function(definition) {
|
||||
if (this.currentDefinition == null) {
|
||||
this.currentDefinition = $.extend(true, {}, Model.define);
|
||||
}
|
||||
Utils.unselect();
|
||||
Model.historyDefine = definition;
|
||||
Designer.open(definition);
|
||||
|
||||
// 取消快捷键
|
||||
Designer.hotkey.cancel();
|
||||
Designer.op.cancel();
|
||||
$("#menu_bar").children().addClass("readonly");
|
||||
$(".diagram_title").addClass("readonly");
|
||||
$(".dock_buttons").children().addClass("disabled");
|
||||
$("#dock_btn_history").removeClass("disabled");
|
||||
$(".panel_box").addClass("readonly");
|
||||
|
||||
// 禁用保存
|
||||
$("#bar_save").button("disable");
|
||||
$("#bar_save").unbind("click");
|
||||
// 禁用插入和视图
|
||||
$("#bar_view").button("disable");
|
||||
$("#bar_insert").button("disable");
|
||||
// 禁用校验
|
||||
$("#dock_btn_validate").unbind("click");
|
||||
// 中止监听
|
||||
// CLB.stopListen();
|
||||
};
|
||||
|
||||
/**
|
||||
* 关闭历史版本
|
||||
*/
|
||||
Dock.closeHistory = function() {
|
||||
if (this.currentDefinition != null) {
|
||||
Designer.open(this.currentDefinition);
|
||||
this.currentDefinition = null;
|
||||
this.activeOperation();
|
||||
}
|
||||
|
||||
// 激活保存事件
|
||||
$("#bar_save").button("enable");
|
||||
$("#bar_save").unbind("click").bind("click", function() {
|
||||
saveDesigner();
|
||||
});
|
||||
// 激活视图和插入
|
||||
$("#bar_view").button("enable");
|
||||
$("#bar_insert").button("enable");
|
||||
$("#moreShapes").removeAttr("disabled");
|
||||
// //激活校验事件
|
||||
// $("#dock_btn_validate").bind("click", function() {
|
||||
// validateBPMN(false);
|
||||
// });
|
||||
};
|
||||
|
||||
/**
|
||||
* 加载历史版本
|
||||
*/
|
||||
/**太费时间,暂时先注掉,后期优化
|
||||
Dock.loadHistorys = function() {
|
||||
|
||||
$("#spinner_play_speed").spinner({
|
||||
min : 0.5,
|
||||
max : 3.0,
|
||||
unit : "s",
|
||||
step : 0.5,
|
||||
value : 5,
|
||||
onChange : function(val) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$("#spinner_play_speed").spinner("setValue", "0.5s");
|
||||
|
||||
if (chartId == "") {
|
||||
$("#history_container")
|
||||
.html("<div style='padding: 20px 10px;'>没有历史</div>");
|
||||
return;
|
||||
}
|
||||
// if($("#history_versions li").length > 0) {
|
||||
// return;
|
||||
// }
|
||||
$.ajax({
|
||||
url : encodeURI("./jd?sid="
|
||||
+ $("#sid").val()
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_history_version_json_data"),
|
||||
// 发送获取versions的请求
|
||||
data : {
|
||||
type : type,
|
||||
appId : appId,
|
||||
chartId : chartId,
|
||||
processDefId : process.processDefId
|
||||
},
|
||||
dataType : "json",
|
||||
success : function(resObj) {
|
||||
if (resObj.result != "ok") {
|
||||
// $.simpleAlert("历史版本获取失败", "error", 2000);
|
||||
}
|
||||
var data = resObj.data;
|
||||
Dock.historyVersions = data;
|
||||
|
||||
if (data.versions.length == 0) {
|
||||
$("#history_container")
|
||||
.html('<div style="padding: 20px 10px;">没有历史</div>');
|
||||
} else {
|
||||
$("#history_container")
|
||||
.html('<ul class="timeline" id="history_versions"></ul>');
|
||||
var users = data.users;
|
||||
for (var i = 0, k = data.versions.length; i < data.versions.length; i++, k--) {
|
||||
var v = data.versions[i];
|
||||
var num = i == 0 ? 0 : k;
|
||||
var newVersion = $('<li vid="' + v.versionId + '" def="'
|
||||
+ v.definitionId + '" ind="' + i + '" number="'
|
||||
+ num + '" >' + '<div class="time">'
|
||||
+ v.updateTimeAlias
|
||||
+ (v.interval ? (' 持续 ' + v.interval) : '')
|
||||
+ '</div>' + '<div class="number">' + k + '</div>'
|
||||
+ '<div class="content">'
|
||||
+ '<div class="version_name"></div>' + '</div>'
|
||||
+ '</li>').appendTo($("#history_versions"));
|
||||
var nameContainer = newVersion.children(".content")
|
||||
.children(".version_name");
|
||||
for (var j = 0; j < v.userIds.length; j++) {
|
||||
var userId = v.userIds[j];
|
||||
nameContainer.append("<div>" + v.userNames + "</div>"); // users[userId]
|
||||
}
|
||||
// var remarkContainer = $("<div class='history_remark'><div
|
||||
// class='remark_container'><div
|
||||
// class='remark_text'></div><a
|
||||
// onclick='Dock.editHistoryRemark(event, \"" + v.versionId
|
||||
// + "\")' href='javascript:'>注释</a></div></div>")
|
||||
// .appendTo($("li[vid="+v.versionId+"] .content"));
|
||||
// if (v.remark) {
|
||||
// remarkContainer.find(".remark_text").text(v.remark);
|
||||
// }
|
||||
// remarkContainer.append("<div
|
||||
// class='edit_container'><textarea class='input_text'
|
||||
// onclick='event.stopPropagation()'></textarea><a
|
||||
// href='javascript:' class='save'>保存</a> <a
|
||||
// href='javascript:' class='cancel'>取消</a></div>");
|
||||
}
|
||||
Dock.resetVersions();
|
||||
}
|
||||
},
|
||||
beforeSend : function(xhr) {
|
||||
// 显示正在加载的图片
|
||||
$("#history_container")
|
||||
.html('<img style="position:absolute;left:42%;top:35%" src="../apps/_bpm.platform/js/designer/themes/default/images/designer/loading.gif">');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
**/
|
||||
/* 显示右侧窗口 */
|
||||
Dock.showView = function(name) {
|
||||
|
||||
//if (name == "attribute") {
|
||||
changeArributeByShape();
|
||||
// }
|
||||
if ($("#dock_btn_" + name).button("isDisabled")) {
|
||||
return;
|
||||
}
|
||||
$(".dock_view").hide();
|
||||
$(".dock_view_" + name).show();
|
||||
// 记录页面用户的操作
|
||||
$(".dock_buttons").children().removeClass("selected");
|
||||
$("#dock_btn_" + name).addClass("selected");
|
||||
if (Dock.currentView == "history" && name != "history") {
|
||||
Dock.closeHistory();
|
||||
}
|
||||
if (name == "history") {
|
||||
//Dock.loadHistorys();
|
||||
}
|
||||
// if (name != "attribute") {
|
||||
// this.currentView = name;
|
||||
// }
|
||||
this.currentView = name;
|
||||
// setCookie(chartId, name+",true");
|
||||
this.update(true);
|
||||
// AWS增加的内容
|
||||
// 强制显示导航小窗口
|
||||
// $(".dock_view_navigator").show();
|
||||
};
|
||||
|
||||
/**
|
||||
* 展示历史版本
|
||||
*/
|
||||
Dock.showHistoryVersion = function(defId) {
|
||||
// AWS增加的内容开始
|
||||
var versionNo = $("#history_versions").children(".selected").attr("number");
|
||||
// AWS增加的内容结束
|
||||
$("#spinner_play_speed").button("disable");
|
||||
$("#btn_history_play").button("disable");
|
||||
$("#btn_history_restore").button("disable");
|
||||
$("#moreShapes").attr("disabled", "disabled");
|
||||
Dock.cancelHistoryRemark();
|
||||
$.ajax({
|
||||
url : encodeURI("./w?sid="
|
||||
+ sessionId
|
||||
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_history_define_json_data"),
|
||||
data : {
|
||||
type : type,
|
||||
chartId : chartId,
|
||||
appId : appId,
|
||||
processDefId : process.processDefId,
|
||||
ver : versionNo
|
||||
},
|
||||
dataType : "json",
|
||||
success : function(resObj) {
|
||||
if (resObj.result != "ok") {
|
||||
// $.simpleAlert("历史版本获取失败", "error", 2000);
|
||||
}
|
||||
var definition = resObj.data;
|
||||
Dock.openHistory(definition);
|
||||
if ($("#history_versions").children(".selected").attr("ind") != "0") {
|
||||
$("#spinner_play_speed").button("enable");
|
||||
$("#btn_history_play").button("enable");
|
||||
$("#btn_history_restore").button("enable");
|
||||
$("#moreShapes").removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 播放一个版本
|
||||
*/
|
||||
Dock.playOneVersion = function(index, msgIndex) {
|
||||
var current = $("#history_versions").children("li[ind=" + index + "]");
|
||||
$("#history_versions").children(".selected").removeClass("selected");
|
||||
current.addClass("selected").addClass("playing");
|
||||
$(".ico_playing").remove();
|
||||
current.append("<div class='ico ico_playing'></div>");
|
||||
|
||||
var top = current.position().top;
|
||||
if (top < 0) {
|
||||
$("#history_versions").scrollTop($("#history_versions").scrollTop()
|
||||
+ top);
|
||||
}
|
||||
|
||||
var time = $("#spinner_play_speed").spinner("getValue") * 1000;
|
||||
var version = Dock.historyVersions.versions[index];
|
||||
if (version.messages.length != 0) {
|
||||
var messageStr = version.messages[msgIndex];
|
||||
var messages = messageStr;
|
||||
// JSON.parse(messageStr);
|
||||
MessageSource.receive(messages);
|
||||
if (index == 0 && msgIndex == version.messages.length - 1) {
|
||||
this.pauseVersions();
|
||||
} else {
|
||||
if (msgIndex < version.messages.length - 1) {
|
||||
msgIndex++;
|
||||
} else {
|
||||
index = index - 1;
|
||||
msgIndex = 0;
|
||||
}
|
||||
this.playingTimeout = setTimeout(function() {
|
||||
Dock.playOneVersion(index, msgIndex);
|
||||
}, time);
|
||||
}
|
||||
} else { // 如果不存在操作message(用户打开设计器后没有操作,直接保存)
|
||||
if (index == 0) {
|
||||
this.pauseVersions();
|
||||
} else {
|
||||
index = index - 1;
|
||||
this.playingTimeout = setTimeout(function() {
|
||||
Dock.playOneVersion(index, msgIndex);
|
||||
}, time);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 编辑版本注释
|
||||
*
|
||||
* @param {}
|
||||
* event
|
||||
*/
|
||||
Dock.editHistoryRemark = function(event, versionId) {
|
||||
event.stopPropagation();
|
||||
var versionDom = $("#history_versions").children("li[vid=" + versionId
|
||||
+ "]");
|
||||
versionDom.find(".remark_container").hide();
|
||||
var currentRemark = versionDom.find(".remark_text").text();
|
||||
var editContainer = versionDom.find(".edit_container");
|
||||
editContainer.show();
|
||||
editContainer.children("textarea").val(currentRemark).select();
|
||||
editContainer.children(".save").bind("click", function(e) {
|
||||
e.stopPropagation();
|
||||
var newRemark = editContainer.children("textarea").val();
|
||||
versionDom.find(".remark_text").text(newRemark);
|
||||
versionDom.find(".remark_container").show();
|
||||
editContainer.hide();
|
||||
if (newRemark != currentRemark) {
|
||||
$.ajax({
|
||||
url : encodeURI("./w?sid=" + sessionId
|
||||
+ "&appId=" + $("#appId").val()
|
||||
+ "&cmd=CONSOLE_M_PROCESS_DESIGNER_REMARK_UPDATE"
|
||||
+ "&processDefId=" + process.processDefId
|
||||
+ "&versionId=" + versionId
|
||||
+ "&remark=" + newRemark),
|
||||
success : function(data) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
editContainer.children(".cancel").bind("click", function(e) {
|
||||
e.stopPropagation();
|
||||
Dock.cancelHistoryRemark();
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 恢复版本
|
||||
*/
|
||||
Dock.restoreVersion = function() {
|
||||
$.confirm({
|
||||
content : "确定将选中的历史记录恢复为新的版本吗?",
|
||||
|
||||
onConfirm : function() {
|
||||
var selected = $("#history_versions").children(".selected");
|
||||
if (selected.length) {
|
||||
coeBiz.restoreVersion(selected.attr("number"));
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 进入演示视图
|
||||
*/
|
||||
Dock.enterPresentation = function() {
|
||||
if (document.fullscreenElement || document.webkitFullscreenElement
|
||||
|| document.mozFullScreenElement) {
|
||||
$.simpleAlert("当前为全屏状态不能进入演示,请退出全屏状态后重试", "info", 2000);
|
||||
$("#simplealert>.msg").css("top", "15px");
|
||||
return;
|
||||
}
|
||||
$("#designer").bind('webkitfullscreenchange', function(e) {
|
||||
Dock.manageFullScreen(true);
|
||||
});
|
||||
$(document).bind('mozfullscreenchange', function(e) {
|
||||
Dock.manageFullScreen(true);
|
||||
}).bind('fullscreenchange', function(e) {
|
||||
Dock.manageFullScreen(true);
|
||||
});
|
||||
Dock.fullScreen(Utils.getDomById("designer"), true);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* 进入全屏视图
|
||||
*/
|
||||
Dock.enterFullScreen = function() {
|
||||
if (document.fullscreenElement || document.webkitFullscreenElement
|
||||
|| document.mozFullScreenElement) {
|
||||
$.simpleAlert("当前已为全屏状态", "info", 2000);
|
||||
$("#simplealert>.msg").css("top", "15px");
|
||||
return;
|
||||
}
|
||||
Dock.fullScreen(document.documentElement);
|
||||
};
|
||||
|
||||
Dock.manageFullScreen = function(presentation) {
|
||||
var designer = Utils.getDomById("designer");
|
||||
if (document.fullscreenElement || document.webkitFullscreenElement
|
||||
|| document.mozFullScreenElement) {
|
||||
// 如果进入全屏状态
|
||||
$("#shape_panel").addClass("readonly");
|
||||
$("#designer_viewport").addClass("readonly");
|
||||
$(window).unbind("resize.designer");
|
||||
$("#designer_layout").height(window.screen.height);
|
||||
// 取消快捷键
|
||||
Designer.hotkey.cancel();
|
||||
Designer.op.cancel();
|
||||
// 隐藏Dock
|
||||
$("#dock").hide();
|
||||
$(".dock_view").hide();
|
||||
Designer.contextMenu.destroy();
|
||||
Designer.op.canvasFreeDraggable();
|
||||
|
||||
if (presentation) {
|
||||
$("#dock").show();
|
||||
$("#dock_btn_validate").hide();
|
||||
$("#btn_history_restore").hide();
|
||||
}
|
||||
} else {
|
||||
$("#shape_panel").removeClass("readonly");
|
||||
$("#designer_viewport").removeClass("readonly");
|
||||
Designer.initialize.initLayout();
|
||||
Designer.hotkey.init();
|
||||
Designer.op.init();
|
||||
$("#dock").show();
|
||||
if (Dock.currentView != "") {
|
||||
Dock.showView(Dock.currentView);
|
||||
}
|
||||
Designer.contextMenu.init();
|
||||
$("#designer").unbind('webkitfullscreenchange');
|
||||
$(document).unbind('mozfullscreenchange').unbind('fullscreenchange');
|
||||
if (presentation) {
|
||||
$("#dock_btn_validate").show();
|
||||
$("#btn_history_restore").show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 进入全屏
|
||||
*/
|
||||
Dock.fullScreen = function(element, presentation) {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen();
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if (element.webkitRequestFullscreen) {
|
||||
element.webkitRequestFullscreen();
|
||||
} else if (element.msRequestFullscreen) {
|
||||
element.msRequestFullscreen();
|
||||
} else {
|
||||
// 无法进入全屏,提示错误
|
||||
if (presentation) {
|
||||
$("#fullscreen_tip").find(".t").text("由于您的浏览器限制,无法进入演示视图。");
|
||||
} else {
|
||||
$("#fullscreen_tip").find(".t").text("无法进入全屏视图,您可以按(F11)进入。");
|
||||
}
|
||||
$("#fullscreen_tip").fadeIn();
|
||||
}
|
||||
};
|
||||
|
||||
// coeUI修改
|
||||
var CoeUI = {
|
||||
initNavigationEye : function() {
|
||||
var layoutW = $("#designer_layout").width();
|
||||
var desiger = $("#designer").width();
|
||||
var designerHeight = $("#designer").height();
|
||||
var viewHeight = $("#navigation_view").height();
|
||||
// 总宽度减去可视区域的宽度,得到滚动条宽度
|
||||
var navleft = 0;// layoutW-desiger;
|
||||
var navtop = designerHeight - viewHeight;
|
||||
var dockLeft = navleft - 164;
|
||||
var dockTop = navtop - 2;
|
||||
$("#navigation_view").css("left", dockLeft);
|
||||
$("#navigation_view").css("top", dockTop);
|
||||
$("#navigation_view").css("width", 162);
|
||||
$("#navigation_view").css("height", 255);
|
||||
}
|
||||
}
|
||||
|
||||
// UI更多图形管理
|
||||
// UI.showShapesManage = function(){
|
||||
// $("#shapes_dialog").dialog({
|
||||
// buttons:[
|
||||
// {text:'确定',cls:"blue",handler:function(){alert(88);}},
|
||||
// {text:'取消',handler:function(){alert(22);}}
|
||||
// ]
|
||||
// });
|
||||
// }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user