maxiaoshan 2 yıl önce
ebeveyn
işleme
dece3d84ef
2 değiştirilmiş dosya ile 36 ekleme ve 36 silme
  1. 33 33
      src/front/front.go
  2. 3 3
      src/web/templates/index.html

+ 33 - 33
src/front/front.go

@@ -971,39 +971,39 @@ func (f *Front) UpdateESP() {
 		set["event"] = 7000
 		set["spidertype"] = "history"
 		//更新、新建任务
-		task, _ := u.MgoEB.FindOne("task", map[string]interface{}{"s_code": code, "i_state": map[string]interface{}{"$in": []int{0, 1, 2, 3, 5}}})
-		text := "指定追加描述:------------------------------\n无发布转待完成\n"
-		if len(*task) > 0 { //已有任务,更新
-			u.MgoEB.UpdateById("task", (*task)["_id"],
-				map[string]interface{}{
-					"$set": map[string]interface{}{
-						"i_state":      2,
-						"s_descript":   qu.ObjToString((*task)["s_descript"]) + text,
-						"l_updatetime": time.Now().Unix(),
-					},
-				})
-		} else {
-			save := map[string]interface{}{
-				"s_channel":           (*one)["channel"],
-				"i_event":             (*one)["event"],
-				"i_frequencyerrtimes": 0,
-				"i_state":             2,
-				"s_descript":          text,
-				"l_complete":          time.Now().Unix() + int64(24*3600),
-				"s_urgency":           "4",
-				"i_pendstate":         0,
-				"s_modifyid":          (*one)["modifyuserid"],
-				"s_source":            "人工",
-				"i_times":             0,
-				"l_comeintime":        time.Now().Unix(),
-				"i_num":               0,
-				"s_modify":            (*one)["modifyuser"],
-				"s_code":              code,
-				"s_site":              (*one)["site"],
-				"s_type":              "0",
-			}
-			u.MgoEB.Save("task", save)
-		}
+		//task, _ := u.MgoEB.FindOne("task", map[string]interface{}{"s_code": code, "i_state": map[string]interface{}{"$in": []int{0, 1, 2, 3, 5}}})
+		//text := "指定追加描述:------------------------------\n无发布转待完成\n"
+		//if len(*task) > 0 { //已有任务,更新
+		//	u.MgoEB.UpdateById("task", (*task)["_id"],
+		//		map[string]interface{}{
+		//			"$set": map[string]interface{}{
+		//				"i_state":      2,
+		//				"s_descript":   qu.ObjToString((*task)["s_descript"]) + text,
+		//				"l_updatetime": time.Now().Unix(),
+		//			},
+		//		})
+		//} else {
+		//	save := map[string]interface{}{
+		//		"s_channel":           (*one)["channel"],
+		//		"i_event":             (*one)["event"],
+		//		"i_frequencyerrtimes": 0,
+		//		"i_state":             2,
+		//		"s_descript":          text,
+		//		"l_complete":          time.Now().Unix() + int64(24*3600),
+		//		"s_urgency":           "4",
+		//		"i_pendstate":         0,
+		//		"s_modifyid":          (*one)["modifyuserid"],
+		//		"s_source":            "人工",
+		//		"i_times":             0,
+		//		"l_comeintime":        time.Now().Unix(),
+		//		"i_num":               0,
+		//		"s_modify":            (*one)["modifyuser"],
+		//		"s_code":              code,
+		//		"s_site":              (*one)["site"],
+		//		"s_type":              "0",
+		//	}
+		//	u.MgoEB.Save("task", save)
+		//}
 	} else if w == "platform" {
 		set["platform"] = val
 		set["comeintime"] = time.Now().Unix()

+ 3 - 3
src/web/templates/index.html

@@ -250,7 +250,7 @@ $(function(){
 					if(cellData!=4&&cellData!=7&&cellData!=8&&cellData!=9&&cellData!=10){
 					  return
 					}
-					$(this).html(createComboxState(rowData._id));
+					$(this).html(createComboxState(rowData._id,rowData.code));
 					var aInput = $(this).find(":input");
 					  aInput.focus().val(cellData);
 				  });
@@ -874,8 +874,8 @@ $(function(){
 		}
     	return "<select onchange='updateesp(this.value,\"event\",\""+state+"\",\""+code+"\",\""+id+"\")' class='form-control input-sm'>"+spiderEvent+"</select>"
     };
-    function createComboxState(id){
-    	return "<select id='task_state'  onchange='updateesp(this.value,\"state\",\"\",\"\",\""+id+"\")' class='form-control input-sm'>"+
+    function createComboxState(id,code){
+    	return "<select id='task_state'  onchange='updateesp(this.value,\"state\",\"\",\""+code+"\",\""+id+"\")' class='form-control input-sm'>"+
             "<option value='0' class='text-info text-bold'>待完成</option>"+
       		"<option disabled value='1'>待审核</option>"+
       		"<option disabled value='2'>未通过</option>"+