You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
5.6 KiB
Vue

2 years ago
<template>
<div class="camerChannel">
<div class="deviceBox">
<div class="deviceBtnGroup">
2 years ago
<h4>通道管理</h4>
2 years ago
<el-button
type="primary"
icon="el-icon-plus"
@click.native.stop="handleAdddevice()"
>新增</el-button
>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
:data="deviceTableData"
2 years ago
stripe
2 years ago
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 40px)"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
>
<!-- <el-table-column type="index" width="55"> </el-table-column>
<el-table-column type="selection" width="55"> </el-table-column> -->
2 years ago
<el-table-column
label="通道名称"
show-overflow-tooltip
prop="channelname"
></el-table-column>
<el-table-column
label="分辨率高"
show-overflow-tooltip
prop="maxResolutionHeight"
></el-table-column>
<el-table-column
label="分辨率宽"
show-overflow-tooltip
prop="maxResolutionWidth"
></el-table-column>
2 years ago
<el-table-column label="状态" show-overflow-tooltip>
<template slot-scope="scope">
2 years ago
<!-- <el-switch
2 years ago
v-model="scope.row.status"
:active-value="1"
:inactive-value="0"
disabled
2 years ago
></el-switch> -->
<el-tag
:type="scope.row.status == 1 ? 'success' : 'info'"
effect="dark"
>
{{ scope.row.status == 1 ? "开启" : "关闭" }}</el-tag
>
2 years ago
</template>
2 years ago
</el-table-column>
<el-table-column fixed="right" label="操作" width="200">
<template slot-scope="scope">
2 years ago
<el-button
@click.native.stop="handleResive(scope.row)"
type="text"
>修改</el-button
>
2 years ago
2 years ago
<!-- <el-button type="text" class="deleteText" @click.native.stop="handleDelete(scope.row)" >删除</el-button> -->
2 years ago
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
2 years ago
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
2 years ago
:total="total"
2 years ago
background
>
2 years ago
</el-pagination>
</div>
</div>
</div>
<!-- 新增时间表 -->
<adddeviceDialog :title="title" ref="adddeviceDialogref"></adddeviceDialog>
</div>
</template>
<script>
import adddeviceDialog from "./components/adddeviceDialog.vue";
2 years ago
import { getChannelListapi, deleteChannelapi } from "@/utils/api/index";
2 years ago
export default {
components: {
adddeviceDialog,
},
data() {
return {
title: "", //弹窗标题
deviceTableData: [],
//multipleSelection: [], //获取当前选中
page: 1, // 当前页数
pageSize: 20, // 每页数量
2 years ago
total: 0, //总条数
};
},
created() {
this.deviceList();
},
methods: {
//获取线路列表数据
deviceList() {
2 years ago
getChannelListapi({
2 years ago
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
this.deviceTableData = res.data.list;
this.total = res.data.total;
})
.catch((err) => {});
},
//点击行选中
handleRowClick(row, column, event) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//获取选中的行
handleSelectionChange(val) {
this.multipleSelection = val;
},
// 新建
handleAdddevice() {
this.title = "新增";
this.$refs.adddeviceDialogref.display();
this.$refs.adddeviceDialogref.getdataform(null);
},
//修改
handleResive(data) {
this.title = "修改";
this.$refs.adddeviceDialogref.display();
this.$refs.adddeviceDialogref.getdataform(data);
},
//删除数据
handleDelete(data) {
let deleteArr = [];
deleteArr.push({
id: data.id,
});
this.$confirm("确定要删除记录吗,同时删除关联关系?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
2 years ago
deleteChannelapi({ list: deleteArr }).then((res) => {
2 years ago
this.deviceList(); //刷新
});
2 years ago
this.$message({
showClose: true,
type: "success",
message: "删除成功!",
});
2 years ago
})
.catch(() => {
2 years ago
this.$message({
showClose: true,
type: "info",
message: "已取消删除",
});
2 years ago
});
},
//点击分页
handleCurrentChange(val) {
this.page = val;
this.deviceList();
},
//每页条数
handleSizeChange(val) {
this.pageSize = val;
this.deviceList();
},
2 years ago
},
};
</script>
<style lang="less">
.camerChannel {
width: calc(100% - 32px);
height: calc(100% - 32px);
padding: 16px 16px;
background: @color-white;
.deviceBox {
border: 1px solid #dddddd;
height: calc(100% - 32px);
padding: 16px;
border-radius: 4px;
}
.deviceBtnGroup {
display: flex;
2 years ago
justify-content: space-between;
align-items: center;
2 years ago
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 48px);
//background: #fcc;
}
}
</style>