2018-08-19 00:12:00   Visit  57

Elementui 导航组件和Vuejs路由结合, 达到点击导航切换路由,根据路由定位导航

一下是nav.vue代码,导航数据以json格式配置

<template>
 <el-menu  :default-active=\"$route.path\" 
      class=\"el-menu-vertical-demo\"
      router=true
      @open=\"handleOpen\"
      @close=\"handleClose\"
      background-color=\"#545c64\"
      text-color=\"#fff\" 
      active-text-color=\"#ffd04b\"
      v-bind:aa=\"$route.path\" >
      <template  v-for=\"item in menuDatas\">
          <el-submenu  v-if=\"item.children&&item.children.length>0\" v-bind:key=\"item.index\" v-bind:index=\"item.src\">
              <template slot=\"title\">
                <i class=\"el-icon-location\"></i>   
                <span  >{{ item.title }}</span>
              </template>
              <el-menu-item-group  v-if=\"item.children&&item.children.length>0\" > 
                <el-menu-item   v-for=\"item in item.children\"  v-bind:key=\"item.index\" v-bind:index=\"item.src\" > 
                  <span >{{ item.title }}</span>
                </el-menu-item> 
              </el-menu-item-group> 
          </el-submenu>
          <el-menu-item  v-else v-bind:key=\"item.index\" v-bind:index=\"item.src\">
            <i class=\"el-icon-menu\"></i>
            <span  >{{ item.title }}</span>
          </el-menu-item>
      </template>
     
 
  </el-menu>
 
</template>

<script>
export default {
  name: \"LeechgNav\",
  data: function() {
    var menuDatas = [
      {index:\"1\", type: \"href\", title: \"导航一\", icon: \"\", src: \"/1\", children: [
        {index:\"1-2\",  type: \"href\", title: \"选项一\", icon: \"\", src: \"/index\", children: [] },
        {index:\"1-3\",  type: \"href\", title: \"选项二\", icon: \"\", src: \"/lee\", children: [] },
        {index:\"1-4\",  type: \"href\", title: \"选项三\", icon: \"\", src: \"/lee2\", children: [] }
      ] },
      {index:\"2\",  type: \"href\", title: \"导航二\", icon: \"\", src: \"/2\", children: [] },
      {index:\"3\",  type: \"href\", title: \"导航三\", icon: \"\", src: \"/3\", children: [] },
      {index:\"4\",  type: \"href\", title: \"导航四\", icon: \"\", src: \"/4\", children: [] }
    ];
    return {
      greeting: \"Hello\",
      menuDatas
    };
  }
};
</script>
<style>
.leechg_index {
  background-color: red;
  color: white;
}

.el-row {
  margin-bottom: 20px;
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
a{
  color: white;
  text-decoration: none;
  color: inherit;
  text-decoration: inherit;
}
</style>

2018-08-10 11:01:41   Visit  46
a点到b的射线方位角   Math.atan2(b.y-a.y,b.x-a.x)*180/Math.PI

转:javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 解决方案
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 解决方案
这个是jdk导致的,jdk里面有一个jce的包,安全性机制导致的访问https会报错,官网上有替代的jar包,换掉就好了

目录 %JAVA_HOME%\jre\lib\security里的local_policy.jar,US_export_policy.jar

JDK7 http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

JDK8 http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

https://www.cnblogs.com/1995hxt/p/6185399.html

2018-07-28 22:28:51   Visit  73

select 'alter system kill session '''||sid|| ','||serial#||''';' from v$session where username =' ';

2018-07-28 22:21:17   Visit  55

select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0

2018-07-27 21:12:49   Visit  86

sdo_relate(t.geom, sdo_geometry(:geometry,null),\'mask=ANYINTERACT\')=\'TRUE\'

JavaScript在浏览器中把文本保存为文件的方法

经过测试第二种方法可以保存更多的文本不至于卡死

var saveTextAsFile1 = function (text, fileName, success, error) {
    var data = text;
    if (!(text instanceof Array)) {
        data = [text];
    }
    var file = new File(data, fileName);
    var reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = function (r) {
        var url = reader.result;
        downLoadFile(url, fileName,
            function () {
                success && success();
            }, function () {
                error && error();
            });
    };


}

/**
 * 下载文件
 * @param {string, Array} text 
 * @param {string} fileName 
 * @param {function} success 
 * @param {function} error 
 */
var saveTextAsFile = function (text, fileName, success, error) {
    var data = text;
    if (!(text instanceof Array)) {
        data = [text];
    }
    var urlObject = window.URL || window.webkitURL || window;
    var export_blob = new Blob(data);
    var url = urlObject.createObjectURL(export_blob);
    downLoadFile(url, fileName,
        function () {
            success && success();
        }, function () {
            error && error();
        });
}
2018-07-26 01:00:21   Visit  68

jQuery 获取指定url标题



function getTitleOfUrl(u, callback) {
    var url = \\\"jsapi/proxy.jsp?\\\" + u;
    $.ajax({
        url: url,
        complete: function (e) {
            var text = e.responseText;
            text = text.replace(/\\\\s*/g,\\\"\\\");
            var reg = /<title>(.*)\\\\<\\\\/title>/;
            window.b = e;
            title = text.match(reg)[1];
            callback&&callback(title,e)
        }
    })
}
var u = \\\"http://leechg.com\\\";
getTitleOfUrl(u, function(title,e){
    console.log(title)
})

2018-07-04 15:02:10   Visit  64

bootstrapValidator 同一个页面两个form

bootstrapValidator 同一个页面两个form出现随机一个form无法验证的问题

经验证发现是页面内通过ajax加载子页面内容导致 bootstrapValidator .js重复加载,bootstrapValidator 没有记住之前配置的验校内容,导致后一个加载的子页面上的form没法验校。

解决方法

在子页去掉bootstrapValidator .js的加载

bootstrapValidator 不符合jQuery组件的画风

ORA-01483: DATE 或 NUMBER 绑定变量的长度无效

hibernate、 java 、Spring环境下访问数据库,使用org.hibernate.Session 的get方法获取实体时出现

ORA-01483: DATE 或 NUMBER 绑定变量的长度无效

经反复排查,发现是因为记录中的一个clob字段为空导致的

临时解决方法
修改java代码使其默认值为一个空格