Эх сурвалжийг харах

爬虫新增infoformat字段相关修改

maxiaoshan 2 жил өмнө
parent
commit
5854d47cad

+ 4 - 0
src/front/front.go

@@ -382,6 +382,7 @@ func (f *Front) LoadIndex() {
 		state, _ := f.GetInteger("state")
 		urgency, _ := f.GetInteger("urgency") //节点
 		platform := f.GetString("platform")
+		infoformat, _ := f.GetInteger("infoformat") //节点
 		query := map[string]interface{}{}
 		if event > -1 {
 			query["event"] = event
@@ -392,6 +393,9 @@ func (f *Front) LoadIndex() {
 		if platform != "-1" {
 			query["platform"] = platform
 		}
+		if infoformat > -1 {
+			query["infoformat"] = infoformat
+		}
 		if search != "" {
 			query["$or"] = []interface{}{
 				map[string]interface{}{"code": map[string]interface{}{"$regex": search}},

+ 24 - 7
src/web/templates/index.html

@@ -218,9 +218,9 @@ $(function(){
 					var text = $(this).find("option:selected").text();
 					if (text == "招标"){
 						text = 1
-					}else if (text == "拟建"){
+					}else if (text == "拟建/审批"){
 						text = 2
-					}else if (text == "审批"){
+					}else if (text == "产权"){
 						text = 3
 					}
 					ttable.cell(cell).data(text);
@@ -399,9 +399,9 @@ $(function(){
 				if(val == 1){
 					return "招标"
 				}else if (val == 2){
-					return "拟建"
+					return "拟建/审批"
 				}else if (val == 3){
-					return "审批"
+					return "产权"
 				}
 			}},
 			{ "data": "urgency",render:function(val){
@@ -524,6 +524,7 @@ $(function(){
 			var taskEvent = $("#task_event").val();
 			var urgency = $("#luaurgency").val();
 			var platform = $("#platform").val();
+			var infoformat = $("#infoformat").val();
 			//紧急度
 			if(urgency){
 				e.urgency=urgency
@@ -531,7 +532,7 @@ $(function(){
 				e.urgency="-1"
 			}
 		    //状态
-		  if(state){
+		    if(state){
 				e.state=state
 			}else{
 				e.state="-1"
@@ -548,6 +549,12 @@ $(function(){
 			}else{
 				e.platform="-1"
 			}
+			//类型
+			if(infoformat){
+				e.infoformat=infoformat
+			}else{
+				e.infoformat="-1"
+			}
 		}
 	});
 	common.setActive("index");
@@ -586,7 +593,7 @@ $(function(){
 		{{else}}
 			opt=opt+opt1+opt2+opt3+opt4
 		{{end}}
-		var select="<div class='form-group'><label for='name'>选择分类:</label>"+
+		var select="<div class='form-group'><label for='name'>状态:</label>"+
 			"<select id='type_state' onchange='checkclick(this.value)' class='form-control input-sm'>"+
 			opt+
 			"</select></div>"
@@ -604,6 +611,16 @@ $(function(){
 			"</select></div>"
 		$("#spider_filter").prepend("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
 		$("#spider_filter").prepend(selectEvent);
+		//类型
+		var infoformat="<div class='form-group'><label for='name'>类型:</label>"+
+				"<select id='infoformat' onchange='checkclick(this.value)' class='form-control input-sm'>"+
+				"<option value='-1'>全部</option>"+
+				"<option value='1'>招标</option>"+
+				"<option value='2'>拟建/审批</option>"+
+				"<option value='3'>产权</option>"+
+				"</select></div>"
+		$("#spider_filter").prepend("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+		$("#spider_filter").prepend(infoformat);
 		//平台
 		var platform="<div class='form-group'><label for='name'>平台:</label>"+
 			"<select id='platform' onchange='checkclick(this.value)' class='form-control input-sm'>"+
@@ -898,7 +915,7 @@ $(function(){
 	};
 	//修改爬虫类型
 	function updateInfoformat(id,state,code){
-		var spiderInforformat="<option value=1>招标</option><option value=2>拟建</option><option value=3>审批</option>";
+		var spiderInforformat="<option value=1>招标</option><option value=2>拟建/审批</option><option value=3>产权</option>";
 		return "<select onchange='updateesp(this.value,\"infoformat\",\""+state+"\",\""+code+"\",\""+id+"\")' class='form-control input-sm'>"+spiderInforformat+"</select>"
 	};
 	//修改紧急度