Răsfoiți Sursa

Merge branch 'dev2.0' of http://192.168.3.207:8080/data_processing/data_validation into dev2.0

maxiaoshan 3 ani în urmă
părinte
comite
da481ba85e

+ 27 - 3
src/front/remark.go

@@ -588,6 +588,7 @@ func (f *Front) CheckData() {
 	qu.Catch()
 	pid := f.GetString("pid")
 	tid := f.GetString("tid")
+	stype := f.GetString("stype")
 	sourceinfo := f.GetString("s_sourceinfo")
 	if f.Method() == "POST" {
 		start, _ := f.GetInteger("start")
@@ -595,9 +596,21 @@ func (f *Front) CheckData() {
 		draw, _ := f.GetInteger("draw")
 		searchStr := f.GetString("search[value]")
 		search := strings.TrimSpace(searchStr)
-		query := map[string]interface{}{"b_istag": true}
+		query := make(map[string]interface{})
 		if tid != "" {
+			// 任务数据质检
+			query["b_istag"] = true
 			query["s_grouptaskid"] = tid
+		} else {
+			if stype == "notag" {
+				query["b_istagging"] = false // 达标
+				query["i_ckdata"] = 2
+			} else if stype == "tag" {
+				query["b_istagging"] = true //未达标
+				query["i_ckdata"] = 2
+			} else {
+				query["i_ckdata"] = 2
+			}
 		}
 		if search != "" {
 			query["$or"] = []interface{}{
@@ -619,8 +632,19 @@ func (f *Front) CheckData() {
 		if tid == "" {
 			project, _ := util.Mgo.FindById(util.PROJECTCOLLNAME, pid, map[string]interface{}{"i_importnum": 1})
 			f.T["taskNum"] = (*project)["i_importnum"]
-			tagCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"b_istag": true})
-			checkCount := util.Mgo.Count(sourceinfo, map[string]interface{}{"b_check": true})
+			query1 := make(map[string]interface{})
+			query2 := make(map[string]interface{})
+			if stype == "notag" {
+				query1["b_istagging"] = false // 达标
+				query2["b_istagging"] = false
+			} else if stype == "tag" {
+				query1["b_istagging"] = true //未达标
+				query2["b_istagging"] = true
+			}
+			query1["i_ckdata"] = 2
+			query2["b_check"] = true
+			tagCount := util.Mgo.Count(sourceinfo, query1)
+			checkCount := util.Mgo.Count(sourceinfo, query2)
 			f.T["taskTagNum"] = tagCount
 			f.T["taskCheckNum"] = checkCount
 		} else {

+ 1 - 1
src/web/templates/project/check_detail.html

@@ -918,7 +918,7 @@
                         if (nextid === "") {
                             showMsg("数据已经全部标注完")
                         } else {
-                            window.location.href = "/front/user/remark/list?pid="+pid+"&tid="+tid+"&s_sourceinfo="+coll
+                            // window.location.href = "/front/user/remark/list?pid="+pid+"&tid="+tid+"&s_sourceinfo="+coll
                         }
                     }
                 },

+ 13 - 13
src/web/templates/project/project_clear.html

@@ -38,8 +38,8 @@
                                     <div class="col-xs-5 form-group">
                                         <label class="form-inline">&nbsp;操作:
                                             <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?pid={{.T.s_projectid}}&stype=all">标注</a>
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('all')" value="分发">
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="checkMethod('all')" value="质检">
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('all')">分发</a>
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('all')">质检</a>
 <!--                                            <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
                                         </label>
                                     </div>
@@ -58,8 +58,8 @@
                                     <div class="col-xs-5 form-group">
                                         <label class="form-inline">操作:
                                             <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?pid={{.T.s_projectid}}&stype=notag">标注</a>
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('notag')" value="分发">
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="checkMethod('notag')" value="质检">
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('notag')">分发</a>
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('notag')">质检</a>
 <!--                                            <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
                                         </label>
                                     </div>
@@ -78,8 +78,8 @@
                                     <div class="col-xs-5 form-group">
                                         <label class="form-inline">操作:
                                             <a type="button" class="btn btn-sm btn-primary" href="/front/user/jymark/list?pid={{.T.s_projectid}}&stype=tag">标注</a>
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('tag')" value="分发">
-                                            <input type="button" class="btn btn-sm btn-primary" onclick="checkMethod('tag')" value="质检">
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="dispatchTask('tag')">分发</a>
+                                            <a type="button" class="btn btn-sm btn-primary" onclick="checkMethod('tag')">质检</a>
 <!--                                            <input type="button" class="btn btn-sm btn-primary" value="质检结果">-->
                                         </label>
                                     </div>
@@ -458,26 +458,26 @@
     }
 
     function checkMethod(stype) {
-        let num1 = {{ .T.allIsTagDataNum }}
-        let num2 = {{ .T.okIsTagDataNum }}
+        let num1 = {{ .T.allDataNum }}
+        let num2 = {{ .T.okAllDataNum }}
         let num3 = {{ .T.IsNotOkIsTagDataNum }}
         if (stype === "all") {
-            if (num1 <= 0) {
-                showTip("没有标注数据")
+            if (num2 <= 0) {
+                showTip("没有可质检的数据")
                 return;
             }
         }else if (stype === "notag") {
             if (num2 <= 0) {
-                showTip("没有标注数据")
+                showTip("没有可质检的数据")
                 return;
             }
         }else if (stype === "tag") {
             if (num3 <= 0) {
-                showTip("没有标注数据")
+                showTip("没有可质检的数据")
                 return;
             }
         }
-        window.location.href = "/front/user/check/data?pid=" + projectid + "&s_sourceinfo={{.T.s_sourceinfo}}"
+        window.location.href = "/front/user/check/data?pid="+projectid+"&s_sourceinfo={{.T.s_sourceinfo}}"+"&stype="+stype
     }
 
 </script>

+ 6 - 0
src/web/templates/project/remark_jy_list.html

@@ -48,6 +48,12 @@
                             <label class="form-inline" id="search-btn" style="padding-left: 10px;display: none">
                                 <input type="button" class="btn btn-sm btn-default" value="搜索" onclick="searchBtn()">
                             </label>
+                            <label for="statusSelect" class="form-inline">状态:
+                                <select class="form-control selectpicker" id="statusSelect">
+                                    <option value=-1>全部</option>
+                                    <option value=0>未标注</option>
+                                    <option value=1>已标注</option>
+                                </select></label>
                         </div>
                         <table id="dataTable" class="table table-bordered table-hover">
                             <thead>