<template>
<div class="wrapper">
<pop-nav :nav-list="navList"></pop-nav>
<pop-title>{{$t("store.shopCategory.title")}}</pop-title>
<div class="btn-group">
<pop-button type="danger">{{ $t("store.shopCategory.btnDelete") }}</pop-button>
<pop-button type="primary">{{ $t("store.shopCategory.btnExpandAll") }}</pop-button>
<pop-button type="primary">{{ $t("store.shopCategory.btnCollapseAll") }}</pop-button>
</div>
<div class="category-title">
<div class="left-title">{{ $t("store.shopCategory.catetoryTitle") }}</div>
<div class="right-title">{{ $t("store.shopCategory.addSubCategoryTitle") }}</div>
</div>
<div class="category-tree-wrapper">
<ul id="ul_shop_category_tree" class="ztree"></ul>
</div>
<div class="add-category">
<pop-button type="primary">{{ $t("store.shopCategory.btnAddCategory") }}</pop-button>
</div>
<div class="text-center">
<pop-button type="primary">{{ $t("store.shopCategory.btnSave") }}</pop-button>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import popNav from "components/common/PopNav";
import popTitle from "components/common/PopTitle";
import popButton from "components/common/PopButton";
import "ztree/css/zTreeStyle/zTreeStyle.css";
import $ from "jquery";
import "ztree/js/jquery.ztree.all.min";
// const HIDDEN_NODE_NAME = "-9999999999";
export default {
data () {
return {
cateList: [{
"children": [{
"id": 886,
"name": "new subcategory1"
}, {
"id": 887,
"name": "new subcategory2"
}],
"id": 885,
"name": "new main category1",
"shopId": 125
}, {
"children": [{
"id": 889,
"name": "new subcategory3"
}, {
"id": 890,
"name": "new subcategory4"
}],
"id": 888,
"name": "new main category2",
"shopId": 125
}, {
"children": [{
"id": 892,
"name": "new subcategory5"
}, {
"id": 893,
"name": "new subcategory6"
}],
"id": 891,
"name": "new main category3",
"shopId": 125
}, {
"children": [{
"id": 895,
"name": "new subcategory7"
}, {
"id": 896,
"name": "new subcategory8"
}],
"id": 894,
"name": "new main category4",
"shopId": 125
}, {
"children": [{
"id": 898,
"name": "new subcategory9"
}, {
"id": 899,
"name": "new subcategory10"
}],
"id": 897,
"name": "new main category5",
"shopId": 125
}]
};
},
mounted () {
this._initTreeData();
},
methods: {
_initTreeData () {
if (this.cateList) {
var setting = {
edit: {
drag: {
autoExpandTrigger: true
// prev: dropPrev,
// inner: dropInner,
// next: dropNext
},
enable: true,
showRemoveBtn: true,
showRenameBtn: true
},
data: {
key: {
children: "children"
}
},
callback: {
// beforeDrag: beforeDrag,
// beforeRemove: beforeRemove,
// beforeRename: beforeRename,
// onRemove: onRemove
},
view: {
showTitle: false,
showIcon: false,
nameIsHTML: true
}
};
let ztree = $.fn.zTree.init($("#ul_shop_category_tree"), setting, this.cateList);
ztree.expandAll(true);
let ztreeNode = ztree.getNodesByParam("level", 0);
// var hiddenTreeNode;
for (let i = 0, len = ztreeNode.length; i < len; i++) {
let aObj = $("#" + ztreeNode[i].tId + "_a");
aObj.append("<span name='span_add_category' class='add-category'>+Add SubCategory</span>");
}
}
}
},
components : {
popNav, popTitle, popButton
},
computed: {
navList () {
return [
this.$t("store.shopCategory.navFirstLevel"),
this.$t("store.shopCategory.navSecondLevel"),
this.$t("store.shopCategory.navThirdLevel")
];
}
}
};
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
.wrapper
.btn-group
padding: 29px 21px
.category-title
border-top: 1px solid #e2e2e2
border-bottom: 1px solid #e2e2e2
background-color: #f4f5f9
height: 44px
line-height: 44px
color: #333
font-size: 14px
font-weight: bold
.left-title
display: inline-block
width: 553px
padding-left: 33px
.right-title
display: inline-block
.category-tree-wrapper
padding: 12px 33px
border-bottom: 1px solid #e2e2e2
/*重寫ztree樣式*/
.ztree
width: 500px
padding: 0
overflow: visible
& *
box-sizing: border-box;
font-size: 20px;
font-weight: 700;
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微軟雅黑",Arial,sans-serif !important;
.ztree li
background-color: red
li span.button
background-image: url("./zTree_standard_category.png") !important
&.root_close,
&.roots_close,
&.center_close,
&.bottom_close,
&.noline_close
width: 7px
height: 12px
background-position: -3px -8px
&.root_docu,
&.roots_docu,
&.center_docu,
&.bottom_docu,
&.noline_docu
margin-top: 14px
margin-right: 7px
width: 18px
height: 18px
background-position: -3px -64px
li span.button.edit
width: 19px;
height: 17px;
background-position: -3px -43px;
.ztree li span.button.root_open,
.ztree li span.button.roots_open,
.ztree li span.button.center_open,
.ztree li span.button.bottom_open,
.ztree li span.button.noline_open {
width: 11px;
height: 7px;
background-position: -3px 0;
}
.ztree li span.button.remove {
width: 21px;
height: 21px;
background-position: 0 -21px;
}
.ztree li span.node_name{
display: inline-block;
width: 390px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ztree li ul.line {
background: none;
}
.ztree li a {
position: relative;
border: 1px solid #e2e2e2;
width: 420px;
height: 34px !important;
line-height: 34px;
margin-top: 12px !important;
padding: 0 15px;
}
.ztree li span {
line-height: 34px;
}
.ztree li span.button.ico_close,
.ztree li span.button.ico_open {
vertical-align: middle !important;
}
.ztree li span.button.edit {
position: absolute;
top: -8px;
right: 18px;
}
.ztree li span.button.remove {
position: absolute;
right: -10px;
top: -10px;
margin: 0;
}
.ztree li a.curSelectedNode,
.ztree li a.curSelectedNode_Edit {
background-color: #fff;
border: 1px solid #e2e2e2;
}
.ztree li span.add {
margin-top: -3px;
background-position: -145px 0;
}
.ztree li a input.rename {
position: absolute;
left: 0;
top: 0;
padding: 0 15px;
height: 32px;
width: 418px;
margin: 0;
font-size: 14px;
border: none;
}
.ztree li a input:focus.rename {
padding: 0 15px;
}
.ztree li span.add-category {
position: absolute;
left: 504px;
color: #0664b6;
font-size: 14px;
}
.add-category
padding: 20px 26px
</style>
比如說(shuō):
li
background-color: red
li span.button
background-image: url("./zTree_standard_category.png") !important
都沒(méi)有生效,不知道是什么原因
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。