tianyunperfect 2 lat temu
rodzic
commit
fd1919efdd

+ 180 - 0
simple-demo/bootstrapTest.html

@@ -0,0 +1,180 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>bootstrap - 增删改查</title>
+  <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
+  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
+  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
+</head>
+<body>
+<!-- 表格 -->
+<div class="container" style="padding-top: 40px;">
+  <div class="form-group">
+    <div class="row">
+      <div class="col-md-8">
+        <input type="text" class="form-control swich" />
+      </div>
+      <div class="col-md-3">
+        <button class="btn btn-danger sreach">搜索</button>
+        <button class="btn btn-default add" data-toggle="modal" data-target="#myModel">增加</button>
+      </div>
+    </div>
+  </div>
+  <table class="table table-bordered text-center">
+    <tr>
+      <td>编号</td>
+      <td>姓名</td>
+      <td>成绩</td>
+      <td>操作</td>
+    </tr>
+    <tr>
+      <td>1</td>
+      <td>张三</td>
+      <td>89</td>
+      <td>
+        <button class="btn btn-primary rev" data-toggle="modal" data-target="#myModal">修改</button>
+        <button class="btn btn-danger del">删除</button>
+      </td>
+    </tr>
+    <tr>
+      <td>2</td>
+      <td>李四</td>
+      <td>91</td>
+      <td>
+        <button class="btn btn-primary rev" data-toggle="modal" data-target="#myModal">修改</button>
+        <button class="btn btn-danger del">删除</button>
+      </td>
+    </tr>
+    <tr>
+      <td>3</td>
+      <td>刘一</td>
+      <td>80</td>
+      <td>
+        <button class="btn btn-primary rev" data-toggle="modal" data-target="#myModal">修改</button>
+        <button class="btn btn-danger del">删除</button>
+      </td>
+    </tr>
+  </table>
+</div>
+<!-- 修改的模态框 -->
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <h4 class="modal-title" id="myModalLabel">修改信息</h4>
+      </div>
+      <div class="modal-body">
+        <form>
+          <div class="form-group">
+            <input type="text" placeholder="编号" id="reusrnum" class="form-control" />
+          </div>
+          <div class="form-group">
+            <input type="text" placeholder="名字" id="reusrname" class="form-control" />
+          </div>
+          <div class="form-group">
+            <input type="text" placeholder="成绩" class="form-control" id="rescore" />
+          </div>
+        </form>
+
+      </div>
+      <div class="modal-footer">
+        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+        <button type="button" class="btn btn-primary olk" data-dismiss="modal">提交更改</button>
+      </div>
+    </div>
+    <!-- /.modal-content -->
+  </div>
+  <!-- /.modal -->
+</div>
+<!-- 增加的模态框 -->
+<div class="modal fade" id="myModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <h4 class="modal-title" id="myModalLabel">增加信息</h4>
+      </div>
+      <div class="modal-body">
+        <form>
+          <div class="form-group">
+            <input type="text" placeholder="编号" id="reusrnum" class="form-control" />
+          </div>
+          <div class="form-group">
+            <input type="text" placeholder="名字" id="reusrname" class="form-control" />
+          </div>
+          <div class="form-group">
+            <input type="text" placeholder="成绩" class="form-control" id="rescore" />
+          </div>
+        </form>
+
+      </div>
+      <div class="modal-footer">
+        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+        <button type="button" class="btn btn-primary aad" data-dismiss="modal">增加信息</button>
+      </div>
+    </div>
+    <!-- /.modal-content -->
+  </div>
+  <!-- /.modal -->
+</div>
+<script>
+
+  //删除的功能
+  $(document).on("click", ".del", function () {
+    $(this).parents("tr").remove()
+  })
+  //改的功能
+  var _this = null
+  $(document).on("click", ".rev", function () {
+    var _arr = []
+    _this = $(this).parents("tr")
+    $(this).parents("tr").find("td:not(:last)").each(function () {
+      _arr.push($(this).text())
+    })
+    $("#myModal").find("input").each(function (i) {
+      $(this).val(_arr[i])
+    })
+  })
+
+  $(document).on("click", ".olk", function () {
+    var _arr = []
+    $("#myModal").find("input").each(function () {
+      _arr.push($(this).val())
+    })
+    _this.find("td:not(:last)").each(function (i) {
+      $(this).text(_arr[i])
+    })
+  })
+  //增加的功能
+  $(document).on("click", ".aad", function () {
+    var _arr = []
+    var str = ""
+    $("#myModel").find("input").each(function () {
+      _arr.push($(this).val())
+
+    })
+
+    str = '<tr><td>' + _arr[0] + '</td><td>' + _arr[1] + '</td><td>' + _arr[2] + '</td><td><button class="btn btn-primary rev" data-toggle="modal" data-target="#myModal">修改</button> <button class="btn btn-danger del">删除</button></td></tr>'
+    $(".table").append(str)
+
+  })
+  //查的功能
+  $(".sreach").click(function () {
+    var oS = $(".swich").val()
+    if (oS.length == 0) {
+      alert("请输入点东西")
+    } else if ($("table tr td:contains('" + oS + "')").length == 0) {
+      alert("找不到数据")
+    } else {
+      $(".table tr:not(:first)").hide()
+      $(".table tr:contains('" + oS + "')").show().find("input").prop("checked", true)
+    }
+
+  })
+</script>
+</body>
+</html>

