多单位版国产化地质资料管理系统
zhai
2025-12-13 fc0cc9fff4b4cbdc7cbb52b4a96c947530fcbba0
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
/*------------------------------------------------------*/
/*                   修改控件的配置信息                                                                    */
/*                   version:1.7.3                      */
/*                   number:002                         */
/*------------------------------------------------------*/
//64位控件的calssid
var classidx64 = "A64E3073-2016-4baf-A89D-FFE1FAA10EE0";
//32位控件的classid
var classid = "A64E3073-2016-4baf-A89D-FFE1FAA10EC0";
//32位控件包的路径
var codebase = "officecontrol/OfficeControl.cab#version=6.0.1.0";
//64位控件包的路径
var codebase64 = "officecontrol/OfficeControlx64.cab#version=6,0,1,0";
//设置高度
var height = "100%";
//设置宽度
var width = "100%";
//买断授权密钥如果不是买断可以不用写
var MakerCaption = "";
//买断授权密钥如果不是买断可以不用写
var MakerKey = "";
//密钥
var ProductCaption = "中国核能电力股份有限公司";
//密钥
var ProductKey = "EF38BB6FB9DB37E213541BB2FE37C28BEB892CBD";
//解除时间密钥
var NoExpireKey = "";
document.write('<param name="Caption" value="中国核能电力股份有限公司〔专用〕">   ');
 
 
/*------------------------------------------------------*/
/*             以下内容 请勿修改,否则可能出错                                                              */
/*------------------------------------------------------*/
 
var userAgent = navigator.userAgent,
    rMsie = /(msie\s|trident.*rv:)([\w.]+)/,
    rFirefox = /(firefox)\/([\w.]+)/,
    rOpera = /(opera).+version\/([\w.]+)/,
    rChrome = /(chrome)\/([\w.]+)/,
    rSafari = /version\/([\w.]+).*(safari)/;
var browser;
var version;
var ua = userAgent.toLowerCase();
 
function uaMatch(ua) {
    var match = rMsie.exec(ua);
    if (match != null) {
        return {browser: "IE", version: match[2] || "0"};
    }
    var match = rFirefox.exec(ua);
    if (match != null) {
        return {browser: match[1] || "", version: match[2] || "0"};
    }
    var match = rOpera.exec(ua);
    if (match != null) {
        return {browser: match[1] || "", version: match[2] || "0"};
    }
    var match = rChrome.exec(ua);
    if (match != null) {
        return {browser: match[1] || "", version: match[2] || "0"};
    }
    var match = rSafari.exec(ua);
    if (match != null) {
        return {browser: match[2] || "", version: match[1] || "0"};
    }
    if (match != null) {
        return {browser: "", version: "0"};
    }
}
 
var browserMatch = uaMatch(userAgent.toLowerCase());
if (browserMatch.browser) {
    browser = browserMatch.browser;
    version = browserMatch.version;
}
 
/*
谷歌浏览器事件接管
*/
 
/*function ntkosavetourl(type,code,html)
{
    alert("SaveToURL成功回调");
}*/
 
function ntkopublishashtml(type, code, html) {
    //alert("Onpublishashtmltourl成功回调");
}
 
function ntkopublishaspdf(type, code, html) {
//alert("Onpublishaspdftourl成功回调");
}
 
function ntkosaveasotherurl(type, code, html) {
//alert("SaveAsOtherformattourl成功回调");
}
 
