多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<meta name="viewport" charset="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>文件浏览</title>
<!--[if !IE]><!-->
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
<!--<![endif]-->
<!--[if gt IE 8]>
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
<![endif]-->
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
<link rel="stylesheet" href="static/plugins/jquery.iviewer/jquery.iviewer.css" type="text/css" />
 
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
 
<!-- 图片浏览插件引入 --> 
<script type="text/javascript" src="static/plugins/jquery.js" ></script>
<script type="text/javascript" src="static/plugins/jqueryui.js" ></script>
<script type="text/javascript" src="static/plugins/jquery.mousewheel.min.js" ></script>
<script type="text/javascript" src="static/plugins/jquery.iviewer/jquery.iviewer.min.js"></script>
 
  
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
 
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
 
<!--[if lt IE 9]>
<script type="text/javascript" src="static/plugins/json2.js"></script>
<![endif]-->
<style  type="text/css">
    .viewer
     {
         width: 100%;
         border: 1px solid black;
         position: relative;
     }
</style>
</head>
<body class="pt-tree">
      <div class="margin-lr">        
        <div class="pt-form">
            <form id="form1">
                <!-- 普通图片浏览(iViewer插件) -->
                <div id="div_Img" style="display:none">
                    <div class="wrapper">
                        <div id="viewer" class="viewer">
                        </div>
                    </div> 
                </div> 
                <!-- tiff图片浏览 -->
                <div id="div_Tif" style="display:none;width: 100%; height: 100%;text-align: center;"> 
                </div>
                <!-- pdf浏览(iWebPdf插件) -->
                <div id="div_PDF" style="margin-top: -25px;display:none;height: 103%;"> 
                    <object id="iWebPDF" width="100%" height="100%" classid="clsid:39E08D82-C8AC-4934-BE07-F6E816FD47A1"
                        codebase="iWebPDF.ocx#version=8,0,0,592" viewastext>
                        <span style="color: red" align="center">你未安装pdf阅读器,请下载并安装AdbeReader软件。</span>
                    </object> 
                </div>
                <!-- office文件浏览(officeviewer插件) -->
                <div id="div_Office" style="display:none;height: 100%;overflow-y: hidden;">
                   <div> 
                       <!-- <input type="button" value="选择头部红头文件" class="btn4" onclick="SelectHead()" id="btn_officetbht" />
                       <input type="button" value="选择尾部红头文件" class="btn4" onclick="SelectLast()" id="btn_officewbht" />  
                       <input type="button" value="保存在服务器" class="btn4" onclick="SavetoServer()" id="btn_SavetoServer" />
                       -->
                       <input id="btnSaveFile" type="button" value="保存服务器" class="btn4" style="display:none" onclick="SavetoServer()"/>
                       <span id="masklayer" style=" display:none;font-size:14px; color:red; font-weight:bold;"></span>
                       <div style="display: none">
                           <input id="txt_hongtou2" type="text" value="" />
                       </div>
                    </div>
                   
                        <div style="width:100%; height:100%;">
                                <object classid="clsid:7677E74E-5831-4C9E-A2DD-9B1EF9DF2DB4" id="OA1" width="100%" height="98%" codebase="static/plugins/officeviewer.cab#version=8,0,0,651">
                                    <param name="Toolbars" value="-1">
                                    <param name="LicenseName" value="HZRAETC6706823702">
                                    <param name="LicenseCode" value="EDO8-552B-126C-ABEB">
                                    <param name="BorderColor" value="15647136">
                                    <param name="BorderStyle" value="2">
                                </object>
                                <script language="JavaScript" type="text/javascript" src="static/plugins/NoIEActivate.js"></script>
                        </div> 
                    
                </div>
            </form>
        </div>
        
    </div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
 
 
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack : null
    };
 
    $(function() {
        var extension='${attach.extension}';
        var attachViewUrl="${attach.attachViewUrl}";
        switch(extension.toLowerCase())
        {
            case '.jpg':
            case '.png': 
            case '.bmp':
            case '.bmp':
            case '.jpeg':
            case '.gif':
                $('#div_Img').show();
                $(".viewer").css("height", $(document).height() - 55); 
                var iv1 = $("#viewer").iviewer({src:attachViewUrl});
                break;
            case '.tiff':
                $('#div_Tif').show();
                var server = "/fcgi-bin/iipsrv.fcgi"; 
                var credit = "杭州瑞利声电技术公司";
                var flashvars = {
                    server: server,
                    image: attachViewUrl,
                    navigation: true,
                    credit: credit
                }
                var params = {
                    scale: "noscale",
                    bgcolor: "#000000",
                    allowfullscreen: "true",
                    allowscriptaccess: "always"
                }
                swfobject.embedSWF("IIPZoom.swf", "container", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params);
                break;
            case '.pdf':
                $('#div_PDF').show();  
                form1.iWebPDF.WebOpenUrlFile("http://"+window.location.host+attachViewUrl);
                break;
            case '.doc':
            case '.docm':
            case '.docx':
            case '.xls':
            case '.xlsx':            
            case '.ppt':
            case '.pptx': 
                $('#div_Office').show();   
                if('${isEdit}'=='1')
                {
                    $('#btnSaveFile').show(); 
                } 
                 OpenFromServer("http://"+window.location.host+attachViewUrl);
                break;
            default:
                wcp.message.error("不支持此格式文件浏览!");
                closeWindow();
                break;
        } 
    });
    function closeWindow() { 
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
</script>
 
<!-- PDF插件初始化及各种方法--> 
<script>
    try{
         var UserPrintRight = "1";               //用户打印权限。
         var DownLoad = "1";
         form1.iWebPDF.ShowMenus = 0; //菜单栏是否显示 1:显示   0:隐藏
         form1.iWebPDF.ShowTools = 1; //工具栏是否显示
         form1.iWebPDF.ShowSigns = 0; //签章栏是否显示
         form1.iWebPDF.ShowSides = 0; //侧边栏是否显示
         form1.iWebPDF.ShowMarks = 1; //书签树是否显示
         form1.iWebPDF.ShowState = 1; //状态栏是否显示  
         form1.iWebPDF.ShowPostil=0;//批注栏是否显示
    
         //禁止显示页面的页码数。
         //禁用所有按钮
         //form1.iWebPDF.EnableTools("实际大小;搜索文本", 2);
         //form1.iWebPDF.EnableTools("全屏显示", 0);
    
    
         //依据打印权限来控制打印按钮
         if (UserPrintRight == "1") {
             //有权限
             form1.iWebPDF.EnableTools("打印文档", 1);
         }
         else {
             form1.iWebPDF.EnableTools("打印文档", 2)
         }
         if (DownLoad == "1") {
             form1.iWebPDF.EnableTools("另存为", 1);
         }
         else {
             form1.iWebPDF.EnableTools("另存为", 0);
         }
         form1.iWebPDF.EnableTools("保存文档", 0);
         form1.iWebPDF.EnableTools("文档属性", 0);
         form1.iWebPDF.EnableTools("关闭文档", 0);
    
         form1.iWebPDF.EnableTools("搜索文本", 0);
         form1.iWebPDF.EnableTools("文本选择", 0);
         form1.iWebPDF.EnableTools("快照工具", 0);
         form1.iWebPDF.EnableTools("关于金格", 0);
         WateMark();
         EnablePages();  
    }catch(e){}
      
     function ChangeTrueUrl(url) {
           var pathfilepathindex = url.lastIndexOf('/');
           var pathfilepath = url.substr(0, pathfilepathindex + 1);
           var pathfilename = url.substr(pathfilepathindex + 1);
           var pathfilenameq = pathfilename.substr(0, 2);
           var pathfilenameh = pathfilename.substr(3);
           return pathfilepath + pathfilenameq + pathfilenameh;
      }
     //保存到服务器
     function SavePDF() {
         form1.iWebPDF.WebSave();
     }
     //设置水印 参数1,起始页 2,终止页 3,水印文本 4,透明度 5,字体大小 0表示自适应 6,旋转角度 7,水印位置(文本上/下) true/false 8,水印左下角X坐标,-1时则为居中位置 9,水印左下角Y坐标,-1时则为居中位置
     //特别说明:在X或Y不为-1时,FontSize必须为大于零的值,否则会导致水印不可见
     function WateMark() {
          var WateMarkText = "水印";
           var WateMarkStartPage = 1; 
           var WateMarkEndPage = form1.iWebPDF.PageCount;
           var Xloaction = "100";
         var Ylocation = "100";
         var Transparency=10;//透明度
         var fontSize=20;//字体大小
         var Angel=45;//旋转角度
         form1.iWebPDF.WateMark(WateMarkStartPage, WateMarkEndPage, WateMarkText,Transparency , fontSize, Angel, false, Xloaction, Ylocation);
     }
 
     //禁止显示部分页面 参数1:string页面范围,2:bool显示与否,3:String 禁止显示的文本
     function EnablePages() {
         var NoPageNum = "";
         form1.iWebPDF.EnablePages(NoPageNum, false, "此页为涉密件!");
     }
 
     //页面
     function PageChanged(action) {
         switch (action) {
             case "Next":
                 if (form1.iWebPDF.CurPage + 1 <= form1.iWebPDF.PageCount) {
                     form1.iWebPDF.GotoNextPage();
                 }
                 break;
             case "Prve":
                 if (form1.iWebPDF.CurPage - 1 >= 1) {
                     form1.iWebPDF.GotoPreviousPage();
                 }
                 break;
             case "First":
                 if (form1.iWebPDF.CurPage != 1) {
                     form1.iWebPDF.GotoFirstPage();
                 }
                 break;
             case "End":
                 if (form1.iWebPDF.CurPage != form1.iWebPDF.PageCount) {
                     form1.iWebPDF.GotoLastPage();
                 }
                 break;
         }
 
     }
     //                //打印 参数1:打印份数 2.打印机名称 3.打印起始页 4,打印结束页 5,是否显示打印窗口
     //                function PrintPDF() {
     //                    if (WebPrint(1, PrinterName, 0, 0, false)) {
     //                        alert("打印成功!");
     //                    }
     //                    else{
     //                        alert("打印失败!");
     //                    }
     //                } 
</script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
//<!--
 
   function OpenFromServer(sPath) { 
       CloseDoc();
       //var sPath= window.prompt("Type the file url:", "http://www.ocxt.com/demo/samples/sample.doc");
 
       // var sPath = "http://localhost:8161/ViewFile/2015/201507/20150721/rl19303137_淳安公积金网站修改内容.docx";
 
       // var sPath = "http://localhost:8161/ViewFile/2015/201507/20150721/rl19303137_淳安公积金网站修改内容.docx";
       // document.all.OA1.Open(sPath, "PowerPoint.Application");
 
       //document.all.OA1.LoadFile(sPath);
       //  document.all.OA1.Open(sPath, "Word.Application");
       //document.all.OA1.Open(sPath, "Excel.Application");
       document.all.OA1.Open(sPath);
       //                    if (document.all.OA1.GetCurrentProgID() == "Word.Application") {
       //                        document.all.OA1.Open(sPath, "Word.Application");
       //                    }
       //                    if (document.all.OA1.GetCurrentProgID() == "Excel.Application") {
       //                        document.all.OA1.Open(sPath, "Excel.Application");
       //                    }
       //                    if (document.all.OA1.GetCurrentProgID() == "PowerPoint.Application") {
       //                        document.all.OA1.Open(sPath, "PowerPoint.Application");
       //                    }
 
 
 
       //document.all.OA1.Open(sPath, "Word.Application");
       //document.all.OA1.Open(sPath, "Excel.Application");
       //document.all.OA1.Open(sPath, "PowerPoint.Application");
       //document.all.OA1.Open(sPath, "Visio.Application");
       //document.all.OA1.Open(sPath, "MSProject.Application");
   }
 
   function PrintDoc() {
       if (document.all.OA1.IsOpened()) {
           document.all.OA1.PrintDialog();
       }
   }
 
   function PrintPreview() {
       if (document.all.OA1.IsOpened()) {
           document.all.OA1.PrintPreview();
       }
   }
 
   function ProtectDoc() {
 
       if (document.all.OA1.GetCurrentProgID() != "PowerPoint.Application") {
           if (document.all.OA1.IsOpened()) {
               if (document.all.OA1.GetCurrentProgID() == "Word.Application") {
                   document.all.OA1.ProtectDoc(2); //wdAllowOnlyFormFields
 
 
               }
               else if (document.all.OA1.GetCurrentProgID() == "Excel.Application") {
                   document.all.OA1.ProtectDoc(1);
               }
           }
       }
       else {
           window.alert("The method doesn't work for the MS PowerPoint!");
       }
   }
 
   function UnProtectDoc() {
       if (document.all.OA1.GetCurrentProgID() != "PowerPoint.Application") {
           if (document.all.OA1.IsOpened()) {
               document.all.OA1.UnProtectDoc();
           }
       }
       else {
           window.alert("The method doesn't work for the MS PowerPoint!");
       }
   }
 
     function DocIsDirty() {
         if (document.all.OA1.IsOpened()) {
             if (document.OA1.IsDirty) {
                 window.alert("The file has been modified!");
             }
             else {
                 window.alert("The file hasn't been modified!");
             }
         }
     }
 
     function ShowHideToolbar() {
         if (document.all.OA1.IsOpened()) {
             var x = document.OA1.Toolbars;
             document.OA1.ShowMenubar(!x);
             document.OA1.Toolbars = !x;
         }
     }
 
     function DisableHotKey() {
         if (document.all.OA1.GetCurrentProgID() == "Word.Application") {
             if (document.all.OA1.IsOpened()) {
                 document.all.OA1.WordDisableSaveHotKey(true);
                 document.all.OA1.WordDisablePrintHotKey(true);
                 document.all.OA1.WordDisableCopyHotKey(true);
             }
         }
         else if (document.all.OA1.GetCurrentProgID() == "Excel.Application") {
             document.all.OA1.WordDisableSaveHotKey(true);
             document.all.OA1.WordDisablePrintHotKey(true);
             document.all.OA1.WordDisableCopyHotKey(true);
         }
         else {
         }
     }
 
     function DisableRightClick() {
         if (document.all.OA1.IsOpened()) {
             document.all.OA1.DisableViewRightClickMenu(true);
         }
     }
 
     function SaveAs() {
         if (document.all.OA1.IsOpened()) {
             document.all.OA1.SaveFileDialog();
             //You can call the SaveAs method to save silently.
         }
     }
 
     function SavetoServer() {
         if (document.OA1.IsOpened) {
             document.OA1.SetAppFocus();
             document.OA1.HttpInit();
             //var sFileName = document.OA1.GetDocumentName();
             //  alert(sFileName);
             sFileName = "${attach.attachViewUrl}";//??
             // alert(sFileName);
             document.OA1.HttpAddPostOpenedFile(sFileName); //save as the same file format with the sFileName then upload
             //document.OA1.HttpAddPostOpenedFile (sFileName, 16); //save as docx file then upload
             //document.OA1.HttpAddPostOpenedFile (sFileName, 0); //save as doc file then upload
             //document.OA1.HttpAddPostOpenedFile (sFileName, -4143); //save as xls file then upload
             //document.OA1.HttpAddPostOpenedFile (sFileName, 51); //save as xlxs file then upload
             //document.OA1.HttpPost("http://www.ocxt.com/demo/upload_weboffice.php");
             var url="http://"+window.location.host+"/wcp/management/attach/saveServer";
             //alert(url);
             document.OA1.HttpPost(url);
             //if (document.OA1.GetErrorCode() == 0 || document.OA1.GetErrorCode() == 200) {
             if (document.OA1.GetErrorCode() == 200) {
                 var sPath = "保存成功! ";
                 window.alert(sPath);
             }
             else {
                 window.alert("you need enable the IIS Windows Anonymous Authentication if you have not set the username and password in the HttpPost method. you need set the timeout and largefile size in the web.config file.");
             }
         }
         else {
             window.alert("Please open a document firstly!");
         }
     }
 
     function CloseDoc() {
      document.all.OA1.ExitOfficeApp();
             document.all.OA1.ClearTempFiles();
         if (document.OA1.IsOpened) { 
             document.all.OA1.ExitOfficeApp();
             document.all.OA1.ClearTempFiles();
         }
     }
 
     function VBAProgramming() {
        // alert(0);
         if (document.OA1.IsOpened) {
            // alert(1);
             var objWord = document.OA1.ActiveDocument;
            // alert(1.5);
            // document.OA1.GotoItem(101, 0); //move to start.
            // alert(2);
            // document.OA1.InsertBreak(6); //insert a line break
             alert(3);
             var range = objWord.Range(0, 0);
             var WTable = objWord.Tables.Add(range, 3, 3);
             alert(4);
             WTable.Cell(1, 1).Range.Font.Name = "Times New Roman";
             WTable.Cell(1, 1).Range.Text = "Automation 1";
             WTable.Cell(1, 2).Range.Font.Size = 18;
             WTable.Cell(1, 2).Range.Bold = true;
             WTable.Cell(1, 2).Range.Font.Italic = true;
             WTable.Cell(1, 2).Range.Text = "Automation 2";
             WTable.Cell(2, 1).Range.ParagraphFormat.Alignment = 1; // 0= Left, 1=Center, 2=Right   
             WTable.Cell(2, 1).Range.Font.Name = "Arial";
             WTable.Cell(2, 1).Range.Font.Size = 12;
             WTable.Cell(2, 1).Range.Bold = false;
             WTable.Cell(2, 1).Range.ParagraphFormat.Alignment = 2;
             WTable.Cell(3, 3).Range.Font.Name = "Times New Roman";
             WTable.Cell(3, 3).Range.Font.Size = 14;
             WTable.Cell(3, 3).Range.Bold = true;
             WTable.Cell(3, 3).Range.Font.Underline = true;
             WTable.Cell(3, 3).Range.ParagraphFormat.Alignment = 0;
             WTable.Cell(3, 2).Range.Text = "Automation 3";
         }
     } 
       function GetAllRedFile() {
 
           if (isGetRedFileList == false) {
               //var urljson = [{ "webpath": "http://localhost:8115/Upload/Hongtou/201408187800.doc" }, { "webpath": "http://localhost:8115/Upload/Hongtou/201408184052.doc" }, { "webpath": "http://localhost:8115/Upload/Hongtou/201408187050.doc"}];
             
                var urljson = eval(RedFileList);
               for (var i = 0; i < urljson.length; i++) {
                   var path = document.all.OA1.HttpDownloadFileToTempDir(urljson[i].webpath);
                   RedHeadTempPath.push({ "weburl": urljson[i].webpath, "baseurl": path });
               }
               isGetRedFileList = true;
           } 
       }
      function InsertRedFile(webpath,position) {
         // var webpath = "http://localhost:8115/Upload/Hongtou/201408187050.doc";
          var basepath = "";
          $.each(RedHeadTempPath, function (i, elem) {
              if (RedHeadTempPath[i].weburl == webpath) {
                  basepath = RedHeadTempPath[i].baseurl;
              }
          });
          if (basepath != "") {
    
              var ttt = document.all.OA1.WordInsertFile(basepath, position);
              if (ttt == false) {
    
                  alert(basepath+"  可以再试试插入一次");
              }
          } else {
              alert("没有获取到相符合的文件,检查红头文件是否存在!");
          }
      }
    
    
    
      function OA1_NotifyCtrlReady() {
          //document.OA1.ShowRibbonTitlebar (false);
          //document.OA1.ShowMenubar (false);
          //document.OA1.Toolbars = false;
    
          //If you want to open a document when the page loads, you should put the code here.
          //document.all.OA1.Open("http://www.ocxt.com/demo/samples/sample.doc");
          document.OA1.LicenseName = "HZRAETC6706823702";
          document.OA1.LicenseCode = "EDO8-552B-126C-ABEB";
      }
    
      function OA1_BeforeDocumentOpened() {
          document.OA1.DisableFileCommand(1, true); //wdUIDisalbeOfficeButton
          document.OA1.DisableFileCommand(2, true); //wdUIDisalbeNew
          document.OA1.DisableFileCommand(4, true); //wdUIDisalbeOpen
    
          //                    var viewSign = "";//??
          //                    if (document.all.OA1.GetCurrentProgID() == "Word.Application" && viewSign == "0") {
          //                        
          //                        document.OA1.DisableFileCommand(16, false); 
          //                    } else {
          //                        document.OA1.DisableFileCommand(16, true); //wdUIDisalbeSave
          //                    }
    
          document.OA1.DisableFileCommand(16, true); //wdUIDisalbeSave
          document.OA1.DisableFileCommand(32, true); //wdUIDisalbeSaveAs
          document.OA1.DisableFileCommand(512, true); //wdUIDisalbePrint (Ctrl+P) PES,PCT,CON
          document.OA1.DisableFileCommand(1024, true); //wdUIDisalbePrintQuick
          document.OA1.DisableFileCommand(2048, true); //wdUIDisalbePrintPreview
      }
    
      function OA1_DocumentOpened() {
          //You can do the office automation here
          //var objWord = document.OA1.ActiveDocument;
          //objWord.Content.Text = "You can do the office Automation with the Edraw Viewer Component.";
    
    
    
      }
    
      function OA_DocumentBeforePrint() {
          //window.alert("OA_DocumentBeforePrint");
      }
    
      function OA_WindowBeforeRightClick() {
          //window.alert("OA_WindowBeforeRightClick");
      }
 
        function OA_BeforeDocumentSaved() {
            //window.alert("OA_BeforeDocumentSaved");
            //document.OA1.DisableStandardCommand(1, true);//cmdTypeSave  = 0x00000001, the line code will prevent the save
 
            //                    if (document.all.OA1.GetCurrentProgID() == "Word.Application") {
            //                        var r = confirm("是否保存到服务器?")
            //                        if (r == true) {
            //                           
            //                        }
            //                        else {
            //                            document.OA1.DisableStandardCommand(1, true);
            //                        }
            //                    }
        }
 
</script>
 
<script   language="javascript">
    window.onbeforeunload = function () {
        document.all.OA1.ExitOfficeApp();
    }    
</script>
 
<SCRIPT LANGUAGE=javascript FOR=OA1 EVENT=NotifyCtrlReady>
<!--
 OA1_NotifyCtrlReady();
//-->
</SCRIPT>
 
<script language="javascript" for="OA1" event="DocumentOpened()"> 
  OA1_DocumentOpened();
</script>
 
<script language="javascript" for="OA1" event="BeforeDocumentOpened()"> 
  OA1_BeforeDocumentOpened();
</script>
 
<script language="javascript" for="OA1" event="DocumentBeforePrint()"> 
  OA_DocumentBeforePrint();
</script>
 
<script language="javascript" for="OA1" event="BeforeDocumentSaved()"> 
  OA_BeforeDocumentSaved();
</script>
 
<script language="javascript" for="OA1" event="WindowBeforeRightClick()"> 
  OA_WindowBeforeRightClick();
</script>
 
</html>