Jianghan пре 3 година
родитељ
комит
8d3da23a19
5 измењених фајлова са 15 додато и 22 уклоњено
  1. 1 2
      src/front/front.go
  2. 8 2
      src/front/server.go
  3. 0 4
      src/main.go
  4. 1 1
      src/web/templates/list.html
  5. 5 13
      src/web/templates/re_detail.html

+ 1 - 2
src/front/front.go

@@ -1017,7 +1017,6 @@ func GetDataById1(coll string, ids []string, stype string, tmp map[string]map[st
 			if id < util.BIDDINGSTARTID {
 				tmpBidColl = util.BidColl2 //bidding_back
 			}
-			qu.Debug(tmpBidColl, id)
 			bidData, _ := util.MgoB.FindById(tmpBidColl, id, nil)
 			if bidData != nil && len(*bidData) > 0 { //bidding表数据存在
 				//查询extract
@@ -1090,7 +1089,6 @@ func GetDataById1(coll string, ids []string, stype string, tmp map[string]map[st
 				}
 				// 补充filetext
 				(*bidData)["filetext"] = util.GetFileText(*bidData)
-				qu.Debug("es find project")
 				// es查询项目合并信息
 				esQ := `{"query":{"bool":{"must":[{"term":{"ids":"` + id + `"}}]}}}`
 				info := util.Es.Get("projectset", "projectset", esQ)
@@ -1186,6 +1184,7 @@ func GetNextDataId(id, coll string, query map[string]interface{}) string {
 	for k, v := range query {
 		nextIdQuery[k] = v
 	}
+
 	one, _ := util.MgoM.Find(coll, nextIdQuery, `{"_id":1}`, `{"_id":1}`, true, 0, 1)
 	if one != nil && len(*one) == 1 {
 		return mgo.BsonIdToSId((*one)[0]["_id"])

+ 8 - 2
src/front/server.go

@@ -144,9 +144,11 @@ func (i *Front) ListInfo() error {
 	qu.Debug("query:", coll, query)
 	if coll == "" {
 		coll = util.Config.Fromtable
+		//coll = "markwork_wb_zcz"
 	}
 	i.SetSession("coll", coll)   //session中存入查询表
 	i.SetSession("query", query) //session中存入查询条件
+
 	listData := getListInfo(coll, query, pagenum)
 	i.T["list"] = listData
 	i.T["type"] = stype
@@ -162,6 +164,9 @@ func (i *Front) ListInfo() error {
 	i.T["hasno"] = hasno
 	i.T["notag"] = notag
 	checkedNum, allNum := GetCheckedAndAllDataInfo(query, coll) //已标和总数信息
+	if notag {
+		checkedNum = 0
+	}
 	i.T["checkednum"] = checkedNum
 	i.T["allnum"] = allNum
 	i.T["pagenum"] = pagenum
@@ -670,6 +675,7 @@ func (i *Front) SyncMarked() {
 					tmpMap[f] = val
 				}
 			}
+			tmpMap["info"] = tmp["info"]
 			lock.Lock()
 			idArr = append(idArr, id)
 			result[id] = tmpMap
@@ -834,6 +840,7 @@ func (i *Front) ReviewList() {
 		if user != "0" && user != "-1"  {
 			q["modifyuser"] = user
 		}
+		i.SetSession("query1", q)
 		datas, b := util.MgoM.Find(coll, q, bson.M{"_id": 1}, nil, false, -1, -1)
 		if b && len(*datas) > 0 {
 			i.ServeJson(map[string]interface{}{
@@ -853,7 +860,7 @@ func (i *Front) ReviewList() {
 func (i *Front) ReviewDetail(id string) error {
 	defer qu.Catch()
 	coll, _ := i.GetSession("coll").(string)
-	query, _ := i.GetSession("query").(map[string]interface{})
+	query, _ := i.GetSession("query1").(map[string]interface{})
 	rep := getDetail(id, coll)          //获取本条公告的信息
 	i.T["otherInfo"] = rep["otherInfo"] //展示关联公告信息
 	i.T["moreInfo"] = rep["moreInfo"]   //更多关联公告信息
@@ -1083,7 +1090,6 @@ func (i *Front) ReviewNext() {
 	coll := i.GetSession("coll").(string)
 	q := bson.M{"_id": bson.M{"$gt": mgo.StringTOBsonId(id)}}
 	info, b := util.MgoM.Find(coll, q, bson.M{"_id": 1}, bson.M{"_id": 1}, false, 0, 1)
-	qu.Debug(q)
 	if b && len(*info) > 0 {
 		nxid := mgo.BsonIdToSId((*info)[0]["_id"])
 		i.ServeJson(bson.M{"id": nxid, "exists": true})

+ 0 - 4
src/main.go

@@ -5,7 +5,6 @@ import (
 	//"crypto/md5"
 	//"encoding/hex"
 	_ "filter"
-	"fmt"
 	"front"
 	"log"
 
@@ -25,9 +24,6 @@ import (
 // }
 
 func init() {
-	//log.Println(MD5("jynw166_fEs2021", "1617340065", "Tgb#8diO90L"))
-	//os.Exit(0)
-	qu.Debug(fmt.Sprint(9999999.0))
 	qu.ReadConfig(&util.Config)
 	util.InitConfig()
 	//redis

+ 1 - 1
src/web/templates/list.html

@@ -176,7 +176,7 @@
                      <button type="submit" style="display: none" class="btn btn-primary" id="submitForm"></button>
                      <div  class="btn btn-primary" style="margin-left: 15px" onclick="alertsync()">查看</div>
                     <div id="markedinit"  class="btn btn-primary" style="margin-left: 15px;display:none;" onclick="markedinit()">初始化marked</div>
-<!--                     <div  class="btn btn-primary" style="margin-left: 15px" onclick="syncmarked()">同步</div>--> -->
+<!--                     <div  class="btn btn-primary" style="margin-left: 15px" onclick="syncmarked()">同步</div>-->
                  </div>
              </form>
          </div>

+ 5 - 13
src/web/templates/re_detail.html

@@ -865,19 +865,11 @@
                  alert("请先保存数据!")
                  return
               }else{
-                  $.ajax({
-                    url: "/center/review/next",
-                    type: "post",
-                    data: {"id": _id},
-                    async: false,
-                    success: function (r) {
-                        if(r.exists){
-                            window.location.href = "/center/reviewdetail/"+r.id+".html"
-                        }else {
-                            alert("没有更新数据了!")
-                        }
-                    }
-                })
+                if (nextid == "") {
+                    alert("没有更多数据了!")
+                    return
+                }
+                window.location.href = "/center/reviewdetail/"+nextid+".html"
               }
             },
             // 检查一级是否需要改变状态