Commit ccd1b8a2 by 陈玉兰

提交

parent a674c257
......@@ -144,6 +144,14 @@ function addRow(){
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
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){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
is_row[0].OPETYPE = 'update';
//document.getElementById("textGrapiframe").contentWindow.init(is_row[0].TABLE_NAME);
//fileGrapiframe.window.init(is_row[0].TABLE_NAME);
if(is_row[0].STATUS!='SUCCESS'){
$.messager.alert('提示',"该记录无数据!",'info');
return;
}
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);
......@@ -327,8 +337,12 @@ function lookRow(index){
function statusRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
if(is_row[0].STATUS=='SUCCESS'){
$.messager.alert('提示',"该记录已爬取成功!",'info');
}
var map={};
map.FIELD_UUID=is_row[0].UUID
map.FIELD_CREATE_ID=is_row[0].CREATE_ID
......@@ -344,7 +358,10 @@ function statusRow(index){
url:"fileGrapAct_status",
data:map,
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(){
$("#SAVE_PATH").textbox('setValue',record.SAVE_PATH);
$("#DATABASE_NAME").textbox('setValue',record.DATABASE_NAME);
$("#TABLE_NAME").textbox('setValue',record.TABLE_NAME);
console.log(record);
}
})
}
......@@ -316,18 +315,24 @@ function grapRow(index){
//alert("开发中");
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$.ajax({
type:'post',
url:"textGrapAct_grap",
data:{
uuid:is_row[0].UUID,
url_id:is_row[0].URL_ID,
dbName:is_row[0].DATABASE_NAME,
tableName:is_row[0].TABLE_NAME
},
success:function(data){
console.log(data);
$.messager.confirm('提示', '确定开始爬取?', function(r) {
if (r) {
$.ajax({
type:'post',
url:"textGrapAct_grap",
data:{
uuid:is_row[0].UUID,
url_id:is_row[0].URL_ID,
dbName:is_row[0].DATABASE_NAME,
tableName:is_row[0].TABLE_NAME
},
success:function(data){
if(data.statusCode==200){
$.messager.alert('提示',"开始爬取!",'info');
}
}
});
}
});
......@@ -337,6 +342,10 @@ function grapRow(index){
function lookRow(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
if(is_row[0].STATUS!='SUCCESS'){
$.messager.alert('提示',"该记录无数据!",'info');
return;
}
$('#list').datagrid('clearSelections');
window.location = 'textGrapView_textGrapDataTab?tablename='+is_row[0].TABLE_NAME;
}
......@@ -354,12 +363,20 @@ function statusRow(index){
map.FIELD_TABLE_NAME=is_row[0].TABLE_NAME*/
map.FIELD_URL_ID=is_row[0].URL_ID;
map.FIELD_TASK_ID=is_row[0].TASK_ID;
if(is_row[0].STATUS=='SUCCESS'){
$.messager.alert('提示',"该记录已爬取成功!",'info');
return;
}
$.ajax({
type:'post',
url:"textGrapAct_status",
data:map,
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 {
public int listCount_file_attribute(Map<String, Object> query)
throws BusinessException {
// 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);
}
......
......@@ -67,5 +67,8 @@
<![CDATA[
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>
</mapper>
\ No newline at end of file
......@@ -141,6 +141,8 @@ public class actAction extends BasicAction{
entity.put("RESULT_COUNT", 0);
}
business.update_fileGrap(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("查询状态成功"));
jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody());
return "json";
}
......
......@@ -162,7 +162,9 @@ public class actAction extends BasicAction{
entity.put("STATUS", responseBack.getResponseBody());
business.update_textGrap(entity);
}
jsonObject.putAll(Status.getStatusSuccessMessage("获取状态成功"));
jsonObject.put("statusCode", responseBack.getStatusCode());
jsonObject.put("responseBody", responseBack.getResponseBody());
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