Browse Source

3d库房配置

master
z_yu 3 years ago
parent
commit
3a60d64e03
  1. 9
      src/api/storeManage/deviceManage/device.js
  2. 4
      src/api/storeManage/deviceManage/storeroom.js
  3. 34
      src/api/storeManage/displayConfig/index.js
  4. 10
      src/views/components/SecurityDoor.vue
  5. 1
      src/views/storeManage/warehouse3D/index.vue
  6. 284
      src/views/storeManage/warehouse3DConfig/data.json
  7. 121
      src/views/storeManage/warehouse3DConfig/index.vue

9
src/api/storeManage/deviceManage/device.js

@ -83,5 +83,12 @@ function getUrl(data, optTYpe) {
}
return url
}
export function getDeviceList(params) {
return request({
url: 'api/device/list',
method: 'get',
params
})
}
export default { add, edit, del, getSupplier, getDeviceType, getDeviceById, getDesecabinetById, getRotarycabinetById }
export default { add, edit, del, getSupplier, getDeviceType, getDeviceById, getDesecabinetById, getRotarycabinetById, getDeviceList }

4
src/api/storeManage/deviceManage/storeroom.js

@ -27,11 +27,11 @@ export function edit(data) {
})
}
export function get(data) {
export function getRooms(data) {
return request({
url: 'api/storeroom/tree',
method: 'get'
})
}
export default { add, edit, del, get }
export default { add, edit, del, getRooms }

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

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function list(params) {
return request({
url: 'api/displayconfig/list',
method: 'get',
params
})
}
export function bingdingLabel(data) {
return request({
url: 'api/tag/bingdingLabel',
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 }

10
src/views/components/SecurityDoor.vue

@ -8,13 +8,17 @@
</p>
</h3>
<el-table ref="table" style="min-width: 100%;" height="100%" :data="tableData" class="warehose-el-table" stripe>
<el-table-column prop="time" label="时间" align="center" min-width="60" />
<el-table-column label="库房" align="center" min-width="60">
<el-table-column prop="update_time" label="时间" align="center" min-width="60">
<template slot-scope="scope">
<div>{{ scope.row.update_time | parseTime }}</div>
</template>
</el-table-column>
<el-table-column label="库房" align="center" min-width="30">
<template>
档案库
</template>
</el-table-column>
<el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
<el-table-column prop="alarmMsg" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
</el-table>
</div>
</template>

1
src/views/storeManage/warehouse3D/index.vue

@ -85,6 +85,7 @@ export default {
//
if (data.includes('CAM')) {
_this.$nextTick(() => {
// ToDo....
this.$refs.camera.openVideoVisible = true
//
this.$refs.camera.videoSrc = 'https://qiniu.aiyxlib.com/1606275873000.mp4'

284
src/views/storeManage/warehouse3DConfig/data.json

@ -1,284 +0,0 @@
{
"rows":[
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"未绑定",
"isShow":"隐藏"
},
{
"showPosition":"DIV_001",
"devName":"空气质量监测设备",
"paramName":"名称1,名称2",
"bindState":"已绑定",
"isShow":"显示"
}
]
}

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

@ -2,12 +2,12 @@
<div>
<div class="head-container">
<div>
<el-select v-model="room" class="filter-item" style="width:245px">
<el-select v-model="room" class="filter-item" style="width:245px" @change="getDisplayConfigList">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div>
<el-button type="primary" class="iconfont icon-bangdingcanshu-fanbai" size="mini" @click="handleBindParam">绑定参数</el-button>
<el-button type="primary" class="iconfont icon-bangdingcanshu-fanbai" size="mini" :disabled="selections.length !== 1" @click="handleBindParam">绑定参数</el-button>
</div>
</div>
<div class="app-container container-wrap">
@ -17,17 +17,25 @@
<el-table ref="table" :data="tableData" style="width: 100%;" height="calc(100vh - 245px)" :cell-class-name="cell" @selection-change="selectionChangeHandler" @row-click="clickRowHandler">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="showPosition" label="显示位置" align="center" />
<el-table-column prop="devName" label="设备名称" align="center" />
<el-table-column prop="paramName" label="参数名称" align="center" />
<el-table-column prop="bindState" label="绑定状态" align="center">
<el-table-column prop="divPosition" width="200" label="显示位置" align="center" />
<el-table-column prop="devName" label="设备名称" align="center">
<template slot-scope="scope">
<span class="clear" style="width:76px">{{ scope.row.bindState }}</span>
<span>{{ scope.row.deviceInfo?scope.row.deviceInfo.deviceName:'' }}</span>
</template>
</el-table-column>
<el-table-column prop="isShow" label="是否显示" align="center">
<el-table-column prop="paramName" label="参数名称" align="center">
<template slot-scope="scope">
<span class="clear" style="width:76px">{{ scope.row.isShow }}</span>
<span>{{ scope.row.displayParams?scope.row.displayParams.map(x => x.paramName).join(','):'' }}</span>
</template>
</el-table-column>
<el-table-column prop="bindState" label="绑定状态" align="center" width="150">
<template slot-scope="scope">
<span class="clear" style="width:76px">{{ scope.row.bindState?'已绑定':'未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="isDisplay" label="是否显示" align="center" width="150">
<template slot-scope="scope">
<span class="clear" style="width:76px">{{ scope.row.isDisplay?'显示':'隐藏' }}</span>
</template>
</el-table-column>
</el-table>
@ -38,28 +46,28 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="formDom" class="form" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="显示位置" prop="showPosition">
<el-form-item label="显示位置" prop="divPosition">
<!-- <input-select :options="options" @selectValue="handleSelectValue" /> -->
<p class="form-first">{{ form.showPosition }}</p>
<p class="form-first">{{ form.divPosition }}</p>
</el-form-item>
<el-form-item label="设备绑定" prop="devName">
<el-select v-model="devVal" placeholder="请选择" clearable filterable>
<el-form-item label="设备绑定" prop="deviceInfo">
<el-select v-model="form.deviceInfo" 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.value }}</span>
<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 v-model="paramsVal" filterable multiple clearable placeholder="请选择">
<el-select ref="paramsSelect" v-model="paramsVal" filterable multiple 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.value }}</span>
<span style="float: left">{{ item.label }}&nbsp;-&nbsp;{{ item.info }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否显示" prop="isShow">
<el-radio-group v-model="form.isShow" size="mini">
<el-radio-button label="显示"></el-radio-button>
<el-radio-button label="隐藏"></el-radio-button>
<el-form-item label="是否显示" prop="isDisplay">
<el-radio-group v-model="form.isDisplay" size="mini">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
</el-form>
@ -72,65 +80,78 @@
</template>
<script>
import data from './data.json'
import { get } from '@/api/storeManage/deviceManage/storeroom'
import crudDevice from '@/api/storeManage/deviceManage/device'
import displayConfigApi from '@/api/storeManage/displayConfig'
import { getParams } from '@/api/storeManage/deviceManage/param'
import { getRooms } from '@/api/storeManage/deviceManage/storeroom'
export default {
data() {
return {
room: '选项1',
//
options: [],
tableData: [],
selections: [],
dialogVisible: false,
cameraTypeId: '',
airEquipmentTypeId: '',
form: {},
//
devVal: '',
devOptions: [
{ value: '000', label: '空气质量检测设备' },
{ value: '111', label: '摄像头' }
],
devOptions: [],
//
paramsVal: [],
paramsOptions: [
{ value: '0000', label: '参数0' },
{ value: '1111', label: '参数1' },
{ value: '2222', label: '参数2' },
{ value: '3333', label: '参数3' }
],
paramsOptions: [],
rules: {
devName: [
deviceInfo: [
{ required: true, message: '请选择设备', trigger: 'blur' }
]
}
}
},
created() {
get().then((data) => {
getRooms().then((data) => {
const rooms = data[0].children.map((x) => { return { value: x.id, label: x.name } })
this.options.push(...rooms)
this.room = rooms[0].value
this.getDisplayConfigList()
})
crudDevice.getDeviceType().then((data) => {
this.cameraTypeId = data.find((x) => { return x.name === '摄像头' }).id
this.airEquipmentTypeId = data.find((x) => { return x.name === '空气质量检测设备' }).id
})
this.getData()
},
methods: {
getData() {
this.tableData = data.rows
},
selectionChangeHandler(val) {
this.selections = val
},
//
cell({ row, columnIndex }) {
if ((row.bindState === '已绑定' && columnIndex === 5) || (row.isShow === '显示' && columnIndex === 6)) {
if ((row.bindState && columnIndex === 5) || (row.isDisplay && columnIndex === 6)) {
return 'have-clear'
} else if ((row.bindState === '未绑定' && columnIndex === 5) || (row.isShow === '隐藏' && columnIndex === 6)) {
} else if ((!row.bindState && columnIndex === 5) || (!row.isDisplay && columnIndex === 6)) {
return 'fail-clear'
}
},
handleBindParam() {
if (this.selections.length === 1) {
console.log(this.selections[0])
this.form = this.selections[0]
this.devVal = this.form.devName
// this.devVal = this.form.devName
// this.devOptions
let deviceTypeId
if (this.form.divPosition.indexOf('CAM') > 0) {
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) {
isCamera = true
}
this.devOptions = data.content.map(data => { return { value: data.id, label: data.deviceName, info: isCamera ? data.videoRoute : data.deviceId } })
})
this.dialogVisible = true
} else {
this.$message({
@ -145,6 +166,16 @@ export default {
},
handleConfirm() {
this.dialogVisible = false
},
getDisplayConfigList() {
displayConfigApi.list({ storeroomId: this.room }).then((data) => {
this.tableData = data
})
},
getParamsOptionsList() {
getParams({ deviceInfoId: this.form.deviceInfo }).then((data) => {
this.paramsOptions = data.map(data => { return { value: data.id, label: data.paramName, info: data.paramId } })
})
}
}
}
@ -161,6 +192,11 @@ export default {
height: 30px;
background-color: #1aae93;
border: none;
&.is-disabled {
border-color: #0d5649;
background-color: #0d5649;
color: #666;
}
}
}
::v-deep .el-icon-more:before {
@ -204,4 +240,7 @@ export default {
right: -43px;
top: 0;
}
::v-deep thead .el-table-column--selection .cell {
display: none;
}
</style>
Loading…
Cancel
Save