Procházet zdrojové kódy

转件和流向条件适配

ljy121 před 1 rokem
rodič
revize
00efdd4471

+ 30 - 1
zjugis-business/src/main/resources/application.yaml

@@ -3,7 +3,37 @@ spring:
     allow-circular-references: true
     allow-bean-definition-overriding: true
   datasource:
+    druid:
+      web-stat-filter:
+        enabled: true
+      stat-view-servlet:
+        enabled: true
+        allow:
+        url-pattern: /druid/*
+        login-username: workflow
+        login-password: zjugis
+      filter:
+        stat:
+          enabled: true
+          log-slow-sql: true
+          slow-sql-millis: 100
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
     dynamic:
+      druid:
+        initial-size: 1
+        min-idle: 1
+        max-active: 20
+        max-wait: 60000
+        time-between-eviction-runs-millis: 60000
+        min-evictable-idle-time-millis: 300000
+        max-evictable-idle-time-millis: 900000
+        validation-query: SELECT 1 FROM DUAL
+        test-while-idle: true
+        test-on-borrow: false
+        test-on-return: false
       primary: oracle #设置默认的数据源
       strict: false
       datasource:
@@ -12,7 +42,6 @@ spring:
           url: jdbc:oracle:thin:@10.10.10.8:1521:ORCL
           username: ZJUGIS_BUSINESS
           password: Zjugis1402
-          type: com.zaxxer.hikari.HikariDataSource
 
 
   #freemarker

+ 1 - 1
zjugis-business/src/main/resources/static/flow/js/formCommon.js

@@ -12,7 +12,7 @@ function allowChildClick(even, treeNode, clickFlag) {
 
 function selecttree(selector,data,callback,beforeClick){
     z.ui.selecttree(selector).init({
-        panelwidth: 800,
+        panelwidth: 600,
         panelheight: 400,
         view:
             {

+ 2 - 2
zjugis-business/src/main/resources/templates/public/workFlow1.ftl

@@ -35,7 +35,7 @@
             '${WORKFLOW.URL!}/js/flow.js',
             '${WORKFLOW.URL!}/js/headBtn.js',
             '${WORKFLOW.URL!}/js/zFileUploadBase.js',
-            '${WORKFLOW.FILEURL!}/FileInfo/js/filePreview.js',
+            '${WORKFLOW.URL!}/js/js/filePreview.js',
             '${WORKFLOW.URL!}/IFlowMaterials/levelgrid/levelgrid.js',
             '${WORKFLOW.URL!}/IFlowOpinion/tempOpinion/flowOpinionTemp.js',
             '${WORKFLOW.URL!}/js/messager.js' ]+javascripts
@@ -61,7 +61,7 @@
             '${WORKFLOW.URL!}/js/flow.js',
             '${WORKFLOW.URL!}/js/headBtn.js',
             '${WORKFLOW.URL!}/js/zFileUploadBase.js',
-            '${WORKFLOW.FILEURL!}/FileInfo/js/filePreview.js',
+            '${WORKFLOW.URL!}/js/filePreview.js',
             '${WORKFLOW.URL!}/IFlowMaterials/levelgrid/levelgrid.js',
             '${WORKFLOW.URL!}/IFlowOpinion/tempOpinion/flowOpinionTemp.js',
             '${WORKFLOW.URL!}/js/messager.js' ]+javascripts

+ 6 - 12
zjugis-workflow/pom.xml

@@ -13,9 +13,6 @@
     <properties>
         <org.mybatis.spring.boot.mybatis-spring-boot-autoconfigure.version>1.3.2</org.mybatis.spring.boot.mybatis-spring-boot-autoconfigure.version>
         <com.baomidou.mybatis-plus-boot-starter.version>3.2.7.1</com.baomidou.mybatis-plus-boot-starter.version>
-        <com.baomidou.dynamic-datasource-spring-boot-starter.version>3.2.0
-        </com.baomidou.dynamic-datasource-spring-boot-starter.version>
-        <com.oracle.ojdbc6.version>11.2.0.3</com.oracle.ojdbc6.version>
         <org.apache.commons.commons-io.version>1.3.2</org.apache.commons.commons-io.version>
         <org.apache.poi.poi.version>3.17</org.apache.poi.poi.version>
         <commons-beanutils.commons-beanutils.version>1.9.4</commons-beanutils.commons-beanutils.version>
@@ -36,6 +33,10 @@
         </dependencies>
     </dependencyManagement>
     <dependencies>
+        <dependency>
+            <groupId>com.zjugis.cloud</groupId>
+            <artifactId>zjugis-spring-boot-starter-mybatis</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
@@ -70,17 +71,10 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <!--多数据源配置-->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
-            <version>${com.baomidou.dynamic-datasource-spring-boot-starter.version}</version>
-        </dependency>
         <!-- oracle连接驱动JDBC -->
         <dependency>
-            <groupId>com.oracle</groupId>
-            <artifactId>ojdbc6</artifactId>
-            <version>${com.oracle.ojdbc6.version}</version>
+            <groupId>com.oracle.database.jdbc</groupId>
+            <artifactId>ojdbc8</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>

+ 2 - 2
zjugis-workflow/src/main/java/com/zjugis/z_workflow/controller/TModalController.java

@@ -336,8 +336,8 @@ public class TModalController extends BaseController {
 			js.add(host + "/js/flow.js");
 			js.add(host + "/js/headBtn.js");
 			js.add(host + "/js/zFileUploadBase.js");
-			js.add(host + "/FileInfo/js/filePreview.js");
-			js.add(host + "/assets/lib/suwell_ofdReader.js");
+			js.add(host + "/js/filePreview.js");
+			js.add(host + "/js/suwell_ofdReader.js");
 			js.add(host + "/IFlowMaterials/levelgrid/levelgrid.js");
 			js.add(host + "/IFlowMaterials/materialstree/materialstree.js");
 			//判断是否启用意见签名图自适应

+ 19 - 23
zjugis-workflow/src/main/java/com/zjugis/z_workflow/service/ProcessEngineService.java

@@ -28,9 +28,8 @@ import com.zjugis.z_workflow.utils.GlobalConstant;
 import com.zjugis.z_workflow.utils.LocalDateTimeUtil;
 import com.zjugis.z_workflow.utils.LogicUtils;
 import com.zjugis.z_workflow.utils.ParticipantsUtils.PostParticipantsUtils;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Lazy;
@@ -58,6 +57,7 @@ import static com.zjugis.z_workflow.exception.enums.ProcessEngineExceptionEnum.*
  * @author Chenl
  */
 @Service
+@Slf4j
 public class ProcessEngineService {
 
 	//region Service
@@ -161,9 +161,6 @@ public class ProcessEngineService {
     @Value("${serviceUrl.z_workflow}")
     private String workflowUrl;
 	//endregion
-
-	//region 常量
-	public static final Logger logger = LoggerFactory.getLogger(ProcessEngineService.class);//日志构造器
 	private static final String MQ_METHOD = "/Rabbit/pushMessage";//推送消息
 	private static final String MQ_CALLBACK_METHOD = "/ProcessEngineApi/mqCallback";//MQ回调服务
 	private static final String ACTIVITY_TRANSFER_METHOD = "/ProcessEngineApi/activityAsynchronousTransfer";//活动异步转件服务
@@ -582,10 +579,10 @@ public class ProcessEngineService {
 					}
 				}
 			} catch (InterruptedException e) {
-                logger.error(e.getMessage(),e);
+                log.error(e.getMessage(),e);
 				throw new BusinessException(e.getMessage());
 			} catch (ExecutionException e) {
-                logger.error(e.getMessage(),e);
+                log.error(e.getMessage(),e);
 				throw new BusinessException(e.getMessage());
 			} finally {
 				executorService.shutdown();
@@ -658,7 +655,7 @@ public class ProcessEngineService {
 							pantGroupRel,flowIns.getId(),nextActivity.getActivityTemplateMark(),false,currentUserId,participantsUtils)));
 					nextActivity.setiExistParticipant(true);
 				} catch (Exception e) {
-					logger.error(e.getMessage(),e);
+					log.error(e.getMessage(),e);
 					throw new BusinessException(PROCESS_PARTICIPANT_ERROR);
 				}
 			}
@@ -977,7 +974,7 @@ public class ProcessEngineService {
 				Map conditionMap = processFlowConditionSplit(node.getId(), HDCJTJ.getValue(), flowIns,
 						activityTemp, prevActivityInstances, activityIds, currentUserId);
 				if (!Boolean.valueOf(conditionMap.get("logicRes").toString())) {
-					logger.error("["+flowIns.getCode()+"]环节["+node.getLabel()+"]创建条件不满足!");
+					log.error("["+flowIns.getCode()+"]环节["+node.getLabel()+"]创建条件不满足!");
 					//后置活动无法触发时,需同步生成流向实例信息
 					iDirectionInstanceService.saveDirectionInstance(direRecordId, flowIns.getId(), activityIns.getId(),
 							IDirectionInstanceBuilder.ACTIVITY, node.getId(), IDirectionInstanceBuilder.ACTIVITY);
@@ -1077,7 +1074,7 @@ public class ProcessEngineService {
 			//endregion
 		} catch (Exception e) {
 			String errorMsg = "["+activityIns.getName()+"]环节转件失败!" + e.getMessage();
-			logger.error(errorMsg, e);
+			log.error(errorMsg, e);
 			throw new BusinessException(errorMsg);
 		}
 		return TransferTipEnum.TRANSFER_SUCCESS.getValue();
@@ -1163,6 +1160,7 @@ public class ProcessEngineService {
 			//去除重复参与人
 			return partIds.stream().distinct().collect(Collectors.toList());
 		} catch (Exception e) {
+            log.error(e.getMessage(),e);
 			throw new BusinessException("获取流向参与用户ID集合失败:" + e.getMessage());
 		}
 	}
@@ -1441,7 +1439,7 @@ public class ProcessEngineService {
                     : TransferTipEnum.TRANSFER_SUCCESS.getValue();
         } catch (Exception e) {
             finishedStatus = IsFinishedEnum.FINISHED_N.getStatus();
-            logger.error("asynchronous transfer failed:" + e.getMessage(), e);
+            log.error("asynchronous transfer failed:" + e.getMessage(), e);
             throw new BusinessException("转件失败!" + e.getMessage());
         }
 	}
@@ -1456,10 +1454,8 @@ public class ProcessEngineService {
             MessageBody4ThirdSys messageBody = new MessageBody4ThirdSys();
             messageBody.setSystemCode("Z_WORKFLOW");
             messageBody.setRoutingKey(GlobalConstant.MQ_QUEUE_NAME);
-            messageBody
-                    .setTargetUrl(workflowUrl + ARCHIVE_METHOD);
-            messageBody
-                    .setPayload(JSON.toJSONString(paramMap));
+            messageBody.setTargetUrl(workflowUrl + ARCHIVE_METHOD);
+            messageBody.setPayload(JSON.toJSONString(paramMap));
             CommonResult<Object> result = rabbitClient.pushMessage(messageBody);
             if (!result.isSuccess()) {
                 throw new Exception(result.getMsg());
@@ -1470,7 +1466,7 @@ public class ProcessEngineService {
 			pushWebSocketNotice(archiveParam.getCurrentUserId());
 			return TransferTipEnum.ARCHIVE_SUCCESS.getValue();
 		} catch (Exception e) {
-			logger.error("asynchronous archive failed:" + e.getMessage(), e);
+			log.error("asynchronous archive failed:" + e.getMessage(), e);
 			throw new BusinessException("归档失败!" + e.getMessage());
 		}
 	}
@@ -1644,7 +1640,7 @@ public class ProcessEngineService {
 						currentActivityIns.getId(), participantData.get(0));
 			}
 		} catch (Exception e) {
-			logger.error("生成活动拆件失败:" + e.getMessage(), e);
+			log.error("生成活动拆件失败:" + e.getMessage(), e);
 			throw new BusinessException(SPLIT_ACTIVITY_FAIL);
 		}
 	}
