Commit 08709bc4 authored by jingnan's avatar jingnan 👀

Merge branch 'dev' of http://94.191.100.41/tfmom/tf-mom-web into dev

parents 755e3742 feb80ec5
<template>
<section>
<div v-if="!show" class="from">
<div class="from">
<div class="icon-wrap"><i class="icon" /> <span>搜索</span></div>
<el-form ref="ruleForm" :model="form" label-width="95px">
<el-form-item label="机型" prop="model">
......@@ -23,9 +23,6 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="labelShow()" label="AO(号/名称)" prop="aoName">
<el-input v-model="form.aoName" clearable class="input-with-select el-input--small" @change="searchAoname" />
</el-form-item> -->
<p class="btn">
<el-button size="small" type="primary" @click="searchForm">查询</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
......@@ -38,10 +35,6 @@
export default {
name: 'Left',
props: {
show: {
type: Boolean,
default: null
},
dataModel: {
type: Array,
default: () => {
......@@ -98,15 +91,6 @@ export default {
this.getAddRecursion()
},
methods: {
labelShow() {
if (this.$parent.$parent &&
this.$parent.$parent.name === 'right' &&
this.$parent.$parent.isActive === 'ag') {
return false
} else {
return true
}
},
searchForm() {
this.$parent.$children
.filter(function(item) {
......
......@@ -3,7 +3,6 @@
<div class="left-menu">
<searchForm
ref="searchForm"
:show="isCollapse"
:data-model="searchData.model"
/>
<!-- <i
......@@ -14,7 +13,6 @@
<tree
ref="tree"
class="tree"
:is-collapse="isCollapse"
/>
</div>
</section>
......@@ -48,10 +46,6 @@ export default {
mounted() { },
created() {},
methods: {
// handleCollapse() {
// this.isCollapse = !this.isCollapse
// this.$emit('handleCollapse', this.isCollapse)
// }
}
}
</script>
......
<template>
<section v-show="!isCollapse" class="left-tree">
<section class="left-tree">
<el-tree
ref="tree"
class="tree"
......@@ -31,127 +31,42 @@
<script>
import { post } from '@/utils/http'
import $ from 'jquery'
export default {
name: 'Tree',
props: {
isCollapse: {
type: Boolean,
default: null
}
},
data() {
return {
// 组件唯一标识
name: 'tree',
treeData: [],
rowData: {},
curId: null,
// 判断当前组件处于指令标识还是Mbom
isMbom: false,
curNodeTitle: null,
assembly: null,
defaultProps: {
children: 'children',
label: 'label'
},
curTree: {},
currentNodekey: ''
currentNodekey: '',
isRefresh: false,
curData: {},
curNode: {}
}
},
mounted() {
this.$bus.$on('getPositionData', () => {
this.isRefresh = true
this.getTreeData()
})
// const that = this
// if (that.$parent.$parent.name === 'right') {
// that.assembly = that.$parent.$parent.$parent.$parent
// that.isMbom = true
// } else {
// that.assembly = that.$parent.$parent.$children.filter(function(item) {
// return item.name === 'right'
// })[0]
// }
},
methods: {
handleNodeClick(data, node, event) {
if (!data || !data.id) return
this.curId = data.id
this.curData = data
this.curNode = node
this.$bus.$emit('getPlanData', data, node ? node.level : data.level)
},
/**
* 高亮状态
*/
highlightTreeRow() {
if (this.isMbom) {
this.$nextTick(() => {
if (
this.assembly.isActive === 'ag' ||
this.assembly.isActive === 'ins'
) {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('hhover')
} else {
$(ele).addClass('disabled')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
} else {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
}
})
} else {
this.$nextTick(() => {
$('.el-tree-node__content').each((index, ele) => {
$(ele).removeClass('disabled')
$(ele).removeClass('is-curr')
if ($(ele).find('.is-leaff').length) {
$(ele).addClass('disabled')
} else {
$(ele).addClass('hhover')
}
if ($(ele).find('.is-curr').length) {
$(ele).addClass('is-curr')
}
})
})
}
},
statuwMbom(id) {
if (id) {
this.curId = id
}
const that = this
if (that.isMbom) {
if (this.assembly.isActive === 'ass') {
this.handleNodeClick(that.data[0].children[0], this.froms.aoName)
} else {
this.handleNodeClick(that.data[0], this.froms.aoName)
}
}
this.highlightTreeRow()
},
/**
* 获取树结构数据
*/
getTreeData(froms) {
// var that = this
if (froms) {
this.froms = froms
}
......@@ -213,10 +128,19 @@ export default {
total: total
}]
this.treeData = data
if (this.isRefresh) {
this.handleNodeClick(this.curData, this.curNode)
this.curId = this.curData.id
this.currentNodekey = this.curData.id
} else {
this.handleNodeClick(data[0])
this.curId = data[0].id
this.currentNodekey = data[0].id
}
this.$nextTick(() => {
setTimeout(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey)
}, 1000)
})
})
.catch((err) => console.error(err))
......
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