+ 0 - 75
simple-demo/cityMap.html

@@ -1,75 +0,0 @@
-<font size="" color="">
-    <!DOCTYPE html>
-    <html>
-    <head>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-        <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
-        <script type="text/javascript"
-                src="http://api.map.baidu.com/api?v=2.0&ak=WMYeXwq7z0VcaiUXTuYTGPZsm8Selmfd"></script>
-        <script type="text/javascript" src="http://api.map.baidu.com/library/Heatmap/2.0/src/Heatmap_min.js"></script>
-        <title>热力图功能-tianjiangnan</title>
-        <style type="text/css">
-            ul, li {
-                list-style: none;
-                margin: 0;
-                padding: 0;
-                float: left;
-            }
-
-            html {
-                height: 100%
-            }
-
-            body {
-                height: 100%;
-                margin: 0px;
-                padding: 0px;
-                font-family: "微软雅黑";
-            }
-
-            #container {
-                height: 1000px;
-                width: 1000px;
-            }
-
-            #r-result {
-                width: 100%;
-            }
-        </style>
-    </head>
-    <body>
-    <div id="container"></div>
-    </body>
-    </html>
-    <script type="text/javascript">
-        // 创建地图实例
-        var map = new BMap.Map("container");
-        //设置地图的中心点如合肥的坐标
-        var point = new BMap.Point(117.17, 31.52);
-        // 初始化地图,设置中心点坐标和地图级别
-        map.centerAndZoom(point, 8);
-        // 允许滚轮缩放
-        map.enableScrollWheelZoom();
-        //只显示某个省份的关键代码
-        var cityName = '安徽省';
-        //添加缩略地图控件
-        map.addControl(new BMap.OverviewMapControl());
-        map.addControl(new BMap.NavigationControl({
-            type: BMAP_NAVIGATION_CONTROL_LARGE,
-            anchor: BMAP_ANCHOR_TOP_LEFT,
-            offset: new BMap.Size(1000, 1000)
-        }));
-        var bdary = new BMap.Boundary();
-        bdary.get(cityName, function (rs) {       //获取行政区域
-            var EN_JW = "180, 90;";         //东北角
-            var NW_JW = "-180,  90;";       //西北角
-            var WS_JW = "-180, -90;";       //西南角
-            var SE_JW = "180, -90;";        //东南角
-            //4.添加环形遮罩层
-            var ply1 = new BMap.Polygon(rs.boundaries[0] + SE_JW + SE_JW + WS_JW + NW_JW + EN_JW + SE_JW,
-                {strokeColor: "none", fillColor: "#fefb9c", fillOpacity: 1, strokeOpacity: 0.5}); //建立多边形覆盖物
-            map.addOverlay(ply1);
-        });
-        //只显示某个省份的关键代码
-    </script>
-</font>

