|
|
|
@ -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>
|
|
|
|
|
|
|
|
|
@ -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"
|
|
|
|
@ -458,6 +460,7 @@ export default {
|
|
|
|
|
sceneDisabled: true,
|
|
|
|
|
subDeviceVisible: false,//子设备字段是否显示
|
|
|
|
|
deviceVisible: false,//网关设备或直连设备字段是否显示
|
|
|
|
|
deviceModeVisible: false,//设备模型是否显示
|
|
|
|
|
deviceModeDisabled: true,
|
|
|
|
|
|
|
|
|
|
DEVICE_TYPE_GATEWAY_DEVICE: "1",//网关设备
|
|
|
|
@ -602,6 +605,7 @@ export default {
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.subDeviceVisible = true;
|
|
|
|
|
this.deviceModeVisible = true;
|
|
|
|
|
this.deviceVisible = false;
|
|
|
|
|
this.form = {
|
|
|
|
|
deviceId: null,
|
|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|