|
@ -25,7 +25,8 @@ |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="paramName" label="参数名称" align="center"> |
|
|
<el-table-column prop="paramName" label="参数名称" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<span>{{ scope.row.displayParams?scope.row.displayParams.map(x => x.paramName).join(','):'' }}</span> |
|
|
|
|
|
|
|
|
<span v-if="scope.row.displayParams && scope.row.displayParams.map">{{ scope.row.displayParams.map(x => x.paramName).join(',') }}</span> |
|
|
|
|
|
<span v-else>{{ scope.row.displayParams?scope.row.displayParams:'' }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="bindState" label="绑定状态" align="center" width="150"> |
|
|
<el-table-column prop="bindState" label="绑定状态" align="center" width="150"> |
|
@ -50,15 +51,15 @@ |
|
|
<!-- <input-select :options="options" @selectValue="handleSelectValue" /> --> |
|
|
<!-- <input-select :options="options" @selectValue="handleSelectValue" /> --> |
|
|
<p class="form-first">{{ form.divPosition }}</p> |
|
|
<p class="form-first">{{ form.divPosition }}</p> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="设备绑定" prop="deviceInfo"> |
|
|
|
|
|
<el-select v-model="form.deviceInfo" placeholder="请选择" clearable filterable @change="getParamsOptionsList"> |
|
|
|
|
|
|
|
|
<el-form-item label="设备绑定" prop="deviceInfo.id"> |
|
|
|
|
|
<el-select v-model="form.deviceInfo.id" placeholder="请选择" clearable filterable @change="getParamsOptionsList"> |
|
|
<el-option v-for="item in devOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<el-option v-for="item in devOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<span style="float: left">{{ item.label }} - {{ item.info }}</span> |
|
|
<span style="float: left">{{ item.label }} - {{ item.info }}</span> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="参数绑定" prop="paramName"> |
|
|
|
|
|
<el-select ref="paramsSelect" v-model="paramsVal" filterable multiple clearable placeholder="请选择" :disabled="form.divPosition && form.divPosition.includes('CAM')"> |
|
|
|
|
|
|
|
|
<el-form-item label="参数绑定" prop="displayParams"> |
|
|
|
|
|
<el-select ref="paramsSelect" v-model="form.displayParams" filterable :multiple="form.divPosition && form.divPosition.includes('OAO')" clearable placeholder="请选择" :disabled="form.divPosition && form.divPosition.includes('CAM')"> |
|
|
<el-option v-for="item in paramsOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<el-option v-for="item in paramsOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
<span style="float: left">{{ item.label }} - {{ item.info }}</span> |
|
|
<span style="float: left">{{ item.label }} - {{ item.info }}</span> |
|
|
</el-option> |
|
|
</el-option> |
|
@ -95,7 +96,7 @@ export default { |
|
|
dialogVisible: false, |
|
|
dialogVisible: false, |
|
|
cameraTypeId: '', |
|
|
cameraTypeId: '', |
|
|
airEquipmentTypeId: '', |
|
|
airEquipmentTypeId: '', |
|
|
form: {}, |
|
|
|
|
|
|
|
|
form: { deviceInfo: {}}, |
|
|
// 设备绑定 |
|
|
// 设备绑定 |
|
|
devVal: '', |
|
|
devVal: '', |
|
|
devOptions: [], |
|
|
devOptions: [], |
|
@ -135,23 +136,28 @@ export default { |
|
|
}, |
|
|
}, |
|
|
handleBindParam() { |
|
|
handleBindParam() { |
|
|
if (this.selections.length === 1) { |
|
|
if (this.selections.length === 1) { |
|
|
console.log(this.selections[0]) |
|
|
|
|
|
this.form = this.selections[0] |
|
|
|
|
|
// this.devVal = this.form.devName |
|
|
|
|
|
// this.devOptions |
|
|
|
|
|
|
|
|
this.form = JSON.parse(JSON.stringify(this.selections[0])) |
|
|
|
|
|
if (!this.form.deviceInfo) { |
|
|
|
|
|
this.form.deviceInfo = {} |
|
|
|
|
|
} |
|
|
let deviceTypeId |
|
|
let deviceTypeId |
|
|
if (this.form.divPosition.indexOf('CAM') > 0) { |
|
|
|
|
|
|
|
|
const isCAM = this.form.divPosition.includes('CAM') |
|
|
|
|
|
if (isCAM) { |
|
|
deviceTypeId = this.cameraTypeId |
|
|
deviceTypeId = this.cameraTypeId |
|
|
} else { |
|
|
} else { |
|
|
deviceTypeId = this.airEquipmentTypeId |
|
|
deviceTypeId = this.airEquipmentTypeId |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取设备选项 |
|
|
crudDevice.getDeviceList({ storeroomId: this.room, deviceTypeId: deviceTypeId }).then((data) => { |
|
|
crudDevice.getDeviceList({ storeroomId: this.room, deviceTypeId: deviceTypeId }).then((data) => { |
|
|
let isCamera = false |
|
|
let isCamera = false |
|
|
if (this.form.divPosition.indexOf('CAM') > 0) { |
|
|
|
|
|
|
|
|
if (isCAM) { |
|
|
isCamera = true |
|
|
isCamera = true |
|
|
} |
|
|
} |
|
|
this.devOptions = data.content.map(data => { return { value: data.id, label: data.deviceName, info: isCamera ? data.videoRoute : data.deviceId } }) |
|
|
|
|
|
|
|
|
this.devOptions = data.content.map(data => { return { value: data.id, label: data.deviceName, info: isCamera ? data.videoRoute : data.deviceId, self: data } }) |
|
|
}) |
|
|
}) |
|
|
|
|
|
if (!isCAM && this.form.deviceInfo.id) { |
|
|
|
|
|
this.getParamsOptionsList() |
|
|
|
|
|
} |
|
|
this.dialogVisible = true |
|
|
this.dialogVisible = true |
|
|
} else { |
|
|
} else { |
|
|
this.$message({ |
|
|
this.$message({ |
|
@ -165,7 +171,20 @@ export default { |
|
|
this.$refs.table.toggleRowSelection(row) // 单选选中 |
|
|
this.$refs.table.toggleRowSelection(row) // 单选选中 |
|
|
}, |
|
|
}, |
|
|
handleConfirm() { |
|
|
handleConfirm() { |
|
|
this.dialogVisible = false |
|
|
|
|
|
|
|
|
this.form.deviceInfo = this.devOptions.find((option) => { return option.value === this.form.deviceInfo.id }).self |
|
|
|
|
|
if (Array.isArray(this.form.displayParams)) { |
|
|
|
|
|
const paramValues = this.paramsOptions.filter((option) => { return this.form.displayParams.includes(option.value) }) |
|
|
|
|
|
this.form.displayParams = paramValues.map((paramValue) => { return { paramName: paramValue.self.paramName, paramValue: paramValue.self.paramId, unit: paramValue.self.unit } }) |
|
|
|
|
|
} else if (this.form.displayParams !== null) { |
|
|
|
|
|
const paramValue = this.paramsOptions.find((option) => { return option.value === this.form.displayParams }) |
|
|
|
|
|
if (paramValue) { |
|
|
|
|
|
this.form.displayParams = [] |
|
|
|
|
|
this.form.displayParams.push({ paramName: paramValue.self.paramName, paramValue: paramValue.self.paramId, unit: paramValue.self.paramId }) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
displayConfigApi.bind(this.form).then(() => { |
|
|
|
|
|
this.getDisplayConfigList() |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getDisplayConfigList() { |
|
|
getDisplayConfigList() { |
|
|
displayConfigApi.list({ storeroomId: this.room }).then((data) => { |
|
|
displayConfigApi.list({ storeroomId: this.room }).then((data) => { |
|
@ -173,8 +192,8 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
getParamsOptionsList() { |
|
|
getParamsOptionsList() { |
|
|
getParams({ deviceInfoId: this.form.deviceInfo }).then((data) => { |
|
|
|
|
|
this.paramsOptions = data.map(data => { return { value: data.id, label: data.paramName, info: data.paramId } }) |
|
|
|
|
|
|
|
|
getParams({ deviceInfoId: this.form.deviceInfo.id }).then((data) => { |
|
|
|
|
|
this.paramsOptions = data.map(data => { return { value: data.id, label: data.paramName, info: data.paramId, self: data } }) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|