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> <template>
<section> <section>
<div v-if="!show" class="from"> <div class="from">
<div class="icon-wrap"><i class="icon" /> <span>搜索</span></div> <div class="icon-wrap"><i class="icon" /> <span>搜索</span></div>
<el-form ref="ruleForm" :model="form" label-width="95px"> <el-form ref="ruleForm" :model="form" label-width="95px">
<el-form-item label="机型" prop="model"> <el-form-item label="机型" prop="model">
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
/> />
</el-select> </el-select>
</el-form-item> </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"> <p class="btn">
<el-button size="small" type="primary" @click="searchForm">查询</el-button> <el-button size="small" type="primary" @click="searchForm">查询</el-button>
<el-button size="small" @click="resetForm('ruleForm')">重置</el-button> <el-button size="small" @click="resetForm('ruleForm')">重置</el-button>
...@@ -38,10 +35,6 @@ ...@@ -38,10 +35,6 @@
export default { export default {
name: 'Left', name: 'Left',
props: { props: {
show: {
type: Boolean,
default: null
},
dataModel: { dataModel: {
type: Array, type: Array,
default: () => { default: () => {
...@@ -98,15 +91,6 @@ export default { ...@@ -98,15 +91,6 @@ export default {
this.getAddRecursion() this.getAddRecursion()
}, },
methods: { methods: {
labelShow() {
if (this.$parent.$parent &&
this.$parent.$parent.name === 'right' &&
this.$parent.$parent.isActive === 'ag') {
return false
} else {
return true
}
},
searchForm() { searchForm() {
this.$parent.$children this.$parent.$children
.filter(function(item) { .filter(function(item) {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
<div class="left-menu"> <div class="left-menu">
<searchForm <searchForm
ref="searchForm" ref="searchForm"
:show="isCollapse"
:data-model="searchData.model" :data-model="searchData.model"
/> />
<!-- <i <!-- <i
...@@ -14,7 +13,6 @@ ...@@ -14,7 +13,6 @@
<tree <tree
ref="tree" ref="tree"
class="tree" class="tree"
:is-collapse="isCollapse"
/> />
</div> </div>
</section> </section>
...@@ -48,10 +46,6 @@ export default { ...@@ -48,10 +46,6 @@ export default {
mounted() { }, mounted() { },
created() {}, created() {},
methods: { methods: {
// handleCollapse() {
// this.isCollapse = !this.isCollapse
// this.$emit('handleCollapse', this.isCollapse)
// }
} }
} }
</script> </script>
......
<template> <template>
<section v-show="!isCollapse" class="left-tree"> <section class="left-tree">
<el-tree <el-tree
ref="tree" ref="tree"
class="tree" class="tree"
...@@ -31,127 +31,42 @@ ...@@ -31,127 +31,42 @@
<script> <script>
import { post } from '@/utils/http' import { post } from '@/utils/http'
import $ from 'jquery'
export default { export default {
name: 'Tree', name: 'Tree',
props: {
isCollapse: {
type: Boolean,
default: null
}
},
data() { data() {
return { return {
// 组件唯一标识 // 组件唯一标识
name: 'tree', name: 'tree',
treeData: [], treeData: [],
rowData: {},
curId: null, curId: null,
// 判断当前组件处于指令标识还是Mbom
isMbom: false,
curNodeTitle: null,
assembly: null,
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'label' label: 'label'
}, },
curTree: {}, currentNodekey: '',
currentNodekey: '' isRefresh: false,
curData: {},
curNode: {}
} }
}, },
mounted() { mounted() {
this.$bus.$on('getPositionData', () => { this.$bus.$on('getPositionData', () => {
this.isRefresh = true
this.getTreeData() 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: { methods: {
handleNodeClick(data, node, event) { handleNodeClick(data, node, event) {
if (!data || !data.id) return 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) 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) { getTreeData(froms) {
// var that = this
if (froms) { if (froms) {
this.froms = froms this.froms = froms
} }
...@@ -213,10 +128,19 @@ export default { ...@@ -213,10 +128,19 @@ export default {
total: total total: total
}] }]
this.treeData = data 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.handleNodeClick(data[0])
this.curId = data[0].id
this.currentNodekey = data[0].id this.currentNodekey = data[0].id
}
this.$nextTick(() => { this.$nextTick(() => {
setTimeout(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey) this.$refs.tree.setCurrentKey(this.currentNodekey)
}, 1000)
}) })
}) })
.catch((err) => console.error(err)) .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