|
@@ -1,3 +1,4 @@
|
|
|
|
+
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
@@ -11,7 +12,12 @@
|
|
class="input-with-select"
|
|
class="input-with-select"
|
|
@keyup.enter.native="doSearch"
|
|
@keyup.enter.native="doSearch"
|
|
>
|
|
>
|
|
- <el-select v-model="searchParams.hardTypeId" class="input-with-select-select" slot="prepend" placeholder="请选择">
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="searchParams.hardTypeId"
|
|
|
|
+ class="input-with-select-select"
|
|
|
|
+ slot="prepend"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ >
|
|
<el-option
|
|
<el-option
|
|
v-for="(type,key) in typeList"
|
|
v-for="(type,key) in typeList"
|
|
:label="type.name"
|
|
:label="type.name"
|
|
@@ -49,7 +55,10 @@
|
|
v-if="isCamera(scope.row.hardTypeId)"
|
|
v-if="isCamera(scope.row.hardTypeId)"
|
|
>播放</el-button>
|
|
>播放</el-button>
|
|
<el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button>
|
|
<el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button>
|
|
- <el-button @click="handleDel(scope.row)" type="text" size="small">删除</el-button>
|
|
|
|
|
|
+ <!-- <el-button @click="handleDel(scope.row)" type="text" size="small">删除</el-button> -->
|
|
|
|
+ <el-popconfirm title="是否删除此设备的信息?" @onConfirm="handleDel(scope.row)">
|
|
|
|
+ <el-button slot="reference" type="text" size="small">删除</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
<el-button @click="subDeviceAdmin(scope.row)" type="text" size="small">子设备管理</el-button>
|
|
<el-button @click="subDeviceAdmin(scope.row)" type="text" size="small">子设备管理</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -109,11 +118,6 @@
|
|
<el-dialog :title="videoData.title" :visible.sync="isShowVideo">
|
|
<el-dialog :title="videoData.title" :visible.sync="isShowVideo">
|
|
<rtsp-player :rtspData="videoData"></rtsp-player>
|
|
<rtsp-player :rtspData="videoData"></rtsp-player>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
- <el-dialog title="子设备管理" :visible.sync="isShowSubDeviceAdmin">
|
|
|
|
- <div></div>
|
|
|
|
- </el-dialog>
|
|
|
|
- <!-- 子设备管理 -->
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -149,8 +153,7 @@ export default {
|
|
title: null,
|
|
title: null,
|
|
rtsp: null,
|
|
rtsp: null,
|
|
ws: null
|
|
ws: null
|
|
- },
|
|
|
|
- isShowSubDeviceAdmin: false
|
|
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -197,7 +200,7 @@ export default {
|
|
this.typeList = res;
|
|
this.typeList = res;
|
|
this.typeTree.push(this.typeList);
|
|
this.typeTree.push(this.typeList);
|
|
} else {
|
|
} else {
|
|
- console.log('222')
|
|
|
|
|
|
+ console.log("222");
|
|
if (res.length > 0)
|
|
if (res.length > 0)
|
|
this.typeTree.splice(
|
|
this.typeTree.splice(
|
|
this.position + 1,
|
|
this.position + 1,
|
|
@@ -215,7 +218,7 @@ export default {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
isCamera(hid) {
|
|
isCamera(hid) {
|
|
if (hid === 4 || hid === 5 || hid === 6) return true;
|
|
if (hid === 4 || hid === 5 || hid === 6) return true;
|
|
@@ -234,7 +237,7 @@ export default {
|
|
// 编辑
|
|
// 编辑
|
|
handleEdit(row) {
|
|
handleEdit(row) {
|
|
console.log(row);
|
|
console.log(row);
|
|
- row.meta = JSON.stringify(row.meta)
|
|
|
|
|
|
+ row.meta = JSON.stringify(row.meta);
|
|
if (this.formData.id) {
|
|
if (this.formData.id) {
|
|
delete this.formData.id;
|
|
delete this.formData.id;
|
|
delete this.formData.name;
|
|
delete this.formData.name;
|
|
@@ -244,17 +247,21 @@ export default {
|
|
delete this.formData.description;
|
|
delete this.formData.description;
|
|
}
|
|
}
|
|
this.formData = Object.assign({}, this.formData, row);
|
|
this.formData = Object.assign({}, this.formData, row);
|
|
- this.isShowDialog = true
|
|
|
|
|
|
+ this.isShowDialog = true;
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
handleDel(row) {
|
|
handleDel(row) {
|
|
console.log(row);
|
|
console.log(row);
|
|
- this.isShowVideo = true
|
|
|
|
|
|
+ this.isShowVideo = true;
|
|
},
|
|
},
|
|
// 子设备管理
|
|
// 子设备管理
|
|
subDeviceAdmin(row) {
|
|
subDeviceAdmin(row) {
|
|
- console.log(row)
|
|
|
|
- this.isShowSubDeviceAdmin = true
|
|
|
|
|
|
+ console.log(row);
|
|
|
|
+ // SubDeviceAdmin
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "subDeviceAdmin",
|
|
|
|
+ query: row
|
|
|
|
+ });
|
|
},
|
|
},
|
|
// 编辑的保存按钮
|
|
// 编辑的保存按钮
|
|
handleSave() {
|
|
handleSave() {
|
|
@@ -265,7 +272,7 @@ export default {
|
|
let api = isNew
|
|
let api = isNew
|
|
? "/device/device-communication/add"
|
|
? "/device/device-communication/add"
|
|
: "/device/device/device-communication/update";
|
|
: "/device/device/device-communication/update";
|
|
- this.formData.meta = JSON.parse(this.formData.meta)
|
|
|
|
|
|
+ this.formData.meta = JSON.parse(this.formData.meta);
|
|
this.fetch({
|
|
this.fetch({
|
|
api,
|
|
api,
|
|
data: this.formData,
|
|
data: this.formData,
|
|
@@ -286,7 +293,7 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
-.input-with-select-select{
|
|
|
|
- width: 180px;
|
|
|
|
|
|
+.input-with-select-select {
|
|
|
|
+ width: 180px;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|