|
@@ -0,0 +1,236 @@
|
|
|
+{{include "com/inc.html"}}
|
|
|
+<!-- Main Header -->
|
|
|
+{{include "com/header.html"}}
|
|
|
+<!-- Left side column. 权限菜单 -->
|
|
|
+{{include "com/menu.html"}}
|
|
|
+
|
|
|
+<style>
|
|
|
+ .j-input__inner {
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: inline-block;
|
|
|
+ padding: 0px 45px 0px 15px;
|
|
|
+ width: 300px;
|
|
|
+ height: 40px;
|
|
|
+ color: #1D1D1D;
|
|
|
+
|
|
|
+ background-color: #fff;
|
|
|
+ background-image: none;
|
|
|
+ line-height: 40px;
|
|
|
+ font-size: inherit;
|
|
|
+ -webkit-appearance: none;
|
|
|
+ outline: none;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ border-radius: 4px;
|
|
|
+ transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
+ }
|
|
|
+ .j-input__inner:hover {
|
|
|
+ border-color: #c0c4cc;
|
|
|
+ }
|
|
|
+ .j-input__inner:focus {
|
|
|
+ border-color: #409eff;
|
|
|
+ }
|
|
|
+ .search-icon {
|
|
|
+ position:relative;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ top: 0px;
|
|
|
+ right: 40px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<div class="content-wrapper" id="showbtn">
|
|
|
+ <section class="content-header">
|
|
|
+ <ol class="breadcrumb">
|
|
|
+ <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
|
|
|
+ <li><a href="/lua/datafind"> 数据查询</a></li>
|
|
|
+ </ol>
|
|
|
+
|
|
|
+ <br/>
|
|
|
+ </section>
|
|
|
+ <!-- Main content -->
|
|
|
+ <section class="content">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-xs-12">
|
|
|
+ <div class="box">
|
|
|
+ <div class="box-body">
|
|
|
+ <div class="tab-content">
|
|
|
+ <input class="j-input__inner" type="text" placeholder="请输入标题" id="title">
|
|
|
+ <img src="/picture/img_search.jpg" style='cursor:pointer;' class="search-icon" onclick="searchData('title')" />
|
|
|
+ <input class="j-input__inner" type="text" placeholder="请输入链接" id="href">
|
|
|
+ <img src="/picture/img_search.jpg" style='cursor:pointer;' class="search-icon" onclick="searchData('href')" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table id="dataTable" class="table table-bordered table-hover">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>编号</th>
|
|
|
+ <th>id</th>
|
|
|
+ <th>标题</th>
|
|
|
+ <th>链接</th>
|
|
|
+ <th>来源</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <!-- /.box-body -->
|
|
|
+ </div>
|
|
|
+ <!-- /.box -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </section>
|
|
|
+</div>
|
|
|
+
|
|
|
+{{include "com/footer.html"}}
|
|
|
+<script>
|
|
|
+ menuActive("datafind");
|
|
|
+ $(document).ready(function () {
|
|
|
+ ttable = $('#dataTable').DataTable({
|
|
|
+ "paging": false,
|
|
|
+ "lengthChange": false,
|
|
|
+ "searching": false,
|
|
|
+ "ordering": false,
|
|
|
+ "info": true,
|
|
|
+ "autoWidth": false,
|
|
|
+ "serverSide": false,
|
|
|
+ "language": {
|
|
|
+ "url": "/dist/js/dataTables.chinese.lang"
|
|
|
+ },
|
|
|
+ "fnDrawCallback": function () {
|
|
|
+ $("ul.pagination").prepend(" 转到第 <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": null,width:"5%"},
|
|
|
+ {"data": "_id"},
|
|
|
+ {"data": "title", width: "50%"},
|
|
|
+ {"data": function (row) {
|
|
|
+ if (row.href) {
|
|
|
+ var str = "链接地址"
|
|
|
+ tmp = '<a class="" target="_blank" href=' + row.href + '>' + str + '</a>';
|
|
|
+ return tmp
|
|
|
+ } else {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ }, width: "10%"},
|
|
|
+ {"data": "by"},
|
|
|
+ {"data": function (row) {
|
|
|
+ return "<a href='/lua/dataview?coll="+row.by+"&id="+row._id+"' target='_blank' class='btn btn-sm btn-primary'>详情</a>"
|
|
|
+ }},
|
|
|
+ ]
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function searchData(stype) {
|
|
|
+ var text = ""
|
|
|
+ if(stype == "title"){
|
|
|
+ text = $('#title').val()
|
|
|
+ }else if(stype == "href"){
|
|
|
+ text = $('#href').val()
|
|
|
+ }
|
|
|
+ if(text == ""){
|
|
|
+ alert("内容不能为空")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url:"/lua/searchdata",
|
|
|
+ type:"post",
|
|
|
+ data:{"text": text,"stype":stype},
|
|
|
+ success:function(r){
|
|
|
+ if (r&&r.data.length>0) {
|
|
|
+ $('#dataTable').dataTable().fnClearTable();
|
|
|
+ $('#dataTable').dataTable().fnAddData(r.data);
|
|
|
+ $('#dataTable').dataTable().fn
|
|
|
+ }else {
|
|
|
+ showTip("未找到数据")
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function idSearch() {
|
|
|
+ var search_name = $('#idSea').val()
|
|
|
+ $.ajax({
|
|
|
+ url:"/service/jy/searchID",
|
|
|
+ type:"post",
|
|
|
+ data:{"_id": search_name},
|
|
|
+ success:function(r){
|
|
|
+ if (r.rep) {
|
|
|
+ curColl = r.orgColl
|
|
|
+ $('#dataTable').dataTable().fnClearTable();
|
|
|
+ $('#dataTable').dataTable().fnAddData(r.data);
|
|
|
+ }else {
|
|
|
+ showTip(r.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function jyurlSearch() {
|
|
|
+ var search_name = $('#jyurlSea').val()
|
|
|
+ $.ajax({
|
|
|
+ url:"/service/jy/searchJyurl",
|
|
|
+ type:"post",
|
|
|
+ data:{"jyurl": search_name},
|
|
|
+ success:function(r){
|
|
|
+ if (r.rep) {
|
|
|
+ curColl = r.orgColl
|
|
|
+ $('#dataTable').dataTable().fnClearTable();
|
|
|
+ $('#dataTable').dataTable().fnAddData(r.data);
|
|
|
+ }else {
|
|
|
+ showTip(r.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function jyShaSearch() {
|
|
|
+ var search_name = $('#shaSea').val()
|
|
|
+ $.ajax({
|
|
|
+ url:"/service/jy/searchSha",
|
|
|
+ type:"post",
|
|
|
+ data:{"sha": search_name},
|
|
|
+ success:function(r){
|
|
|
+ if (r.rep) {
|
|
|
+ curColl = "bidding"
|
|
|
+ $('#dataTable').dataTable().fnClearTable();
|
|
|
+ $('#dataTable').dataTable().fnAddData(r.data);
|
|
|
+ }else {
|
|
|
+ showTip(r.msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function del_repair(del_id,coll){
|
|
|
+ showConfirm("确定删除?", function() {
|
|
|
+ $.ajax({
|
|
|
+ url:"/service/jy/delete",
|
|
|
+ type:"post",
|
|
|
+ data:{"_id": del_id,"coll":curColl},
|
|
|
+ success:function(r){
|
|
|
+ if(r.rep){
|
|
|
+ $('#dataTable').dataTable().fnClearTable();
|
|
|
+ showTip("删除成功")
|
|
|
+ }else{
|
|
|
+ alert("删除失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</script>
|