+ 0 - 53
simple-demo/cityMap1.html

@@ -1,53 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="UTF-8">
-    <title>获取行政区域边界坐标</title>
-    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=WMYeXwq7z0VcaiUXTuYTGPZsm8Selmfd"></script>
-</head>
-<body>
-<div id="container" style="top: 30px;width: 100%;height: 100%;overflow: hidden;position: absolute;"></div>
-输入省、直辖市或县名称:
-<input type="text" id="districtName" style="width:200px" value="重庆市"/>
-<input type="button" id="getButton" name="getButton" onclick="getBoundary()" value="获取轮廓线"/>
-
-<script type="text/javascript">
-    var map = new BMap.Map("container");
-
-    map.centerAndZoom(new BMap.Point(116.403765, 39.914850), 9);
-
-    map.addControl(new BMap.NavigationControl({type: BMAP_NAVIGATION_CONTROL_SMALL}));
-
-    map.enableScrollWheelZoom();
-
-    function getBoundary() {
-
-        var bdary = new BMap.Boundary();
-
-        var name = document.getElementById("districtName").value;
-
-        bdary.get(name, function (rs) {       //获取行政区域
-
-            map.clearOverlays();        //清除地图覆盖物
-
-            var count = rs.boundaries.length; //行政区域的点有多少个
-
-            for (var i = 0; i < count; i++) {
-
-                var ply = new BMap.Polygon(rs.boundaries[i], {strokeWeight: 2, strokeColor: "#ff0000"}); //建立多边形覆盖物
-
-                console.log("当前辖区坐标:" + name);
-                console.log(rs.boundaries[i]);
-
-                map.addOverlay(ply);  //添加覆盖物
-
-                map.setViewport(ply.getPath());    //调整视野
-
-            }
-
-        });
-
-    }
-</script>
-</body>
-</html>

+ 166 - 0
simple-demo/history_list.html

@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
+    <script src="https://web.tianyunperfect.cn/util.js"></script>
+    <title>历史 URL 列表</title>
+    <script src="js/axios.min.js"></script>
+    <script src="js/vue.min.js"></script>
+    <script src="https://api.map.baidu.com/api?v=2.0&ak=WMYeXwq7z0VcaiUXTuYTGPZsm8Selmfd"></script>
+    <style>
+        .container {
+            width: 500px;
+            height: 50px;
+            margin: 20px auto;
+        }
+        .parent {
+            width: 100%;
+            height: 42px;
+            top: 4px;
+            position: relative;
+        }
+
+        .parent > input:first-of-type {
+            /*输入框高度设置为40px, border占据2px,总高度为42px*/
+            width: 380px;
+            height: 40px;
+            border: 1px solid #ccc;
+            font-size: 16px;
+            outline: none;
+        }
+
+        .parent > input:first-of-type:focus {
+            border: 1px solid #317ef3;
+            padding-left: 10px;
+        }
+
+        .parent > input:last-of-type {
+            /*button按钮border并不占据外围大小,设置高度42px*/
+            width: 100px;
+            height: 44px;
+            position: absolute;
+            background: #317ef3;
+            border: 1px solid #317ef3;
+            color: #fff;
+            font-size: 16px;
+            outline: none;
+        }
+    </style>
+</head>
+<body>
+<div id="tby">
+    <div class="container">
+        <form action="" class="parent">
+            <input type="text" v-model="msg">
+            <input type="button" value="搜索" @click="search">
+        </form>
+    </div>
+    <table>
+        <thead>
+        <tr>
+            <td>id</td>
+            <td>时间</td>
+            <td>网址</td>
+            <td>url</td>
+        </tr>
+        </thead>
+        <tbody>
+        <tr v-for="(item,index) in list">
+            <td>{{item.id}}</td>
+            <td>{{new Date(item.create_time).format("yyyy-MM-dd hh:mm:ss")}}</td>
+            <td>
+                <a :href="item.url"
+                   target="_blank">{{item.title}}</a>
+            </td>
+            <td>{{item.url}}</td>
+        </tr>
+        </tbody>
+    </table>
+    <!-- 分页按钮 -->
+    <div class="page-icon">
+        <button class="firstPage" @click="first_click">第一页</button>
+        <button class="beforePage" @click="prev_click">上一页</button>
+        <button>第<input v-model="page" @change="choose_page" type="text" value="1"/>页</button>
+        <button class="nextPage" @click="next_click">下一页</button>
+    </div>
+
+
+</div>
+
+
+<script>
+
+    Date.prototype.format = function (fmt) {
+        var o = {
+            "M+": this.getMonth() + 1,                 //月份
+            "d+": this.getDate(),                    //日
+            "h+": this.getHours(),                   //小时
+            "m+": this.getMinutes(),                 //分
+            "s+": this.getSeconds(),                 //秒
+            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+            "S": this.getMilliseconds()             //毫秒
+        };
+        if (/(y+)/.test(fmt)) {
+            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+        }
+        for (var k in o) {
+            if (new RegExp("(" + k + ")").test(fmt)) {
+                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+            }
+        }
+        return fmt;
+    }
+
+    const scrollElement = (el) => {
+        document.querySelector(el).scrollIntoView({behavior: 'smooth'});
+    }
+
+    let _this = new Vue({
+        el: '#tby',
+        data: {
+            page: 1,
+            size: 30,
+            msg: "",
+            list: []
+        },
+        mounted: function () {
+            this.search();
+        },
+        methods: {
+            first_click: function () {
+                this.page = 1;
+                this.search();
+            },
+            prev_click: function () {
+                this.page -= 1;
+                this.search();
+            },
+            choose_page: function () {
+                this.search();
+            },
+            next_click: function () {
+                this.page += 1;
+                this.search();
+            },
+            getParam: function () {
+                let obj = {};
+                obj['title'] = this.msg;
+                obj['page'] = this.page;
+                obj['size'] = this.size;
+                return obj;
+            },
+            search: function () {
+                axios.get("https://api.tianyunperfect.cn/web_history/search", {params: this.getParam()}).then(res => {
+                    if (res.data.code === 1) {
+                        _this.list = res.data.data.list;
+                    }
+                });
+            }
+        }
+    });
+
+
+</script>
+</body>
+</html>

+ 3 - 3
simple-demo/index.html

@@ -65,8 +65,8 @@
         <div class="modal-dialog modal-dialog-centered" role="document">
             <div class="modal-content">
                 <div class="modal-header">
-                    <h5 class="modal-title" v-if="isUpdate">修改书籍</h5>
-                    <h5 class="modal-title" v-else>新增书籍</h5>
+                    <h5 class="modal-title" v-if="isUpdate">修改</h5>
+                    <h5 class="modal-title" v-else>新增</h5>
                     <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                         <span aria-hidden="true">&times;</span>
                     </button>
@@ -125,7 +125,7 @@
             }
         },
         mounted: function () {
-            // this.queryList();
+            this.queryList();
         },
         methods: {
             modelShow() {

+ 1 - 1
simple-demo/location_list.html

@@ -15,7 +15,7 @@
 
             height: 50px;
 
-            margin: 100px auto;
+            margin: 20px auto;
 
         }
 

+ 0 - 11
tmp/calendar.html

@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>日历</title>
-</head>
-<body>
-<iframe id="api_iframe_bmcx" name="api_iframe_bmcx" src="https://www.bmcx.com/apiiframe/?api_from=bmcx&api_url=https://wannianrili.bmcx.com/&api_width=98%&api_backgroundcolor=FFFFFF&api_navigation=no" width="400" height="470" scrolling="no" frameborder="0"></iframe>
-
-</body>
-</html>