@@ -1683,7 +1679,7 @@ public class ProcessEngineService {
 						currentActivityIns.getId(), new String[]{userIds.get(0)});
 			}
 		} catch (Exception e) {
-			logger.error("生成活动拆件失败:" + e.getMessage(), e);
+			log.error("生成活动拆件失败:" + e.getMessage(), e);
 			throw new BusinessException(SPLIT_ACTIVITY_FAIL);
 		}
 	}
@@ -1890,7 +1886,7 @@ public class ProcessEngineService {
 			} catch (Exception e) {
 				resultMap.put("result", false);
 				resultMap.put("returnMsg", e.getMessage());
-				logger.error("event execution failed:" + e.getMessage(), e);
+				log.error("event execution failed:" + e.getMessage(), e);
 			}
 			return resultMap;
 		} else {
@@ -2309,7 +2305,7 @@ public class ProcessEngineService {
 				}
 			}
 		} catch (Exception ex) {
-			logger.error("设置流程描述失败:" + ex.getMessage(), ex);
+			log.error("设置流程描述失败:" + ex.getMessage(), ex);
 			throw ex;
 		}
 	}
@@ -2487,7 +2483,7 @@ public class ProcessEngineService {
 				callInterfaceService.sendCenterMessage(MessageTemplateEnum.TRANSFER_NOTICE.getName(),
 						null, Arrays.asList(msgNoticeMethod.split(",")), "", userIds, dynamicParam);
 			} catch (Exception ex) {
-				logger.error("工作流转件通知失败!" + ex.getMessage(), ex);
+				log.error("工作流转件通知失败!" + ex.getMessage(), ex);
 			}
 		}
 	}
@@ -2545,7 +2541,7 @@ public class ProcessEngineService {
 				ChannelSupervise.sendToUser(userId, WebSocketEnum.OFFICE_CENTER.getType());
 			}
 		} catch (Exception e) {
-			logger.error("【" + userId + "】推送WebSocket失败:" + e.getMessage(), e);
+			log.error("【" + userId + "】推送WebSocket失败:" + e.getMessage(), e);
 		}
 	}
 
@@ -2648,7 +2644,7 @@ public class ProcessEngineService {
 				directionDto.setParticipants(participantList);
 			}
 		} catch(Exception ex) {
-			logger.error(ex.getMessage(), ex);
+			log.error(ex.getMessage(), ex);
 		}
 		return directionDto;
 	}

+ 2 - 2
zjugis-workflow/src/main/java/com/zjugis/z_workflow/service/TModalService.java

