Commit ccd1b8a2 by 陈玉兰

提交

parent a674c257
...@@ -144,6 +144,14 @@ function addRow(){ ...@@ -144,6 +144,14 @@ function addRow(){
//加载增加子页面成功后的回调 //加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){ function addUrlOnloadCallback(is_row){
init_combobox(); init_combobox();
init_inputValue();
}
function init_inputValue(){
$('#save_Path').textbox('setValue','/usr/local/spider_pic');
$('#DATABASE_NAME').textbox('setValue','pc_business');
$('#TABLE_NAME').textbox('setValue','file_attribute');
} }
//初始化下拉框 //初始化下拉框
...@@ -318,8 +326,10 @@ function lookRow(index){ ...@@ -318,8 +326,10 @@ function lookRow(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
is_row[0].OPETYPE = 'update'; is_row[0].OPETYPE = 'update';
//document.getElementById("textGrapiframe").contentWindow.init(is_row[0].TABLE_NAME); if(is_row[0].STATUS!='SUCCESS'){
//fileGrapiframe.window.init(is_row[0].TABLE_NAME); $.messager.alert('提示',"该记录无数据!",'info');
return;
}
window.location = 'fileGrapView_fileGrapDataTab?savepath='+is_row[0].SAVE_PATH; window.location = 'fileGrapView_fileGrapDataTab?savepath='+is_row[0].SAVE_PATH;
//openViewIframRow('listData',"fileGrapView_fileGrapDataTab?tableName="+is_row[0].TABLE_NAME,is_row[0],"爬取数据",true,0.65,0.95,170,0); //openViewIframRow('listData',"fileGrapView_fileGrapDataTab?tableName="+is_row[0].TABLE_NAME,is_row[0],"爬取数据",true,0.65,0.95,170,0);
...@@ -327,8 +337,12 @@ function lookRow(index){ ...@@ -327,8 +337,12 @@ function lookRow(index){
function statusRow(index){ function statusRow(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
if(is_row[0].STATUS=='SUCCESS'){
$.messager.alert('提示',"该记录已爬取成功!",'info');
}
var map={}; var map={};
map.FIELD_UUID=is_row[0].UUID map.FIELD_UUID=is_row[0].UUID
map.FIELD_CREATE_ID=is_row[0].CREATE_ID map.FIELD_CREATE_ID=is_row[0].CREATE_ID
...@@ -344,7 +358,10 @@ function statusRow(index){ ...@@ -344,7 +358,10 @@ function statusRow(index){
url:"fileGrapAct_status", url:"fileGrapAct_status",
data:map, data:map,
success:function(data){ success:function(data){
$('#list').datagrid('reload'); if(data.statusCode==200){
$.messager.alert('提示',"状态获取成功!",'info');
}
$('#list').datagrid('load',{});
} }
}); });
} }
\ No newline at end of file
...@@ -167,7 +167,6 @@ function init_combobox_for_url(){ ...@@ -167,7 +167,6 @@ function init_combobox_for_url(){
$("#SAVE_PATH").textbox('setValue',record.SAVE_PATH); $("#SAVE_PATH").textbox('setValue',record.SAVE_PATH);
$("#DATABASE_NAME").textbox('setValue',record.DATABASE_NAME); $("#DATABASE_NAME").textbox('setValue',record.DATABASE_NAME);
$("#TABLE_NAME").textbox('setValue',record.TABLE_NAME); $("#TABLE_NAME").textbox('setValue',record.TABLE_NAME);
console.log(record);
} }
}) })
} }
...@@ -316,18 +315,24 @@ function grapRow(index){ ...@@ -316,18 +315,24 @@ function grapRow(index){
//alert("开发中"); //alert("开发中");
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
$.messager.confirm('提示', '确定开始爬取?', function(r) {
$.ajax({ if (r) {
type:'post', $.ajax({
url:"textGrapAct_grap", type:'post',
data:{ url:"textGrapAct_grap",
uuid:is_row[0].UUID, data:{
url_id:is_row[0].URL_ID, uuid:is_row[0].UUID,
dbName:is_row[0].DATABASE_NAME, url_id:is_row[0].URL_ID,
tableName:is_row[0].TABLE_NAME dbName:is_row[0].DATABASE_NAME,
}, tableName:is_row[0].TABLE_NAME
success:function(data){ },
console.log(data); success:function(data){
if(data.statusCode==200){
$.messager.alert('提示',"开始爬取!",'info');
}
}
});
} }
}); });
...@@ -337,6 +342,10 @@ function grapRow(index){ ...@@ -337,6 +342,10 @@ function grapRow(index){
function lookRow(index){ function lookRow(index){
$('#list').datagrid('selectRow',index); $('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections'); var is_row = $('#list').datagrid('getSelections');
if(is_row[0].STATUS!='SUCCESS'){
$.messager.alert('提示',"该记录无数据!",'info');
return;
}
$('#list').datagrid('clearSelections'); $('#list').datagrid('clearSelections');
window.location = 'textGrapView_textGrapDataTab?tablename='+is_row[0].TABLE_NAME; window.location = 'textGrapView_textGrapDataTab?tablename='+is_row[0].TABLE_NAME;
} }
...@@ -354,12 +363,20 @@ function statusRow(index){ ...@@ -354,12 +363,20 @@ function statusRow(index){
map.FIELD_TABLE_NAME=is_row[0].TABLE_NAME*/ map.FIELD_TABLE_NAME=is_row[0].TABLE_NAME*/
map.FIELD_URL_ID=is_row[0].URL_ID; map.FIELD_URL_ID=is_row[0].URL_ID;
map.FIELD_TASK_ID=is_row[0].TASK_ID; map.FIELD_TASK_ID=is_row[0].TASK_ID;
if(is_row[0].STATUS=='SUCCESS'){
$.messager.alert('提示',"该记录已爬取成功!",'info');
return;
}
$.ajax({ $.ajax({
type:'post', type:'post',
url:"textGrapAct_status", url:"textGrapAct_status",
data:map, data:map,
success:function(data){ success:function(data){
$('#list').datagrid('reload'); if(data.statusCode==200){
$.messager.alert('提示',"状态获取成功!",'info');
}
$('#list').datagrid('load',{});
} }
}); });
} }
\ No newline at end of file
...@@ -158,6 +158,9 @@ public class AllDataBusinessImpl implements AllDataBusiness { ...@@ -158,6 +158,9 @@ public class AllDataBusinessImpl implements AllDataBusiness {
public int listCount_file_attribute(Map<String, Object> query) public int listCount_file_attribute(Map<String, Object> query)
throws BusinessException { throws BusinessException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if(query.get("SAVE_PATH")!=null&&""!=(query.get("SAVE_PATH"))){
query.put("SAVE_PATH", "%"+query.get("SAVE_PATH")+"%");
}
return allDataDAO.listCount_file_attribute(query); return allDataDAO.listCount_file_attribute(query);
} }
......
...@@ -67,5 +67,8 @@ ...@@ -67,5 +67,8 @@
<![CDATA[ <![CDATA[
select count(*) c from FILE_ATTRIBUTE f where 1=1 select count(*) c from FILE_ATTRIBUTE f where 1=1
]]> ]]>
<if test="SAVE_PATH != null and SAVE_PATH != ''">
and f.SAVE_PATH LIKE #{SAVE_PATH}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -141,6 +141,8 @@ public class actAction extends BasicAction{ ...@@ -141,6 +141,8 @@ public class actAction extends BasicAction{
entity.put("RESULT_COUNT", 0); entity.put("RESULT_COUNT", 0);
} }
business.update_fileGrap(entity); business.update_fileGrap(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("查询状态成功"));
jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody()); jsonObject.put("responseBody", responseBack.getResponseBody());
return "json"; return "json";
} }
......
...@@ -162,7 +162,9 @@ public class actAction extends BasicAction{ ...@@ -162,7 +162,9 @@ public class actAction extends BasicAction{
entity.put("STATUS", responseBack.getResponseBody()); entity.put("STATUS", responseBack.getResponseBody());
business.update_textGrap(entity); business.update_textGrap(entity);
} }
jsonObject.putAll(Status.getStatusSuccessMessage("获取状态成功"));
jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody());
return "json"; return "json";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment