<template>
<div>
<el-dialog
:title="title"
:visible.sync="dialogVisible"
width="80%"
:before-close="handleClose"
>
<div>
<el-row>
<el-col :span="24">
<el-button type="primary" icon="el-icon-refresh" size="small">{{ $t("lang.action.Refresh") }}</el-button>
<div class="pattern">
<el-form :inline="true" :model="formInline" size="small">
<el-form-item label="数据源">
<el-select v-model="formInline.source">
<el-option v-for="item in typeList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
</el-form-item>
<el-form-item label="所属产品">
<el-select v-model="formInline.status">
<el-option label="全部" value="" />
</el-select>
</el-form-item>
<el-form-item>
<el-form-item label="设备类型">
<el-select v-model="formInline.type">
<el-option v-for="item in typeList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
</el-form-item>
<el-form-item>
<el-form-item>
<el-input v-model="formInline.equipmentName" size="small" placeholder="请输入设备名称列表" class="input-with-select">
<el-select slot="prepend" v-model="device" placeholder="请选择">
<el-option
v-for="item in nameList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-input>
</el-form-item>
<el-button type="primary">查询</el-button>
<el-button type="primary">重置</el-button>
</el-form-item>
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
<el-table
ref="multipleTable"
:data="tableData"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
@selection-change="handleSelectionChange"
@select-all="selectAll"
>
<el-table-column
v-if="type!=='view'"
type="selection"
width="55"
/>
<el-table-column
prop="equipmentName"
label="设备名称"
width="180"
/>
<el-table-column
prop="equipmentIdentification"
label="设备标识"
width="180"
/>
<el-table-column
prop="equipmentType"
label="设备类型"
/>
<el-table-column
prop="product"
label="所属产品"
/>
</el-table>
</div>
<div class="page">
<el-pagination
background
:current-page="currntPage"
:page-sizes="[10,20,30,40,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalItems"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
<span slot="footer" class="dialog-footer">
<el-button v-stopBtnRepeat="5000" size="mini" @click="handleClose">{{ $t("lang.action.cancel") }}</el-button>
<el-button v-if="type!=='view'" v-stopBtnRepeat="5000" type="primary" size="mini" @click="submitConfirm">{{ $t("lang.action.confirm") }}</el-button>
</span>
</el-dialog>
<!-- 选择所属模型 -->
<belongingModelDialog />
<el-dialog
title="选择所属模型"
:visible.sync="modelDialogVisible"
width="30%"
:before-close="handleClose"
>
<span>这是一段信息</span>
<span slot="footer" class="dialog-footer">
<el-button @click="modelDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="modelDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import belongingModelDialog from './belongingModelDialog';
export default {
name: 'RemoteDeviceDialog',
components: {
belongingModelDialog
},
props: {
instanceUri: {
// 数据源实例uri,当传入uri变化时,需要根据uri进行过滤设备
type: String,
default: ''
},
dialogVisible: {
type: Boolean,
default: false
},
type: {
// 用来区分是查看设备还是用来实例化远程设备,
// 当为查看设备时,数据源置灰,不可操作,只能接收传来的uri,并根据数据源uri过滤数据
// 同时隐藏确认按钮以及表格树的复选框
type: String,
default: ''
}
},
data() {
return {
modelDialogVisible: false,
checkedKeys: false,
formInline: {
source: '',
status: '',
type: '',
equipmentName: ''
},
device: 1,
currntPage: 1,
pageSize: 10,
totalItems: 0,
typeList: [{
name: '全部',
code: '0'
}, {
name: '网关设备',
code: '1'
}, {
name: '直连设备',
code: '2'
}, {
name: '网关子设备',
code: '3'
},
{
name: '网关子设备(上报)',
code: '4'
}
],
nameList: [{
value: '1',
label: '设备名称'
}, {
value: '2',
label: '设备标识'
}, {
value: '3',
label: '所属产品'
}, {
value: '4',
label: '资源空间'
}],
tableData: [{
id: 1,
equipmentName: '雾感器1',
equipmentIdentification: '359090041311327',
equipmentType: '直连设备',
product: '雾感器'
}, {
id: 2,
equipmentName: '雾感器1',
equipmentIdentification: '359090041311327',
equipmentType: '直连设备',
product: '雾感器'
}, {
id: 3,
equipmentName: '网关1',
equipmentIdentification: '865441035303585',
equipmentType: '网关设备',
product: '工业网关',
children: [{
id: 31,
equipmentName: '汽轮机1',
equipmentIdentification: '764341035304564',
equipmentType: '网关子设备',
product: '汽轮机'
}, {
id: 32,
equipmentName: '立磨机2',
equipmentIdentification: '764341035304671',
equipmentType: '网关子设备',
product: '立磨机'
}]
}, {
id: 4,
equipmentName: '立磨机2',
equipmentIdentification: '764341035304671',
equipmentType: '网关子设备',
product: '立磨机'
}]
};
},
computed: {
title() {
return this.type === 'view' ? '查看设备' : '实例设备';
}
},
mounted() {
this.init();
},
methods: {
handleClose() {
this.$emit('handleClose', false);
},
submitConfirm() {
this.modelDialogVisible = true;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
selectAll() {
this.checkedKeys = !this.checkedKeys;
this.splite(this.tableData, this.checkedKeys);
},
// 处理数据
splite(data, flag) {
data.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row, flag);
if (row.children != undefined) {
this.splite(row.children);
}
});
},
init() {
this.totalItems = this.tableData.length;
},
// 每页显示条数改变触发
handleSizeChange(val) {
this.pageSize = val;
},
// 查询清空
getNewlist() {
this.currntPage = 1;
},
// 当前页改变触发
handleCurrentChange(val) {
this.currntPage = val;
}
}
};
</script>
<style scoped>
.pattern{
float:right;
}
</style>

