<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<base href="{%#local%}" />
<title>网页采集</title>
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link href="css/title.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<script>
function goDelete(link)
{
if(confirm("确定要删除吗？"))
{
window.external.get(link);
window.location=window.external.getUrl();
}
}
function goDeleteAll()
{
if(confirm("确定要删除吗？"))
{
var elm=document.getElementsByName("ids");
for (var i=0;i<elm.length;i++)
{
var e = elm[i];
if(e.name=="ids"&e.checked)
{
var link="?xmls=readx.xmls&method=delete&id="+e.value;
window.external.get(link);
}
}
window.location=window.external.getUrl();
}
}
function goCheck()
{
var elm=document.getElementsByName("ids");
for (var i=0;i<elm.length;i++)
{
var e = elm[i];
if(e.name=="ids")
{
if (e.checked==false)
{
e.checked = true;
}
else
{
e.checked = false;
}
}
}
}
function goWork()
{
var elm=document.getElementsByName("ids");
for (var i=0;i<elm.length;i++)
{
var e = elm[i];
if(e.name=="ids"&e.checked)
{document.getElementById("status"+e.value).innerHTML="采集中";
var link="?xmls=readx.xmls&method=getContent&id="+e.value;
var ret= window.external.get(link);
if(ret=="1"){
document.getElementById("status"+e.value).innerHTML="已采集";
}
}
}
}
function goExport() {
var list = window.external.saveFileBrowser("选择文件", "CSV Files|*.csv","import.csv");
if(list!=null){
window.external.get('?xmls=readx.xmls&method=export&ItemId={%$http.get(ItemId)%}&filename='+encodeURIComponent(list));
window.external.openFile(list);
 }
}
</script><body>
<div class="bgcolor">
<div class="bg">
<header>
<div class="center">
<h2>网页采集</h2>
</div>
</header>
<div class="pic_main">
<div class="pic_left">
<span><a href="{%#path%}?xmls=index.xmls">项目列表 </a>&gt; <a href="{%#path%}?xmls=readx.xmls&ItemId={%$http.get(ItemId)%}">所有内容</a>  |  <a href="{%#path%}?xmls=readx.xmls&ItemId={%$http.get(ItemId)%}&status=1">已采集 </a> | <a href="{%#path%}?xmls=readx.xmls&ItemId={%$http.get(ItemId)%}&status=0">未采集 </a> </span>

<button type=“button” class="but" onClick="window.location='{%#path%}?xmls=field.xmls&ItemId={%$http.get(ItemId)%}'" style="margin-right:10px;">规则管理</button>
<button type=“button” class="but" onClick="window.location='{%#path%}?xmls=work.xmls&ItemId={%$http.get(ItemId)%}'" style="margin-right:10px;">采集目录</button>
<button type=“button” class="but" onClick="goDeleteAll()" style="margin-right:10px;">删除</button>
<button type=“button” class="but" onClick="window.location='{%#path%}?xmls=readx.xmls&method=add&ItemId={%$http.get(ItemId)%}'" style="margin-right:10px;">添加</button>

<button type=“button” class="but" onClick="goWork()" style="margin-right:10px;">开始</button>
<button type=“button” class="but" onClick="goExport()" style="margin-right:10px;">导出数据</button>
<!--<div class="sanjiao"></div>-->
<div class="file_name clear">
<table class="clear">
<tr class="first">
<th class="name_left"><input type="checkbox" onClick="goCheck()"/> 源网址</th>
<th class="name_center">状态</th>
<th class="name_right" style="color:#000 ">管理</th>
</tr>
{%@Body%}
</table>
</div>
</div>
</div>
</div>
</div>
</body>
</html>