@@ -474,8 +474,8 @@ public class TModalService {
 			js.add(host + "/js/flow.js");
 			js.add(host + "/js/headBtn.js");
 			js.add(host + "/js/zFileUploadBase.js");
-			js.add(host + "/FileInfo/js/filePreview.js");
-			js.add(host + "/assets/lib/suwell_ofdReader.js");
+			js.add(host + "/js/filePreview.js");
+			js.add(host + "/js/suwell_ofdReader.js");
 			js.add(host + "/IFlowMaterials/levelgrid/levelgrid.js");
 			js.add(host + "/IFlowMaterials/materialstree/materialstree.js");
 			js.add(host + "/IFlowOpinion/tempOpinion/flowOpinionTemp.js");

+ 5 - 0
zjugis-workflow/src/main/java/com/zjugis/z_workflow/serviceApi/ProcessEngineApiController.java

@@ -1,6 +1,7 @@
 package com.zjugis.z_workflow.serviceApi;
 
 import com.alibaba.fastjson2.JSON;
+import com.zjugis.framework.security.core.LoginUser;
 import com.zjugis.framework.workflow.exception.BusinessException;
 import com.zjugis.framework.workflow.model.BaseController;
 import com.zjugis.framework.workflow.spring.resovler.ParamModel;
@@ -22,6 +23,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
+import static com.zjugis.framework.security.core.util.SecurityFrameworkUtils.mockLoginUser;
+import static com.zjugis.framework.security.core.util.SecurityFrameworkUtils.setLoginUser;
 import static com.zjugis.z_workflow.exception.enums.ProcessEngineExceptionEnum.*;
 
 /**
@@ -267,6 +270,8 @@ public class ProcessEngineApiController extends BaseController {
 	@ResponseBody
 	public String activityAsynchronousTransfer(@ParamModel AsynchronousTransferDto transferParam) {
 		try {
+            LoginUser test1 = mockLoginUser(request, "test1", 2);
+            setLoginUser(test1,request);
 			return ok(processEngineService.asynchronousActivityTransfer(transferParam));
 		} catch (Exception ex) {
             log.error(ex.getMessage(),ex);

+ 1 - 1
zjugis-workflow/src/main/java/com/zjugis/z_workflow/serviceApi/TMobileModalApiController.java

@@ -294,7 +294,7 @@ public class TMobileModalApiController extends BaseController {
 
 		private void js() {
 			js.add(AddressUtils.redirectPrefix(YmlUtil.getzWorkFlowUrl(), this.iExtranet) + "/js/zFileUploadBase.js");
-			js.add(AddressUtils.redirectPrefix(YmlUtil.getzFileManagement(), this.iExtranet) + "/FileInfo/js/filePreview.js");
+			js.add(AddressUtils.redirectPrefix(YmlUtil.getzWorkFlowUrl(), this.iExtranet) + "/js/filePreview.js");
 			js.add(AddressUtils.redirectPrefix(YmlUtil.getzWorkFlowUrl(), this.iExtranet) + "/IFlowMaterials/levelgrid/levelgrid.js");
 			js.add(AddressUtils.redirectPrefix(YmlUtil.getzWorkFlowUrl(), this.iExtranet) + "/IFlowMaterials/materialstree/materialstree.js");
 			js.add(AddressUtils.redirectPrefix(YmlUtil.getzWorkFlowUrl(), this.iExtranet) + "/js/messager.js");

+ 32 - 0
zjugis-workflow/src/main/resources/application.yaml

@@ -4,6 +4,24 @@ spring:
     allow-bean-definition-overriding: true
   #多数据源配置
   datasource:
+    druid:
+      web-stat-filter:
+        enabled: true
+      stat-view-servlet:
+        enabled: true
+        allow:
+        url-pattern: /druid/*
+        login-username: workflow
+        login-password: zjugis
+      filter:
+        stat:
+          enabled: true
+          log-slow-sql: true
+          slow-sql-millis: 100
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
     dynamic:
       primary: oracle #设置默认的数据源
       strict: false #设置严格模式,默认不启动.启动后在未匹配到指定数据源时候会抛出异常,不启动则使用默认数据源
@@ -13,6 +31,17 @@ spring:
           url: jdbc:oracle:thin:@10.10.10.8:1521:ORCL
           username: Z_WORKFLOW
           password: Zjugis1402
+          initial-size: 1
+          min-idle: 1
+          max-active: 20
+          max-wait: 60000
+          time-between-eviction-runs-millis: 60000
+          min-evictable-idle-time-millis: 300000
+          max-evictable-idle-time-millis: 900000
+          validation-query: SELECT 1 FROM DUAL
+          test-while-idle: true
+          test-on-borrow: false
+          test-on-return: false
   freemarker:
     prefix:
     suffix: .ftl
@@ -52,6 +81,9 @@ zjugis:
   web:
     admin-ui:
       url: http://dashboard.zjugis.iocoder.cn # Admin 管理后台 UI 的地址
+  info:
+    version: 1.0.0
+    base-package: com.zjugis.workflow
 
       # 验证api调用合法性
 authentication:

+ 449 - 0
zjugis-workflow/src/main/resources/static/js/filePreview.js

@@ -0,0 +1,449 @@
+(function (global) {
+    // upload
+    "use strict";//严格模式下,禁用指向了window的this
+    var webObj;
+    var pdfViewTypes = [".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf"];//以PDF预览的文件类型
+
+    var previewProto = {
+        file_preview: function () {
+            this.__proto__.funcType = 'filePreview';
+        }
+    };
+    if (window.z === undefined || window.z === null) window.z = {};
+    if (z.fileManagement === undefined || z.fileManagement === null) {
+        z.fileManagement = {};
+        z.fileManagement.files = previewProto;
+    } else {
+        if (z.fileManagement.files === undefined || z.fileManagement.files === null) {
+            z.fileManagement.files = previewProto;
+        } else {
+            z.fileManagement.files.file_preview = previewProto.file_preview;
+        }
+    }
+
+    var basePrototype = {
+        // 属性
+        options: {
+            name: 'filePreview',
+            elem: '#fileContainer',
+            fileSite: 'http://localhost:6060/',// 系统预设,不经过后台,无法从配置读取
+            fileContainerId: '',
+            revisionWorker: '',
+            ids: [],
+            fileUrls: []
+        },
+        containerStyle: {
+            height: '100%',
+            width: '100%'
+        },
+        // 方法
+        /**
+         * 初始化
+         * @param opts 参数
+         */
+        init: function (opts) {
+            this.config(opts.options, this.options);//用户配置
+            if (this.options.fileUrls.length > 0) {
+                var item = this.options.fileUrls.filter(function (value) {
+                    return value.defaultShow === true;
+                });
+                if (item.length > 0) {
+                    this.show('', item[0].fileUrl, item[0].fileSuffix);
+                } else {
+                    this.show('', this.options.fileUrls[0].fileUrl, this.options.fileUrls[0].fileSuffix);
+                }
+            } else if (this.options.ids.length > 0) {
+                var item = this.options.ids.filter(function (value) {
+                    return value.defaultShow === true;
+                });
+                if (item.length > 0) {
+                    this.show(item[0].id);
+                } else {
+                    this.show(this.options.ids[0].id);
+                }
+            }
+            return this;
+        },
+        /**
+         * 移动端预览附件
+         * @param id
+         * @param suffix
+         */
+        mobileFileView: function(id, suffix) {
+            $("#view-page-file-content").html('<div style="text-align: center;width: 100%;margin: 0 auto;font-size: 16px;position: relative;top: 50%">正在加载附件,请等待...</div>');
+            var fileSiteUrl = this.options.fileSite + "/FileInfo";
+            if (suffix) {
+                var lowerSuffix = suffix.toLowerCase();
+                if ($.inArray(lowerSuffix, pdfViewTypes) >= 0) {
+                    //以PDF方式预览附件
+                    var filePath = encodeURIComponent(fileSiteUrl+"/"+(lowerSuffix==".pdf"?"getFileById":"mobileFileToPdfView")+"?id="+id);
+                    var viewerPath = fileSiteUrl + "/pdfh5/pdf.html?file=" + filePath;
+                    $("#view-page-file-content").html("<iframe src=\""+viewerPath+"\" frameBorder=\"0\" width=\"100%\" height=\"100%\"></iframe>");
+                } else if (lowerSuffix == ".ofd") {
+                    //以OFD方式预览附件
+                    var filePath = fileSiteUrl + "/getFileById?id=" + id;
+                    var viewerPath = fileSiteUrl + "/ofdView/ofdview.html?file=" + encodeURIComponent(filePath);
+                    $("#view-page-file-content").html("<iframe src=\""+viewerPath+"\" frameBorder=\"0\" width=\"100%\" height=\"100%\"></iframe>");
+                } else if (lowerSuffix == ".dwg") {
+                    //DWG文件转换为PDF方式预览附件
+                    this.mobileCadPreview(id, this.options.fileSite);
+                } else {
+                    this.mobileShow(id, this.options.fileSite);
+                }
+            } else {
+                this.mobileShow(id, this.options.fileSite);
+            }
+        },
+        show: function (id, fileUrl, fileSuffix) {
+            if (fileUrl) {
+                this.rooting(z.ui.comm.getEntranceUrl(fileUrl), fileSuffix);
+            } else {
+                this.getFileUrl(id);
+            }
+        },
+        mobileShow: function(id, fileSiteUrl) {
+            z.ui.jsonpAjax({
+                url: fileSiteUrl + "/FileInfo/mobileFileView",
+                data: {id: id},
+                success: function(data) {
+                    if (data && data.error_code) {
+                        z.ui.alertWarning(data.msg, 1000);
+                        return;
+                    }
+                    var entranceSiteUrl = z.ui.comm.getEntranceUrl(fileSiteUrl);
+                    var commonCss = "width: 100%;-webkit-user-drag: none;-moz-user-drag: none;-o-user-drag: none;user-drag: none;";
+                    var html = '<div class="pinch-zoom" style="position: relative;' + commonCss + 'height: '+$("#view-page-file-content").height()+'px;">' +
+                        '<img style="' + commonCss + '" src="data:image/png;base64,' + data.imgBase64 + '"/>' +
+                        '</div>';
+                    $("#view-page-file-content").empty().html(html);
+                    $.getScript(entranceSiteUrl + '/assets/lib/pinchZoom/js/underscore.js', function () {
+                        $.getScript(entranceSiteUrl + '/assets/lib/pinchZoom/js/pinchzoom.js', function () {
+                            $("div.pinch-zoom").each(function () {
+                                new RTP.PinchZoom($(this), {});
+                            });
+                        });
+                    });
+                },
+                error: function() {
+                    $("#view-page-file-content").html("");
+                }
+            });
+        },
+        /**
+         * 获取文件路径
+         * @param id 文件文件id
+         */
+        getFileUrl: function (id) {
+            var _this = this;
+            var currentFileSite = this.options.fileSite;
+            z.ui.jsonpAjax({
+                url: currentFileSite + "/FileInfo/getFileById",
+                data: {id: id, getUrl: true, browserType: distinguishBrowser()},
+                success: function (data, b, c) {
+                    if (data && data.error_code) {
+                        z.ui.alertWarning(data.msg, 1000);
+                        return;
+                    }
+                    if(data.noSupport) {
+                        if (data.fileName) {
+                            z.ui.comm.downLoadFile(currentFileSite + "/FileInfo/getFileById?id=" + id, data.fileName);
+                        }
+                        _this.noSuportPreview();
+                        return;
+                    }
+                    if (data.isStreamFile) {
+                        _this.rooting(data.fileUrl, data.fileSuffix);
+                    } else {
+                        _this.rooting(data.fileUrl.replace(/\+/g, "%20"));
+                    }
+                }
+            });
+        },
+        rooting: function (fileUrl, fileSuffix) {
+            if (!fileSuffix) {
+                fileSuffix = fileUrl.split('.')[fileUrl.split('.').length - 1];
+            }
+            fileSuffix = fileSuffix.toLowerCase();
+            $(this.options.elem).empty();
+
+            switch (fileSuffix) {
+                case 'doc':
+                case 'docx':
+                case 'ppt':
+                case 'pptx':
+                case 'xls':
+                case 'xlsx':
+                    this.officePreview(fileUrl, fileSuffix);
+                    break;
+                case 'pdf':
+                case 'ceb':
+                    this.iframePreview(fileUrl);
+                    break;
+                case 'cebx':
+                    this.iframePreview(fileUrl);
+                    break;
+                case 'ofd':
+                    this.ofdPreview(fileUrl);
+                    break;
+                case 'dwg':
+                case 'dxf':
+                    this.cadPreview(fileUrl);
+                    break;
+                case 'png':
+                case 'jpg':
+                case 'jpeg':
+                case 'gif':
+                case 'bmp':
+                case 'tif':
+                case 'tiff':
+                    this.imagePreview(fileUrl);
+                    break;
+                case 'txt':
+                    this.txtPreview(fileUrl);
+                    break;
+                default:
+                    this.noSuportPreview();
+                    break;
+            }
+        },
+        noSuportPreview: function () {
+            var html = '<div class="z-position" style="text-align: center;top: 50%;margin-top: -100px;"><div><i class="fa fa-ban text-danger" style="font-size: 100px;"></i></div><p style="color: #999;"><strong>文件格式不在支持范围内</strong></p></div>';
+            $(this.options.elem).html(html);
+        },
+        officePreview: function (fileUrl, fileSuffix) {
+            var objId = this.options.fileContainerId ? this.options.fileContainerId : (fileSuffix + 'View');
+            var width = $(this.options.elem).width();
+            var classid = 'classid="clsid:E77E049B-23FC-4DB8-B756-60529A35FAD5"';
+            if (distinguishBrowser() == "Chrome") {
+                //兼容360极速浏览器
+                classid = 'type="application/x-itst-activex" clsid="{E77E049B-23FC-4DB8-B756-60529A35FAD5}"';
+            }
+            var html = '';
+            html += '<div class="office-container" style="height:' + this.containerStyle.height + ';width:' +
+                this.containerStyle.width + ';margin: 0;">' +
+                // '<div class="fullscreen-weboffice" style="position: absolute;height: 30px;width: 50px;top: 0;right: 0;text-align: center;line-height: 30px;background-color: #cccccc;font-weight: bold;cursor: pointer;">全屏</div>' +
+                '<object id="' + objId +
+                '" height="100%" width=' + width + '"px" style="LEFT:0;TOP:0;margin: 0;display: block;" ' + classid + ' codebase="' +
+                z.ui.comm.getEntranceUrl(this.options.fileSite) + '/assets/lib/webOffice/WebOffice.cab#Version=7,0,1,0"></object></div>';
+            $(this.options.elem).append(html);
+            try {
+                webObj = document.getElementById(objId);
+                webObj.OptionFlag |= 128;
+                // 禁止显示自带的工具条
+                webObj.ShowToolBar = 0;
+                // webObj.FullScreen = true;
+                webObj.LoadOriginalFile(fileUrl, fileSuffix);
+                // 修订人员 设置为当前登录人
+                if (this.revisionWorker) {
+                    webObj.SetCurrUserName(this.revisionWorker);
+                }
+                if (fileUrl !== '') {
+                    // 修订版本
+                    webObj.SetTrackRevisions(1);
+                }
+                // 显示修订
+                webObj.ShowRevisions(0);
+            } catch (e) {
+                this.noSuportPreview();
+            }
+        },
+        iframePreview: function (fileUrl) {
+            var html = '';
+            html += '<div class="pdf-container" style="height: ' + this.containerStyle.height + ';width: ' +
+                this.containerStyle.height + ';margin: 0;">' +
+                '<iframe style="height: 100%;width: 100%;display: block;" frameborder="0" class="pdfh5-con" src="' +
+                fileUrl + '#view=FitH&toolbar=0"></iframe>' +
+                '</div>';
+
+            $(this.options.elem).append(html);
+        },
+        ofdPreview: function(fileUrl) {
+            var viewerPath = z.ui.comm.getEntranceUrl(this.options.fileSite)+"/FileInfo/ofdView/ofdview.html?file="+encodeURIComponent(fileUrl);
+            $(this.options.elem).append("<iframe src=\""+viewerPath+"\" frameBorder=\"0\" width=\"100%\" height=\"100%\"></iframe>");
+        },
+        imagePreview: function (fileUrl) {
+            var fileName = fileUrl.split('/')[fileUrl.split('/').length - 1];
+            var html = '';
+            html += '<div class="image-container docs-pictures" style="height: ' + this.containerStyle.height + ';width: ' +
+                this.containerStyle.height + ';">' +
+                '<link rel="stylesheet" href="' + z.ui.comm.getEntranceUrl(this.options.fileSite) + '/assets/lib/imageView/css/viewer.css"/>' +
+                '<img alt="' + decodeURI(fileName) + '" style="height: 100%;width: 100%;display: none;" data-original="' + decodeURI(fileUrl) +
+                '" src="' + decodeURI(fileUrl) + '"/>' +
+                '</div>';
+            $(this.options.elem).append(html);
+            $.getScript(this.options.fileSite + '/assets/lib/imageView/js/viewer.js', function () {
+                $('.image-container').viewer({inline: true, url: 'data-original'});
+            });
+        },
+        cadPreview: function (fileUrl) {
+            var id = 'MxDrawX';
+            var html = '';
+            var classid = 'classid="clsid:74A777F8-7A8F-4e7c-AF47-7074828086E2"';
+            if (distinguishBrowser() == "Chrome") {
+                //兼容360极速浏览器
+                classid = 'type="application/x-itst-activex" clsid="{74A777F8-7A8F-4e7c-AF47-7074828086E2}"';
+            }
+            html += '<div class="cad-container" style="height: ' + this.containerStyle.height + ';width: ' +
+                this.containerStyle.height + ';">' +
+                '<object codebase="' + z.ui.comm.getEntranceUrl(this.options.fileSite) +
+                '/assets/lib/cadPreview/MxDrawX52.CAB#version=5.2.0.0" id="' + id + '" height="' +
+                this.containerStyle.height + '" width="' + this.containerStyle.width +
+                //'" classid="clsid:74A777F8-7A8F-4e7c-AF47-7074828086E2">' +
+                '" ' + classid + '>' +
+                '<param name="_Version" value="65536">' +
+                '<param name="_ExtentX" value="18521">' +
+                '<param name="_ExtentY" value="13758">' +
+                '<param name="_StockProps" value="0">' +
+                '<param name="IsRuningAtIE" value="1">' +
+                '<param name="BrowseMode" value="1">' +
+                '<param name="ShowPropertyWindow" value="0">' +
+                '<param name="ShowCommandWindow" value="0">' +
+                '<param name="ShowToolBars" value="0">' +
+                '<param name="ShowModelBar" value="0">' +
+                '<param name="Iniset" value="">' +
+                '<param name="ToolBarFiles" value="">' +
+                '<param name="ShowMenuBar" value="0">' +
+                '<param name="EnableUndo" value="1">' +
+                '<param name="UserName" value="浙江万维空间信息技术有限公司">' +
+                '<param name="UserSoftwareName" value="电子政务平台">' +
+                '<param name="UserPhone" value="0571-86723197">' +
+                '<param name="UserData" value="HHHH262AB346CB4FB33268F82C067BD80C0998015277215224C6E03DA1A664639733372E359776C0226457BF0000262A3EC8957E56C8B2D4FE7487DDD2312B46BB8C0EC92849B97877B64E334DCBDA939DE69A66E4456B620000262AFD9540037D8A06D355EA8A42DE11B57BF12E40BEFE40A74D8678E2D6A888D241520DA1FF53999C840000262AF0CEA6A5982CF973BBCC10074889583ED5094C614DCBBA832591D912AEC62EB78A9CE68A761C208A0000262A2D8DDE95A39BCE97EB3A1A6EDB6DEA7D08A2CF6CB03CE1D5956FE0EDA3588DAC819699375273363E0000262A8211AFB10F7C89C7D6FEBCB5F11DC035999FD8F69694D7ADCC01FBC3EF586600E2498AFAA8418CA70000262AF8C7629E031C8342CD793C1828D382FFE52E584C299B24B7ACDDF35F0316CD07E7EAC339F53824F20000262AE690BC76193B7FDFFCE70F7ADBFE96D275CB3F886C207CB2B6797ADF2F74427204133D1651259B240000262AF5D3C074CA5D80A61EC09EB1B8337FDE56421E216C84368471B353BF84A2C7AA1D401FF0D1D976940000262AE418D21C646611A0CE9EE0640C08A5E835A7698525AF337AE837B720B8C8DD962C17CAB647450D810000040A5BF49063A436400D0000">' +
+                '<embed width="100%" height="100%" showtoolbar="-1" showlayoutbar="1" pluginspage="' + z.ui.comm.getEntranceUrl(this.options.fileSite) +
+                '/assets/lib/cadPreview/MxDrawX52.CAB"/>' +
+                '</object>' +
+                '</div>';
+            $(this.options.elem).append(html);
+            var mxDrawTime = setInterval(function () {
+                var MxDrawX = document.getElementById("MxDrawX");
+                if (MxDrawX) {
+                    try {
+                        if (!MxDrawX.IsIniting()) {
+                            clearInterval(mxDrawTime);
+                            // 控件初始化完成,需要在启动做的事,在这里做
+                            MxDrawX.BrowseMode = true;
+                            MxDrawX.OpenDwgFile(fileUrl);
+                        }
+                    } catch (e) {
+                        clearInterval(mxDrawTime);
+                    }
+                }
+            }, 100);
+        },
+        txtPreview: function (fileUrl) {
+            var id = 'text';
+            var html = '';
+            html += '<div class="txt-container" style="height: ' + this.containerStyle.height + ';width: ' +
+                this.containerStyle.height + ';margin: 0;">' +
+                '<textarea readonly="readonly" style="font-family: Microsoft JhengHei;resize: none;height: 100%;width: 100%;background: transparent;border-style: none;padding: 0;" id="' + id + '"></textarea>' +
+                '</div>';
+            $(this.options.elem).append(html);
+            $.get(fileUrl, function (data) {
+                $('#' + id).val(data);
+            });
+        },
+        mobileCadPreview: function(id, fileSiteUrl) {
+            z.ui.jsonpAjax({
+                url: fileSiteUrl + "/ThirdParty/convertDwg",
+                data: {fileId: id},
+                success: function(data) {
+                    if (data) {
+                        $("#view-page-file-content").html("<iframe src=\""+data+"\" frameBorder=\"0\" width=\"100%\" height=\"100%\"></iframe>");
+                    } else {
+                        $("#view-page-file-content").css('display', "none");
+                        $("#view-page-readable-container").css('display', 'block');
+                        $("#view-page-readable-icon").html('<i class="iconfont-ljydeal iconwenjianzanbuzhichichakan"></i>');
+                        $("#view-page-readable-text").find("span").text("该文件暂不支持在线查看");
+                    }
+                },
+                error: function(err) {
+                    $("#view-page-file-content").html("");
+                }
+            });
+        },
+        /**
+         * 验证参数
+         */
+        validateParam: function () {
+            if (this.options.id === undefined || this.options.id === null || this.options.id === '') {
+                z.ui.alertError('请传入正确的文件id');
+                return false;
+            }
+            return true;
+        },
+        /**
+         * @method 配置
+         * @param opts { object } 用户提供的参数,在没有提供参数的情况下使用默认参数
+         * @param options { object } 默认参数
+         * @return options { object } 返回一个配置对象
+         */
+        config: function (opts, options) {
+            //默认参数
+            if (!opts) return options;
+            for (var key in opts) {
+                if (opts[key] !== null && opts[key] !== undefined && opts[key] !== "") {
+                    options[key] = opts[key];
+                }
+            }
+            return options;
+        },
+        /**
+         * 验证文件后缀是否支持
+         * @param fileSuffix 文件后缀
+         * @returns {boolean} 是否支持
+         */
+        validateSuffix: function (fileSuffix) {
+            return validate(fileSuffix);
+        }
+    };
+
+    z.fileManagement.files.file_preview.prototype = basePrototype;
+
+    function validate(fileSuffix) {
+        var types = ['pdf', 'txt', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'tif', 'tiff'];
+        if (distinguishBrowser() === 'IE') {
+            types = types.concat(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'dwg', 'dxf', 'ceb']);
+        }
+        fileSuffix = fileSuffix.toLowerCase();
+        if (types.indexOf(fileSuffix) >= 0) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 识别浏览器
+     * @returns {string} 浏览器类型
+     */
+    function distinguishBrowser() {
+        var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
+        var browser = navigator.appName;
+        var isOpera = userAgent.indexOf("Opera") > -1;
+        // 判断是否Opera浏览器
+        if (isOpera) {
+            return "Opera"
+        }
+        // 判断是否Firefox浏览器
+        if (userAgent.indexOf("Firefox") > -1) {
+            return "FF";
+        }
+        // 判断是否Chrome浏览器
+        if (userAgent.indexOf("Chrome") > -1) {
+            return "Chrome";
+        }
+        // 判断是否Safari浏览器
+        if (userAgent.indexOf("Safari") > -1) {
+            return "Safari";
+        }
+        // 判断是否IE浏览器
+        if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera || browser == "Netscape" || browser == "Microsoft Internet Explorer") {
+            return "IE";
+        }
+    }
+
+    window.onbeforeunload = function (event) {
+        if (webObj) {
+            webObj.CloseDoc(0);
+        }
+    }
+}(this));

