Browse Source

3D库房配置页面

master
z_yu 3 years ago
parent
commit
847680f4d7
  1. 21
      src/api/storeManage/displayConfig/index.js
  2. 51
      src/views/storeManage/warehouse3DConfig/index.vue

21
src/api/storeManage/displayConfig/index.js

@ -8,27 +8,12 @@ export function list(params) {
})
}
export function bingdingLabel(data) {
export function bind(data) {
return request({
url: 'api/tag/bingdingLabel',
url: 'api/displayconfig/bind',
method: 'post',
data
})
}
export function unbindTag(data) {
return request({
url: 'api/tag/unbindTag',
method: 'post',
data
})
}
export function initTagLogList(parameter) {
return request({
url: 'api/tag/initTagLogList',
method: 'get',
params: parameter
})
}
export default { list, bingdingLabel, unbindTag, initTagLogList }
export default { list, bind }

51
src/views/storeManage/warehouse3DConfig/index.vue

@ -25,7 +25,8 @@
</el-table-column>
<el-table-column prop="paramName" label="参数名称" align="center">
<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>
</el-table-column>
<el-table-column prop="bindState" label="绑定状态" align="center" width="150">
@ -50,15 +51,15 @@
<!-- <input-select :options="options" @selectValue="handleSelectValue" /> -->
<p class="form-first">{{ form.divPosition }}</p>
</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">
<span style="float: left">{{ item.label }}&nbsp;-&nbsp;{{ item.info }}</span>
</el-option>
</el-select>
</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">
<span style="float: left">{{ item.label }}&nbsp;-&nbsp;{{ item.info }}</span>
</el-option>
@ -95,7 +96,7 @@ export default {
dialogVisible: false,
cameraTypeId: '',
airEquipmentTypeId: '',
form: {},
form: { deviceInfo: {}},
//
devVal: '',
devOptions: [],
@ -135,23 +136,28 @@ export default {
},
handleBindParam() {
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
if (this.form.divPosition.indexOf('CAM') > 0) {
const isCAM = this.form.divPosition.includes('CAM')
if (isCAM) {
deviceTypeId = this.cameraTypeId
} else {
deviceTypeId = this.airEquipmentTypeId
}
//
crudDevice.getDeviceList({ storeroomId: this.room, deviceTypeId: deviceTypeId }).then((data) => {
let isCamera = false
if (this.form.divPosition.indexOf('CAM') > 0) {
if (isCAM) {
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
} else {
this.$message({
@ -165,7 +171,20 @@ export default {
this.$refs.table.toggleRowSelection(row) //
},
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() {
displayConfigApi.list({ storeroomId: this.room }).then((data) => {
@ -173,8 +192,8 @@ export default {
})
},
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 } })
})
}
}

Loading…
Cancel
Save