121 lines
3.4 KiB
HTML
121 lines
3.4 KiB
HTML
<html>
|
||
<head>
|
||
<meta content="IE=10" http-equiv="X-UA-Compatible" />
|
||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||
<title>首页 - OFFICE文档控件演示示例</title>
|
||
<link href="./ntkoStyle.css" rel="stylesheet" type="text/css" />
|
||
<script type="text/javascript" src="./ntko.js"></script>
|
||
<script type="text/javascript">
|
||
var cmd; //命令类型
|
||
var datatext;
|
||
var datavalue;
|
||
function getQueryString(name) {
|
||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||
var r = window.location.search.substr(1).match(reg);
|
||
if (r != null) return unescape(r[2]);
|
||
|
||
return null;
|
||
|
||
}
|
||
function CurentTime() {
|
||
var now = new Date();
|
||
|
||
var year = now.getFullYear(); //年
|
||
var month = now.getMonth() + 1; //月
|
||
var day = now.getDate(); //日
|
||
|
||
var hh = now.getHours(); //时
|
||
var mm = now.getMinutes(); //分
|
||
var ss = now.getSeconds(); //分
|
||
|
||
var clock = year + "-";
|
||
|
||
if(month < 10)
|
||
clock += "0";
|
||
|
||
clock += month + "-";
|
||
|
||
if(day < 10)
|
||
clock += "0";
|
||
|
||
clock += day + " ";
|
||
|
||
if(hh < 10)
|
||
clock += "0";
|
||
|
||
clock += hh + ":";
|
||
if (mm < 10) clock += '0';
|
||
clock += mm + ":";
|
||
if (ss < 10) clock += '0';
|
||
clock += ss;
|
||
return(clock);
|
||
}
|
||
|
||
//在子页面定义的向父页面回传值的方法,方法名可以自定义
|
||
function ntkoSendDataToParentPage()
|
||
{
|
||
var varData = new Array();
|
||
varData.push(ntko.docsize);
|
||
varData.push(CurentTime());
|
||
ntkoBrowser.ntkoSetReturnValueToParentPage("OnData","dddd");
|
||
}
|
||
function ntkoDataToChild(data){
|
||
ntko.SetBookmarkValue("ntko",data);
|
||
var ntkoc= ntko.ActiveDocument.bookMarks.count;
|
||
for(var i=1;i<=ntkoc;i++){
|
||
var ntkoname= ntko.ActiveDocument.bookMarks.item(i).name;
|
||
if(ntkoname=="ntko"){
|
||
ntko.ActiveDocument.bookMarks.item(i).select();
|
||
ntko.ActiveDocument.Application.Selection.Font.Color=255;
|
||
ntko.ActiveDocument.Application.Selection.Font.Bold=9999998;
|
||
ntko.ActiveDocument.Application.Selection.Font.Size = 16;
|
||
}
|
||
}
|
||
}
|
||
function ntkoGetParentData(data){//该方法用于接收父页面传递的值
|
||
if(data=="Save"){
|
||
/*url&文件类型(file)&其它参数&文件名&其它 */
|
||
var msg=ntko.SaveToURL("/api/ebtp-mall-attachment/v1/upload","file","businessId="+code+"&file="+code,code+".doc","");
|
||
if(JSON.parse(msg).success){
|
||
ntkoBrowser.ntkoSetReturnValueToParentPage("OnData","success");
|
||
} else{
|
||
ntkoBrowser.ntkoSetReturnValueToParentPage("OnData","error");
|
||
}
|
||
}
|
||
|
||
|
||
}
|
||
function ntkocloseparentpage(){
|
||
ntkoGetParentData();
|
||
ntkoSendDataToParentPage();
|
||
|
||
}
|
||
</script>
|
||
|
||
|
||
</head>
|
||
|
||
|
||
|
||
<body onload="cmd=getQueryString('cmd');code=getQueryString('code');type=getQueryString('type');init(cmd,code,type);" onbeforeunload="ntkocloseparentpage()">
|
||
<script language="JScript" for="TANGER_OCX" event="OnCustomButtonOnMenuCmd(btnPos,btnCaption,btnCmdid)">
|
||
|
||
</script>
|
||
<script language="JScript" for="TANGER_OCX" event="AfterOpenFromURL(doc, statusCode)">
|
||
</script>
|
||
<script type="text/javascript" for="TANGER_OCX" event="OnDocumentOpened(File, Document)" >
|
||
<div class="divTopInnerNtko">
|
||
<a href="http://www.ntko.com" title="点击访问NTKO官网">官网</a>
|
||
</div>
|
||
</script>
|
||
<div class="divTop">
|
||
<div class="divTopInner">
|
||
<div class="divTopInnerCaption">商城3.0</div>
|
||
</div>
|
||
</div>
|
||
<div class="divBody">
|
||
<script type="text/javascript" src="./ntkoofficecontrol.min.js"></script>
|
||
</div>
|
||
</body>
|
||
</html>
|