+ 1615 - 0
zjugis-workflow/src/main/resources/static/js/suwell_ofdReader.js

@@ -0,0 +1,1615 @@
+(function(w) {
+	/*
+	 * 方法和控件方法的映射. 一般来说,名称相同.key为js的方法名称;
+	 * value中,real为控件的方法名,如果省略,则认为和js的方法相同.args为控件中该方法接受的参数名称
+	 */
+	w._METHOD = {		        
+        //3.1.2退出插件及阅读器
+        "exit":{
+			args : []
+		},		
+		//导入注释
+        "ImportAnnot":{
+			args:["importAnnotInfo"]
+		},
+		//导出注释
+        "ExportAnnot" :{
+			args:["exportAnnotInfo"]
+		},
+		// 3.2.1 设置元素可用性
+		"setCompsiteEnable" : {
+			args : [ "cmpName", "isEnable" ]
+		},
+		// 3.2.1-s 设置元素可用性-标准
+		"setCompositeEnable" : {
+			real : "setCompsiteEnable",
+			args : [ "cmpName", "isEnable" ]
+		},
+		// 3.2.2 设置元素可见性
+		"setCompsiteVisible" : {
+			args : [ "cmpName", "isVisible" ]
+		},		
+		// 3.2.2-s 设置元素可见性-标准
+		"setCompositeVisible" : {
+			real : "setCompsiteVisible",
+			args : [ "cmpName", "isVisible" ]
+		},
+		// 3.2.3 设置插件的背景==setConfigInfo(“reader.backgroundinfo”,xml)*
+		"setBackGroundInfo" : {
+			args : [ "config" ]
+		},
+		// 3.2.4 设置插件的前景==setConfigInfo(“reader.foregroundinfo”,configxml)*
+		"setForeGroundInfo" : {
+			args : [ "config" ]
+		},
+		// 3.2.5 设置视图缩放率
+		"setScale" : {
+			args : [ "scale" ]
+		},
+		// (兼容旧版本)
+		"setZoomRadio" : {
+			args : [ "scale" ]
+		},
+		// (兼容旧版本)
+		"getZoomRadio" : {
+			args : []
+		},
+		// 3.2.6 设置多文档模式==setConfigInfo(“reader.singlemode”,true)*
+		"setSingleMode" : {
+			args : [ "mode" ]
+		},
+		// 获取当前是否单文档模式
+		"isSingleMode":{
+			args : [ ]
+		},
+		// 3.2.7 设置阅读器模式==setConfigInfo(“readermode”,1)
+		"setReaderMode" : {
+			args : [ "mode" ]
+		},
+		//3.2.7 获取阅读器模式
+		"getReaderMode" : {
+			args : [ ]
+		},
+		// 3.2.8 设置视图首选项==setConfigInfo(“view.navigator”,none)*
+		"setViewPreference" : {
+			args : [ "key", "value" ]
+		},           
+		// 3.2.9 设置回调函数(已不推荐使用)
+		"setCallback" : {
+			args : [ "name", "func", "after" ]
+		},
+		// 3.2.9 设置回调函数
+		"registListener" : {
+			args : [ "name", "func", "after" ]
+		},
+		// 3.2.9 设置回调函数.移除监听
+		"unRegistListener" : {
+			args : [ "listenerID" ]
+		},		
+		// 3.2.10 设置掩膜生效模式。==setConfigInfo(“annot.maskmode”,0)*--setConfigInfo(“maskmode”,0)	说明:0为不禁止;1为禁止显示掩膜(Display);2为禁止打印掩膜(Print);3为全部禁止(DisplayAndPrint);其他值按照0处理。
+		"setMaskMode" : {
+			args : [ "mode" ]
+		},
+		 // 3.2.11 设置导航栏不能移动==setConfigInfo(“toolbarmovable”,false)*
+   		"setToolbarMovable" : {
+			args : [ "value" ]
+		},		
+		"setNavigatorVisible":{
+			args : [ "obj","visible" ]			
+		},         
+        // 3.3.1 设置用户信息
+		"setUserInfo" : {
+			args : [ "userInfo" ]
+		},
+		// 3.3.1 设置用户信息.设置当前用户名
+		"setUserName" : {
+			args : [ "name" ]
+		},
+		// 3.3.1 设置用户信息.获取当前用户名
+		"getUserName" : {
+			args : []
+		},
+		// 3.3.1 设置用户信息.设置用户ID。
+		"setUserID" : {
+			args : [ "id" ]
+		},
+		"setDataTag" : {
+			args : [ "dataTage" ]
+		},
+		//获取当前用户标识
+		"getUserID" :{
+			args : []
+		},
+		"getDataTag" : {
+			args : []
+		},
+		// 设置登录身份标识
+		"setUserToken" : {
+			args : [ "sessionId" ]
+		},
+		//设置当前用户会话标识
+		"setCookie":{
+			args : [ "sessionId" ]
+		},
+        //设置网络代理信息
+		"setUserAgent":{
+			args : [ "url" ]
+		},
+        // 3.3.2 设置文档信息
+		"setDocInfo" : {
+			args : [ "docInfo" ]
+		},
+        // 3.3.2 获取文档信息
+		"getDocInfo" : {
+			args : []
+		},
+		// 3.3.2 设置文档信息.设置元数据.
+		"setMetaData" : {
+			args : [ "id", "val" ]
+		},
+		// 3.3.2 设置文档信息.获取元数据。
+		"getMetaData" : {
+			args : [ "id" ]
+		},
+        // 3.3.3 设置权限信息
+		"setRightInfo" : {
+			args : [ "rightInfo" ]
+		},		
+        // 3.3.4 设置追踪水印
+		"setBarcodeInfo" : {
+			args : [ "param" ]
+		},
+		// 3.3.4 添加追踪水印
+		"addTrackInfo" : {
+			args : [ "param" ]
+		},
+		// 3.3.4 清除所有水印。
+		"clearTrackInfo" : {
+			args : []
+		},
+        // 3.3.5 设置文档水印
+		"addWaterMakerAnnot" : {
+			args : [ "param" ]
+		},
+		// 3.3.5 设置文档水印
+		"addWatermarkAnnot" : {
+			real:"addWaterMakerAnnot",
+			args : [ "param" ]
+		},				
+        // 3.3.5 删除文档水印
+		"delWaterMakerAnnot" : {
+			args : [ "user", "Annotflag" ]
+		},
+        // 3.3.5 删除文档水印
+		"delWatermarkAnnot" : {
+			real:"delWaterMakerAnnot",
+			args : [ "user", "Annotflag" ]
+		},
+        // 3.3.6 高亮关键词
+		"addDynamicLink" : {
+			args : [ "key", "url", "color" ]
+		},
+		// 3.3.6 高亮关键词2
+		"addDynamicLink" : {
+			args : [ "key", "url", "color","bLocate"]
+		},
+		// 3.3.5 清除所有高亮关键词
+		"clearDynamicLink" : {
+			args : []
+		},		
+		// 3.3.7 获取日志文件地址
+		"getLogFilePath" : {
+			args : []
+		},		
+        // 3.3.8 设置服务地址
+		"setServiceAddr":{
+			args : ["key","url"]
+		},			
+		// 3.3.8设置内容服务地址
+		"setContentSvrAddr" : {
+			args : [ "url" ]
+		},
+		// 3.3.8设置转换服务地址
+		"setConvertSvrAddr" : {
+			args : [ "url" ]
+		},
+		//3.3.8设置注册服务地址
+		"setRegistSvrAddr" : {
+			args : [ "url" ]
+		},
+		//3.3.8设置封装服务地址
+		"setEnvelopSvrAddr" : {
+			real : "setEncryptSvrAddr",
+			args : [ "url" ]
+		},
+		//3.3.8设置日志服务地址
+		"setLogSvrAddr" : {
+			args : [ "url" ]
+		},
+		//3.3.8设置日志服务地址-兼容四院标准接口
+		"setLogSvrURL" : {
+			real:"setLogSvrAddr",
+			args : [ "url" ]
+		},
+		//3.3.8更新阅读器下载地址
+		"setUpdateSvrAddr" : {
+			args : [ "url" ]
+		},
+		//3.3.9 设置配置信息项
+		"setConfigInfo":{
+			args : ["configKey","configValue"]
+		},
+		//3.3.9   设置最大可打印份数
+		"setPrintCopies" : {
+			args : [ "number" ]
+		},
+		//3.3.9 设置可使用打印机名
+		"setPrinterName" : {
+			args : [ "printer" ]
+		},
+		//3.3.9 设置可使用打印分辨率
+		"setPrintResolution":{
+			args : [ "printDpi" ]
+		},		
+		//3.3.10保存配置信息项
+        "saveConfigInfoToIni":{
+        	args : [ "svraddr","url"]
+        },
+		//3.3.11 获取阅读器版本信息项
+	    "version":{
+			args : [ ]
+		},			   
+		//3.3.11 获取阅读器版本信息项--标准接口
+		"getPluginVersion":{
+			real : "version",
+			args : []
+		},       
+        //3.3.12 设置文本框常用意见信息项
+		"setFreqUsedComments":{
+			args:["comments"]
+		},
+		//3.3.13 自定义文本框落款
+		"setCommentsSignInfo":{
+			args:["signinfo"]
+		},
+		//3.3.14 打印时是否带章
+		"setPrintSealEnable":{
+			args:["isEnable"]
+		},
+        //3.3.15设置打印弹出对话框的复选框组件是否选中。
+		"setPrintCompsiteChecked":{
+			args:["cmpName","bChecked"]
+		},
+        //3.3.16设置打印弹出对话框的复选框组件是否可用。
+		"setPrintCompsiteEnable":{
+			args:["cmpName","bEnable"]
+		},		
+		"scrollScreenOneTime":{
+			args:["forward"]
+		},				
+		// 3.4.1 获取语义位置
+		"getTaggedPosition" : {
+			args : [ "fieldId" ]
+		},
+		// 3.4.2 获取语义内容
+		"getTaggedText" : {
+			args : [ "fieldId" ]
+		},
+		// 3.4.3 获取全文文本内容
+		"getDocumentText" : {
+			args : []
+		},
+		// 3.4.4 获取打开文档的页数
+		"getPageCount" : {
+			args : []
+		},
+		//3.4.5 设置监视并清空剪切板
+		"setClipboardMonitor" :{
+			args : ["bMonitor"]
+		},
+		//3.4.6 关闭浏览器不弹出保存确认对话框
+		"closeBrowser":{
+			args : [""]
+		},		
+		//3.4.7 获取当前文档是否处于编辑状态
+		"isDocumentModified":{
+			args : []
+		},
+        //3.4.8 获取组件中当前在阅读状态的文档打开后的修改状态
+		"isDocumentModifiedAfterOpen":{
+             args : [ ]	
+		},
+        //3.4.9 获得文档中签章个数
+		"getSignaturesCount":{
+			args:["type"]
+		},
+		//3.4.10 获取当前页面索引
+		"getCurrentPageIndex":{
+			args:[]
+		},
+		"openFile2" : {		
+			args : [ "path", "readeOnly" ]
+		},
+		// 3.5.1 打开远程文件,并可设置是否只读状态
+		"openFile" : {
+			real : "openFile2",
+			//args : [ "path", "readeOnly" ]
+			args : [ "path" , false]
+		},
+		// 3.5.1 打开远程文件,可编辑状态
+		"openFileOld" : {
+			real : "openFile",
+			args : [ "path"]
+		},		
+		// 3.5.2 打开文件并设置保存路径
+        "openurl":{
+			args : [ "open_url","save_url","readeOnly"]
+        },		
+		// 3.5.3 打开内容服务文件
+		"openSvcFile" : {
+			args : [ "svcAddr", "docId" ]
+		},		
+		// 3.5.4 保存文件
+		"saveFile" : {
+			args : [ "filename" ]
+		},		
+		// 3.5.5 下载安全文件
+		"downloadFile":{
+			args : [ "filename", "param" ]
+		},		
+		// 3.5.6 打印文件
+		"printFile" : {
+			real : "printFile3",
+			args : [ "docName", "bGrayPrint" ]
+		},
+		// 3.5.7 打印文件
+		"printFileCopies" : {
+			args : [ "copies" ]
+		},
+		//3.5.8 按指定的设置直接打印
+		"printFileBySetting":{
+			args : [ "printSetting" ]
+		},
+		// 3.5.9 关闭文件
+		"closeFile" : {
+			args : []
+		},
+		// 3.5.10 转换文件
+		"convertFile" : {
+			args : [ "srcpath", "destFile", "metaContent" ]
+		},
+		// 3.5.11 执行拷贝
+		"editCopy" : {
+			args : []
+		},
+		// 3.5.12 执行粘贴
+		"editPaste" : {
+			args : []
+		},
+		// 3.5.13 模拟点击
+		"performClick" : {
+			args : [ "commandId" ]
+		},
+		// 3.5.13 模拟点击-指定路径和文件名
+		"performClickConfigable" : {
+			args : [ "commandId", "paramjson" ]
+		},
+        // 3.5.14 添加注释
+		"addPageAnnot" : {
+			args : [ "type", "index", "xPos", "yPos", "width", "height","parms" ]
+		},
+        // 3.5.15 执行跳转
+		"gotoDest" : {
+			args : [ "pageIndex", "xpost", "ypost" ]
+		},
+        // 3.5.16 执行操作
+		"excuteOperation" : {
+			args : [ "commandXML" ]
+		},
+        // 3.5.17 导入语义模板
+		"importSinemaTemp" : {
+			args : [ "param" ]
+		},
+		//3.5.18 验证签名
+		"validSignature":{
+			args : [ "online","signIds" ]
+		},
+		
+		//3.5.18 验证签名并返回结果
+		"validSignatureWithResult":{
+				args : [ "online","signIds" ]
+		},
+        //3.5.19设置远程打开文件的临时文件模式
+	    "setEncryptTempFile":{
+		    args : ["bEncrypt"]
+        },
+        //3.5.20全屏显示功能
+		"readerFullScreen":{
+	     	args : [ ]
+	     },
+		//3.5.21 设置提示框为顶端显示
+        "setWindowNotOnTop":{
+			args : [ ]	
+		 },
+        //3.5.22 控制插件是否退出
+        "setExit":{
+        	args:["isExit"]
+        },
+        //3.5.23客户端转换接口
+		"openOfficeFile":{
+			args : [ "filename","suffixes"]	
+		},
+        //3.5.24 注册高级版
+		"setRegistrationInfo":{
+			args : [ "projectInfo","registration"]
+		},
+        //3.5.25查找文本接口
+        "searchText":{
+        	 args : [ "keyword","bCaseSensitive","bWholeWord","bForward" ]
+        },
+		//3.5.26清空注释
+        "clearHandwrittenAnnotation":{
+        	args:[]
+        },
+        //3.5.27 在线文件脱密并下载到本地-接口1
+		"decryptAllSeals":{
+			args:["bBlack","fileName"]
+		},
+		//3.5.27 在线文件脱密并下载到本地-接口2
+		"decryptAllSeals":{
+			args:["bWordBlack"," bPictureBlack","bSealBlack","fileName"]
+		},
+		//3.5.28添加远程橡皮图章地址
+		"addStampUrl":{
+			args:["url"]
+		}, 
+        //3.5.29 导出图片接口
+		"exportImage":{
+			 args : [ "imageInfo"]	
+		},
+		//3.5.30 自定义盖章
+		"sealSignBySetting":{
+			 args : [ "json"]	
+		},
+		//添加橡皮图章base64文件流
+		"addStampStream":{
+			 args : [ "basestream"]	
+		},		
+		//添加橡皮图章拉伸参数
+		"SetKeepStampRatioParam":{
+			 args : [ "strIsKeepRatio","strWidth","strHeight"]	
+		},		
+		//3.5.29 添加文本框注释
+		"addFreeText":{
+			  args : ["textInfo"]	
+		},
+		//3.3.14 获取所有文本框ID
+		"getAllFreeTextBy":{
+			args:["user","datatag"]
+		},
+		//3.3.14 根据ID获取文本框内容
+		"getFreeTextInfoById":{
+			args:["String "]
+		},
+		//3.5.29 放大矩形区域
+		"ZoominBoundary":{
+            args : ["json"]
+		},
+		//3.5.30 获取文本框注释
+		"getFreeTextContentById":{
+            args : ["id"]
+		},
+		//3.5.31 修改文本框注释内容
+        "modifyFreeTextById":{
+           	args : [ "id","text" ]
+		},
+        //3.5.32 删除指定的文本框注释
+        "deleteAllFreeTextBy":{
+            args : [ "user","datatag" ]
+        },
+	    //3.5.33 添加图片
+		"addWaterImageAnnot":{
+			args : [ "imagInfo"]	
+		},
+		//3.5.34 删除图片
+		"delWaterMakerAnnotByID":{
+			args : ["annotId"]	
+		},
+	    //3.5.35 设置印章标识
+		"setSealId":{
+            args : [ "sealId"]
+        },
+        //3.5.36 更新文档视图缓存
+		"updateViewCache":{
+            args : [ "bClearAll"]
+        },
+        //时间戳
+		"setDateFormat" : {
+			args : [ "data" ]
+		},
+		"writeDateText" : {
+			args : [ ]
+		},
+		"cancleWriteDateText" : {
+			args : [ ]
+		},
+        //文档脱密-全黑
+	    "decryptAlltoBlack":{
+            args:["saveFileName"]
+        },
+        //插入橡皮图章
+		"addStampAnnot" :{
+			args :["param"]
+		},
+        //3.6.1 异步下载接口
+	    "downloadHttpFile":{
+	      	args:["url","localFileName","md5"]
+        },
+        //3.6.2 删除本地文件接口
+	    "deleteLocalFile":{
+            args : [ "localFileName" ]
+        },
+        //3.6.3上传本地文件接口
+        "uploadLocalFile":{
+            args : [ "url","localFileName"]
+        },
+		//3.6.4 获取计算机名
+		"getLocalHostName":{
+            args : []
+		},
+		//3.6.5 删除本地目录
+		"deleteLocalDir":{
+			args : ["url"]
+		},
+		// 可拖动图片
+		"addAffixAnnot":{
+            args : ["strAffixAnnot"]
+        },
+		//3.6.6 修改本地目录
+		"renameLocalDir":{
+			args : ["url","localDirNamel"]	
+		},
+		//add interface 2019.10.10
+        // 插入页面
+        "InsertPage":{
+            args : []
+        },
+        // 插入页面(指定页面相关信息)
+        "InsertPage2":{
+            args : ["info"]
+        },
+        // 插入空白页(指定页面相关信息)
+        "InsertBlankPage":{
+            args : ["info"]
+        },
+        // 删除页面(ID: 从0开始)
+        "DeletePage":{
+            args : ["pageIndex"]
+        },
+		// 根据指定注释类型、用户ID、标识、时间范围等获取注释数量		
+        "getAnnotAmountBy":{
+            args : ["annotInfo"]
+        },
+		// 设置右键菜单可见
+        "SetContextMenuStripVisible":{
+			args:["operationName","visible"]
+		},
+		// 设置右键菜单可用
+		"SetContextMenuStripEnable":{
+			args:["operationName","enable"]
+		},
+		//根据签批注释用户ID、标识、页码范围获取注释图片
+		"getSignaturePenAnnotImageBy":{
+			args:["annotInfojson"]
+		},
+		//获得文档中签章个数
+		"getSignaturesCount":{
+			args:["type" ]
+		},
+		//获取印章的ID
+		"getSignatureID":{
+			args:["index" ]
+		},
+		//获取印章的ID
+		"getSignatrueID" : {
+			real : "getSignatureID",
+			args : [ "index" ]
+		},
+		//删除签名
+		"deleteSignature":{
+			args:["signatureID"]
+		},
+		//导入签名图片-人名章
+		"importSignatureImage":{
+			args:["signInfo"]
+		},
+		//清除注释功能需要清除文本框、橡皮图章、手写
+		"deleteAnnotationByParameter":{
+			args:["annotInfo"]
+		},
+		//获取文件中书签功能
+		"getBookmarkInfo":{
+			args:[""]
+		},
+		//获取文档中的可移动的图片水印、橡皮图章、手写、文本框等信息以json返回信息
+		"getAnnotInfoBy":{
+			args:["param"]
+		},
+		//获取签章所在页码、中心点坐标值以及宽高信息
+		"getSignatureInfo":{
+			args:["signatureID"]
+		},
+		//导出附件
+		"ExportAttachment":{
+			args:["strFilePath","ShowMessage"]
+		},
+		//导入附件
+		"ImportAttachment":{
+			args:["strFilePath"]
+		},		
+        //根据源文件中签章位置批量打开文件盖章
+        "sealByBatch": {
+            args: ["srcFileName","mbFileUrls","saveFileUrls","pageIndex"]
+        },
+        //同步阻塞打开文件
+        "openFileSyn": {
+            args: ["filename","bReadOnly"]
+        },
+		//获取公文域ID
+		"GetCustomTagID": {
+            args: ["strTagName"]
+        },
+		//删除公文域ID对应的内容
+		"DeleteCustomTagContentbyID": {
+            args: ["strID"]
+        },
+		//设置橡皮图章不绘制控制点参数		
+		"SetNotDrawdragControl": {
+            args: ["strControlList"]
+        },
+		//获取文件指定页面宽度		
+		"GetPageWidth": {
+            args: ["pageIndex"]
+        },
+		//获取文件指定页面高度
+		"GetPageHeight": {
+            args: ["pageIndex"]
+        },
+		//传入base64数据流信息,直接在内存中打开
+		"openBase64File": {
+            args: ["base64Info"]
+        },
+		//保存并返回文件base64数据流信息
+		"saveBase64File": {
+            args: []
+        },
+		//根据info添加文号章
+		"AddChapterBy": {
+            args: ["chapterInfo"]
+        },
+		//动态隐藏或者显示导航栏面板里的按钮
+		"setNavigationButtonVisible": {
+            args: ["navType","buttonName","visible"]
+        },
+		//从base64pdf文件转换到指定路径ofd文件并返回文件base64数据流信息
+		"convertFileFromBase64PDF": {
+            args: ["base64Info","destFile"]
+        },
+		//获取文件的MD5哈希值
+		"getFileMd5Value": {
+            args: []
+        },
+		//根据页面范围返回文件base64数据流信息
+		"saveBase64FilebyIndex": {
+            args: ["strPageindex"]
+        },
+		//获取某个区域内的注释信息
+        "getAnnotIdsByInfo":{
+            args: ["params"]
+        },
+        //粘贴注释到指定位置
+        "copyAnnotsToPos":{
+            args: ["params"]
+        },
+		//通过书签名称,获取书签的boundary
+		"getBookmarkBoundaryByName":{
+			args: ["sname"]
+		},
+		//拆分OFD文件
+		"DistillOFD":{
+			args: ["distillInfo"]
+		},
+		//合并OFD文件
+		"MergeOFD":{
+			args: ["distillInfo"]
+		},
+		//提取页面为txt文件
+		"DistillPageAsTxt":{
+			args: ["distillInfo"]
+		},
+		//根据标识name获取文本批注的信息<userid,dataId,批注内容,批注框位置>
+		"getFreeTextInfoByName":{
+			args: ["name"]
+		},
+		//根据指定用户和环节,获取所有文本批注标识/name列表
+		"getAllFreeTextNameBy":{
+			args: ["user","datatag"]
+		},
+		//要修改的文本批注的标识/name
+		"modifyFreeTextByName":{
+			args: ["name","freetextInfo"]
+		},
+		//打开接续文档
+		"openContinuousFile":{
+			args: ["fileInfo"]
+		},
+		//设置隐写水印信息
+		"setSafeWatermarkInfo":{
+			args: ["displaySafeWatermark","printSafeWatermark","userCode","initPassword"]
+		},
+		//获取文档中关键字数量
+		"getSearchResultAmount":{
+			args: ["keyword","bMatchWholeWord","bMatchCase"]
+		},
+		//设置打印份号
+		"setPrintCopyNo":{
+			args: ["printCopyNo"]
+		},
+		//添加待删除文件
+		"addFileToDelete":{
+			args: ["fileName"]
+		},
+		//显示打印设置界面
+		"showPrintSetting":{
+			args: ["fileName"]
+		},
+		//保存安全文件
+		"saveEnvFile":{
+			args: ["jsoninfo"]
+		},
+		//打开安全ofd文件
+		"openEnvFile":{
+			args: ["filename", "strEncryptionInfoPath"]
+		},
+		//获取隐写嵌入结果
+		"getSafeWatermarkResult":{
+			args: ["iType"]
+		},
+		//获取IP和MAC地址
+		"getIPMacAddress":{
+			args: []
+		},
+		//从图片创建ofd文件
+		"createOFDfromImages":{
+			args: ["params"]
+		},
+		//根据ofd模板获取字段信息
+		"GetChapterParamInfo":{
+			args: ["chapterInfo"]
+		},
+		//根据chapterInfo动态刷新生成ofd文件
+		"AddChapterFileByParamInfo":{
+			args: ["chapterInfo"]
+		},
+		//根据文号章字段语义结点跳转
+		"GoToActionByChapterCustomtag":{
+			args: ["chaptercustomtag"]
+		},
+		// 插入base64数据流文件
+		"InsertBase64File":{
+			args: ["base64Info"]
+		},
+		// 通过图片信息添加橡皮图章
+		"addStampAnnotFromFile":{
+			args: ["stampAnnotInfo"]
+		},
+		// 添加语义结点的objectdata节点
+		"AddCustomtagObjectDataInfo":{
+			args: ["customtagInfo"]
+		},
+		// 插入流转管控文件信息
+		"InsertCirculationControlInfo":{
+			args: ["cirControlInfo"]
+		},
+		// 根据name判断橡皮图章是否存在
+		"isStampAnnotExist":{
+			args: ["name"]
+		},
+		// 根据id删除注释
+		"DeleteAnnotById":{
+			args: ["ids"]
+		}		
+	},
+
+	/*
+	 * 初始化时需要隐藏的
+	 */
+	w._HIDDEN = [ "menu" ]
+
+})(this);
+
+var OFD = (function(_w) {
+	/*
+	 * 常量
+	 */
+	var Constant = {
+		// CLSID
+		CLSID : "C7F277DC-6C47-AB2C-FB6A-070DC8BE7533",
+		// 控件的注册名
+		ACTIVE_NAME_OLD : "suwellreaderax.SuwellOfdActiveX",
+		ACTIVE_NAME : "suwellreaderax.OFDReaderActiveX",
+		// 嵌入类型
+		EMBED_TYPE : "application/x-suwell",
+		// 随机字符种子
+		RANDOM_SEED : "0123456789qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM"
+	};
+
+	var Method = {
+		// 控件组件的显示或隐藏
+		"setCompsiteVisible" : {
+			args : [ "name", "visible" ]
+		},
+		// 兼容旧版
+		"setCompositeVisible" : {
+			real : "setCompsiteVisible",
+			args : [ "name", "visible" ]
+		},
+		// 打文件(包括本地和远程)
+		"openFile" : {
+			args : [ "path", "readOnly" ]
+		},
+		// 关闭当前文件
+		"closeFile" : {
+			args : []
+		}
+	};
+
+	/*
+	 * 一些简单的css
+	 */
+	var CSS = {
+		info : "margin: 10px 0px; padding: 12px; border-radius:10px; color: #00529B; background-color: #BDE5F8;",
+		success : "margin: 10px 0px; padding: 12px; border-radius:10px; color: #4F8A10; background-color: #DFF2BF;",
+		warn : "margin: 10px 0px; padding: 12px; border-radius:10px; color: #9F6000; background-color: #FEEFB3;",
+		error : "margin: 10px 0px; padding: 12px; border-radius:10px; color: #D8000C; background-color: #FFBABA;"
+	};
+	/*
+	 * 工具
+	 */
+	var Tool = {
+		// 合并对象
+		extend : function(defs, target) {
+			var r = target;
+			if (this.isNull(r)) {
+				if (this.isArray(defs)) {
+					r = [];
+				} else {
+					r = {};
+				}
+			}
+			this.each(defs, function(n, v) {
+				if (!(n in r)) {
+					r[n] = v;
+				}
+			});
+			return r;
+		},
+		// 判断参数是否是数组
+		isArray : function(v) {
+			return Object.prototype.toString.call(v) === "[object Array]";
+		},
+		// 判断是否为纯粹对象,like jquery.isPlainObject
+		isPlainObject : function(v) {
+			if (!v || v.toString() !== "[object Object]" || v.nodeType
+					|| "setInterval" in v) {
+				return false;
+			}
+			try {
+				if (v.constructor
+						&& !v.hasOwnProperty("constructor")
+						&& !v.constructor.prototype
+								.hasOwnProperty("isPrototypeOf")) {
+					return false;
+				}
+			} catch (e) {
+				return false;
+			}
+			var key;
+			for (key in v) {
+			}
+			return key === undefined || v.hasOwnProperty(key);
+		},
+		// 判断参数是否是undefined或null
+		isNull : function(v) {
+			return typeof v == "undefined" || (v != 0 && !v);
+		},
+		// 判断参数是有有效值
+		isValid : function(v) {
+			return this.isNull(v) !== true;
+		},
+		// getElementById
+		_$ : function(id) {
+			return document.getElementById(id);
+		},
+		// createElement
+		_new : function(tag) {
+			return document.createElement(tag);
+		},
+		// for-each like jquery
+		each : function(o, fn) {
+			if (this.isNull(o)) {
+				return o;
+			}
+			if (this.isArray(o)) {
+				for ( var i = 0, ol = o.length, val = o[0]; i < ol
+						&& fn.call(val, i, val) !== false; val = o[++i]) {
+				}
+			} else {
+				for ( var i in o) {
+					if (fn.call(o[i], i, o[i]) === false) {
+						break;
+					}
+				}
+			}
+			return o;
+		},
+		// 对字符串进行转义
+		escape : function(s) {
+			return ('' + s).replace(/["'\\\n\r\u2028\u2029]/g, function(
+					character) {
+				// http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4
+				switch (character) {
+				case '"':
+				case "'":
+				case '\\':
+					return '\\' + character
+				case '\n':
+					return '\\n'
+				case '\r':
+					return '\\r'
+				case '\u2028':
+					return '\\u2028'
+				case '\u2029':
+					return '\\u2029'
+				}
+			});
+		},
+		/*
+		 * 浏览器类型判断 http://
+		 * stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
+		 */
+		Browser : {
+			// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
+			isOpera : function() {
+				return !!window.opera
+						|| navigator.userAgent.indexOf(' OPR/') >= 0;
+			},
+			// Firefox 1.0+
+			isFirefox : function() {
+				return typeof InstallTrigger !== 'undefined';
+			},
+			// At least Safari 3+: "[object HTMLElementConstructor]"
+			isSafari : function() {
+				return Object.prototype.toString.call(window.HTMLElement)
+						.indexOf('Constructor') > 0;
+			},
+			// Chrome 1+
+			isChrome : function() {
+				return !!window.chrome && !this.isOpera();
+			},
+			// IE6-11
+			isIE : function() {// At least IE6
+				// 此处防止编辑器把正则误认为注释而出现问题
+				return eval('/*@cc_on!@*/false || !!document.documentMode');
+			}
+		},
+		/*
+		 * 系统和浏览器位数
+		 */
+		Bit : {
+			// 操作系统位数
+			os : function() {
+				var agent = navigator.userAgent;
+				var isX64OS = agent.indexOf("WOW64") != -1
+						|| agent.indexOf("Win64") != -1;
+				return isX64OS ? 64 : 32;
+			},
+			// ie的位数
+			ie : function() {
+				var agent = navigator.userAgent;
+				var o = OFD.Bit.os;
+				var isX64IE = (o == 64) && agent.indexOf("MSIE") != -1
+						&& agent.indexOf("x64") != -1;
+				return isX64IE ? 64 : 32;
+			}
+		},
+		/*
+		 * 页面方法
+		 */
+		Page : {
+			// 获取窗口宽度
+			width : function() {
+				var w = 0;
+				if (window.innerWidth) {
+					w = window.innerWidth;
+				} else if ((document.body) && (document.body.clientWidth)) {
+					w = document.body.clientWidth;
+				}
+				// 通过深入Document内部对body进行检测,获取窗口大小
+				if (document.documentElement
+						&& document.documentElement.clientHeight
+						&& document.documentElement.clientWidth) {
+					w = document.documentElement.clientWidth;
+				}
+				return w;
+			},
+			// 获取窗口高度
+			height : function() {
+				var h = 0;
+				if (window.innerHeight) {
+					h = window.innerHeight;
+				} else if ((document.body) && (document.body.clientHeight)) {
+					h = document.body.clientHeight;
+				}
+				// 通过深入Document内部对body进行检测,获取窗口大小
+				if (document.documentElement
+						&& document.documentElement.clientHeight
+						&& document.documentElement.clientWidth) {
+					h = document.documentElement.clientHeight;
+				}
+				return h;
+			}
+		}
+	};
+
+	var _Private = function(reader, config) {
+		// reader对象本身
+		this.reader = reader;
+		// object的id
+		this.id;
+		// 控件对象
+		this.obj;
+
+		// 配置
+		this.cfg = Tool
+				.extend(
+						// 合并配置
+						{
+							// 容纳控件的div的id
+							div : undefined,
+							// 控件宽度
+							width : "auto",
+							// 控件高度
+							height : "auto",
+							// 组件初始化时的状态
+							compsite : {
+								// 显示的控件
+								show : [],
+								// 隐藏的控件
+								hide : []
+							},
+							// 控件安装程序的下载路径
+							downURL : undefined,
+							//downURL : "http://localhost:8080/cpcns-content-server/installer/SuwellReader_Pro_2.0_setup_windows_i386.exe",
+
+							// 是否检查控件已经安装
+							checkInstalled : false,
+							// 是否在未给定容纳控件的div时自动新建
+							autoNewDiv : false,
+							// codebase
+							codebase : undefined
+						}, config);
+
+		if (_w._HIDDEN) {// 如果没有设置,则使用默认的隐藏
+			var h = this.cfg.compsite.hide;
+			if (h == undefined || h.length == 0) {
+				this.cfg.compsite.hide = _w._HIDDEN;
+			}
+		}
+
+		// 缓存未完成的操作,key为函数名称,value为每次操作的参数的数组
+		this.operates = {
+		// openFile : [ [ "doc1" ], [ "doc2" ] ]
+		};
+		// ready后的回调函数
+		this.callback = [];
+
+		/*
+		 * 缓存操作
+		 */
+		this.cache = function(fnName, fnArgs) {
+			var o = this.operates[fnName];
+			if (Tool.isNull(o)) {
+				o = new Array();
+				this.operates[fnName] = o;
+			}
+			o.push(fnArgs);
+		};
+
+		/*
+		 * 生成随机串
+		 */
+		this.randomText = function(length) {
+			var x = Constant.RANDOM_SEED;
+			var s = "";
+			for ( var i = 0; i < length; i++) {
+				s += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
+			}
+			return s;
+		};
+
+		/*
+		 * 写出HTML信息
+		 */
+		this.message = function(html, level) {
+			var div = Tool._$(this.cfg.div);
+			if (Tool.isValid(div)) {
+				if (Tool.isNull(level)) {
+					level = "error";
+				}
+				if (level == "none") {
+					div.innerHTML = html;
+				} else {
+					div.innerHTML = "<span style='" + CSS[level] + "'>" + html
+							+ "</span>";
+				}
+			} else {
+				alert(html);
+			}
+		};
+
+		/*
+		 * 判断组件是否已经安装
+		 */
+		this.checkComponent = function() {
+			// alert("判断组件是否已经安装");
+			if (Tool.Browser.isIE()) {
+				return this.hasActiveX();
+			} else if (Tool.Browser.isFirefox()) {
+				return this.hasEmbed();
+			} else if (Tool.Browser.isChrome()) {
+				return this.hasEmbed();
+			}
+			return "不支持的浏览器类型";
+		}
+
+		/*
+		 * 判断Firefox是否已经安装了OFD控件
+		 */
+		this.hasEmbed = function() {
+
+			var version = navigator.plugins['Suwell Reader Plugin'];
+			if (typeof (version) == "undefined") {
+
+				var html = "OFD阅读控件没有正确安装,请下载安装!";
+				if (Tool.isValid(this.cfg.downURL)) {
+					html += "<a href='"// 
+							+ this.cfg.downURL //
+							+ "' target='_blank'>&gt;&gt;&gt;&gt;&nbsp;&nbsp;下载&nbsp;&nbsp;&lt;&lt;&lt;&lt;</a>";
+				}
+				// html +=
+				// "<br>由于安装程序会更改IE的安全设置并注册dll文件,安全软件可能会弹出安全警告,允许本软件继续即可。<br>建议使用管理员权限运行本软件。";
+				this.message(html, "warn");
+				return false;
+			} else {
+
+				return true;
+			}
+		}
+
+		/*
+		 * 判断IE是否安装了OFD控件
+		 */
+		this.hasActiveX = function() {
+	
+	if ("ActiveXObject" in window) {// 判断是否IE
+		if (this.cfg.checkInstalled !== true) {
+			
+			return true;
+		}
+		try {// 判断是否安装OFD阅读器
+			var axo = new ActiveXObject(Constant.ACTIVE_NAME);
+			return true;
+
+		} catch (e) {
+
+			
+				try {// 判断是否安装OFD阅读器
+					var axo = new ActiveXObject(Constant.ACTIVE_NAME_OLD);
+					return true;
+				
+				} catch (e) {
+					
+					var html = "OFD阅读控件没有正确安装,请下载安装!";
+					if (Tool.isValid(this.cfg.downURL)) {
+						html += "<a href='"// 
+								+ this.cfg.downURL //
+								+ "' target='_blank'>&gt;&gt;&gt;&gt;&nbsp;&nbsp;下载&nbsp;&nbsp;&lt;&lt;&lt;&lt;</a>";
+					}
+				// html +=
+				// "<br>由于安装程序会更改IE的安全设置并注册dll文件,安全软件可能会弹出安全警告,允许本软件继续即可。<br>建议使用管理员权限运行本软件。";
+				this.message(html, "warn");
+			}
+				
+		}
+	} else {
+		this.message("无法显示ActiveX控件,请使用IE访问", "warn");
+	}
+	return false;
+};
+
+		/*
+		 * 输出控件的HTML
+		 */
+		this.write = function() {
+			var w = this.cfg.width;
+			if (Tool.isNull(w) || w == "auto") {
+				w = "100%";
+			}
+			var h = this.cfg.height;
+			if (Tool.isNull(h) || h == "auto") {
+				h = (Tool.Page.height() - 10) + "px";
+
+			}
+			
+			if (Tool.Browser.isIE()) {
+				this
+						.message(
+								"<object id='"
+										+ this.id // id
+										+ "' width='"
+										+ w// width
+										+ "' height='"
+										+ h// heigth
+										+ "' classid='CLSID:"
+										+ Constant.CLSID // clsid
+										// + "' codebase='" + this.cfg.codebase
+										// //
+										// codebase,不使用cab时注释掉此行
+										+ "'><param name='object_id' value = '"
+										+ this.id
+										+ "'><param name='inited_call' value = '__OFD_OCX_Ready'><param name='object_width' value = '"+ w
+										+ "'><param name='object_height' value = '"+ h + "'> "										
+										+ "</object>", "none");
+			} else if (Tool.Browser.isFirefox()) {
+				this.message("<embed id='" + this.id // id
+						+ "' width='" + w// width
+						+ "' height='" + h// heigth
+						+ "' type='" + Constant.EMBED_TYPE// type
+						+ "' object_id='" + this.id
+						+ "' inited_call='__OFD_OCX_Ready"// callback
+						+ "' >", "none");
+			} else if (Tool.Browser.isChrome()) {
+				this.message("<embed id='" + this.id // id
+						+ "' width='" + w// width
+						+ "' height='" + h// heigth
+						+ "' type='" + Constant.EMBED_TYPE// type
+						+ "' object_id='" + this.id
+						+ "' inited_call='__OFD_OCX_Ready"// callback
+						+ "' >", "none");
+			} else {
+				this.message("不支持的浏览器类型", "error");
+			}
+		};
+
+		/*
+		 * 加载控件
+		 */
+		this.load = function() {
+			var rand = this.randomText(10);
+			if (Tool.isNull(this.cfg.div)) {
+				if (this.cfg.autoNewDiv === true) {
+					// 新建一个div放置控件,并追加到body的最后
+					var div = Tool._new("div");
+					div.id = "ofd_div_" + rand;
+					var body = document.body;
+					if (Tool.isNull(body)) {
+						this.message("请在onload中调用本方法", "warn");
+						return;
+					} else {
+						body.appendChild(div);
+					}
+					this.cfg.div = div.id;
+				} else {
+					this.message("请指定一个div,以便写入控件!");
+					return;
+				}
+			}
+			var check = this.checkComponent();
+			if (check === true) {
+				this.message("正在加载控件,请稍候...", "info");
+				this.id = "ofd_ocx_" + rand;
+				this.write();
+			} else if (check === false) {
+				// alert("控制加载失败");
+				// this.message("控件加载失败", "error");
+			} else {
+				this.message(check);
+			}
+		};
+
+		/*
+		 * 加载配置,完成准备工作,只执行一次
+		 */
+		this.ready = function() {
+			if (this.reader.valid()) {// 已经初始化
+				return;
+			}
+
+			var o = Tool._$(this.id);
+			//if (Tool.isNull(o)) {// 判断是否有对象
+			//	this.message("控件未正确初始化!");
+			//	return;
+			//}
+			// 赋值,很重要
+			this.obj = o;
+			// private
+			var T = this;
+
+			// 控制初始化时的组件显示
+			Tool.each([ "show", "hide" ], function(i, n) {
+				var v = T.cfg.compsite[n];
+				if (Tool.isValid(v) && v.length > 0) {
+					reader.setCompsiteVisible(v, n == "show");
+				}
+			});
+
+			// 加载完毕前的动作都执行一遍
+			Tool.each(this.operates, function(n, v) {
+				if (Tool.isArray(v) && v.length > 0) {
+					var fn = T.reader[n];// 得到reader对象的函数
+					if (fn) {// 如果正确,执行函数
+						Tool.each(v, function(i, args) {
+							try {
+								fn.apply(T.reader, args);
+							} catch (e) {
+							}
+						});
+					} else {
+						_log("Not found function " + n + " from Reader");
+					}
+
+					v.length = 0;// 清除缓存
+				}
+			});
+		};
+	}
+
+	// 缓存所有的Reader对象,id为reader的id,value为private对象实例
+	var _ = {};
+	/*
+	 * 控件封装
+	 */
+	function Reader(config) {
+		// 构建私有
+		var _p = new _Private(this, config);
+		// 加载
+		_p.load();
+		// 控件的id
+		this.id = _p.id;
+		// 缓存
+		_[this.id] = _p;
+		// 当调用控件方法时回调
+		this.onInvoke = function(fnName, fnRet) {
+		};
+	}
+
+	/*
+	 * 检查组件是否准备完毕
+	 */
+	Reader.prototype.valid = function() {
+		return Tool.isValid(_[this.id].obj);
+	};
+
+	/*
+	 * 控件版本号
+	 */
+	Reader.prototype.version = function() {
+		var o = Tool._$(this.id);
+		try {
+			return o.version();
+		} catch (e) {
+		}
+		return false;
+	};
+
+	// 遍历注册所有的方法
+	Tool.each(Tool.isValid(_w._METHOD) ? _w._METHOD : Method, function(name,
+			val) {
+		Reader.prototype[name] = function() {
+			// 方法名
+			var n = val.real;
+			if (Tool.isNull(n)) {
+				n = name;
+			}
+
+			// 参数
+			var l = val.args.length, al = arguments.length;
+			if (l > al) {
+				l = al;
+			}
+			var arg = [];
+			for ( var i = 0; i < l; i++) {
+				arg[i] = arguments[i];
+			}
+
+			var _p = _[this.id];
+			var T = this;
+			// 返回值
+			var result;
+			if (this.valid()) {
+				var o = _p.obj;
+				if (Tool.isArray(arg[0])) {// 第一个参数是数组,拆开执行
+					var A = arg.slice();// clone
+					Tool.each(arg[0], function(i, v) {
+						A[0] = v;
+						result = doEval(T, o, n, A, val.ret);
+					});
+				} else {// 执行并返回值
+					result = doEval(T, o, n, arg, val.ret);
+				}
+			} else {// 缓存操作
+				_p.cache(name, arg);
+			}
+			var ret = val.ret;
+			if (Tool.isNull(ret)) {
+				return result;
+			} else if (Tool.isFunction(ret)) {
+				return ret.call(this, result);
+			} else {
+				return ret;
+			}
+		}
+	});
+
+	// 执行方法,并回调
+	var doEval = function(reader, o, n, args) {
+			
+		if(false && n==='addFreeText'){
+			var json=JSON.parse(args);;
+			var page={};
+			var user10='{"text":"","page-index":"1","pos-x":"40.65","pos-y":"59.06","width":"130.19","height":"133.39","font-family": "simsun","font-size":"36","font-style":"italic","font-weight":"bold", "font-color":"#ff0000"}';
+			 var user1='{"page-index":"1","pos-x":"54.83","pos-y":"225.87","width":"141.83","height":"100.66","text":""}',
+			 user2='{"page-index":"1","pos-x":"55.04","pos-y":"192.21","width":"141.83","height":"33.66","text":"请在此处添加意见"}',
+			user3='{"page-index":"1","pos-x":"55.04","pos-y":"158.13","width":"141.62","height":"33.66","text":"请在此处添加意见"}',
+			 user4='{"page-index":"1","pos-x":"55.04","pos-y":"124.47","width":"141.62","height":"33.66","text":"请在此处添加意见"}',
+			 user5='{"page-index":"1","pos-x":"55.04","pos-y":"90.60","width":"141.62","height":"34.08","text":"请在此处添加意见"}',
+			 user6='{"page-index":"1","pos-x":"54.83","pos-y":"79.17","width":"47.21","height":"11.43","text":"请在此处添加意见"}';
+			var jsonobjects=[];
+			if(json.userid=='1'){
+				jsonobjects[0]=user10;
+			}else if(json.userid=='2'){
+				jsonobjects[0]=user2;
+			}
+			else if(json.userid=='3'){
+				jsonobjects[0]=user3;
+			}
+			else if(json.userid=='4'){
+				jsonobjects[0]=user4;
+			}
+			else if(json.userid=='5'){
+				jsonobjects[0]=user5;
+			}
+			else if(json.userid=='6'){
+				jsonobjects[0]=user6;
+			}
+			var nret={};
+			
+			nret.id = _eval(o, n, jsonobjects);
+			nret.index="1";
+			nret.x="54.83";
+			nret.y="225.87"
+			var ret=nret;
+			
+			
+		}else{
+			var ret = _eval(o, n, args);
+		}
+		
+		if (reader.onInvoke) {
+			try {
+				// if (ret == undefined) {
+				// reader.onInvoke.call(reader, n);
+				// } else {
+				reader.onInvoke.call(reader, n, ret);
+				// }
+			} catch (e) {
+				_log("onInvoke " + n + " : " + e);
+			}
+		}
+		return ret;
+	}
+
+	// 执行控件的方法
+	var _eval = function(o, m, args) {
+		var arg = "";
+		Tool.each(args, function(i, v) {
+			if (i > 0) {
+				arg += ", ";
+			}
+			if (typeof (v) === "string") {
+				arg += "\"" + Tool.escape(v) + "\"";
+			} else {
+				arg += v;
+			}
+		});
+		try {
+			return eval("o." + m + "(" + arg + ")");
+		} catch (e) {
+			_log("Eval " + m + " : " + e);
+		}
+	};
+
+	// 记录日志
+	var _log = function(msg) {
+		window.console && console.log(msg);
+	}
+
+	// 缓存所有的定时结果
+	var cache = {};
+
+	return {// 防止外界的非法访问
+		OCX : {
+			// 初始化一个控件
+			init : function(a) {				
+				var config = {};
+				if (Tool.isPlainObject(a)) {
+					config = Tool.extend(config, a);
+				} else {
+					var name = [ "div", "width", "height", "downURL" ];
+					for ( var i = 0; i < arguments.length; i++) {
+						if (i > name.length - 1) {
+							break;
+						}
+						var n = name[i], v = arguments[i];
+						if (Tool.isValid(v)) {
+							config[n] = arguments[i];
+						}
+					}
+				}
+
+				// 新对象
+				var r = new Reader(config);
+				// 尝试用版本号来确定是否已经加载
+				var T = this;
+				cache[r.id] = setInterval(function() {
+					if (r.version() !== false) {
+						T.ready(r.id);
+					}
+				}, 500);// 缓存起来
+				return r;
+			},
+			// 控件已准备好
+			ready : function(id) {
+				var _p = _[id];
+				if (Tool.isValid(_p)) {
+					_p.ready();
+					clearInterval(cache[id]);
+
+					_log("Reader is ready, version is " + _p.reader.version());
+				}
+				return _p;
+			}
+		}
+	}
+})(this);// 立即执行函数,使其成为单例
+
+var suwell = {};
+// 加载并初始化阅读器OCX控件
+var width;
+var height;
+suwell.ofdReaderInit = function(divID, width, height) {
+	this.width=width;
+	this.height=height;
+	
+	return OFD.OCX.init(divID, width, height);
+};
+
+
+var ofdreader={};
+ofdreader.init=function(divID, width, height) {
+	this.width=width;
+	this.height=height;
+	
+	return OFD.OCX.init(divID, width, height);
+};

