|
@@ -5,7 +5,23 @@
|
|
|
</div>
|
|
</div>
|
|
|
<el-container class="content-height-fit">
|
|
<el-container class="content-height-fit">
|
|
|
<inner-sidebar>
|
|
<inner-sidebar>
|
|
|
- <DeviceTree @node-click="handleTreeClick" />
|
|
|
|
|
|
|
+ <div id="project-section-tree">
|
|
|
|
|
+ <el-tree
|
|
|
|
|
+ ref="tree"
|
|
|
|
|
+ style="margin-top:5px;"
|
|
|
|
|
+ class="filter-tree"
|
|
|
|
|
+ :props="treeProps"
|
|
|
|
|
+ :highlight-current="true"
|
|
|
|
|
+ :data="treeData"
|
|
|
|
|
+ @node-click="nodeClick"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span slot-scope="{ data }" class="custom-tree-node">
|
|
|
|
|
+ <el-tag v-if="data.isDevice && data.deviceType===0" size="mini" type="danger">架桥机</el-tag>
|
|
|
|
|
+ <el-tag v-if="data.isDevice && data.deviceType===1" size="mini" type="danger">运梁车</el-tag>
|
|
|
|
|
+ <span>{{ data.name }}</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </el-tree>
|
|
|
|
|
+ </div>
|
|
|
</inner-sidebar>
|
|
</inner-sidebar>
|
|
|
<el-container class="resize-fit-container">
|
|
<el-container class="resize-fit-container">
|
|
|
<div>
|
|
<div>
|
|
@@ -22,8 +38,6 @@
|
|
|
<script>
|
|
<script>
|
|
|
import * as interfaceApi from '@/api/device-manage.js'
|
|
import * as interfaceApi from '@/api/device-manage.js'
|
|
|
import * as griderApi from '@/api/grider-erection'
|
|
import * as griderApi from '@/api/grider-erection'
|
|
|
-import * as areaApi from '@/api/backbone/section-area'
|
|
|
|
|
-import * as dictEntryApi from '@/api/dict-entry.js'
|
|
|
|
|
const defaultSettings = require('@/settings.js')
|
|
const defaultSettings = require('@/settings.js')
|
|
|
// import ProjectSectionTree from '@/views/projects/components/ProjectSectionTree'
|
|
// import ProjectSectionTree from '@/views/projects/components/ProjectSectionTree'
|
|
|
import DeviceTree from '@/views/projects/components/DeviceTree.vue'
|
|
import DeviceTree from '@/views/projects/components/DeviceTree.vue'
|
|
@@ -50,40 +64,61 @@ export default {
|
|
|
},
|
|
},
|
|
|
dialogFormVisible: false,
|
|
dialogFormVisible: false,
|
|
|
dialogStatus: '',
|
|
dialogStatus: '',
|
|
|
- node: {},
|
|
|
|
|
griders: [],
|
|
griders: [],
|
|
|
|
|
+ treeFilterText: '',
|
|
|
|
|
+ treeData: [],
|
|
|
|
|
+ treeProps: {
|
|
|
|
|
+ children: 'children',
|
|
|
|
|
+ label: 'name',
|
|
|
|
|
+ isLeaf: 'isDevice'
|
|
|
|
|
+ },
|
|
|
|
|
+ tkySectionId: this.$route.query.token,
|
|
|
formLoading: false
|
|
formLoading: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
|
|
+ treeFilterText(val) {
|
|
|
|
|
+ this.$refs.tree.filter(val)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
try {
|
|
try {
|
|
|
this.$store.dispatch('user/clientCredentials')
|
|
this.$store.dispatch('user/clientCredentials')
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ this.loadTreeNode()
|
|
|
|
|
+ })
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
} catch (ex) {
|
|
} catch (ex) {
|
|
|
console.log(ex)
|
|
console.log(ex)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- getJQJTypes() {
|
|
|
|
|
- dictEntryApi.getJQJTypes().then(res => {
|
|
|
|
|
- res.forEach(t => {
|
|
|
|
|
- t.code = t.code - 0
|
|
|
|
|
- })
|
|
|
|
|
- this.jqjTypes = res
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ filterTree(value, data) {
|
|
|
|
|
+ if (!value) return true
|
|
|
|
|
+ return data.name.indexOf(value) !== -1
|
|
|
},
|
|
},
|
|
|
- getYLCTypes() {
|
|
|
|
|
- dictEntryApi.getYLCTypes().then(res => {
|
|
|
|
|
- res.forEach(t => {
|
|
|
|
|
- t.code = t.code - 0
|
|
|
|
|
|
|
+ loadTreeNode(node, resolve) {
|
|
|
|
|
+ griderApi.getDeviceList(this.tkySectionId)
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ res.forEach(t => {
|
|
|
|
|
+ t.isDevice = true
|
|
|
|
|
+ t.code = t.deviceNo
|
|
|
|
|
+ t.name = t.tkySectionName + t.deviceName
|
|
|
|
|
+ t.children = []
|
|
|
|
|
+ })
|
|
|
|
|
+ this.treeData = res
|
|
|
|
|
+ if (this.treeData.length > 0) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ document
|
|
|
|
|
+ .querySelector('.custom-tree-node')
|
|
|
|
|
+ .click()
|
|
|
|
|
+ })
|
|
|
|
|
+ // this.nodeClick(this.treeData[0])
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
- this.ylcTypes = res
|
|
|
|
|
- })
|
|
|
|
|
},
|
|
},
|
|
|
// 树形事件
|
|
// 树形事件
|
|
|
- handleTreeClick(data) {
|
|
|
|
|
|
|
+ nodeClick(data) {
|
|
|
this.node = data
|
|
this.node = data
|
|
|
if (data.isDevice) {
|
|
if (data.isDevice) {
|
|
|
this.listQuery.deviceCode = data.deviceNo
|
|
this.listQuery.deviceCode = data.deviceNo
|
|
@@ -97,29 +132,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- getArea() {
|
|
|
|
|
- this.areas = []
|
|
|
|
|
- areaApi.lookupBySection(this.listQuery.sectionId).then(res => {
|
|
|
|
|
- res.forEach(t => {
|
|
|
|
|
- this.areas.push({
|
|
|
|
|
- id: t.id,
|
|
|
|
|
- name: t.name
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- getAreaName(areaId) {
|
|
|
|
|
- const area = this.areas.find(t => t.id === areaId)
|
|
|
|
|
- if (area) {
|
|
|
|
|
- return area.name
|
|
|
|
|
- } else {
|
|
|
|
|
- return ''
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 清空下拉
|
|
|
|
|
- delValue(parameter) {
|
|
|
|
|
- this.listQuery[parameter] = undefined
|
|
|
|
|
- },
|
|
|
|
|
// 获取数据列表
|
|
// 获取数据列表
|
|
|
getList() {
|
|
getList() {
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
@@ -138,10 +150,10 @@ export default {
|
|
|
this.listLoading = false
|
|
this.listLoading = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- nodeClick(beamCode) {
|
|
|
|
|
- this.listQuery.beamCode = beamCode
|
|
|
|
|
- this.getList()
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // nodeClick(beamCode) {
|
|
|
|
|
+ // this.listQuery.beamCode = beamCode
|
|
|
|
|
+ // this.getList()
|
|
|
|
|
+ // },
|
|
|
// 查询
|
|
// 查询
|
|
|
handleFilter() {
|
|
handleFilter() {
|
|
|
this.listQuery.skipCount = 0
|
|
this.listQuery.skipCount = 0
|