function OnDocumentOpened(TANGER_OCX_str, TANGER_OCX_obj) {
    console.log("文档类型", OFFICE_CONTROL_OBJ.doctype);
    if (OFFICE_CONTROL_OBJ.doctype >= 1 && OFFICE_CONTROL_OBJ.doctype <= 3) {
        OFFICE_CONTROL_OBJ.activeDocument.saved = true;//saved属性用来判断文档是否被修改过,文档打开的时候设置成true,当文档被修改,自动被设置为false,该属性由office提供.
        //setMenubar();
        initCustomMenus();
        //获取文档控件中打开的文档的文档类型
        switch (OFFICE_CONTROL_OBJ.doctype) {
            case 1:
                fileType = "Word.Document";
                fileTypeSimple = "word";
                break;
            case 2:
                fileType = "Excel.Sheet";
                fileTypeSimple = "excel";
                break;
            case 3:
                fileType = "PowerPoint.Show";
                fileTypeSimple = "powerpoint";
                break;
            case 4:
                fileType = "Visio.Drawing";
                break;
            case 5:
                fileType = "MSProject.Project";
                break;
            case 6:
                fileType = "WPS Doc";
                fileTypeSimple = "wps";
                break;
            case 7:
                fileType = "Kingsoft Sheet";
                fileTypeSimple = "et";
                break;
            default :
                fileType = "unkownfiletype";
                fileTypeSimple = "unkownfiletype";
        }
        setFileOpenedOrClosed(true);
    }
}
 
//设置显隐
function display(id) {
    var traget = document.getElementById(id);
    if (traget.style.display == "none") {
        traget.style.display = "";
    } else {
        traget.style.display = "none";
    }
}
 
function OnDocumentClosed() {
    setFileOpenedOrClosed(false);
}
 
function OnFileCommand(TANGER_OCX_str, TANGER_OCX_obj) {
    OFFICE_CONTROL_OBJ.WebFileName = unescape(fileName);
    if (TANGER_OCX_str == 3) {
        saveFileToUrl();
        OFFICE_CONTROL_OBJ.CancelLastCommand = true;
    } else if (TANGER_OCX_str == 4) {
        /*                                 console.dir(OFFICE_CONTROL_OBJ.ActiveDocument.Application);
                var dg = OFFICE_CONTROL_OBJ.ActiveDocument.Application.FileDialog(3);
                dg.InitialFileName = document.all("fileName").value;
                dg.show(); */
        //由于NTKO插件的限制,只有保存操作可以指定文件名,PDF另存为时无法设置文件名,因此用保存操作代替另存为操作。
        OFFICE_CONTROL_OBJ.ShowDialog(2);
        OFFICE_CONTROL_OBJ.CancelLastCommand = true;//取消默认操作
    }
}
 
function OnCustomMenuCmd2(menuPos, submenuPos, subsubmenuPos, menuCaption, menuID) {
    if (menuPos == 0) { //流程文档模板
        openTemplateFileFromUrl(getTemplateUrl(submenuPos));
    } else if (menuPos == 1) { //套红模板
        insertRedHeadFromUrl("../downloadFile.do?id=" + getTaohongId(submenuPos));
    }
}
 
function OnCustomButtonOnMenuCmd(btnPos, btnCaption, btnCmdid) {
    if (btnPos == 2) {
        syncBookmarkData();
    }
}
 
 
/*function ntkoondocumentopened(type,code){
    //alert("Ondocumentopened成功回调");
   if(cmd==5){
    if(datavalue==1){
     ntko.ShowTipMessage("注意","已经接收到父页面传过来的值,请注意文档中内容的变化");
     ntkoDataToChild(datatext);
     }
 }
}*/
 