+ 1 - 1
zjugis-workflow/src/main/resources/templates/IFlowMaterials/grid.ftl

@@ -1,5 +1,5 @@
 <@h.html javascripts=["/js/zFileUploadBase.js"]+
-["${fileManagerUrl}/FileInfo/js/filePreview.js"]+
+["/js/filePreview.js"]+
 ["/IFlowMaterials/js/grid.js"]
 styles=["/css/workFlow.css"]>
     <style>

+ 1 - 1
zjugis-workflow/src/main/resources/templates/IFlowMaterials/gridMobile.ftl

@@ -1,5 +1,5 @@
 <@h.html javascripts=["/js/zFileUploadBase.js"]+
-["${fileManagerUrl}/FileInfo/js/filePreview.js"]+
+["/js/filePreview.js"]+
 ["/IFlowMaterials/js/grid.js"]
 styles=["/css/workFlow.css"]>
 

+ 1 - 1
zjugis-workflow/src/main/resources/templates/IFlowMaterialsFile/filePreview.ftl

@@ -13,5 +13,5 @@
 <script>
     window.fileUrl = "${fileUrl}";
 </script>
-<script type="text/javascript" src="${z_workflow}/IFlowMaterialsFile/js/filePreview.js"></script>
+<script type="text/javascript" src="/js/filePreview.js"></script>
 

