1.添加Container 布局容器 Ztree页面,设置导航搜索路由

This commit is contained in:
WangHao 2020-08-11 22:31:18 +08:00
parent b86156d9d0
commit 606ca27730
3 changed files with 399 additions and 316 deletions

View File

@ -6,6 +6,13 @@ Vue.use(Router)
/* Layout */
import Layout from '@/layout'
// 导航首页
import bookmarkmenu from '@/views/bookmark/menu';
import index3 from '@/views/bookmark/index';
/**
* Note: 路由配置项
*
@ -23,6 +30,15 @@ import Layout from '@/layout'
breadcrumb: false // 如果设置为false则不会在breadcrumb面包屑中显示
}
*/
//书签路由bookmark
export const bookmark = [
{
path: '/index2',
component: bookmarkmenu,
hidden: true
},
]
// 公共路由
export const constantRoutes = [
@ -117,11 +133,23 @@ export const constantRoutes = [
meta: { title: '修改生成配置' }
}
]
}
},
{
path: '/index2',
component: bookmarkmenu,
hidden: true
},
{
path: '/index3',
component: index3,
hidden: true
},
]
export default new Router({
mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
routes:constantRoutes
})

View File

@ -0,0 +1,337 @@
<template >
<el-container>
<transition name="el-zoom-in-left">
<el-aside width="300px" style="height:900px" v-show="isShowZtree" class="transition-box">
<div class="aside-logo">
<img src="https://s1.ax1x.com/2020/08/11/aXV1YV.png"/>
</div>
<div class="aside-title"><i class="el-icon-s-tools"></i><span>所有书签</span></div>
<div class="aside-title"><i class="el-icon-help"></i><span>发现书签</span></div>
<div class="aside-title"><i class="el-icon-s-platform"></i><span>任意门</span></div>
<div class="aside-title"><i class="el-icon-message-solid"></i><span>收件箱</span></div>
<div class="reminder">我的收藏</div>
<div class="areaTree" >
<ul id="treeDemo" class="ztree" ></ul>
</div>
<div class="reminder">工具箱</div>
<div class="aside-title"><i class="el-icon-s-tools"></i><span>所有书签</span></div>
<div class="aside-title"><i class="el-icon-help"></i><span>发现书签</span></div>
<div class="aside-title"><i class="el-icon-s-platform"></i><span>任意门</span></div>
<div class="aside-title"><i class="el-icon-message-solid"></i><span>收件箱</span></div>
<el-footer class="aside-navigation">
</el-footer>
</el-aside>
</transition>
<el-container>
<el-header > <el-button @click="isShowZtree = !isShowZtree">Click Me</el-button></el-header>
<el-main style="background-color: #1c84c6">Main</el-main>
<el-footer>Footer</el-footer>
</el-container>
</el-container>
</template>
<script>
// Vuemain.js
import "../ztree/jquery-1.4.4.min.js"
import "../ztree/jquery.ztree.core.js"
import "../ztree/demo.css"
import "../ztree/zTreeStyle.css"
import "../ztree/jquery.ztree.exedit.js"
export default {
name: 'areaTree',
components:{
},
data:function(){
return{
enterable:false,
isShowZtree:true,//ztree
expandAll:false,//ztree
curMenu:null,
zTree_Menu:null,
setting:{
view: {
showLine: false,
showIcon: true,
selectedMulti: false,
dblClickExpand: false,
addHoverDom: this.addHoverDom,
removeHoverDom: this.removeHoverDom,
addDiyDom: this.addDiyDom,
},
check: {
enable: true,
nocheckInherit: false ,
chkboxType: { "Y": "p", "N": "s" }
},
data: {
simpleData: {
enable: true
}
},
callback: {
beforeClick: this.beforeClick,
onClick: this.zTreeOnClick,
onCheck: this.zTreeOnCheck,
}
},
zNodes:[
{ id:1, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.baidu.com"},
{ id:2, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://movie.douban.com/"},
{ id:3, pId:2, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:4, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.w3school.com.cn/"},
{ id:5, pId:4, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:6, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:7, pId:6, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:8, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://open.163.com/"},
{ id:9, pId:8, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:1123, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://y.qq.com"},
{ id:1142, pId:1, name:"收件箱",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:111, pId:19, name:"收件箱1",icon:"https://favicon.lucq.fun/?url=https://mail.sina.com.cn/"},
{ id:112, pId:111, name:"收件箱2",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:113, pId:112, name:"收件箱3",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:114, pId:113, name:"收件箱4",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:1321, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:2322, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:3323, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:4324, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:5325, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:6399, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:32, pId:399, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:12, pId:1, name:"垃圾邮件",icon:"https://favicon.lucq.fun/?url=https://www.google.com/"},
{ id:13, pId:1, name:"草稿",icon:"https://favicon.lucq.fun/?url=https://yz.m.sm.cn/"},
{ id:14, pId:1, name:"已发送邮件",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:15, pId:1, name:"已删除邮件",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:322, pId:11, name:"快速视图",icon:"https://favicon.lucq.fun/?url=https://taobao.com/"},
{ id:31, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:131, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:231, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:331, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:431, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:531, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:631, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:731, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:831, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
],
}
},
methods:{
addDiyDom:function(treeId, treeNode) {
// console.log("ztree:"+treeId.tId+"___treeNode"+treeNode.tId)
var spaceWidth = 20;
var switchObj = $("#" + treeNode.tId + "_switch"),
icoObj = $("#" + treeNode.tId + "_ico");
switchObj.remove();
icoObj.before(switchObj);
if (treeNode.level > -1) {
var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level)+ "px'></span>";
switchObj.before(spaceStr);
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_count style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>99</span>";
switchObjspan.after(editStr);
}
},
addHoverDom:function(treeId, treeNode) {
var confCount = $("."+treeNode.tId+"_sz").length;
//console.log("addHoverDom:"+treeNode.tId+"_sz :"+confCount);
if (confCount>0) return;
//if (treeNode.parentNode && treeNode.parentNode.id!=1) return;
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_sz onclick='alert(2222);return false;' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>删</span>";
switchObjspan.after(editStr);
$("." + treeNode.tId + "_count").unbind().remove();
//
// document.getElementsByClassName(treeNode.tId + "_sz").onclick=function(){alert(this.value)};
//document.getElementsByClassName(treeNode.tId + "_sz").addEventListener('click', editBookmark);
// $("." + treeNode.tId + "_sz").addEventListener('click', editBookmark);
},
removeHoverDom:function(treeId, treeNode) {
//console.log("removeHoverDom:"+"." + treeNode.tId + "_sz")
//if (treeNode.parentTId && treeNode.getParentNode().id!=1) return;
$("." + treeNode.tId + "_sz").unbind().remove();
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_count onclick='alert(1111111);return false;' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>12</span>";
switchObjspan.after(editStr);
},
//
beforeClick:function(treeId, treeNode) {
//if (treeNode.level != 19990 ) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.expandNode(treeNode);
// return false;
// }
//return true;
},
// ztree
zreaZtree:function () {
var that=this;
that.isShowZtree = !that.isShowZtree;
},
editBookmark:function(){
var that=this;
alert("this button");
// //IE
// if ( e && e.stopPropagation )
// //W3CstopPropagation()
// e.stopPropagation();
// else
// //使IE
// window.event.cancelBubble = true;
},
},
mounted(){
var that=this;
$.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes).expandAll(that.expandAll);
},
}
</script>
<style >
/*body{*/
/* font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;*/
/*}*/
.ztree li ul{ margin:0; padding:0}
.ztree li {line-height:32px}
.ztree li a {width:200px;height:32px;padding-top: 0px;font-size: 14px;width:100%}
.ztree li a:hover {text-decoration:none; background-color: #c5c5c5;}
.ztree li a span.button.switch {vertical-align:middle}
.ztree.showIcon li a span.button.switch {visibility:visible}
.ztree li a.curSelectedNode {background-color:#D4D4D4;border:0;height:32px;}
.ztree li span {line-height:32px;}
.ztree li span.button {margin-top: -4px;margin-left:3px}
.ztree li span.button.switch {width: 16px;height: 16px;}
/*.ztree li a.level0 span {font-size: 100%;font-weight: bold}*/
.ztree li span.button {background-image:url("../ztree/left_menuForOutLook.png"); *background-image:url("../ztree/left_menuForOutLook.gif")}
.ztree li span.button.switch.level0 {width: 20px; height:20px}
.ztree li span.button.switch.level1 {width: 20px; height:20px}
.ztree li span.button.noline_open {background-position: 0 0;}
.ztree li span.button.noline_close {background-position: -18px 0;}
.ztree li span.button.noline_open.level0 {background-position: 0 0;}
.ztree li span.button.noline_close.level0 {background-position:-18px 0;}
.ztree li span.button.ico_close{vertical-align: middle}
.ztree li span.button.ico_open{vertical-align: middle}
.ztree li span.button.ico_docu {vertical-align: middle}
.ztr{
/*//background{ width:100%;height:100%;position:absolute;top:0px;opacity: 0.6;background-image: url(https://s1.ax1x.com/2020/07/27/akFjER.jpg);background-size: 500px 100px;}*/
/*background:red;*/
}
/*.areaTree{*/
/* width: 300px;*/
/* !*height: 700px;*!*/
/* font-weight: 400;*/
/* !*overflow:auto;*!*/
/* background-color: #F6F6F6;*/
/* !* background:url('https://ftp.bmp.ovh/imgs/2020/08/4ac1d6b4f41049ef.jpg') no-repeat;*!*/
/* background-size: 100% 100%;*/
/*}*/
aside{
padding:0;
margin-bottom: 0;
/*background:url('https://ftp.bmp.ovh/imgs/2020/08/4ac1d6b4f41049ef.jpg') no-repeat;*/
background-color: #f6f6f6;
border: 3px solid transparent;
}
.aside-title{
height: 32px;
margin-left: 26px;
}
.aside-title i{
font-size: 20px;
margin-right: 11px;
}
.aside-title span{
font-size: 14px;
margin-right: 11px;
}
.aside-logo{
}
.aside-logo img{
background-repeat: no-repeat;
width: 100%;
height: 50px;
opacity: 0.6;
}
.reminder{
margin-left: 27px;
color: #878787;
opacity: 0.6;
font-size: 14px;
font-weight: 500;
}
.aside-navigation{
width: 100%;
height: 30px;
background-color: #a0c4ff;
}
</style>

View File

@ -3,56 +3,21 @@
<div class="index-top"></div>
<!--github-->
<a @click="zreaZtree" class="github-corner" target="_blank" title="Follow me on GitHub" aria-label="Follow me on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#008000; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<div style="height: 700px;width: 270px;margin-top: 50px"></div>
<div style="height: 700px;width: 500px;margin-top: 50px">
</div>
<div class="areaTree" >
<ul id="treeDemo" class="ztree" ></ul>
</div>
<!-- &lt;!&ndash;github&ndash;&gt;-->
<!-- <a @click="zreaZtree" class="github-corner" target="_blank" title="Follow me on GitHub" aria-label="Follow me on GitHub">-->
<!-- <svg width="80" height="80" viewBox="0 0 250 250" style="fill:#008000; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">-->
<!-- <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>-->
<!-- <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>-->
<!-- </svg>-->
<!-- </a>-->
<div class="sousou">
<!-- //-->
<div style="width: 50%;height: 200px;margin: 0 auto;margin-top: 19%">
<div >
<div class="choice-top" v-for="iconlist in iconlist">
<div class="choice-top notcopy" v-for="iconlist in iconlist">
<el-tooltip :visible-arrow="visiblearro" :enterable="enterable" class="item" effect="dark" :content="iconlist.title" placement="top" >
<div @click="sendEventDataTop($event)" :data-icon="iconlist.icon"><img :ng-src="'https://favicon.lucq.fun/?url='+iconlist.icon" err-src="./images/default.ico" ng-click="detailBookmark(bookmark);$event.stopPropagation()" :src="'https://favicon.lucq.fun/?url='+iconlist.icon" ></div>
</el-tooltip>
@ -61,14 +26,14 @@
</div>
<div style="margin-top: 15px;">
<el-input placeholder="百度一下" v-model="sousou" class="sousoucss" ref="sousouref">
<el-input placeholder="百度一下" v-model="sousou" class="sousoucss notcopy" ref="sousouref">
<img @click="IsCord()" slot="prefix" :src="sousouicon" style="width: 20px;height: 20px;position: absolute;top: 50%;margin-top: -10px;">
<el-button slot="append" icon="el-icon-search" circle @click="getUrl"></el-button>
</el-input>
</div>
<transition name="el-zoom-in-top">
<el-card class="box-card" v-show="isSousouCard" style="width: 100%;opacity: 0.7;margin-top: 10px;height:200px;overflow:auto">
<el-card class="box-card notcopy" v-show="isSousouCard" style="width: 100%;opacity: 0.7;margin-top: 10px;height:200px;overflow:auto">
<div class="choice" v-for="iconlist in iconlist" >
<div @click="sendEventData($event)" :data-icon="iconlist.icon"><img err-src="https://favicon.lucq.fun/?url=https://www.5118.com/" class="sousouicon" :ng-src="'https://favicon.lucq.fun/?url='+iconlist.icon" :src="'https://favicon.lucq.fun/?url='+iconlist.icon" ><span>{{iconlist.title}}</span></div>
@ -79,22 +44,9 @@
<!-- <el-card class="box-card" v-show="isSousouCard" style="width: 500px;opacity: 0.7">-->
<!-- <div class="choice" v-for="iconlist in iconlist">-->
<!-- <div @click="sendEventData($event)" :data-icon="iconlist.icon"><img err-src="https://favicon.lucq.fun/?url=https://www.5118.com/" class="sousouicon" :ng-src="'https://favicon.lucq.fun/?url='+iconlist.icon" :src="'https://favicon.lucq.fun/?url='+iconlist.icon" ><span>{{iconlist.title}}</span></div>-->
<!--&lt;!&ndash; ng-click="detailBookmark(bookmark);$event.stopPropagation()" &ndash;&gt;-->
<!-- </div>-->
<!-- </el-card>-->
</div>
</div>
@ -105,15 +57,9 @@
<script>
// Vuemain.js
import "../ztree/jquery-1.4.4.min.js"
import "../ztree/jquery.ztree.core.js"
import "../ztree/demo.css"
import "../ztree/zTreeStyle.css"
import "../ztree/jquery.ztree.exedit.js"
export default {
name: 'areaTree',
components:{
},
@ -121,9 +67,7 @@
data:function(){
return{
enterable:false,
visiblearro:true,//
isShowZtree:false,//ztree
expandAll:false,//ztree
visiblearro:false,//
curMenu:null,
sousou:'百度一下',//
zTree_Menu:null,
@ -132,71 +76,6 @@
sousouicon:'https://favicon.lucq.fun/?url=https://www.baidu.com/',//
sousou:'',
sousouVlaue:'百度一下',
setting:{
view: {
showLine: false,
showIcon: true,
selectedMulti: false,
dblClickExpand: false,
addHoverDom: this.addHoverDom,
removeHoverDom: this.removeHoverDom,
addDiyDom: this.addDiyDom
},
check: {
enable: true,
nocheckInherit: false ,
chkboxType: { "Y": "p", "N": "s" }
},
data: {
simpleData: {
enable: true
}
},
callback: {
beforeClick: this.beforeClick,
onClick: this.zTreeOnClick,
onCheck: this.zTreeOnCheck,
}
},
zNodes:[
{ id:1, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.baidu.com"},
{ id:2, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://movie.douban.com/"},
{ id:3, pId:2, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:4, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.w3school.com.cn/"},
{ id:5, pId:4, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:6, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:7, pId:6, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:8, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://open.163.com/"},
{ id:9, pId:8, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:1123, pId:0, name:"文件夹",icon:"https://favicon.lucq.fun/?url=https://y.qq.com"},
{ id:1142, pId:1, name:"收件箱",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:111, pId:19, name:"收件箱1",icon:"https://favicon.lucq.fun/?url=https://mail.sina.com.cn/"},
{ id:112, pId:111, name:"收件箱2",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:113, pId:112, name:"收件箱3",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:114, pId:113, name:"收件箱4",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:1321, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:2322, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:3323, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:4324, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:5325, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:6399, pId:114, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:32, pId:399, name:"照片",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:12, pId:1, name:"垃圾邮件",icon:"https://favicon.lucq.fun/?url=https://www.google.com/"},
{ id:13, pId:1, name:"草稿",icon:"https://favicon.lucq.fun/?url=https://yz.m.sm.cn/"},
{ id:14, pId:1, name:"已发送邮件",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:15, pId:1, name:"已删除邮件",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:322, pId:11, name:"快速视图",icon:"https://favicon.lucq.fun/?url=https://taobao.com/"},
{ id:31, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:131, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:231, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:331, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:431, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:531, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:631, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:731, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
{ id:831, pId:3, name:"文档",icon:"https://favicon.lucq.fun/?url=https://www.sogou.com/"},
]
,
iconlist:[
{iconID:"1",icon:"https://www.baidu.com",title:"百度"},
{iconID:"2",icon:"https://www.google.com/",title:"谷歌搜索引擎"},
@ -224,77 +103,11 @@
{iconID:"7",icon:"https://github.com/",title:"GitHub"},
{iconID:"7",icon:"https://mail.sina.com.cn/",title:"新浪邮箱"},
{iconID:"7",icon:"https://movie.douban.com/",title:"豆瓣电影"},
{iconID:"7",icon:"http://www.zzrbl.com/",title:"猪猪电影网"},
]
}
},
methods:{
addDiyDom:function(treeId, treeNode) {
console.log("自定义ztree:"+treeId.tId+"___treeNode"+treeNode.tId)
var spaceWidth = 20;
var switchObj = $("#" + treeNode.tId + "_switch"),
icoObj = $("#" + treeNode.tId + "_ico");
switchObj.remove();
icoObj.before(switchObj);
if (treeNode.level > -1) {
var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level)+ "px'></span>";
switchObj.before(spaceStr);
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_count style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>99</span>";
switchObjspan.after(editStr);
}
},
addHoverDom:function(treeId, treeNode) {
var confCount = $("."+treeNode.tId+"_sz").length;
//console.log("addHoverDom:"+treeNode.tId+"_sz :"+confCount);
if (confCount>0) return;
//if (treeNode.parentNode && treeNode.parentNode.id!=1) return;
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_sz onclick='alert(2222);return false;' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>删</span>";
switchObjspan.after(editStr);
$("." + treeNode.tId + "_count").unbind().remove();
//
// document.getElementsByClassName(treeNode.tId + "_sz").onclick=function(){alert(this.value)};
//document.getElementsByClassName(treeNode.tId + "_sz").addEventListener('click', editBookmark);
// $("." + treeNode.tId + "_sz").addEventListener('click', editBookmark);
},
removeHoverDom:function(treeId, treeNode) {
//console.log("removeHoverDom:"+"." + treeNode.tId + "_sz")
//if (treeNode.parentTId && treeNode.getParentNode().id!=1) return;
$("." + treeNode.tId + "_sz").unbind().remove();
var switchObjspan = $("#" + treeNode.tId + "_span");
var editStr = "<span class="+treeNode.tId+"_count onclick='alert(1111111);return false;' style='color: #9e9e9e;float:right;display: inline-block;margin-right: 15px;font-size:8px' onfocus='this.blur();'>12</span>";
switchObjspan.after(editStr);
},
//
beforeClick:function(treeId, treeNode) {
//if (treeNode.level != 19990 ) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.expandNode(treeNode);
// return false;
// }
//return true;
},
// ztree
zreaZtree:function () {
var that=this;
that.isShowZtree = !that.isShowZtree;
},
//
IsCord:function(){
var that=this;
@ -317,19 +130,6 @@
},
editBookmark:function(){
var that=this;
alert("this button");
// //IE
// if ( e && e.stopPropagation )
// //W3CstopPropagation()
// e.stopPropagation();
// else
// //使IE
// window.event.cancelBubble = true;
},
//
getUrl:function () {
var that=this;
@ -346,32 +146,12 @@
that.$refs.sousouref.focus()
}
}
},
mounted(){
var that=this;
$.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes).expandAll(that.expandAll);
//
that.$refs.sousouref.focus()
// var _this = this
//
// var treeObj = $("#treeDemo");
// $.fn.zTree.init(treeObj, this.setting, this.zNodes);
// _this.zTree_Menu = $.fn.zTree.getZTreeObj("treeDemo");
// curMenu = zTree_Menu.getNodes()[0].children[0].children[0];
// _this.zTree_Menu.selectNode(curMenu);
//
// treeObj.hover(function () {
// if (!treeObj.hasClass("showIcon")) {
// treeObj.addClass("showIcon");
// }
// }, function() {
// treeObj.removeClass("showIcon");
// });
},
@ -382,94 +162,19 @@
<style >
body{
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
}
.ztree li ul{ margin:0; padding:0}
.ztree li {line-height:30px}
.ztree li a {width:200px;height:30px;padding-top: 0px;font-size: 14px;width:100%}
.ztree li a:hover {text-decoration:none; background-color: #E3E3E3;}
.ztree li a span.button.switch {vertical-align:middle}
.ztree.showIcon li a span.button.switch {visibility:visible}
.ztree li a.curSelectedNode {background-color:#D4D4D4;border:0;height:30px;}
.ztree li span {line-height:30px;}
.ztree li span.button {margin-top: -4px;margin-left:3px}
.ztree li span.button.switch {width: 16px;height: 16px;}
/*.ztree li a.level0 span {font-size: 100%;font-weight: bold}*/
.ztree li span.button {background-image:url("../ztree/left_menuForOutLook.png"); *background-image:url("../ztree/left_menuForOutLook.gif")}
.ztree li span.button.switch.level0 {width: 20px; height:20px}
.ztree li span.button.switch.level1 {width: 20px; height:20px}
.ztree li span.button.noline_open {background-position: 0 0;}
.ztree li span.button.noline_close {background-position: -18px 0;}
.ztree li span.button.noline_open.level0 {background-position: 0 0;}
.ztree li span.button.noline_close.level0 {background-position:-18px 0;}
.ztree li span.button.ico_close{vertical-align: middle}
.ztree li span.button.ico_open{vertical-align: middle}
.ztree li span.button.ico_docu {vertical-align: middle}
.ztr{
/*//background{ width:100%;height:100%;position:absolute;top:0px;opacity: 0.6;background-image: url(https://s1.ax1x.com/2020/07/27/akFjER.jpg);background-size: 500px 100px;}*/
/*background:red;*/
}
.areaTree{
width: 300px;
/*height: 700px;*/
font-weight: 400;
/*overflow:auto;*/
background-color: #F6F6F6;
/* background:url('https://ftp.bmp.ovh/imgs/2020/08/4ac1d6b4f41049ef.jpg') no-repeat;*/
background-size: 100% 100%;
/*position:relative;*/
/*animation-name:mymove;*/
/*animation-duration:1s;!* 5s表示执行动画的时间0或不写则无动画效果 *!*/
/*!* 兼容调试如果animation-name执行那么-wekit-animation-name则不执行 *!*/
/*-webkit-animation-name:mymove;*/
/*-webkit-animation-duration:1s;!* 5s表示执行动画的时间0或不写则无动画效果 *!*/
}
@keyframes mymove /* 对应animation-name里面为执行的动画*/
{
from {left:-200px;}/*执行动画的初始位置*/
to {left:0px;}/*动画结束位置*/
0% {
opacity: 0.6; /*初始状态 透明度为10%*/
}
50% {
opacity: 0.9; /*中间状态 透明度为50%*/
}
100% {
opacity: 1; /*结尾状态 不透明*/
}
}
@-webkit-keyframes mymove/* 对应-webkit-animation-name里面为执行的动画*/
{
from {left:-200px;}/*执行动画的初始位置*/
to {left:300px;}/*动画结束位置*/
}
.app-main{
width: 100%;
height: 500px;
background-image: url('https://byr-navi.com/images/backgrounds/14.jpg') ;
background-size: 100%;
background-image: url("https://s1.ax1x.com/2020/08/11/aOHstP.jpg");
background-repeat: no-repeat;
height: 500px;
}
background-size: 100% 100%;
}
.sousoucss{
opacity: 0.6;
}
.sousoucss input{
border:0;
}
.sousoucss button:hover{
color: #1c84c6;
}
@ -595,5 +300,18 @@ width: 100%;
background-color: #7c6fff;
}
/*滚动条美化结束*/
/*禁止复制*/
.notcopy {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>