|
|
|
@ -40,7 +40,8 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="监控单元" prop="monitorUnitId">
|
|
|
|
|
<treeselect v-model="queryParams.monitorUnitId" :options="monitorUnits" :show-count="true"
|
|
|
|
|
placeholder="请选择所属监控单元" :normalizer="normalizer" :flat="true" clearable style="width: 200px;"/>
|
|
|
|
|
placeholder="请选择所属监控单元" :normalizer="normalizer" :flat="true" clearable
|
|
|
|
|
style="width: 200px;"/>
|
|
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
@ -164,7 +165,7 @@
|
|
|
|
|
<dict-tag :options="dict.type.hw_device_online_status" :value="scope.row.onlineStatus"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column-->
|
|
|
|
|
<el-table-column label="设备控制" align="center" class-name="small-padding fixed-width" >
|
|
|
|
|
<el-table-column label="设备控制" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope" v-if="scope.row.deviceType=='1' || scope.row.deviceType=='3'">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
@ -237,7 +238,8 @@
|
|
|
|
|
<el-input v-model="form.deviceName" placeholder="请输入设备名称"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备类型" prop="deviceType">
|
|
|
|
|
<el-select v-model="form.deviceType" placeholder="请选择设备类型" @input="deviceTypeChange" :disabled="deviceTypeDisabled">
|
|
|
|
|
<el-select v-model="form.deviceType" placeholder="请选择设备类型" @input="deviceTypeChange"
|
|
|
|
|
:disabled="deviceTypeDisabled">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.hw_device_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
@ -307,7 +309,7 @@
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="设备模型" prop="deviceModeId" v-if="subDeviceVisible">
|
|
|
|
|
<el-form-item label="设备模型" prop="deviceModeId" v-if="deviceModeVisible">
|
|
|
|
|
<el-select v-model="form.deviceModeId" placeholder="请选择" :disabled="deviceModeDisabled">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(editedDeviceMode, index) in editedDeviceModes"
|
|
|
|
@ -447,18 +449,19 @@ export default {
|
|
|
|
|
deviceModes: [],
|
|
|
|
|
|
|
|
|
|
//编辑页面场景列表
|
|
|
|
|
editedScenes:[],
|
|
|
|
|
editedScenes: [],
|
|
|
|
|
//编辑页面监控单元树
|
|
|
|
|
editedMonitorUnits: [],
|
|
|
|
|
//编辑页面设备模型列表
|
|
|
|
|
editedDeviceModes: [],
|
|
|
|
|
//编辑页面网关设备列表
|
|
|
|
|
editedGatewayDevices: [],
|
|
|
|
|
deviceTypeDisabled:true,
|
|
|
|
|
sceneDisabled:true,
|
|
|
|
|
deviceTypeDisabled: true,
|
|
|
|
|
sceneDisabled: true,
|
|
|
|
|
subDeviceVisible: false,//子设备字段是否显示
|
|
|
|
|
deviceVisible: false,//网关设备或直连设备字段是否显示
|
|
|
|
|
deviceModeDisabled:true,
|
|
|
|
|
deviceModeVisible: false,//设备模型是否显示
|
|
|
|
|
deviceModeDisabled: true,
|
|
|
|
|
|
|
|
|
|
DEVICE_TYPE_GATEWAY_DEVICE: "1",//网关设备
|
|
|
|
|
DEVICE_TYPE_GATEWAY_SUB_EQUIPMENT: "2",//网关子设备
|
|
|
|
@ -473,7 +476,7 @@ export default {
|
|
|
|
|
DEVICE_STATUS_PUBLISHED: "1",//设备状态:已发布
|
|
|
|
|
ACTIVE_STATUS_INACTIVE: "0",//激活状态:未激活
|
|
|
|
|
|
|
|
|
|
confirmBtnVisible : true,
|
|
|
|
|
confirmBtnVisible: true,
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
@ -602,6 +605,7 @@ export default {
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.subDeviceVisible = true;
|
|
|
|
|
this.deviceModeVisible = true;
|
|
|
|
|
this.deviceVisible = false;
|
|
|
|
|
this.form = {
|
|
|
|
|
deviceId: null,
|
|
|
|
@ -673,7 +677,7 @@ export default {
|
|
|
|
|
this.reset();
|
|
|
|
|
const deviceId = row.deviceId || this.ids
|
|
|
|
|
getDevice(deviceId).then(response => {
|
|
|
|
|
if(response.data.deviceStatus===this.DEVICE_STATUS_PUBLISHED){
|
|
|
|
|
if (response.data.deviceStatus === this.DEVICE_STATUS_PUBLISHED) {
|
|
|
|
|
this.confirmBtnVisible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -684,13 +688,19 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.getEditedMonitorTree(response.data.sceneId);
|
|
|
|
|
if (response.data.deviceType === this.DEVICE_TYPE_GATEWAY_DEVICE
|
|
|
|
|
|| response.data.deviceType === this.DEVICE_TYPE_DIRECT_CONNECT_DEVICE) {
|
|
|
|
|
if (response.data.deviceType === this.DEVICE_TYPE_GATEWAY_DEVICE) {
|
|
|
|
|
this.subDeviceVisible = false;
|
|
|
|
|
this.deviceVisible = true;
|
|
|
|
|
this.deviceModeVisible = false;
|
|
|
|
|
} else if (response.data.deviceType === this.DEVICE_TYPE_DIRECT_CONNECT_DEVICE) {
|
|
|
|
|
this.subDeviceVisible = false;
|
|
|
|
|
this.deviceVisible = true;
|
|
|
|
|
this.deviceModeVisible = true;
|
|
|
|
|
this.getEditedDeviceModes(response.data.sceneId);
|
|
|
|
|
} else {
|
|
|
|
|
this.subDeviceVisible = true;
|
|
|
|
|
this.deviceVisible = false;
|
|
|
|
|
this.deviceModeVisible = true;
|
|
|
|
|
this.getEditedDeviceModes(response.data.sceneId);
|
|
|
|
|
this.getGatewayDevices(response.data.sceneId);
|
|
|
|
|
}
|
|
|
|
@ -752,7 +762,7 @@ export default {
|
|
|
|
|
const deviceType = row.deviceType;
|
|
|
|
|
const deviceCode = row.deviceCode;
|
|
|
|
|
this.$modal.confirm('是否确认删除设备信息ID为"' + deviceId + '"的数据项?').then(function () {
|
|
|
|
|
return delDevice(deviceId,deviceType);
|
|
|
|
|
return delDevice(deviceId, deviceType);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
@ -923,11 +933,14 @@ export default {
|
|
|
|
|
this.form.dataFormat = this.DEVICE_DATA_FORMAT_JSON;
|
|
|
|
|
this.deviceVisible = true;
|
|
|
|
|
this.subDeviceVisible = false;
|
|
|
|
|
|
|
|
|
|
this.deviceModeVisible = deviceType === this.DEVICE_TYPE_DIRECT_CONNECT_DEVICE;
|
|
|
|
|
} else {
|
|
|
|
|
this.form.networkingMode = null;
|
|
|
|
|
this.form.accessProtocol = null;
|
|
|
|
|
this.form.dataFormat = null;
|
|
|
|
|
this.subDeviceVisible = true;
|
|
|
|
|
this.deviceModeVisible = true;
|
|
|
|
|
this.deviceVisible = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -964,7 +977,7 @@ export default {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
let text = row.deviceStatus === "0" ? "测试" : "发布";
|
|
|
|
|
this.$modal.confirm('确认要改为'+text+'状态吗?').then(function () {
|
|
|
|
|
this.$modal.confirm('确认要改为' + text + '状态吗?').then(function () {
|
|
|
|
|
return changeDeviceStatus(row.deviceId, row.deviceStatus);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess("修改状态成功");
|
|
|
|
@ -973,8 +986,8 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
publishControlCommand(row,type,typeName){
|
|
|
|
|
this.$modal.confirm('确认要下发指令'+typeName+'么?').then(function () {
|
|
|
|
|
publishControlCommand(row, type, typeName) {
|
|
|
|
|
this.$modal.confirm('确认要下发指令' + typeName + '么?').then(function () {
|
|
|
|
|
return publishControlCommand(row.deviceId, type);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess("下发指令成功");
|
|
|
|
|