+ 1 - 1
zjugis-workflow/src/main/resources/templates/IFlowMaterialsFile/materialPreview.ftl

@@ -1,6 +1,6 @@
 <@mp.masterPage title='附件材料预览' styles=['/IFlowMaterialsFile/css/materialPreview.css']
 javascripts=['/IFlowMaterialsFile/js/materialPreview.js','/js/zFileUploadBase.js',
-'${fileManageUrl!}/FileInfo/js/filePreview.js']>
+'/js/filePreview.js']>
     <div class="preview-body">
         <div class="preview-title">
             <div class="title" file-id="${fileInfoId!}" file-url="${fileUrl!}">${fileName!}</div>

+ 2 - 2
zjugis-workflow/src/main/resources/templates/public/workFlow1.ftl

@@ -35,7 +35,7 @@
             '${WORKFLOW.URL!}/js/flow.js',
             '${WORKFLOW.URL!}/js/headBtn.js',
             '${WORKFLOW.URL!}/js/zFileUploadBase.js',
-            '${WORKFLOW.FILEURL!}/FileInfo/js/filePreview.js',
+            '${WORKFLOW.URL!}/js/filePreview.js',
             '${WORKFLOW.URL!}/IFlowMaterials/levelgrid/levelgrid.js',
             '${WORKFLOW.URL!}/IFlowOpinion/tempOpinion/flowOpinionTemp.js',
             '${WORKFLOW.URL!}/js/messager.js' ]+javascripts
@@ -61,7 +61,7 @@
             '${WORKFLOW.URL!}/js/flow.js',
             '${WORKFLOW.URL!}/js/headBtn.js',
             '${WORKFLOW.URL!}/js/zFileUploadBase.js',
-            '${WORKFLOW.FILEURL!}/FileInfo/js/filePreview.js',
+            '${WORKFLOW.URL!}/js/filePreview.js',
             '${WORKFLOW.URL!}/IFlowMaterials/levelgrid/levelgrid.js',
             '${WORKFLOW.URL!}/IFlowOpinion/tempOpinion/flowOpinionTemp.js',
             '${WORKFLOW.URL!}/js/messager.js' ]+javascripts