xuzhiheng 4 년 전
부모
커밋
65c9540779

+ 44 - 32
src/client/client.go

@@ -3,11 +3,10 @@ package client
 import (
 	"encoding/json"
 	"fmt"
-	"log"
 	mongoutil "qfw/mongodb"
-	"time"
-
 	qu "qfw/util"
+	"strconv"
+	"time"
 	. "util"
 
 	"github.com/go-xweb/xweb"
@@ -31,8 +30,6 @@ func (this *Client) AdminIndex() {
 	defer qu.Catch()
 	user := this.GetSession("user").(map[string]interface{})
 	entId := qu.IntAll(user["ent_id"])
-	// entId = 1869
-	log.Println(user)
 	// entUserId := qu.IntAll(user["id"])
 	// appid := qu.ObjToString(user["appid"])
 	// phone := qu.ObjToString(user["phone"])
@@ -50,6 +47,7 @@ func (this *Client) AdminIndex() {
 					v["departName"] = dName
 				}
 			}
+			v["id"] = qu.SE.EncodeString(strconv.Itoa(userId))
 		}
 		this.T["entUserArr"] = *entUserArr
 	}
@@ -58,35 +56,44 @@ func (this *Client) AdminIndex() {
 
 func (this *Client) PersonnelIndex() {
 	defer qu.Catch()
-	id, _ := this.GetInteger("id")
-	if id == 0 {
+	id := this.GetString("id")
+	if this.Method() == "POST" {
+		start, _ := this.GetInteger("start")
+		limit, _ := this.GetInteger("length")
+		draw, _ := this.GetInteger("draw")
+		entUserId := 0
 		user := this.GetSession("user").(map[string]interface{})
-		entId := qu.IntAll(user["ent_id"])
-		entUserId := qu.IntAll(user["id"])
-		// entId = 1686
-		// entUserId = 2520
-		// appid := qu.ObjToString(user["appid"])
-		// phone := qu.ObjToString(user["phone"])
-		entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, 0, 10)
-		if ok && entRuleArr != nil && *entRuleArr != nil && len(*entRuleArr) > 0 {
-			this.T["entRuleArr"] = *entRuleArr
+		if id == "" {
+			entUserId = qu.IntAll(user["id"])
+		} else {
+			entUserId, _ = strconv.Atoi(qu.SE.DecodeString(id))
 		}
-	} else {
-		user := this.GetSession("user").(map[string]interface{})
 		entId := qu.IntAll(user["ent_id"])
-		entUserId := id
-		// entId = 1686
-		// entUserId = 2520
-		// appid := qu.ObjToString(user["appid"])
-		// phone := qu.ObjToString(user["phone"])
-		entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, 0, 10)
+		count := Mgo.Count("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId})
+		entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, start, limit)
 		if ok && entRuleArr != nil && *entRuleArr != nil && len(*entRuleArr) > 0 {
-			this.T["entRuleArr"] = *entRuleArr
+			for _, v := range *entRuleArr {
+				ruleid := mongoutil.BsonIdToSId(v["_id"])
+				v["_id"] = qu.SE.EncodeString(ruleid)
+			}
+			this.ServeJson(map[string]interface{}{
+				"draw":            draw,
+				"data":            *entRuleArr,
+				"recordsFiltered": count,
+				"recordsTotal":    count,
+			})
+		} else {
+			this.ServeJson(map[string]interface{}{
+				"draw":            draw,
+				"data":            nil,
+				"recordsFiltered": 0,
+				"recordsTotal":    0,
+			})
 		}
+	} else {
+		this.T["id"] = id
+		this.Render("/client/personnelIndex.html")
 	}
-	this.T["id"] = id
-	this.T["preview_href"] = PreviewHref
-	this.Render("/client/personnelIndex.html")
 }
 
 // 对外客户删除 部门规则
@@ -104,7 +111,8 @@ func (c *Client) CuserRuleCreate() {
 	if c.Method() == "POST" {
 		user := c.GetSession("user").(map[string]interface{})
 		data := GetPostForm(c.Request)
-		entUserId, err := c.GetInteger("entUserId")
+		entstr := c.GetString("entUserId")
+		entUserId, err := strconv.Atoi(entstr)
 		if err != nil {
 			entUserId = 0
 		}
@@ -166,7 +174,8 @@ func (c *Client) CuserRuleCreate() {
 		user := c.GetSession("user").(map[string]interface{})
 		c.T["did"] = user["ent_id"]
 		c.T["cid"] = user["id"]
-		c.T["entUserId"], _ = c.GetInteger("entUserId")
+		entstr := qu.SE.DecodeString(c.GetString("entUserId"))
+		c.T["entUserId"], _ = strconv.Atoi(entstr)
 		c.T["province"] = Province
 		c.T["city"] = ProvinceCitys
 		c.T["district"] = CityDistricts
@@ -178,13 +187,14 @@ func (c *Client) CuserRuleCreate() {
 		c.T["buyerClass"] = BuyerClass
 		c.T["buyerClassMap"] = BuyerClassMap
 		c.T["scopeClass"] = ScopeClassMap
+		c.T["preview_href"] = PreviewHref
 		c.Render("client/cuser_rule_create.html", &c.T)
 	}
 }
 
 func (c *Client) CuserRuleEdit() {
 	defer qu.Catch()
-	id := c.GetString("id")
+	id := qu.SE.DecodeString(c.GetString("id"))
 	query := bson.M{"_id": mongoutil.StringTOBsonId(id)}
 	data, _ := Mgo.FindOneByField("entniche_rule", query, `{}`)
 	(*data)["id"] = mongoutil.BsonIdToSId((*data)["_id"])
@@ -202,6 +212,7 @@ func (c *Client) CuserRuleEdit() {
 	c.T["buyerClass"] = BuyerClass
 	c.T["buyerClassMap"] = BuyerClassMap
 	c.T["scopeClass"] = ScopeClassMap
+	c.T["preview_href"] = PreviewHref
 	c.Render("client/cuser_rule_edit.html", &c.T)
 }
 
@@ -212,6 +223,7 @@ func (this *Client) DataPreview() {
 func (this *Client) ExportLog() {
 	if this.Method() == "POST" {
 		id, _ := this.GetInteger("id")
+
 		start, _ := this.GetInteger("start")
 		limit, _ := this.GetInteger("length")
 		draw, _ := this.GetInteger("draw")
@@ -244,7 +256,7 @@ func (this *Client) ExportLog() {
 			})
 		}
 	} else {
-		id, _ := this.GetInteger("id")
+		id, _ := strconv.Atoi(qu.SE.DecodeString(this.GetString("id")))
 		this.T["id"] = id
 		this.Render("client/exportLog.html", &this.T)
 	}

+ 6 - 7
src/front/front.go

@@ -122,7 +122,7 @@ func (f *Front) Login() {
 		log.Println("验证码验证通过")
 		// 3. 验证用户导出权限  确认认用户是否有数据导出权限
 		loginUser := JyMysql.SelectBySql("select id, name,ent_id,phone,export_power,name from entniche_user where phone=? and export_power=1", phone)
-		if loginUser==nil ||len(*loginUser) == 0 {
+		if loginUser == nil || len(*loginUser) == 0 {
 			log.Println("该用户无数据导出权限")
 			f.ServeJson(map[string]interface{}{
 				"code":    0,
@@ -168,7 +168,7 @@ func (f *Front) ChooseEnt() {
 		log.Println(entId)
 		// 2. 确认该手机号有数据导出权限
 		loginUser := JyMysql.SelectBySql("select id, name,ent_id,phone,export_power,name from entniche_user where phone=? and export_power=1 and ent_id=?", info["phone"], qu.IntAll(entId))
-		if loginUser==nil||len(*loginUser) == 0 {
+		if loginUser == nil || len(*loginUser) == 0 {
 			f.ServeJson(map[string]interface{}{
 				"code":    0,
 				"status":  false,
@@ -450,8 +450,7 @@ func SendPhoneCode(f *Front, phone string) {
 	}
 	//发送短信
 	param := map[string]string{"code": s_ranNum}
-	log.Println("短信验证码", phone, s_ranNum)
-	log.Println(param)
+	log.Println("短信验证码", phone, s_ranNum, param)
 	// SendSMS("2828060", phone, param)
 }
 
@@ -473,7 +472,7 @@ func LoginCheck(f *Front, entId int, loginUser map[string]interface{}, userPhone
 	log.Println(entId)
 	isExist, _ := Mgo.FindOne("datatag_export_config", query2)
 	log.Println(isExist)
-	if isExist==nil||len(*isExist) == 0 {
+	if isExist == nil || len(*isExist) == 0 {
 		f.ServeJson(map[string]interface{}{
 			"code":    0,
 			"status":  false,
@@ -483,7 +482,7 @@ func LoginCheck(f *Front, entId int, loginUser map[string]interface{}, userPhone
 	}
 	// 3. 查询企业管理员信息及手机号
 	entInfo := JyMysql.SelectBySql("select phone,name from entniche_info WHERE id = ?", entId)
-	if entInfo==nil||len(*entInfo) == 0 {
+	if entInfo == nil || len(*entInfo) == 0 {
 		f.ServeJson(map[string]interface{}{
 			"code":    0,
 			"status":  false,
@@ -497,7 +496,7 @@ func LoginCheck(f *Front, entId int, loginUser map[string]interface{}, userPhone
 		"username": (*entInfo)[0]["name"],
 	}
 	entMgoInfo, ok := MgoCus.FindOne("user", query)
-	if !ok || len(*entMgoInfo)==0{
+	if !ok || len(*entMgoInfo) == 0 {
 		//	企业信息查询失败
 		f.ServeJson(map[string]interface{}{
 			"code":    0,

+ 37 - 5
src/service/private_service.go

@@ -49,13 +49,14 @@ func (f *Private) Keydatademo(world string) {
 		}
 		entId := qu.IntAll((*tagfield)["entId"])
 		entUserId := qu.IntAll((*tagfield)["entUserId"])
+		dataConfig, _ := Mgo.FindOne("datatag_export_config", map[string]interface{}{"ent_id": entId})
 		current := GetCurrentCount2(entId, entUserId)
 		log.Println("数据余额", current)
 		tmp["current"] = current
 		if (*tagfield) != nil && len(*tagfield) > 0 {
-			if qu.IntAll((*tagfield)["i_extfieldstype"]) == Standard {
+			if qu.IntAll((*dataConfig)["dataType"]) == Standard {
 				tmp["fieldtype"] = Standardstr
-			} else if qu.IntAll((*tagfield)["i_extfieldstype"]) == Advanced {
+			} else if qu.IntAll((*dataConfig)["dataType"]) == Advanced {
 				tmp["fieldtype"] = Advancedstr
 			} else {
 				f.ServeJson(map[string]string{
@@ -63,6 +64,7 @@ func (f *Private) Keydatademo(world string) {
 				})
 				return
 			}
+			tmp["fields"] = (*dataConfig)["fields"]
 			tmp["total"] = qu.Int64All((*tagfield)["i_estotal"])
 			tmp["customername"] = qu.ObjToString((*tagfield)["s_customer"])
 			datas, _ := Mgo.Find("tagsdata", bson.M{"s_dataid": world}, `{"publishtime":-1}`, nil, false, -1, -1)
@@ -146,6 +148,7 @@ func (f *Private) Keydataoption(world string) {
 	datas, _ := Mgo.FindOne("entniche_rule", bson.M{"s_dataid": world})
 	entId := qu.IntAll((*datas)["entId"])
 	entUserId := qu.IntAll((*datas)["entUserId"])
+	dataConfig, _ := Mgo.FindOne("datatag_export_config", map[string]interface{}{"ent_id": entId})
 	current := GetCurrentCount2(entId, entUserId)
 	log.Println("数据余额", current)
 	filterStr := ""
@@ -205,9 +208,14 @@ func (f *Private) Keydataoption(world string) {
 	}
 	if !isFirst {
 		if len(infoArr) > 0 {
-			dataType := qu.IntAll((*datas)["i_extfieldstype"])
+			fields := map[string]interface{}{}
+			dataType := qu.IntAll((*dataConfig)["dataType"])
+			if (*dataConfig)["fields"] != nil {
+				fieldsMap := qu.ObjToMap((*dataConfig)["fields"])
+				fields = *fieldsMap
+			}
 			s_name := qu.ObjToString((*datas)["s_name"])
-			xlsxUrl := GetXlsxfile(infoArr, dataType, s_name)
+			xlsxUrl := GetXlsxfile(infoArr, dataType, s_name, fields)
 			log.Println("生成完成", xlsxUrl)
 			exportId := SaveExportLog2(entId, entUserId, len(infoArr), newCount, xlsxUrl, "1", filterStr)
 			DeductNum2(entId, newCount, entUserId, exportId)
@@ -222,7 +230,7 @@ func (f *Private) Keydataoption(world string) {
 	f.ServeJson(res)
 }
 
-func GetXlsxfile(mMap []map[string]interface{}, dataType int, fn string) string {
+func GetXlsxfile(mMap []map[string]interface{}, dataType int, fn string, fields map[string]interface{}) string {
 	xf, err := xlsx.OpenFile("web/res/fields.xlsx")
 	if err != nil {
 		log.Println("fields file not foud", err.Error())
@@ -234,6 +242,13 @@ func GetXlsxfile(mMap []map[string]interface{}, dataType int, fn string) string
 	style.Alignment.Horizontal = "center"
 	if dataType == 1 {
 		sh := xf.Sheets[0]
+		if len(fields) > 0 {
+			for _, v := range fields {
+				cell := sh.Rows[0].AddCell()
+				cell.SetValue(v)
+				cell.SetStyle(style)
+			}
+		}
 		for i, v := range mMap {
 			row := sh.AddRow()
 			row.AddCell().SetInt(i + 1)
@@ -259,10 +274,22 @@ func GetXlsxfile(mMap []map[string]interface{}, dataType int, fn string) string
 			row.AddCell().SetValue(v["jybxhref"])
 			ids := SE.EncodeString(qu.ObjToString(v["id"]))
 			row.AddCell().SetValue(ids)
+			if len(fields) > 0 {
+				for h, _ := range fields {
+					row.AddCell().SetValue(v[h])
+				}
+			}
 		}
 		xf.Sheets = xf.Sheets[0:1]
 	} else if dataType == 2 {
 		sh := xf.Sheets[1]
+		if len(fields) > 0 {
+			for _, v := range fields {
+				cell := sh.Rows[0].AddCell()
+				cell.SetValue(v)
+				cell.SetStyle(style)
+			}
+		}
 		for _, v := range mMap {
 			row := sh.AddRow()
 			row.AddCell().SetValue(v["s_matchkey"])
@@ -308,6 +335,11 @@ func GetXlsxfile(mMap []map[string]interface{}, dataType int, fn string) string
 			row.AddCell().SetValue(v["company_email"])
 			ids := SE.EncodeString(qu.ObjToString(v["id"]))
 			row.AddCell().SetValue(ids)
+			if len(fields) > 0 {
+				for h, _ := range fields {
+					row.AddCell().SetValue(v[h])
+				}
+			}
 		}
 		xf.Sheets = xf.Sheets[1:2]
 	}

BIN
src/web/res/fields.xlsx


+ 16 - 28
src/web/templates/client/adminIndex.html

@@ -28,7 +28,7 @@
                                             <a class="btn btn-default" onclick="del_Depart()">删除</a>
                                         </div> -->
                                         <tr>
-                                            <th></th>
+                                            <!-- <th></th> -->
                                             <th>编号</th>
                                             <th>部门名称</th>
                                             <th>姓名</th>
@@ -76,7 +76,6 @@
 <script>
     // menuActive("/customer/list");
     var entUserArr = {{.T.entUserArr}};
-    console.log(entUserArr);
 
     $(document).ready(function () {
         $('#departTable').DataTable({
@@ -86,21 +85,29 @@
             "ordering": true,
             "info": true,
             "autoWidth": true,
+            "data": entUserArr,
             "language": {
                 "url": "/dist/js/dataTables.chinese.lang"
             },
-            "data": entUserArr,
             "fnDrawCallback": function () {
-                this.api().column(1).nodes().each(function (cell, i) {
+                $("ul.pagination").prepend("&nbsp;&nbsp;&nbsp;转到第 <input type='text' id='changePage'   style='width:20px;'> 页    <a type='text' href='javascript:void(0);' id='dataTable-btn' style='text-align:center'>GO</a>");
+                $('#dataTable-btn').click(function (e) {
+                    var redirectpage = 0
+                    if ($("#changePage").val() && $("#changePage").val() > 0) {
+                        var redirectpage = $("#changePage").val() - 1;
+                    }
+                    ttable.page(redirectpage).draw(false);
+                });
+                this.api().column(0).nodes().each(function (cell, i) {
                     cell.innerHTML = i + 1;
                 });
             },
             "columns": [
-                {
-                    "data": function () {
-                        return `<input type="checkbox" name="ckb-depart" onclick="singleSelect1(this)" style="text-align: center">`
-                    }, width: "5%"
-                },
+                // {
+                //     "data": function () {
+                //         return `<input type="checkbox" name="ckb-depart" onclick="singleSelect1(this)" style="text-align: center">`
+                //     }, width: "5%"
+                // },
                 {"data": null, width: "5%"},
                 {
                     "data": "departName", width: "30%"
@@ -160,23 +167,4 @@
         }
     }
     
-
-    // function saveCuser() {
-    //     $.ajax({
-    //         url: "/client/customer/save",
-    //         type: 'POST',
-    //         contentType: "application/json",
-    //         data: JSON.stringify(dataMap),
-    //         dataType: "json",
-    //         success: function (r) {
-    //             console.log(r.rep)
-    //             if (r.rep) {
-    //                 showTip("保存成功", 500);
-    //                 window.location.reload()
-    //             } else {
-    //                 showTip("保存失败", 500);
-    //             }
-    //         }
-    //     })
-    // }
 </script>

+ 8 - 1
src/web/templates/client/cuser_rule_create.html

@@ -23,9 +23,9 @@
                             class="fa fa-fw fa-cloud-upload fa-lg"></i>导入关键词
                 </button>
                 <a class="btn btn-sm btn-instagram" onclick="produceData()"><i class="fa fa-fw fa-database fa-lg"></i>生成数据</a>
+                <button id="previewDatas" class="btn btn-warning btn-sm" onclick="previewData()"><i class="fa fa-fw fa-eye fa-lg"></i>数据预览</button>
             </small>
             <a class="btn btn-primary btn-sm" id="back" style="float: right"> 返回</a>
-
         </h1>
 
     </section>
@@ -401,6 +401,7 @@
 {{include "com/footer.html"}}
 <script>
     $('#back').attr("href", "javascript:history.go(-1)")
+    $("#previewDatas").hide()
 
     // menuActive("/customer/list");
     var state = 1;
@@ -1540,6 +1541,7 @@
                     $('#estxt').val(r.s_esquery);
                     state = 2;
                     showTip("保存成功", 1000);
+                    $("#previewDatas").show()
                 } else {
                     showTip("保存失败", 1000);
                 }
@@ -1750,4 +1752,9 @@
         }
         return {flag: flag, v1: v1, v2: v2}
     }
+    
+    function previewData(){
+        var href = {{.T.preview_href}}+"?type=private" + "&key=" + s_dataid;
+        window.open(href);
+    }
 </script>

+ 6 - 2
src/web/templates/client/cuser_rule_edit.html

@@ -49,7 +49,7 @@
                     <input type='file' name='xlsx' id='file'/>
                 </form>
                 <a class="btn btn-sm btn-instagram" onclick="produceData()"><i class="fa fa-fw fa-database fa-lg"></i>生成数据</a>
-
+                <button id="previewData" class="btn btn-warning btn-sm" onclick="previewData()"><i class="fa fa-fw fa-eye fa-lg"></i>数据预览</button>
             </small>
             <a class="btn btn-primary btn-sm" id="back" style="float: right"> 返回</a>
 
@@ -444,7 +444,6 @@
     // menuActive("/customer/list");
     var clearkeyMatchArr = ["detail", "title"];
     var dataMap = {{.T.data}};
-    console.log(dataMap)
     var o_rules = {{.T.data.o_rules}};
     var app = angular.module('app', ["wui.date"]);       //时间插件
     var province = {{.T.province}};
@@ -1934,5 +1933,10 @@
         }
         return {flag: flag, v1: v1, v2: v2}
     }
+    
+    function previewData(){
+        var href = {{.T.preview_href}}+"?type=private" + "&key=" + dataMap.s_dataid;
+        window.open(href);
+    }
 
 </script>

+ 7 - 7
src/web/templates/client/exportLog.html

@@ -29,7 +29,7 @@
                                     <table id="departTable" class="table table-bordered">
                                         <thead>
                                         <tr>
-                                            <th></th>
+                                            <!-- <th></th> -->
                                             <th>编号</th>
                                             <th>姓名</th>
                                             <th>导出时间</th>
@@ -75,16 +75,16 @@
                 "url": "/dist/js/dataTables.chinese.lang"
             },
             "fnDrawCallback": function () {
-                this.api().column(1).nodes().each(function (cell, i) {
+                this.api().column(0).nodes().each(function (cell, i) {
                     cell.innerHTML = i + 1;
                 });
             },
             "columns": [
-                {
-                    "data": function () {
-                        return `<input type="checkbox" name="ckb-depart" onclick="singleSelect1(this)" style="text-align: center">`
-                    }, width: "5%"
-                },
+                // {
+                //     "data": function () {
+                //         return `<input type="checkbox" name="ckb-depart" onclick="singleSelect1(this)" style="text-align: center">`
+                //     }, width: "5%"
+                // },
                 {"data": null, width: "5%"},
                 {
                     "data": "user_name", width: "10%"

+ 17 - 22
src/web/templates/client/personnelIndex.html

@@ -16,7 +16,7 @@
             <div class="col-xs-12">
                 <div class="box">
                     <div class="box-body">
-                        <table id="dataTable" class="table table-bordered table-hover">
+                        <table id="dataTable" class="table table-bordered">
                             <thead>
                             <tr>
                                 <th>编号</th>
@@ -25,7 +25,7 @@
                                 <!-- <th>状态</th> -->
                                 <th>操作</th>
                                 <!--                                <th>功能</th>-->
-                                <th>查看</th>
+                                <!-- <th>查看</th> -->
                             </tr>
                             </thead>
                         </table>
@@ -63,8 +63,6 @@
 {{include "com/footer.html"}}
 <script>
     // menuActive("/customer/list");
-    var entRuleArr = {{.T.entRuleArr}};
-    console.log(entRuleArr);
     $('#addTag').attr("href", "/client/rule/create?entUserId="+{{.T.id}})
     $(function () {
         ttable = $('#dataTable').DataTable({
@@ -74,10 +72,15 @@
             "ordering": true,
             "info": true,
             "autoWidth": true,
+            "serverSide": true,
+            "ajax": {
+                "url": "/personnel/index",
+                "type": "post",
+                "data": {"id": {{.T.id}}}
+            },
             "language": {
                 "url": "/dist/js/dataTables.chinese.lang"
             },
-            "data": entRuleArr,
             "fnDrawCallback": function () {
                 $("ul.pagination").prepend("&nbsp;&nbsp;&nbsp;转到第 <input type='text' id='changePage'   style='width:20px;'> 页    <a type='text' href='javascript:void(0);' id='dataTable-btn' style='text-align:center'>GO</a>");
                 $('#dataTable-btn').click(function (e) {
@@ -130,15 +133,15 @@
                 <!--                          '</div>';-->
                 <!--                      return tmp-->
                 <!--                }},-->*/
-                {
-                    "data": "_id", width: "15%", render: function (val, a, row, pos) {
-                        tmp = '<div xmlns="http://www.w3.org/1999/html">' +
-                            '<button class="btn btn-sm btn-instagram" onclick="preview(\'' + row.s_dataid + '\')">数据预览</button>&nbsp;&nbsp;' +
-                            // <!--                      '<a class="btn btn-sm btn-success" href="/service/rule/history?tagid='+val+'">变更历史</a>'+-->
-                            '</div>';
-                        return tmp
-                    }
-                }
+                // {
+                //     "data": "_id", width: "15%", render: function (val, a, row, pos) {
+                //         tmp = '<div xmlns="http://www.w3.org/1999/html">' +
+                //             '<button class="btn btn-sm btn-instagram" onclick="preview(\'' + row.s_dataid + '\')">数据预览</button>&nbsp;&nbsp;' +
+                //             // <!--                      '<a class="btn btn-sm btn-success" href="/service/rule/history?tagid='+val+'">变更历史</a>'+-->
+                //             '</div>';
+                //         return tmp
+                //     }
+                // }
             ]
         });
     });
@@ -160,14 +163,6 @@
         });
     }
 
-    function preview(s_dataid) {
-        var href = {{.T.preview_href}}+"?type=private" + "&key=" + s_dataid;
-        // $('#preview-href').html(href);
-        // $('#preview-href').attr("href", href);
-        // $('#modal-preview-href').modal("show")
-        window.open(href);
-    }
-
     function cancelModel() {
         $('#modal-preview-href').modal("hide");
     }