You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
573 lines
17 KiB
573 lines
17 KiB
<template>
|
|
<div class="app-container">
|
|
<div class="app-containerb" v-show="viewState == 1">
|
|
<div class="webye">
|
|
<button-bar view-title="质物监测" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
|
<div class="main-content">
|
|
<div class="searchcon">
|
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button>
|
|
<div v-show="isSearchShow" class="search">
|
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="110px" class="tab-header">
|
|
<!-- <el-form-item label="物品名称">
|
|
<el-input v-model="listQuery.manufacturerName" clearable placeholder="" class="addinputw"></el-input>
|
|
</el-form-item> -->
|
|
<!-- <el-form-item label="选择楼层">
|
|
<el-select v-model="listQuery.supplierType1" filterable clearable placeholder="请选择楼层">
|
|
<el-option v-for="item in floor_list" :key="item.id" :label="item.title" :value="item.id" />
|
|
</el-select>
|
|
</el-form-item> -->
|
|
<el-form-item label="选择仓库">
|
|
<el-select v-model="listQuery.ckId" filterable clearable placeholder="请选择仓库">
|
|
<el-option v-for="item in ckList" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="btn">
|
|
<el-button type="primary" icon="el-icon-search" size="small" @click="handleFilter">查询</el-button>
|
|
<el-button type="primary" icon="el-icon-refresh" size="small" @click="handleReset">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="listtop">
|
|
<div class="tit">质物监测信息列表</div>
|
|
<!-- 翻页分页 -->
|
|
<!-- <pageye v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
|
:limit.sync="listQuery.size" class="pagination" @pagination="getList" /> -->
|
|
</div>
|
|
<div>
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;"
|
|
@selection-change="handleSelectionChange">
|
|
<el-table-column type="selection" align="center" width="50" />
|
|
<el-table-column label="序号" fixed type="index" width="80" :index="indexMethod" align="center" />
|
|
<el-table-column prop="jc" width="320" label="质物信息" header-align="center" align="center">
|
|
<template slot-scope="scope">
|
|
<div class="newsname" v-for="(item, index) in Datalistb" :key="index">
|
|
<div class="tit">仓库名称:{{ item.name }}</div>
|
|
<div class="time">仓库位置:{{ item.weizhi }}</div>
|
|
<div class="time">货架号:{{ item.huohao }}</div>
|
|
<div class="time">联系人:{{ item.ren }}</div>
|
|
<div class="time">联系电话:{{ item.dianhua }}</div>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="jc" label="相似度对比" header-align="center" align="center">
|
|
<template slot-scope="{row}">
|
|
<div>
|
|
<div class="newslilefts">
|
|
<div class="newsli">
|
|
<div class="tu"><img :src="fileUrl + row.imgBefore" alt="" /></div>
|
|
<div class="rightwen">
|
|
<div class="time" style="margin-top:10%">拍照时间:{{ row.createTime }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="yuans">
|
|
<p>{{ row.similarity }}</p><span>相似度</span>
|
|
</div>
|
|
<div class="newsli">
|
|
<div class="tu"><img :src="fileUrl + row.imgAfter" alt="" /></div>
|
|
<div class="rightwen">
|
|
<div class="time" style="margin-top:10%">拍照时间:{{ row.modifyTime }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="操作" align="center" width="220px" class-name="small-padding fixed-width">
|
|
<template slot-scope="{row}">
|
|
<el-button size="mini" type="primary" @click="getVedioPcLive(row)">视频</el-button>
|
|
<el-button size="mini" type="primary" @click="handleCheck(row)">详情</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="pages">
|
|
<pagination v-show="list.length > 0" :total="listQuery.total" :page.sync="listQuery.current"
|
|
:limit.sync="listQuery.size" class="pagination" @pagination="getList" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 查看视频 -->
|
|
<el-dialog title="查看视频" :visible.sync="dialogImage" width="800px" :before-close="handleClose">
|
|
<iframe :src="this.spUrl" width="750" height="400" id="ysOpenDevice" allowfullscreen>
|
|
</iframe>
|
|
</el-dialog>
|
|
<zhiwujianceAdd v-show="viewState == 2" ref="divadd" @doback="resetState" @reloadlist="handleFilter" />
|
|
<zhiwujianceInfo v-show="viewState == 4" ref="divinfo" @doback="resetState" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import Pagination from '@/components/pagination'
|
|
import pageye from '@/components/pagination/pageye'
|
|
import ButtonBar from '@/components/ButtonBar'
|
|
import zhiwujianceAdd from './zhiwujianceAdd'
|
|
import zhiwujianceInfo from './zhiwujianceInfo'
|
|
import * as echarts from "echarts";
|
|
import PieChartrenyuan from '@/views/echarts/components/PieChartrenyuanb'
|
|
import { getDeviceImagePage, getShiPinNormalByChannelNo } from '@/api/deviceImage/deviceImage'
|
|
import { getWareHouseList } from '@/api/device/device'
|
|
|
|
// 1.1完好率饼图
|
|
const wanhao_Chart = {
|
|
// seriesName: '完好率',
|
|
unit: '次',
|
|
color: ['#30e9ff', '#d9d9d9', '#fdc004'],
|
|
Data: {
|
|
seriesData: [
|
|
{ value: 75, name: '完好' },
|
|
{ value: 25, name: '不完好' },
|
|
// { value: 12, name: '报警' }
|
|
]
|
|
},
|
|
label: {
|
|
normal: {
|
|
position: 'inner',
|
|
show: false
|
|
}
|
|
},
|
|
|
|
// radius: ['50%', '55%']
|
|
}
|
|
// 1.2维修率饼图
|
|
const weixiu_Chart = {
|
|
// seriesName: '维修率',
|
|
unit: '次',
|
|
color: ['#fe7f02', '#fdc004'],
|
|
Data: {
|
|
seriesData: [
|
|
{ value: 15, name: '维修' },
|
|
{ value: 85, name: '无维修' },
|
|
// { value: 12, name: '报警' }
|
|
]
|
|
},
|
|
label: {
|
|
normal: {
|
|
position: 'inner',
|
|
show: false
|
|
}
|
|
},
|
|
}
|
|
// 1.3损害率饼图
|
|
const sunhai_Chart = {
|
|
// seriesName: '损害率',
|
|
unit: '次',
|
|
color: ['#d2cece', '#ff0202', '#fdc004'],
|
|
Data: {
|
|
seriesData: [
|
|
{ value: 10, name: '损害' },
|
|
{ value: 90, name: '无损害' }
|
|
]
|
|
},
|
|
label: {
|
|
normal: {
|
|
position: 'inner',
|
|
show: false
|
|
}
|
|
},
|
|
|
|
}
|
|
|
|
export default {
|
|
name: 'zhiwujianceList',
|
|
components: {
|
|
Pagination,
|
|
pageye,
|
|
ButtonBar,
|
|
zhiwujianceAdd,
|
|
zhiwujianceInfo, PieChartrenyuan
|
|
},
|
|
data() {
|
|
return {
|
|
// imgUrl: 'http://huirong.ybkjyl.com/1.png',
|
|
fileUrl: 'http://huirong.ybkjyl.com/imagesDownload/',
|
|
// fileUrl: 'http://8.130.39.13:7003/upload/monitor/',
|
|
wanhao_Chart: wanhao_Chart, // 1.1
|
|
weixiu_Chart: weixiu_Chart,
|
|
sunhai_Chart: sunhai_Chart,
|
|
btndisabled: false,
|
|
btnList: [
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: '',
|
|
btnKey: 'toAdd',
|
|
btnLabel: '设置定时'
|
|
},
|
|
{
|
|
type: 'info',
|
|
size: 'small',
|
|
icon: 'cross',
|
|
btnKey: 'doClose',
|
|
btnLabel: '关闭'
|
|
}
|
|
],
|
|
viewState: 1,
|
|
isSearchShow: false,
|
|
searchxianshitit: '显示查询条件',
|
|
sids: [],
|
|
// 查询 -----------
|
|
tableKey: 0,
|
|
list: [],
|
|
ckList: [],
|
|
Datalistb: [
|
|
{ name: '仓库1', cangku: '仓库1003F3', weizhi: '石家庄市长安区和平西路126号', huohao: 'F31006C102325', ren: '李舜华', dianhua: '13933263572' },
|
|
],
|
|
listLoading: false,
|
|
listQuery: {
|
|
current: 1,
|
|
size: 5,
|
|
total: 0
|
|
},
|
|
supplierType_list: [
|
|
{ title: '摄像头', id: '1' },
|
|
],
|
|
floor_list: [
|
|
{ title: '一层', id: '1' },
|
|
{ title: '二层', id: '2' },
|
|
{ title: '三层', id: '3' },
|
|
{ title: '四层', id: '4' },
|
|
],
|
|
status_list: [
|
|
{ title: '已损坏', id: '1' },
|
|
{ title: '已维修', id: '2' },
|
|
{ title: '完好', id: '3' },
|
|
],
|
|
cangku_list: [
|
|
{ title: '仓库1', id: '1' },
|
|
{ title: '仓库2', id: '2' },
|
|
],
|
|
dialogImage: false,
|
|
// 视频开始
|
|
videoSrc: '../../../image/cangkushipin.mp4',
|
|
playStatus: '',
|
|
muteStatus: '',
|
|
isMute: true,
|
|
isPlay: false,
|
|
spUrl: "",
|
|
width: '100%', // 设置视频播放器的显示宽度(以像素为单位)
|
|
height: '430', // 设置视频播放器的显示高度(以像素为单位)
|
|
preload: 'auto', // 建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
|
|
controls: true, // 确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
|
|
autoplay: true,
|
|
// 视频结束
|
|
rules: {}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
|
},
|
|
created() {
|
|
// 初始化变量
|
|
this.init()
|
|
},
|
|
methods: {
|
|
getVedioPcLive(row) {
|
|
getShiPinNormalByChannelNo({ channelNo: row.channelNo }).then(res => {
|
|
this.spUrl = res.data
|
|
this.dialogImage = true
|
|
})
|
|
},
|
|
handleClose() {
|
|
this.dialogImage = false
|
|
// 关闭弹出框时 视频关闭播放
|
|
const video = document.getElementById('video')
|
|
video.pause()
|
|
},
|
|
handleVideo() {
|
|
this.$refs.videoDiolag.dialogImage = true
|
|
},
|
|
getStatus(item) {
|
|
for (var i = 0; i < this.status_list.length; i++) {
|
|
if (this.status_list[i].id == item) {
|
|
return this.status_list[i].title
|
|
}
|
|
}
|
|
},
|
|
getSupplierType(item) {
|
|
for (var i = 0; i < this.supplierType_list.length; i++) {
|
|
if (this.supplierType_list[i].id == item) {
|
|
return this.supplierType_list[i].title
|
|
}
|
|
}
|
|
},
|
|
resetState() {
|
|
this.viewState = 1
|
|
},
|
|
btnHandle(btnKey) {
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey)
|
|
switch (btnKey) {
|
|
case 'toAdd':
|
|
this.toAdd()
|
|
break
|
|
case 'doDel':
|
|
this.doDel()
|
|
break
|
|
case 'toChangShang':
|
|
this.toChangShang()
|
|
break
|
|
case 'toGain':
|
|
this.toGain()
|
|
break
|
|
case 'doExport':
|
|
this.doExport()
|
|
break
|
|
case 'doClose':
|
|
this.doClose()
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
},
|
|
// 搜索条件效果
|
|
clicksearchShow() {
|
|
this.isSearchShow = !this.isSearchShow
|
|
if (this.isSearchShow) {
|
|
this.searchxianshitit = '隐藏查询条件'
|
|
} else {
|
|
this.searchxianshitit = '显示查询条件'
|
|
}
|
|
},
|
|
init() {
|
|
getWareHouseList().then(res => {
|
|
console.log(res)
|
|
if (res.code == 200) {
|
|
this.ckList = res.data
|
|
}
|
|
})
|
|
|
|
getDeviceImagePage(this.listQuery).then((res) => {
|
|
this.list = res.data.records
|
|
this.listQuery.total = res.data.total
|
|
})
|
|
},
|
|
getList() {
|
|
getDeviceImagePage(this.listQuery).then((res) => {
|
|
this.list = res.data.records
|
|
this.listQuery.total = res.data.total
|
|
})
|
|
},
|
|
// 序号
|
|
indexMethod(index) {
|
|
var pagestart = (this.listQuery.current - 1) * this.listQuery.size
|
|
var pageindex = index + 1 + pagestart
|
|
return pageindex
|
|
},
|
|
// 查询按钮
|
|
handleFilter() {
|
|
this.listQuery.current = 1
|
|
this.getList()
|
|
},
|
|
handleReset() {
|
|
this.listQuery.ckId = null
|
|
this.getList()
|
|
},
|
|
// 打开添加对话框
|
|
toAdd() {
|
|
this.viewState = 2
|
|
this.$refs['divadd'].showAdd()
|
|
},
|
|
// 打开添加设备对话框
|
|
handleDddShebei() {
|
|
this.$router.push({
|
|
path: '/zhiwujiance/shebeiList',
|
|
})
|
|
},
|
|
handleSelectionChange(row) {
|
|
const aa = []
|
|
row.forEach((element) => {
|
|
aa.push(element.sid)
|
|
})
|
|
this.sids = aa
|
|
},
|
|
// 根据本行ID删除数据
|
|
doDel() {
|
|
if (this.sids.length > 0) {
|
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?'
|
|
this.$confirm(tip, '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: 'Loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
})
|
|
req.delBySids(this.sids.toString()).then(resp => {
|
|
if (resp.success) {
|
|
loading.close()
|
|
this.$message({ type: 'success', message: resp.msg, showClose: true })
|
|
this.getList()
|
|
} else {
|
|
loading.close()
|
|
}
|
|
}).catch(e => {
|
|
loading.close()
|
|
})
|
|
}).catch(() => {
|
|
})
|
|
} else {
|
|
this.$message({ type: 'error', message: '没有选择!!', showClose: true })
|
|
return
|
|
}
|
|
},
|
|
// 打开查看
|
|
handleCheck(row) {
|
|
this.viewState = 4
|
|
this.$refs['divinfo'].showInfo(row)
|
|
},
|
|
doClose() {
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
this.$router.go(-1)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.app-containerb {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: nowrap;
|
|
justify-content: flex-start;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.webye {
|
|
flex: 1;
|
|
text-align: left;
|
|
}
|
|
|
|
/* ///// */
|
|
|
|
.newslilefts {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: nowrap;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
}
|
|
|
|
/* .news .contents .newslis .tits{padding: 0;width: 20px;color: #8e8e8e;} */
|
|
/*
|
|
.news .contents .newslis .rentu{padding: 0;width: 80px;height: 80px;border-radius: 5px;border: 1px solid #ff2424;margin: 0 20px;} */
|
|
.newslilefts .yuans {
|
|
padding: 0;
|
|
margin: 0 20px;
|
|
width: 80px;
|
|
height: 80px !important;
|
|
border-radius: 80px;
|
|
border: 1px solid #ff2424;
|
|
text-align: center;
|
|
display: inline-block;
|
|
}
|
|
|
|
.newslilefts .yuans p {
|
|
padding: 23px 0 10px 0;
|
|
color: #ff2424;
|
|
font-size: 26px;
|
|
margin: 0;
|
|
}
|
|
|
|
.newslilefts .yuans span {
|
|
padding: 0;
|
|
margin: 0;
|
|
color: #8e8e8e;
|
|
font-size: 14px;
|
|
display: block;
|
|
}
|
|
|
|
/* .news .contents .newslis .rightzi{padding: 0 10px;color: #8e8e8e;text-align: left;}
|
|
.news .contents .newslis .rightzi p{padding: 1px 0;color: #8e8e8e;font-size: 12px;margin: 0;} */
|
|
.newslilefts .newsli {
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: nowrap;
|
|
justify-content: space-between;
|
|
margin: 0px 0px;
|
|
padding: 5px 10px;
|
|
/* border-bottom: 1px solid #ececee; */
|
|
}
|
|
|
|
.newslilefts .newsli .tu {
|
|
padding: 0px 0 0 0;
|
|
width: 120px;
|
|
height: 120px;
|
|
border-radius: 5px;
|
|
border: 1px solid #ff2424;
|
|
}
|
|
|
|
.newslilefts .newsli .tu img {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: 5px;
|
|
border: 1px solid #ff2424;
|
|
}
|
|
|
|
.newslilefts .newsli .rightwen {
|
|
padding: 20px 0 0 20px;
|
|
text-align: left;
|
|
flex: 3;
|
|
}
|
|
|
|
.newslilefts .newsli .rightwen .tit {
|
|
padding: 7px 0;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
/* height: 25px;
|
|
overflow: hidden;
|
|
line-height: 25px; */
|
|
}
|
|
|
|
.newslilefts .newsli .rightwen .time {
|
|
padding: 12px 0;
|
|
/* color: #848383; */
|
|
font-size: 14px;
|
|
/* height: 25px;
|
|
line-height: 25px; */
|
|
}
|
|
|
|
.news .contents .newslis .caozuos {
|
|
width: 180px;
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: nowrap;
|
|
justify-content: space-between;
|
|
margin: 0px 0px;
|
|
padding: 5px 10px;
|
|
text-align: right;
|
|
}
|
|
|
|
/* //// */
|
|
.newsname {
|
|
/* display: flex;
|
|
flex-direction: row;
|
|
flex-wrap: nowrap;
|
|
justify-content: space-between; */
|
|
margin: 0px 0px;
|
|
padding: 5px 10px;
|
|
text-align: left;
|
|
/* border-bottom: 1px solid #ececee; */
|
|
}
|
|
|
|
.newsname .tit {
|
|
padding: 5px 0;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
/* height: 25px;
|
|
overflow: hidden;
|
|
line-height: 25px; */
|
|
}
|
|
|
|
.newsname .time {
|
|
padding: 5px 0;
|
|
/* color: #848383; */
|
|
font-size: 14px;
|
|
/* height: 25px;
|
|
line-height: 25px; */
|
|
}
|
|
</style>
|
|
|