弹框tabel树的更多相关文章

  1. layer的iframe弹框中父子元素的传值

    项目中,左侧导航树,右侧是 iframe 嵌套的页面,在右侧页面中又有layer弹框,可以说是有两层 iframe 框架. 所以查询网上的parent什么的方法都不能用.自己摸索的下面的方法: 1.父 ...

  2. 参考bootstrap中的popover.js的css画消息弹框

    前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...

  3. 安卓客户端a标签长按弹框提示解决办法

    昨天工作时候发现一个bug,是关于a标签的,在安卓客户端中,如果是a标签的话,长按会出现一个弹框,如图所示 是因为安卓客户端的长按触发机制,以后进行wap端开发的时候,如果用到跳转页面尽量不要用a标签 ...

  4. Jquary入门(添加 修改 表单元素)+ JSON+弹框

    字符串拼接 计算机语言 都是 对  数据的处理(获取/修改数据)  添加元素  除了  固定的方法添加 以外 都是   字符串拼接(拼接成固定格式即可执行). 1.表单添加元素  append() 方 ...

  5. ios UIWebView自定义Alert风格的弹框

    之前开发过一个App,因为公司之前写好了网页版的内容和安卓版本的App,我进去后老板要求我ios直接用网页的内容,而不需要自己再搭建框架.我一听,偷笑了,这不就是一个UIWebView吗?简单! 但是 ...

  6. weui 弹框中的单选效果

    <!--性别修改弹框--> <div class="weui_dialog_alert" id="doctorSexDialog" style ...

  7. showPrompt弹框提示

    工作中会有很多的弹框,用来添加模板,用来信息提示,,我现在用的模板有dialog(用来添加数据模板内容),还有一个就是自写的showPrompt用来判断错误或者正确的信息~~ 样子大概就是这样的,, ...

  8. 弹框控件 UIAlertView UIActionSheet

    // 创建弹框 从底部弹出,一般用于危险操作 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"恭喜通关" ...

  9. javascript中的弹框

    大家都见过某度中的恶意广告,你关闭了又出来了!为何,JS来告诉你 效果猛戳此处 HTML <body> <h3 class="whiteColor">无法关 ...

  10. selenium对Alert弹框的多种处理

    Alert弹框是一个很烦人的控件,因为当前页面如果弹出了该弹框,你必须要处理它,不然你就不能操作页面的其它元素,下面我列出了alert弹框在多种场景下的处理办法. 明确知道系统哪个地方会弹alert ...

随机推荐

  1. springdata(jpa)的基础使用

    jpa与mybatis-plus类似,都属于数据库相关的框架 jpa需要扫描,这里在启动类指定路径 jpa的实体类需要绑定@Entity, 与mysql表映射@Table(@name="数据 ...

  2. windows 设置网卡跳跃点

    查看路由表route print -4 添加永久路由表:192.168.1.1(网关)route add 0.0.0.0 mask 255.255.255.0 192.168.1.1 metric 1 ...

  3. js过滤掉指定html标签

    替换标签 var str = "<p><span style='color:#ccc;'>这是测试标签</span><span>这是测试htm ...

  4. unity GetComponent在android端获取对象错误

    PlayerObj pobj = go.GetComponent<PlayerObj>(); if (pobj && pobj.IsMyTeam()) { marchAct ...

  5. kernel32.dll函数简介

    kernel32.dll是非常重要的32位动态链接库文件,属于内核级文件.它控制着系统的内存管理.数据的输入输出操作和中断处理,当Windows启动时,kernel32.dll就驻留在内存中特定的写保 ...

  6. [CSP-S2019] Emiya 家今天的饭

    洛咕 题意:原题面见链接,简单来说就是给出一个\(n*m\)的矩阵,每一行代表同一种烹饪方法,每一列代表同一种食材,\(a_{i,j}\)表示使用第i种烹饪方法第j种食材能做出多少种菜,要求至少做一道 ...

  7. 算法图解 - 第1章 二分查找 与大O

    例子:猜一个1到100之间的数,最多猜几次? # 最糟糕的猜法:一个一个的猜 - 最多查找次数: n  - 运行时间: O(n) # 二分查找:在有序的一组数中猜一个数,对半猜.找到返回其位置(索引) ...

  8. js中的对象方法中this指向问题

    对象方法调用this所在函数fn的是b,所以this指向b,b.a1='hello a3' ,b没有a2属性,b.a2=undefinedvar a1='hello a1'var a2='hello ...

  9. JAVA笔记:double四舍五入并保留两位小数的方法

    1.只要输出结果 double x1 = 0.026; System.out.println(String.format("%.2f", x1)); 2.数据转换 //方案一: g ...

  10. idea常用插件 自用