function getBrowser(n) {
    var ua = navigator.userAgent.toLowerCase(),
        s,
        name = '',
        ver = 0;
    //探测浏览器
    (s = ua.match(/msie ([\d.]+)/)) ? _set("ie", _toFixedVersion(s[1])) :
        (s = ua.match(/firefox\/([\d.]+)/)) ? _set("firefox", _toFixedVersion(s[1])) :
            (s = ua.match(/chrome\/([\d.]+)/)) ? _set("chrome", _toFixedVersion(s[1])) :
                (s = ua.match(/opera.([\d.]+)/)) ? _set("opera", _toFixedVersion(s[1])) :
                    (s = ua.match(/version\/([\d.]+).*safari/)) ? _set("safari", _toFixedVersion(s[1])) : 0;
 
    function _toFixedVersion(ver, floatLength) {
        ver = ('' + ver).replace(/_/g, '.');
        floatLength = floatLength || 1;
        ver = String(ver).split('.');
        ver = ver[0] + '.' + (ver[1] || '0');
        ver = Number(ver).toFixed(floatLength);
        return ver;
    }
 
    function _set(bname, bver) {
        name = bname;
        ver = bver;
    }
 
    return (n == 'n' ? name : (n == 'v' ? ver : name + ver));
}
 
 
if (browser == "IE") {
    if (window.navigator.platform == "Win32") {
        document.write('<SPAN STYLE="font-size:36px;color:#ff0000">由于NTKO插件升级后只兼容360极速浏览器极速模式,请切换到极速模式或安装版本号不小于11.0.2031.0的360极速浏览器</SPAN><br><a href="/cnnpbpm/download/ntko/360cse_11.0.2031.0.exe">浏览器下载</a><br>   ');
        document.write('<SPAN STYLE="font-size:36px;color:red">由于NTKO插件升级兼容360极速浏览器极速模式,请安装新版NTKO Web Chrome跨浏览器插件</SPAN><br><a href="static/plugins/ntko-office/NtkoAllControlSetup.msi">新版插件下载</a><br>  ');
        document.write('<SPAN STYLE="font-size:36px;color:red">如使用中遇到其他问题,请联系600IT服务台</SPAN>');
        document.write('</object>');
    }
    if (window.navigator.platform == "Win64") {
        document.write('<SPAN STYLE="font-size:36px;color:red">由于NTKO插件升级后只兼容360极速浏览器极速模式,请切换到极速模式或安装版本号不小于11.0.2031.0的360极速浏览器</SPAN><br><a href="/cnnpbpm/download/ntko/360cse_11.0.2031.0.exe">浏览器下载</a><br>   ');
        document.write('<SPAN STYLE="font-size:36px;color:red">由于NTKO插件升级兼容360极速浏览器极速模式,请安装新版NTKO Web Chrome跨浏览器插件</SPAN><br><a href="static/plugins/ntko-office/NtkoAllControlSetup.msi">新版插件下载</a><br>  ');
        document.write('<SPAN STYLE="font-size:36px;color:red">如使用中遇到其他问题,请联系600IT服务台</SPAN>');
        document.write('</object>');
    }
} else if (browser == "firefox") {
    document.write('<object id="TANGER_OCX" type="application/ntko-plug"  codebase="' + codebase + '" width="' + width + '" height="' + height + '" ForOnSaveToURL="ntkosavetourl"  ForOndocumentopened="ntkoondocumentopened"');
    document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
    document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
    document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
    document.write('_MakerCaption="' + MakerCaption + '"  ');
    document.write('_MakerKey="' + MakerKey + '"  ');
    document.write('_ProductCaption="' + ProductCaption + '"  ');
    document.write('_ProductKey="' + ProductKey + '"   ');
    document.write('_NoExpireKey="' + NoExpireKey + '"   ');
    document.write('clsid="{' + classid + '}" >');
    document.write('<SPAN STYLE="color:#ff0000">尚未安装NTKO Web FireFox跨浏览器插件</SPAN>   ');
    document.write('</object>   ');
} else if (browser == "chrome") {
    document.write('<object id="TANGER_OCX" clsid="{' + classid + '}"  ForOnSaveToURL="ntkosavetourl"  ForOndocumentopened="OnDocumentOpened"');
    document.write('ForOnpublishAshtmltourl="ntkopublishashtml"');
    document.write('ForOnpublishAspdftourl="ntkopublishaspdf"');
    document.write('ForOnSaveAsOtherFormatToUrl="ntkosaveasotherurl"');
 
    document.write('ForOnDocumentClosed="OnDocumentClosed"');
    document.write('ForOnFileCommand="OnFileCommand"');
    document.write('ForOnCustomMenuCmd2="OnCustomMenuCmd2"');
    document.write('ForOnCustomButtonOnMenuCmd="OnCustomButtonOnMenuCmd"');
 
    document.write('_IsUseUTF8URL="-1"   ');
    document.write('_IsUseUTF8Data="-1"   ');
    document.write('_Caption="中国核能电力股份有限公司"   ');
    document.write('_MakerCaption="' + MakerCaption + '"  ');
    document.write('_MakerKey="' + MakerKey + '"  ');
    document.write('_ProductCaption="' + ProductCaption + '"  ');
    document.write('_NoExpireKey="' + NoExpireKey + '"   ');
    document.write('_ProductKey="' + ProductKey + '"   ');
    document.write('codebase="' + codebase + '" width="' + width + '" height="' + height + '" type="application/ntko-plug" ');
 
    var strStart = userAgent.indexOf('Chrome/') + 7;
    var strEnd = userAgent.indexOf('Safari');
    var version = userAgent.substring(strStart, strEnd);//内核69.0.3497.100 为(版本:11.0.2031.0)的360极速浏览器
    console.log("版本号:" + version);
    if (version.indexOf('69.0.3497.100') === -1) {
        document.write('<SPAN STYLE="font-size:36px;color:red">由于NTKO插件升版后只兼容360极速浏览器极速模式,请切换到极速模式或安装版本号不小于11.0.2031.0的360极速浏览器</SPAN><br><a href="/cnnpbpm/download/ntko/360cse_11.0.2031.0.exe">浏览器下载</a><br>   ');
    }
    document.write('<SPAN STYLE="font-size:36px;color:red">由于NTKO插件升版兼容360极速浏览器极速模式,请安装新版NTKO Web Chrome跨浏览器插件</SPAN><br><a href="static/plugins/ntko-office/NtkoAllControlSetup.msi">新版插件下载</a><br>  ');
    document.write('<SPAN STYLE="font-size:36px;color:red">如使用中遇到其他问题,请联系600IT服务台</SPAN>');
    document.write('</object>');
} else if (Sys.opera) {
    alert("sorry,ntko web印章暂时不支持opera!");
} else if (Sys.safari) {
    alert("sorry,ntko web印章暂时不支持safari!");
}
 
