Commit 7a37bf19 authored by 周远喜's avatar 周远喜

ok

parent 3daadc1b
<template>
<div class="flex fd tree-menu">
<h3 class="stitle pl10">
<h3>
产品结构
<div class="fr mr10 mt10">
<ButtonGroup class="fr" size="small">
......@@ -15,7 +15,7 @@
</div>
</h3>
<div class="search">
<Input search placeholder="关键字" v-model="keys" clearable/>
<Input search placeholder="关键字" v-model="keys" clearable />
</div>
<div class="fg">
<div class="tree">
......@@ -61,48 +61,48 @@ export default {
toggle() {
this.expand = !this.expand;
},
change(v,b) {
let ids=[];
change(v, b) {
let ids = [];
ids.push(b.value);
if(b.children){
if (b.children) {
addId(b.children);
function addId(data){
data.map(u=>{
ids.push(u.value)
if(u.children){
addId(u.children)
function addId(data) {
data.map(u => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
})
});
}
}
this.$emit("on-select",b.value,b,ids)
this.$emit("on-select", b.value, b, ids);
},
hide(){
this.$emit("on-hide")
hide() {
this.$emit("on-hide");
}
},
computed: {
data() {
let items = this.$u.clone(this.list);
let expand = this.expand;
let result=[];
search(this.keys,items)
function search(keys,data){
data.map(u=>{
if(keys.length<3){
u.expand=expand;
let result = [];
search(this.keys, items);
function search(keys, data) {
data.map(u => {
if (keys.length < 3) {
u.expand = expand;
result.push(u);
} else {
u.expand = expand;
if (u.title.indexOf(keys) > -1) {
result.push(u);
}else{
u.expand=expand;
if(u.title.indexOf(keys)>-1){
result.push(u);
}else if(u.children){
search(keys,u.children)
}
} else if (u.children) {
search(keys, u.children);
}
})
}
return result;
}
});
}
return result;
}
}
};
......@@ -110,6 +110,17 @@ export default {
<style lang="less">
.tree-menu {
h3 {
height: 50px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 50px;
color: rgba(81, 90, 110, 1);
background:rgba(245,246,250,1);
opacity: 1;
padding-left: 10px;
}
.search {
height: 50px;
padding: 5px 10px;
......
......@@ -6,6 +6,7 @@
.con {
padding: 5px 5px 0px 10px;
}
background: rgba(245,246,250,1);
}
.fullWindow {
position: fixed;
......@@ -37,10 +38,6 @@
</a>
</div>
<Content class="con">
<!-- <a class="detail_href" @click="view">
<Icon type="ios-undo-outline" />详情页面
</a>-->
<Card class="h100">
<DataGrid :columns="columns" ref="grid" :action="action" class="card_box">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
......@@ -64,7 +61,6 @@
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
</Card>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment