树状图过滤

master
fanluyan 2 years ago
parent f2c82e73d6
commit e81038fb78

@ -179,7 +179,12 @@
>
</el-table-column> -->
<el-table-column fixed="right" label="操作" width="580">
<el-table-column
fixed="right"
label="操作"
width="580"
v-if="roleUser != 2"
>
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
@ -251,6 +256,50 @@
>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="380" v-else>
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
type="text"
>修改</el-button
>
<el-button
type="text"
@click.native.stop="handlepicture(scope.row)"
>图片标记</el-button
>
<el-button
type="text"
@click.native.stop="handleShowGPS(scope.row)"
>获取GPS位置</el-button
>
<el-dropdown
class="dropgps"
trigger="click"
@command="
(command) => {
handleCommand(command, scope.row);
}
"
>
<span class="el-dropdown-link">
GPS开关<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown" class="gpsdropStyle">
<el-dropdown-item command="open">开启GPS</el-dropdown-item>
<el-dropdown-item command="close">关闭GPS</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@ -299,6 +348,7 @@ export default {
},
data() {
return {
roleUser: "",
terminalTableData: [], //
photoDialog: false, //
photoDialogTitle: "", //
@ -525,6 +575,8 @@ export default {
},
created() {
this.terminalList();
this.roleUser = localStorage.getItem("role");
console.log(this.roleUser);
},
};
</script>

@ -3,6 +3,10 @@
<div class="monitor-container">
<!-- 左侧数据列表树 -->
<div class="sideBar">
<div class="searchBar">
<el-input placeholder="输入关键字进行过滤" v-model="filterText">
</el-input>
</div>
<el-tree
:data="lineTreeData"
:props="defaultProps"
@ -12,6 +16,7 @@
:default-expand-all="true"
@node-click="handleNodeClick"
:current-node-key="currentNodekey"
:filter-node-method="filterNode"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level === 1">
@ -246,6 +251,7 @@ export default {
lineTreeData: [],
treeStatus: [],
statusTimer: null,
filterText: "",
defaultProps: {
//
children: "list",
@ -274,14 +280,13 @@ export default {
zzstatus: "",
};
},
// watch: {
// lineTreeData: {
// handler() {
// console.log("count");
// },
// immediate: true, //
// },
// },
watch: {
filterText(val) {
console.log(val);
this.$refs.tree.filter(val);
console.log(this.$refs.tree);
},
},
computed: {
...mapState(["channelid", "termid"]),
channelid() {
@ -304,6 +309,12 @@ export default {
}, 300000);
},
methods: {
//
filterNode(value, data) {
console.log(value, data);
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
//
getDateTime() {
this.dateValue = new Date().getTime();
@ -741,9 +752,16 @@ export default {
.sideBar {
width: 300px;
border-right: 1px solid @border-color-base;
overflow: auto;
display: flex;
flex-direction: column;
padding: 16px 0px;
.searchBar {
width: 94%;
margin: 0 auto;
margin-bottom: 16px;
}
.el-tree {
overflow: auto;
.el-tree-node__content {
height: 40px;
font-size: 12px;

@ -135,7 +135,6 @@ export default {
display() {
this.isShow = true;
this.roleUser = localStorage.getItem("role");
console.log();
},
hide() {
this.isShow = false;

Loading…
Cancel
Save