window.onunload = function () {
    var ntkojb = ntkoBrowser.NtkoJudgingBrowsers();
    if (ntkojb) {
        window.opener.ntkoCloseEvent();
    }
}
 
window.onbeforeunload = function () {
    //修复霞浦公办待阅打开时快时慢问题,去除无用方法 by gw
    //if(cmd==4){
    //ntkoSendDataToParentPage();
    //}
}
 
//ie,谷歌,火狐传值
var ntkoBrowser = {
    ntkoSetReturnValueToParentPage: function (data1, text1) {
 
        var ntkojb = ntkoBrowser.NtkoJudgingBrowsers();
        if (ntkojb) {
            window.opener.ieattachEventntko(data1, text1);
        } else {
            window.external.SetReturnValueToParentPage(data1, text1);
        }
    },
    NtkoBrower: function () {
        if (browser == "IE") {
            return false;
        }
        if (browser == "firefox") {
            if (userAgent.indexOf("Windows NT 5.1") > -1) {
                return false;
            }
            if (version >= "50") {
                return true;
            } else {
                return false;
            }
        }
        if (browser == "chrome") {
            if (userAgent.indexOf("Windows NT 5.1") > -1) {
                return false;
            }
            if (version >= "45") {
                return true;
            } else {
                return false;
            }
        }
    },
    NtkoJudgingBrowsers: function () {
        try {
            var ntkobtop = window.opener.top.browser;
            return true;
        } catch (err) {
            return false;
        }
    }
 
}