Procházet zdrojové kódy

站点信息修改

mxs před 1 rokem
rodič
revize
5334133b7c

+ 15 - 0
src/config.json

@@ -68,6 +68,21 @@
         "社会采购": [],
         "其他": []
     },
+    "sitetype2": {
+        "政府网站": ["人民政府","政府采购网","政府部门网站","公共资源交易中心","在线审批平台","政府电子商城"],
+        "企业": ["企业网站","银行","证券","保险","基金","期货","信托","代理机构"],
+        "学校": ["普通高等学校","成人高等学校","K12教育"],
+        "医院": ["一级甲等","一级乙等","一级丙等","一级其它","二级甲等","二级乙等","二级丙等","二级其它","三级甲等","三级乙等","三级丙等","三级其它"],
+        "军队": [],
+        "社会采购": []
+    },
+    "plattype": {
+        "政府采购平台": true,
+        "三方采购平台": true,
+        "企业自建招标平台": true,
+        "代理机构": true,
+        "其他平台": true
+    },
     "model": {
         "bid": {
             "type": "公告类型",

+ 3 - 0
src/front/front.go

@@ -525,6 +525,9 @@ func saveLua(o map[string]interface{}) (bool, string) {
 				"f_area":         "",
 				"f_city":         "",
 				"f_district":     "",
+				"site_subtype":   "",
+				"site_toptype":   "",
+				"type_plate":     "",
 			}
 			u.MgoEB.Save("site", siteInfo)
 		}

+ 27 - 17
src/front/site.go

@@ -31,8 +31,9 @@ func (s *Site) SiteList() {
 	if s.Method() == "POST" {
 		platform := s.GetString("platform")
 		event := s.GetString("event")
-		sitestype := s.GetString("sitestype")
-		secondstype := s.GetString("secondstype")
+		site_toptype := s.GetString("toptype")
+		site_subtype := s.GetString("subtype")
+		platetype := s.GetString("platetype")
 		area := s.GetString("area")
 		needregister, _ := s.GetInteger("needregister")
 		query := map[string]interface{}{"delete": false}
@@ -42,11 +43,14 @@ func (s *Site) SiteList() {
 		if event != "-1" {
 			query["event"] = map[string]interface{}{"$regex": event}
 		}
-		if sitestype != "-1" {
-			query["site_type"] = sitestype
+		if site_toptype != "-1" {
+			query["site_toptype"] = site_toptype
 		}
-		if secondstype != "-1" {
-			query["second_type"] = secondstype
+		if site_subtype != "-1" {
+			query["site_subtype"] = site_subtype
+		}
+		if platetype != "-1" {
+			query["type_plate"] = platetype
 		}
 		if area != "-1" {
 			query["area"] = area
@@ -99,6 +103,8 @@ func (s *Site) SiteList() {
 		//s.SetCookie(&http.Cookie{Name: "testcookie", Value: "testcookie1"})
 		s.T["events"] = events
 		s.T["sitetypes"] = sp.Config.SiteType
+		s.T["sitetypes2"] = sp.Config.SiteType2
+		s.T["plattype"] = sp.Config.PlatType
 		s.T["areas"] = util.Area
 		s.T["provinces"] = util.Province
 		s.T["citys"] = util.City
@@ -120,8 +126,9 @@ func (s *Site) SaveSite() {
 	othername := s.GetString("othername")               //别名
 	domain := s.GetString("domain")                     //域名
 	sponsor := s.GetString("sponsor")                   //主办方
-	site_type := s.GetString("site_type")               //一级类型
-	second_type := s.GetString("second_type")           //二级类型
+	type_plate := s.GetString("type_plate")             //平台类型
+	site_toptype := s.GetString("site_toptype")         //一级类型
+	site_subtype := s.GetString("site_subtype")         //二级类型
 	special_type := s.GetString("special_type")         //特殊类型
 	isneedregister, _ := s.GetInteger("isneedregister") //是否需要注册
 	isregistered, _ := s.GetInteger("isregistered")     //是否已注册
@@ -156,11 +163,12 @@ func (s *Site) SaveSite() {
 		"city":           city,
 		"district":       district,
 		"industry":       industry,
-		"site_type":      site_type,
+		"site_toptype":   site_toptype,
 		"p_site":         p_site,
 		"s_site":         s_site,
 		"sponsor":        sponsor,
-		"second_type":    second_type,
+		"type_plate":     type_plate,
+		"site_subtype":   site_subtype,
 		"special_type":   special_type,
 		"isneedregister": isneedregister,
 		"isregistered":   isregistered,
@@ -219,7 +227,7 @@ func (s *Site) ImportSite() {
 				city := r.Cells[4].Value
 				district := r.Cells[5].Value
 				industry := r.Cells[6].Value
-				site_type := r.Cells[7].Value
+				site_toptype := r.Cells[7].Value
 				p_site := r.Cells[8].Value
 				s_site := r.Cells[9].Value
 				tmpdomain, status, event, platform, infotype, specialtype, remarktime := util.GetLuasInfoBySite(site, area, city, district)
@@ -239,7 +247,7 @@ func (s *Site) ImportSite() {
 					"city":          city,
 					"district":      district,
 					"industry":      industry,
-					"site_type":     site_type,
+					"site_toptype":  site_toptype,
 					"p_site":        p_site,
 					"s_site":        s_site,
 					"spider_status": status,
@@ -313,11 +321,11 @@ func (s *Site) UpdateSite() {
 	update := map[string]interface{}{}
 	if updatetype == "important" { //重点
 		update["important"] = qu.IntAll(val)
-	} else if updatetype == "classone" { //一级类型
-		update["site_type"] = val
-		update["second_type"] = "" //更新一级类型,二级类型置空
-	} else if updatetype == "classtwo" { //二级类型
-		update["second_type"] = val
+	} else if updatetype == "toptype" { //一级类型
+		update["site_toptype"] = val
+		update["site_subtype"] = "" //更新一级类型,二级类型置空
+	} else if updatetype == "subtype" { //二级类型
+		update["site_subtype"] = val
 	} else if updatetype == "area" { //发布省份
 		update["f_area"] = val
 		update["f_city"] = ""
@@ -327,6 +335,8 @@ func (s *Site) UpdateSite() {
 		update["f_district"] = ""
 	} else if updatetype == "district" { //发布县区
 		update["f_district"] = val
+	} else if updatetype == "type_plate" { //发布县区
+		update["type_plate"] = val
 	}
 	if util.MgoEB.UpdateById("site", id, map[string]interface{}{"$set": update}) {
 		s.Write("y")

+ 10 - 3
src/front/spider.go

@@ -1310,9 +1310,16 @@ func (f *Front) BatchShelves() {
 	if IsHasUpState(auth, Sp_state_5) {
 		if state == 5 { //批量上架
 			for _, code := range codes {
-				_, err = UpStateAndUpSpider(code, "", "", "", Sp_state_5)
-				if err != nil {
-					errCode = append(errCode, code)
+				if _, ok := u.CodeTimeCache.Get(code); ok { //避免短时间内重复上架
+					errCode = append(errCode, code+"重复上架")
+				} else {
+					u.CodeTimeCache.Set(code, "", time.Minute*2) //上架时,内存记录上架爬虫
+					_, err = UpStateAndUpSpider(code, "", "", "", Sp_state_5)
+					if err != nil {
+						errCode = append(errCode, code)
+					} else {
+						u.CodeTimeCache.Del(code) //上架成功后,删除内存记录
+					}
 				}
 			}
 		} else { //批量下架

+ 39 - 0
src/util/util.go

@@ -9,6 +9,7 @@ import (
 	"sort"
 	sp "spiderutil"
 	"strings"
+	"sync"
 	"time"
 
 	"github.com/yuin/gopher-lua"
@@ -543,3 +544,41 @@ func GetTime(day int) int64 {
 	t, _ := time.ParseInLocation(qu.Date_Short_Layout, timeStr, time.Local)
 	return t.Unix()
 }
+
+var CodeTimeCache = &TimeCache{
+	Data:  map[string]interface{}{},
+	mutex: sync.Mutex{},
+}
+
+type TimeCache struct {
+	Data  map[string]interface{}
+	mutex sync.Mutex
+}
+
+func (c *TimeCache) Set(key string, value interface{}, duration time.Duration) {
+	c.mutex.Lock()
+	defer c.mutex.Unlock()
+
+	c.Data[key] = value
+
+	go func() {
+		time.Sleep(duration)
+		c.mutex.Lock()
+		defer c.mutex.Unlock()
+		delete(c.Data, key)
+	}()
+}
+
+func (c *TimeCache) Get(key string) (interface{}, bool) {
+	c.mutex.Lock()
+	defer c.mutex.Unlock()
+
+	value, ok := c.Data[key]
+	return value, ok
+}
+
+func (c *TimeCache) Del(key string) {
+	c.mutex.Lock()
+	defer c.mutex.Unlock()
+	delete(c.Data, key)
+}

+ 154 - 76
src/web/templates/sitelist.html

@@ -43,15 +43,21 @@
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label for="edit-site_type" class="col-sm-2 control-label">一级类型:</label>
+                                <label for="edit-type_plate" class="col-sm-2 control-label">平台类型:</label>
                                 <div class="col-sm-10">
-                                    <select class="form-control" name="site_type" onchange="siteTypeChange(this.value)", id="edit-site_type"></select>
+                                    <select class="form-control" name="type_plate" id="edit-type_plate"></select>
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label for="edit-second_type" class="col-sm-2 control-label">二级类型:</label>
+                                <label for="edit-site_toptype" class="col-sm-2 control-label">一级类型:</label>
                                 <div class="col-sm-10">
-                                    <select class="form-control" name="second_type" id="edit-second_type"></select>
+                                    <select class="form-control" name="site_toptype" onchange="siteTypeChange(this.value)", id="edit-site_toptype"></select>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="edit-site_subtype" class="col-sm-2 control-label">二级类型:</label>
+                                <div class="col-sm-10">
+                                    <select class="form-control" name="site_subtype" id="edit-site_subtype"></select>
                                 </div>
                             </div>
                             <div class="form-group">
@@ -202,15 +208,21 @@
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label for="add-site_type" class="col-sm-2 control-label">一级类型:</label>
+                                <label for="add-type_plate" class="col-sm-2 control-label">平台类型:</label>
+                                <div class="col-sm-10">
+                                    <select class="form-control" name="type_plate" id="add-type_plate"></select>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label for="add-site_toptype" class="col-sm-2 control-label">一级类型:</label>
                                 <div class="col-sm-10">
-                                    <select class="form-control" name="site_type" onchange="siteTypeChange(this.value)" id="add-site_type"></select>
+                                    <select class="form-control" name="site_toptype" onchange="siteTypeChange(this.value)" id="add-site_toptype"></select>
                                 </div>
                             </div>
                             <div class="form-group">
-                                <label for="add-second_type" class="col-sm-2 control-label">二级类型:</label>
+                                <label for="add-site_subtype" class="col-sm-2 control-label">二级类型:</label>
                                 <div class="col-sm-10">
-                                    <select class="form-control" name="second_type" id="add-second_type"></select>
+                                    <select class="form-control" name="site_subtype" id="add-site_subtype"></select>
                                 </div>
                             </div>
                             <div class="form-group">
@@ -361,6 +373,7 @@
                     <th>省份</th>
                     <th>城市</th>
                     <th>区县</th>
+                    <th>平台类型</th>
                     <th>一级类型</th>
                     <th>二级类型</th>
 <!--                    <th>行业</th>-->
@@ -384,24 +397,25 @@
 </section>
 
 <script>
-var siteTypesMap = {};
+var siteTypesMap = {{.T.sitetypes2}};
+var platTypeMap = {{.T.plattype}};
 var areas = {{.T.areas}};
 var provinces = {{.T.provinces}};
 var citys = {{.T.citys}};
 $(function(){
-    siteTypesMap = {{.T.sitetypes}};
-    // $("#edit-site_type").append("<option value=''>--请选择网站一级类型--</option>");
-    // $("#edit-second_type").append("<option value=''>--请选择网站二级类型--</option>");
+    // siteTypesMap = {{.T.sitetypes}};
+    // $("#edit-site_toptype").append("<option value=''>--请选择网站一级类型--</option>");
+    // $("#edit-site_subtype").append("<option value=''>--请选择网站二级类型--</option>");
     // for(var k in siteTypesMap){
-    //     $("#add-site_type").append("<option value='"+k+"'>"+k+"</option>")
-    //     $("#edit-site_type").append("<option value='"+k+"'>"+k+"</option>")
+    //     $("#add-site_toptype").append("<option value='"+k+"'>"+k+"</option>")
+    //     $("#edit-site_toptype").append("<option value='"+k+"'>"+k+"</option>")
     // }
 	ttable=$('#sitelist').DataTable({
 		"language": {
               "url": "/js/dataTables.chinese.lang"
           },
 		"columnDefs": [
-		    { "orderable": false, "targets": [0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17] },
+		    { "orderable": false, "targets": [0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,16,18] },
             //重点
             {"targets":[5], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                 var aInput;
@@ -427,8 +441,28 @@ $(function(){
                     cellData = text;
                 });
             }},
-            //一级类型
+            //平台类型
             {"targets":[9], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
+                    var aInput;
+                    $(cell).click(function () {
+                        $(this).html(selectPlateType(rowData._id));
+                        var aInput = $(this).find(":input");
+                        aInput.focus().val(cellData);
+                    });
+                    $(cell).on("click", ":input", function (e) {
+                        e.stopPropagation();
+                    });
+                    $(cell).on("change", ":input", function () {
+                        $(this).blur();
+                    });
+                    $(cell).on("blur", ":input", function () {
+                        var text = $(this).find("option:selected").text();
+                        ttable.cell(cell).data(text);
+                        cellData = text;
+                    });
+                }},
+            //一级类型 toptype
+            {"targets":[10], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                 var aInput;
                 $(cell).click(function () {
                     $(this).html(selectClassOneSiteTypes(rowData._id));
@@ -447,11 +481,11 @@ $(function(){
                     cellData = text;
                 });
             }},
-            //二级类型
-            {"targets":[10], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
+            //二级类型 subtype
+            {"targets":[11], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                 var aInput;
                 $(cell).click(function () {
-                    $(this).html(selectClassTwoSiteTypes(rowData._id,rowData.site_type));
+                    $(this).html(selectClassTwoSiteTypes(rowData._id,rowData.site_toptype));
                     var aInput = $(this).find(":input");
                     aInput.focus().val(cellData);
                 });
@@ -468,7 +502,7 @@ $(function(){
                 });
             }},
             //发布省份
-            {"targets":[11], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
+            {"targets":[12], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                     var aInput;
                     $(cell).click(function () {
                         $(this).html(selectArea(rowData._id));
@@ -488,7 +522,7 @@ $(function(){
                     });
                 }},
             //发布城市
-            {"targets":[12], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
+            {"targets":[13], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                     var aInput;
                     $(cell).click(function () {
                         $(this).html(selectCity(rowData._id,rowData.f_area));
@@ -511,7 +545,7 @@ $(function(){
                     });
                 }},
             //发布县区
-            {"targets":[13], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
+            {"targets":[14], createdCell: function (cell, cellData, rowData, rowIndex, colIndex) {
                     var aInput;
                     $(cell).click(function () {
                         $(this).html(selectDistrict(rowData._id,rowData.f_area,rowData.f_city));
@@ -575,9 +609,9 @@ $(function(){
           { "data": "area"},
           { "data": "city"},
           { "data": "district"},
-          // { "data": "industry"},
-          { "data": "site_type"},
-          { "data": "second_type"},
+          { "data": "type_plate"},
+          { "data": "site_toptype"},
+          { "data": "site_subtype"},
           { "data": "f_area"},
           { "data": "f_city"},
           { "data": "f_district"},
@@ -627,8 +661,9 @@ $(function(){
 		"fnServerParams": function (e) {
 		    var platform=$("#platform").val()
             var event = $("#event").val();
-            var sitestype = $("#sitestype").val();
-            var secondstype = $("#secondstype").val();
+            var toptype = $("#toptype").val();
+            var subtype = $("#subtype").val();
+            var platetype = $("#platetype").val();
             var area = $("#areas").val();
             var needregister = $("#needregister").val();
             if(platform){
@@ -641,15 +676,20 @@ $(function(){
             }else{
                 e.event="-1"
             }
-            if (sitestype == undefined){
-                e.sitestype="-1";
+            if (toptype == undefined){
+                e.toptype="-1";
+            }else{
+                e.toptype = toptype;
+            }
+            if (subtype == undefined){
+                e.subtype="-1";
             }else{
-                e.sitestype = sitestype;
+                e.subtype = subtype;
             }
-            if (secondstype == undefined){
-                e.secondstype="-1";
+            if (platetype == undefined){
+                e.platetype="-1";
             }else{
-                e.secondstype = secondstype;
+                e.platetype = platetype;
             }
             if(area){
                 e.area = area;
@@ -711,31 +751,44 @@ $(function(){
         $("#sitelist_filter").prepend("&nbsp;&nbsp;");
         $("#sitelist_filter").prepend(selectNeedregister);
         //网站二级类型
-        var secondtype ="<option value='-1'>全部</option>";
+        var subtype ="<option value='-1'>全部</option>";
         for(i in siteTypesMap){
             for(j in siteTypesMap[i]){
-                secondtype+="<option value='"+siteTypesMap[i][j]+"'>"+siteTypesMap[i][j]+"</option>";
+                subtype+="<option value='"+siteTypesMap[i][j]+"'>"+siteTypesMap[i][j]+"</option>";
             }
         }
-        secondtype+="<option value=''>空</option>";
-        var selectSecondStype="<div class='form-group'><label for='name'>二级类型:</label>"+
-            "<select id='secondstype' onchange='checkclick(this.value,\"secondstype\")' class='form-control input-sm'>"+
-            secondtype+
+        subtype+="<option value=''>空</option>";
+        var selectSubtype="<div class='form-group'><label for='name'>二级类型:</label>"+
+            "<select id='subtype' onchange='checkclick(this.value,\"subtype\")' class='form-control input-sm'>"+
+            subtype+
             "</select></div>"
         $("#sitelist_filter").prepend("&nbsp;&nbsp;");
-        $("#sitelist_filter").prepend(selectSecondStype);
+        $("#sitelist_filter").prepend(selectSubtype);
 		//网站一级类型
-        var sitestype ="<option value='-1'>全部</option>";
+        var toptype ="<option value='-1'>全部</option>";
         for(k in siteTypesMap){
-            sitestype+="<option value='"+k+"'>"+k+"</option>";
+            toptype+="<option value='"+k+"'>"+k+"</option>";
+        }
+        toptype+="<option value=''>空</option>";
+        var selectToptype="<div class='form-group'><label for='name'>一级类型:</label>"+
+            "<select id='toptype' onchange='checkclick(this.value,\"toptype\")' class='form-control input-sm'>"+
+            toptype+
+            "</select></div>"
+        $("#sitelist_filter").prepend("&nbsp;&nbsp");
+        $("#sitelist_filter").prepend(selectToptype);
+        //
+        //平台类型
+        var plateType ="<option value='-1'>全部</option>";
+        for(k in platTypeMap){
+            plateType+="<option value='"+k+"'>"+k+"</option>";
         }
-        sitestype+="<option value=''>空</option>";
-        var selectStype="<div class='form-group'><label for='name'>一级类型:</label>"+
-            "<select id='sitestype' onchange='checkclick(this.value,\"sitestype\")' class='form-control input-sm'>"+
-            sitestype+
+        plateType+="<option value=''>空</option>";
+        var selectPlateType="<div class='form-group'><label for='name'>平台类型:</label>"+
+            "<select id='platetype' onchange='checkclick(this.value,\"platetype\")' class='form-control input-sm'>"+
+            plateType+
             "</select></div>"
         $("#sitelist_filter").prepend("&nbsp;&nbsp");
-        $("#sitelist_filter").prepend(selectStype);
+        $("#sitelist_filter").prepend(selectPlateType);
         //
         $("#sitelist_wrapper .col-sm-6").css({width:"100%"})//样式
 	});
@@ -856,12 +909,17 @@ function format_X(d) {
 }
 
 function addSite() {
-    $("#add-site_type").empty();
-    $("#add-second_type").empty();
-    $("#add-site_type").append("<option value=''>--请选择网站一级类型--</option>");
-    $("#add-second_type").append("<option value=''>--请选择网站二级类型--</option>");
+    $("#add-site_toptype").empty();
+    $("#add-site_subtype").empty();
+    $("#add-site_toptype").append("<option value=''>--请选择网站一级类型--</option>");
+    $("#add-site_subtype").append("<option value=''>--请选择网站二级类型--</option>");
     for(var k in siteTypesMap){
-        $("#add-site_type").append("<option value='"+k+"'>"+k+"</option>")
+        $("#add-site_toptype").append("<option value='"+k+"'>"+k+"</option>")
+    }
+    $("#add-type_plate").empty();
+    $("#add-type_plate").append("<option value=''>--请选择平台类型--</option>");
+    for(var k in platTypeMap){
+        $("#add-type_plate").append("<option value='"+k+"'>"+k+"</option>")
     }
     $("#addsite").modal("show");
 }
@@ -910,26 +968,36 @@ function siteEdit(rowjson){
     $("#edit-industry").val(row.industry);
     $("#edit-p_site").val(row.p_site);
     $("#edit-s_site").val(row.s_site);
+    //平台类型
+    $("#edit-type_plate").empty();
+    $("#edit-type_plate").append("<option value=''>--请选择平台类型--</option>");
+    for(var k in platTypeMap){
+        if (row.type_plate == k){
+            $("#edit-type_plate").append("<option selected value='"+k+"'>"+k+"</option>");
+        }else {
+            $("#edit-type_plate").append("<option value='"+k+"'>"+k+"</option>")
+        }
+    }
     //一级类型
-    $("#edit-site_type").empty();
-    $("#edit-site_type").append("<option value=''>--请选择网站一级类型--</option>");
+    $("#edit-site_toptype").empty();
+    $("#edit-site_toptype").append("<option value=''>--请选择网站一级类型--</option>");
     //二级类型
-    $("#edit-second_type").empty();
-    $("#edit-second_type").append("<option value=''>--请选择网站二级类型--</option>");
+    $("#edit-site_subtype").empty();
+    $("#edit-site_subtype").append("<option value=''>--请选择网站二级类型--</option>");
     for(var k in siteTypesMap){
-        if (row.site_type == k){
+        if (row.site_toptype == k){
             //一级类型
-            $("#edit-site_type").append("<option selected value='"+k+"'>"+k+"</option>")
+            $("#edit-site_toptype").append("<option selected value='"+k+"'>"+k+"</option>")
             //二级类型
             for(i in siteTypesMap[k]){
-                if ( row.second_type!="" && row.second_type == siteTypesMap[k][i]){
-                    $("#edit-second_type").append("<option selected value='"+siteTypesMap[k][i]+"'>"+siteTypesMap[k][i]+"</option>");
+                if ( row.site_subtype!="" && row.site_subtype == siteTypesMap[k][i]){
+                    $("#edit-site_subtype").append("<option selected value='"+siteTypesMap[k][i]+"'>"+siteTypesMap[k][i]+"</option>");
                 }else{
-                    $("#edit-second_type").append("<option value='"+siteTypesMap[k][i]+"'>"+siteTypesMap[k][i]+"</option>");
+                    $("#edit-site_subtype").append("<option value='"+siteTypesMap[k][i]+"'>"+siteTypesMap[k][i]+"</option>");
                 }
             }
         }else {
-            $("#edit-site_type").append("<option value='"+k+"'>"+k+"</option>")
+            $("#edit-site_toptype").append("<option value='"+k+"'>"+k+"</option>")
         }
     }
     //需注册
@@ -984,6 +1052,7 @@ function siteDelete(id){
 //保存站点
 function saveSite(){
     var formdataMap = common.form.serializeArray("add-form");
+    console.log(formdataMap)
     if(formdataMap.site=="" || formdataMap.isneedregister == "-1" || formdataMap.isregistered == "-1"){
         alert("表单填写不完整!");
         return
@@ -1038,32 +1107,32 @@ function importSite(){
 }
 
 function siteTypeChange(value) {
-    $("#add-second_type").empty();
-    $("#add-second_type").append("<option value=''>--请选择网站二级类型--</option>");
-    $("#edit-second_type").empty();
-    $("#edit-second_type").append("<option value=''>--请选择网站二级类型--</option>");
+    $("#add-site_subtype").empty();
+    $("#add-site_subtype").append("<option value=''>--请选择网站二级类型--</option>");
+    $("#edit-site_subtype").empty();
+    $("#edit-site_subtype").append("<option value=''>--请选择网站二级类型--</option>");
     for(i in siteTypesMap[value]){
-        $("#add-second_type").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
-        $("#edit-second_type").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
+        $("#add-site_subtype").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
+        $("#edit-site_subtype").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
     }
 }
 
 function checkclick(value,stype){
-    if(stype == "sitestype"){
-        $("#secondstype").empty();
+    if(stype == "toptype"){
+        $("#subtype").empty();
         var secondtype ="<option value='-1'>全部</option>";
-        $("#secondstype").append(secondtype);
+        $("#subtype").append(secondtype);
         if (value != "-1"){
             for(i in siteTypesMap[value]){
-                $("#secondstype").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
+                $("#subtype").append("<option value='"+siteTypesMap[value][i]+"'>"+siteTypesMap[value][i]+"</option>");
             }
         }else{
             for(i in siteTypesMap){
                 for(j in siteTypesMap[i]){
-                    $("#secondstype").append("<option value='"+siteTypesMap[i][j]+"'>"+siteTypesMap[i][j]+"</option>");
+                    $("#subtype").append("<option value='"+siteTypesMap[i][j]+"'>"+siteTypesMap[i][j]+"</option>");
                 }
             }
-            $("#secondstype").append("<option value=''>空</option>");
+            $("#subtype").append("<option value=''>空</option>");
         }
     }
     ttable.ajax.reload();
@@ -1086,13 +1155,21 @@ function selectImportant(id){
     var siteImportant="<option value=1>是</option><option value=0>否</option>";
     return "<select onchange='updateSite(\"important\",this.value,\""+id+"\")' class='form-control input-sm'>"+siteImportant+"</select>"
 };
+//平台类型
+function selectPlateType(id){
+    var plateType = "";
+    for(var k in platTypeMap){
+        plateType += "<option value="+k+">"+k+"</option>"
+    }
+    return "<select onchange='updateSite(\"type_plate\",this.value,\""+id+"\")' class='form-control input-sm'>"+plateType+"</select>"
+};
 //一级类型网站筛选
 function selectClassOneSiteTypes(id){
     var classOneSiteTypes = "";
     for(var k in siteTypesMap){
         classOneSiteTypes += "<option value="+k+">"+k+"</option>"
     }
-    return "<select onchange='updateSite(\"classone\",this.value,\""+id+"\")' class='form-control input-sm'>"+classOneSiteTypes+"</select>"
+    return "<select onchange='updateSite(\"toptype\",this.value,\""+id+"\")' class='form-control input-sm'>"+classOneSiteTypes+"</select>"
 };
 //二级类型网站筛选
 function selectClassTwoSiteTypes(id,siteType){
@@ -1100,7 +1177,7 @@ function selectClassTwoSiteTypes(id,siteType){
     for(var k in siteTypesMap[siteType]){
         classTwoSiteTypes += "<option value="+siteTypesMap[siteType][k]+">"+siteTypesMap[siteType][k]+"</option>"
     }
-    return "<select onchange='updateSite(\"classtwo\",this.value,\""+id+"\")' class='form-control input-sm'>"+classTwoSiteTypes+"</select>"
+    return "<select onchange='updateSite(\"subtype\",this.value,\""+id+"\")' class='form-control input-sm'>"+classTwoSiteTypes+"</select>"
 };
 
 //发布省份选择
@@ -1135,6 +1212,7 @@ function selectDistrict(id,area,city){
 };
 
 function updateSite(updatetype,val,id) {
+    console.log("update---",updatetype,val)
     $.ajax({
         url:"/center/site/updatesite",
         type:"post",

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

@@ -239,7 +239,7 @@
 						var div=$("<div><div class=\"btn-group\"></div></div>")
 						var buttonEdit=$('<a type="button" class="btn btn-sm btn-default">编辑</a>');
 						var buttonDel=$('<a type="button" class="btn btn-sm btn-default">删除</a>');
-						buttonDel.attr("onclick","del('"+row['userid']+"')");
+						buttonDel.attr("onclick","del('"+row['_id']+"')");
 						buttonEdit.attr("onclick","editUserInfo('"+row['s_name']+"','"+row['s_pass']+"','"+row['s_email']+"','"+row['i_auth']+"','"+row['_id']+"','"+row['l_comeintime']+"','"+row['i_identity']+"','"+row['s_platform']+"')");
 						div.find(".btn-group").append(buttonEdit);
 						div.find(".btn-group").append(buttonDel);